/* ==========================================================
   MARBOCRAFT LUXURY FLOATING SEARCH MODAL
   Inspired by Muun Home & High-End D2C Aesthetics
========================================================== */

/* 1. Backdrop Overlay */
.marbo-search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 17, 16, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.site-header.search-active .marbo-search-backdrop,
body.marbo-search-active .marbo-search-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Completely remove/hide announcement bar when search modal is active */
body.marbo-search-active .marbo-announcement-bar,
body.marbo-search-active #marbo-announcement-bar,
.site-header.search-active ~ .marbo-announcement-bar,
.site-header.search-active .marbo-announcement-bar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* 2. Floating Search Modal Card */
.marbo-search-modal {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translate(-50%, -12px) scale(0.98);
    width: calc(100% - 36px);
    max-width: 660px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e2e2;
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.12);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s;
}

.site-header.search-active .marbo-search-modal,
body.marbo-search-active .marbo-search-modal {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.search-modal-card {
    display: flex;
    flex-direction: column;
    max-height: min(80vh, 640px);
}

/* Suppress native browser search cancel / decoration cross */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 3. Input Header Row */
.search-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    position: relative;
}

/* Enforce Satoshi across Search Modal */
.marbo-search-modal,
.marbo-search-modal * {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Rounded Minimalist Neutral Light Grey Search Bar Pill (No Glow) */
.search-input-pill {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 8px 16px;
    box-shadow: none !important;
    outline: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.search-input-pill:focus-within {
    background: #ebebeb;
    border-color: #d4d4d4;
    box-shadow: none !important;
    outline: none !important;
}

.search-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777777;
    flex-shrink: 0;
}

.search-field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 15px;
    font-weight: 500;
    color: #111111;
    letter-spacing: -0.01em;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
    -webkit-appearance: none;
}

.search-field::placeholder {
    color: #999999;
    font-weight: 400;
}

.search-clear-btn {
    background: #d8d8d8;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444444;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none !important;
    transition: background 0.15s, color 0.15s;
}

.search-clear-btn:hover {
    background: #c5c5c5;
    color: #000000;
}

.search-close-btn {
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444444;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}

.search-close-btn:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    transform: rotate(90deg);
}

/* 4. Modal Body */
.search-modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.search-modal-body::-webkit-scrollbar {
    width: 5px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

/* 5. Suggested Search Terms (Default State) */
.suggested-pills-header {
    margin-bottom: 12px;
}

.suggested-caption {
    display: block;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888888;
}

.suggested-pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggested-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    color: #222222;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: none !important;
}

.suggested-pill:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Hide default terms when typing */
.marbo-search-modal.is-typing #marbo-search-default-content {
    display: none;
}

/* 6. Live AJAX Results Layout */
.marbo-live-results {
    width: 100%;
}

.marbo-search-live-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ajax-section {
    display: flex;
    flex-direction: column;
}

.ajax-section-heading {
    display: block;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #888888;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* A. Suggestions List */
.ajax-suggestions-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ajax-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #222222;
    text-decoration: none;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, padding 0.18s ease;
}

.suggestion-hash {
    color: #888888;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}

.suggestion-name {
    color: #111111;
}

.ajax-suggestion-item:hover {
    background: #f0f0f0;
    color: #000;
    padding-left: 16px;
}

/* B. Products Section */
.marbo-ajax-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ajax-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ajax-product-item:hover {
    background: #f5f5f5;
    border-color: #e2e2e2;
    transform: translateX(3px);
}

.ajax-product-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
}

.ajax-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ajax-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ajax-product-title {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14.5px;
    font-weight: 500;
    color: #111111;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajax-product-price {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13.5px;
    color: #666666;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ajax-product-price ins {
    text-decoration: none;
    color: #111111;
    font-weight: 700;
}

.ajax-product-price del {
    font-size: 12px;
    color: #999999;
    font-weight: 400;
}

.ajax-product-arrow {
    color: #999999;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.ajax-product-item:hover .ajax-product-arrow {
    transform: translateX(3px);
    color: #111111;
}

/* C. Footer View All */
.ajax-footer-row {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid #eeeeee;
}

.ajax-view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f2f2f2;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ajax-view-all:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

.ajax-view-all strong {
    font-weight: 700;
}

/* 7. Luxury Empty State */
.marbo-search-empty-state {
    text-align: center;
    padding: 30px 16px 16px;
}

.empty-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #777777;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.empty-title {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 17px;
    font-weight: 600;
    color: #111111;
    margin: 0 0 6px;
}

.empty-subtitle {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px;
    color: #666666;
    margin: 0 auto 20px;
    max-width: 420px;
    line-height: 1.5;
}

.empty-recovery-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.empty-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12.5px;
    font-weight: 500;
    color: #222222;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.empty-pill:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    transform: translateY(-1px);
}

/* 8. Search Spinner */
.marbo-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 0;
}

.marbo-spinner-ring {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top-color: #111111;
    border-radius: 50%;
    animation: marbo-spin 0.65s linear infinite;
}

@keyframes marbo-spin {
    to { transform: rotate(360deg); }
}

/* 9. Responsive Mobile & Tablet Adaptations */
@media (max-width: 768px) {
    .marbo-search-modal {
        top: 16px !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translate(-50%, -10px) scale(0.98);
        width: calc(100% - 24px);
        max-width: 520px;
        border-radius: 16px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    }

    .site-header.search-active .marbo-search-modal,
    body.marbo-search-active .marbo-search-modal {
        transform: translate(-50%, 0) scale(1) !important;
    }

    .search-input-row {
        padding: 14px 16px;
        gap: 10px;
    }

    .search-field {
        font-size: 15px;
    }

    .search-modal-body {
        padding: 16px 16px 20px;
        max-height: min(78vh, 520px);
    }

    .suggested-pill {
        font-size: 12px;
        padding: 7px 13px;
    }

    .ajax-product-title {
        font-size: 14px;
    }

    .empty-title {
        font-size: 16px;
    }

    .empty-subtitle {
        font-size: 12.5px;
    }
}


