/* ======================================
   SEARCH SYSTEM (GLOBAL)
====================================== */

/* Visibility helpers */
.desktop-only{display:none}
.mobile-only{display:none}

@media (min-width:1025px){
.desktop-only{display:block}
}

@media (max-width:1024px){
.mobile-only{display:block}
.desktop-header-search{display:none!important}
.desktop-search-results{display:none!important}
}

/* ======================================
   DESKTOP SEARCH
====================================== */

.desktop-header-search{position:relative;display:inline-flex;align-items:center;margin-left:auto}
.desktop-search-btn{background:none;border:none;cursor:pointer;font-size:20px;color:#333;padding:4px 6px;margin:0 12px;transition:color .2s}
.desktop-search-btn:hover{color:#b89b72}

.desktop-search-form{position:absolute;top:calc(100% + 6px);left:0;width:480px;display:none;padding:8px;background:#f5f1e8;border:1px solid #d8cfc0;border-radius:6px;box-shadow:0 6px 16px #00000026;z-index:9999}
.desktop-search-form.is-open{display:block}

.desktop-search-input{width:100%;padding:8px 10px;border:1px solid #d8cfc0;border-radius:4px;font-family:"Mate",serif;font-size:15px;box-sizing:border-box}
.desktop-search-input:focus{border-color:#b89b72;box-shadow:0 0 0 2px #b89b7233;outline:none}

.desktop-search-results{position:absolute;top:calc(100% + 44px);left:0;width:480px;max-height:320px;display:none;overflow-y:auto;padding:8px 0;background:#fff;border-radius:10px;box-shadow:0 10px 30px #00000026;z-index:1000;opacity:0;transform:translateY(-6px);transition:opacity .25s ease,transform .25s ease}
.desktop-search-results.show{display:block;opacity:1;transform:translateY(0)}
.desktop-search-results{box-sizing:border-box;overflow-x:hidden}

/* ======================================
   MOBILE EXPLORE PANEL
====================================== */

.mobile-explore-panel{position:fixed;top:60px;left:0;width:100vw;max-width:100%;max-height:80vh;overflow-y:auto;background:#f5f1e8;box-shadow:0 6px 18px #00000040;z-index:11000;opacity:0;transform:scaleY(.98);transition:opacity .25s ease,transform .25s ease;pointer-events:none;padding-bottom:20px}
.mobile-explore-panel.show{opacity:1;transform:scaleY(1);pointer-events:auto}

.mobile-explore-backdrop{position:fixed;top:60px;left:0;width:100vw;height:100vh;background:#0006;z-index:10999;opacity:0;transition:opacity .25s ease;pointer-events:none}
.mobile-explore-backdrop.show{opacity:1;pointer-events:auto}


/* Header */
.mobile-explore-header{position:sticky;top:0;display:flex;align-items:center;gap:8px;padding:10px 12px;background:#f5f1e8;border-bottom:1px solid #e0dcd2;z-index:10}
body.search-active .mobile-explore-header{background:#fff}
.close-explore{font-size:16px;background:#fff;border:1px solid #ddd;border-radius:6px;padding:4px 8px}


/* Input */
.explore-input{width:100%;padding:10px 12px;border-radius:8px;border:1px solid #d8cfc0;font-size:15px;background:#fff}
.explore-input:focus{border-color:#b89b72;box-shadow:0 0 0 2px #b89b7233;outline:none}


/* Mobile results */
.explore-search-results{display:none;padding:10px 14px;position:relative;z-index:9999;opacity:0;transform:translateY(-6px);transition:opacity .25s ease,transform .25s ease}
.explore-search-results.show{display:block;opacity:1;transform:translateY(0)}

.explore-search-results:empty::before{content:"Start typing to explore Stockholm…";display:block;padding:20px;text-align:center;color:#8a7a64;font-style:italic}

.explore-search-results .search-result{transform:translateY(6px);transition:all .25s ease}
.explore-search-results.show .search-result{opacity:1;transform:translateY(0)}

.explore-search-results.show .search-result:nth-child(1){transition-delay:.02s}
.explore-search-results.show .search-result:nth-child(2){transition-delay:.04s}
.explore-search-results.show .search-result:nth-child(3){transition-delay:.06s}
.explore-search-results.show .search-result:nth-child(4){transition-delay:.08s}
.explore-search-results.show .search-result:nth-child(5){transition-delay:.1s}

.explore-search-results .no-results{text-align:center;padding:20px;font-size:14px;color:#777}


/* Sections */
.explore-section{padding:10px 14px;transition:opacity .2s ease}
.explore-heading{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#8a7a64;margin-bottom:8px}
.explore-heading::before{content:"— ";opacity:.4}


/* Popular */
.explore-popular{padding:12px 14px;border-bottom:1px solid #e0dcd2}
.explore-popular-list a{display:block;padding:12px;margin-bottom:8px;background:#fff;border-radius:10px;text-decoration:none;color:#2c2c2c;box-shadow:0 2px 6px #0000000d}
.explore-popular-list a:hover{background:#f3eee6}


/* Menu */
.mobile-explore-menu{padding:8px 0 16px;border-top:1px solid #e0dcd2}
.explore-nav{padding:0 12px;margin:0;list-style:none}
.explore-nav > li{margin-bottom:8px;border-bottom:1px solid #eee}

.menu-item-wrapper{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#fff;border-radius:10px;transition:.2s}
.menu-item-wrapper:hover{background:#f0ebe2}

.menu-link{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:500;color:#2b2b2b;text-decoration:none}


/* Icons */
.explore-nav > li:nth-child(1) .menu-link::before{content:"🏠 "}
.explore-nav > li:nth-child(2) .menu-link::before{content:"🏛️ "}
.explore-nav > li:nth-child(3) .menu-link::before{content:"🌳 "}
.explore-nav > li:nth-child(4) .menu-link::before{content:"⛪ "}
.explore-nav > li:nth-child(5) .menu-link::before{content:"⭐ "}
.explore-nav > li:nth-child(6) .menu-link::before{content:"📖 "}


/* Search active state */
body.search-active .explore-section{opacity:.15;pointer-events:none}
body.search-active .mobile-explore-menu{opacity:.2;pointer-events:none}
body.search-active .explore-popular{opacity:.2}
body.search-active .explore-search-results{opacity:1;pointer-events:auto}
body.search-active .close-explore{display:none}


/* ======================================
   SHARED COMPONENTS
====================================== */

.search-result{display:flex;align-items:center;gap:12px;padding:10px 14px;background:#fff;border-radius:10px;margin-bottom:8px;box-shadow:0 2px 6px #0000000d;text-decoration:none;border-bottom:1px solid #00000014;transition:background .2s,transform .2s}
.search-result:last-child{border-bottom:none}
.search-result img{width:70px;height:50px;object-fit:cover;border-radius:4px;flex-shrink:0}
.search-result span{font-size:14px;line-height:1.4;color:#1f2d3d;font-weight:500}
.search-result:hover{background:#f5f1e8;transform:translateX(2px)}
.search-result:active{transform:scale(.98)}
.search-result:hover span{color:#b89b72}
.search-result{text-decoration:none}
.search-result:hover{text-decoration:none}
.search-result{min-width:0}
.search-result span{word-break:break-word}

/* Top result */
.search-top-result{padding:12px;margin:10px;background:#f5f1e8;border:1px solid #eee;border-radius:10px;box-shadow:0 4px 12px #00000014}
.search-top-result a{display:flex;gap:12px;text-decoration:none}
.search-top-result a:hover{transform:translateY(-1px);box-shadow:0 6px 18px #0000001f}
.search-top-result img{width:90px;height:70px;object-fit:cover;border-radius:6px}
.search-top-result a{text-decoration:none}
.search-top-result a:hover{text-decoration:none}
.search-top-result a{min-width:0}
.top-content{min-width:0}
.top-title{word-break:break-word}
.search-top-result a,
.search-top-result a:hover,
.search-top-result a:focus,
.search-top-result a:active{
  text-decoration:none!important;
}

.top-content{display:flex;flex-direction:column;justify-content:center}
.top-label{font-size:11px;text-transform:uppercase;color:#b89b72;letter-spacing:.08em}
.top-title{font-size:16px;font-weight:600;color:#2c2c2c}


/* Categories + highlight */
.category-result{display:inline-flex;align-items:center;width:auto;max-width:100%;padding:8px 12px;margin:6px 14px;border-radius:8px;background:#f9f6ef;border-left:3px solid #b89b72;font-weight:600}
.category-result span{font-size:15px}
.category-label{display:block;font-size:11px;text-transform:uppercase;color:#b89b72;margin-bottom:2px}
.search-group-label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#8a7a64;padding:10px 14px 6px;margin-top:8px}
mark{background:#fff3cd;padding:1px 3px;border-radius:3px}


/* Suggestions */
.search-suggestions{padding:10px 14px}
.search-suggestion{display:block;padding:12px;margin-bottom:8px;background:#fff;border-radius:10px;text-decoration:none;color:#2c2c2c;box-shadow:0 2px 6px #0000000d;font-size:15px}
.search-suggestion:hover{background:#f3eee6}


/* States */
.no-results,.error-message{padding:12px;font-size:14px;color:#777;text-align:center}
.loading::before{content:"";display:inline-block;width:12px;height:12px;margin-right:8px;border:2px solid #cbb79b;border-top-color:transparent;border-radius:50%;animation:spin 1s linear infinite;vertical-align:middle}

@keyframes spin{to{transform:rotate(360deg)}}