/* ==========================================================
   6. SEAMLESS NAVBAR EXTENSION DRAWER
========================================================== */

/* The Background Dimmer */
.marbo-search-backdrop {
    position: fixed; top: 100%; left: 0; width: 100%; height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1; opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease;
}
.site-header.search-active .marbo-search-backdrop {
    opacity: 1; visibility: visible;
}

/* The Sliding Drawer */
.marbo-search-drawer {
    position: absolute;
    top: 100%; /* Attaches exactly to the bottom of the navbar */
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #eaeaea;
    border-radius: 0 0 24px 24px; /* Rounded bottom edges */
    box-shadow: 0 25px 40px rgba(0,0,0,0.08);
    max-height: 0; /* Hidden state */
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0s linear 0.5s;
    z-index: 999;
}

/* The Active Expanding State */
.site-header.search-active .marbo-search-drawer {
    max-height: 70vh; /* Expands smoothly */
    opacity: 1;
    visibility: visible;
    transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0s linear 0s;
    overflow-y: auto;
}

.search-drawer-inner {
    padding: 30px 50px 50px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Input Row */
.search-input-row {
    display: flex; align-items: center;
    border-bottom: 1px solid #111;
    padding-bottom: 15px; margin-bottom: 30px;
}
.search-input-row .search-icon { color: #555; margin-right: 15px; flex-shrink: 0; }
.search-input-row input { flex: 1; border: none; background: transparent; font-family: 'Jost', sans-serif; font-size: 22px; color: #111; outline: none; }
.search-input-row .search-close-btn { background: none; border: none; cursor: pointer; color: #555; transition: transform 0.3s; }
.search-input-row .search-close-btn:hover { transform: rotate(90deg); color: #111; }

/* Suggestions Layout */
.suggestions-grid { display: flex; gap: 60px; }
.suggestions-section { flex: 1; }
.suggestions-section .section-title { display: block; font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #888; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; margin-bottom: 15px; }
.term-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 25px; line-height: 1.8; }
.term-list li a { font-family: 'Jost', sans-serif; font-size: 14px; color: #444; text-decoration: none; transition: color 0.2s; }
.term-list li a:hover { color: #000; text-decoration: underline; }

/* Hide default content when typing */
.marbo-search-drawer.is-typing #marbo-search-default-content { display: none; }

/* ==========================================================
   FIXED LIVE AJAX RESULTS STYLING
========================================================== */
.marbo-live-results { width: 100%; }
.marbo-ajax-list { list-style: none !important; padding: 0 !important; margin: 0 0 20px 0 !important; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.marbo-ajax-list li a { display: flex; align-items: center; gap: 15px; padding: 12px; border-radius: 8px; text-decoration: none; transition: background 0.2s ease; border: 1px solid transparent; }
.marbo-ajax-list li a:hover { background: #fafafa; border: 1px solid #eaeaea; }

.ajax-product-img { flex-shrink: 0; }
.ajax-product-img img { width: 65px; height: 65px; object-fit: cover; border-radius: 6px; display: block; background: #f5f5f5; }

.ajax-product-info { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ajax-product-title { font-family: 'Jost', sans-serif; font-size: 16px; font-weight: 500; color: #111; line-height: 1.3; }
.ajax-product-price { font-family: 'Jost', sans-serif; font-size: 14px; color: #666; display: flex; align-items: baseline; gap: 8px; }
.ajax-product-price ins { text-decoration: none; color: #111; font-weight: 600; }
.ajax-product-price del { font-size: 12px; color: #aaa; }

.ajax-view-all { display: block; text-align: center; font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 500; color: #111; text-decoration: underline; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eaeaea; }

/* Mobile Adaptations */
@media (max-width: 768px) {
    .search-drawer-inner { padding: 20px; }
    .search-input-row input { font-size: 18px; }
    .suggestions-grid { flex-direction: column; gap: 30px; }
    .marbo-ajax-list { grid-template-columns: 1fr; /* 1 column on mobile */ }
    .marbo-search-drawer { border-radius: 0 0 16px 16px; }
}

