/* =========================================================
   SEARCH POPUP
   Opened by the header and bottom-nav search icons.
   ========================================================= */

.vs-modal {
    --vs-ink: #321d1a;
    --vs-text: #6e6059;
    --vs-muted: #9a8c85;
    --vs-line: #eee4d6;
    --vs-brand: #ac0060;
    --vs-gold: #cf9c2c;
    --vs-cream: #faf4e9;

    font-family: "Poppins", sans-serif;
}

.vs-modal .modal-dialog {
    max-width: 720px;
    margin-top: 8vh;
}

.vs-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(50, 29, 26, .25);
}

body:has(.vs-modal.show) .modal-backdrop.show {
    background: #1d0f0d;
    opacity: .55;
    backdrop-filter: blur(4px);
}

/* ---------- Search bar ---------- */

.vs-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 14px 22px;
    border-bottom: 1px solid var(--vs-line);
}

.vs-bar-icon {
    flex: 0 0 auto;
    color: var(--vs-brand);
    font-size: 18px;
}

.vs-bar input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--vs-ink);
    font-family: "Poppins", sans-serif;
    font-size: 17px;
    outline: none;
}

.vs-bar input::placeholder {
    color: #b5a89f;
}

/* Hide the browser's own clear button; we draw our own */
.vs-bar input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.vs-clear {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f3ece2;
    color: var(--vs-text);
    font-size: 13px;
    transition: background .2s ease, color .2s ease;
}

.vs-clear:hover {
    background: var(--vs-brand);
    color: #ffffff;
}

.vs-close {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
}

.vs-close-key {
    padding: 5px 9px;
    border: 1px solid var(--vs-line);
    border-radius: 8px;
    background: var(--vs-cream);
    color: var(--vs-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    transition: color .2s ease, border-color .2s ease;
}

.vs-close:hover .vs-close-key {
    border-color: var(--vs-brand);
    color: var(--vs-brand);
}

.vs-close .vs-close-icon {
    display: none;
}

.vs-spinner {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(172, 0, 96, .2);
    border-top-color: var(--vs-brand);
    border-radius: 50%;
    animation: vsSpin .7s linear infinite;
}

.vs-spinner[hidden],
.vs-clear[hidden],
.vs-modal [hidden] {
    display: none !important;
}

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

/* ---------- Body ---------- */

.vs-body {
    max-height: min(68vh, 620px);
    padding: 20px 22px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vs-group + .vs-group {
    margin-top: 24px;
}

.vs-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vs-group-head span {
    color: var(--vs-muted);
    font-family: "Jost", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.vs-group-head a,
.vs-group-head button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--vs-brand);
    font-size: 12.5px;
    font-weight: 500;
}

.vs-group-head a:hover,
.vs-group-head button:hover {
    text-decoration: underline !important;
}

/* Chips */

.vs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vs-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--vs-line);
    border-radius: 30px;
    background: #ffffff;
    color: var(--vs-ink);
    font-size: 13px;
    font-weight: 500;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.vs-chip i {
    color: var(--vs-muted);
    font-size: 12px;
    transition: color .2s ease;
}

.vs-chip:hover {
    border-color: var(--vs-brand);
    color: var(--vs-brand);
}

.vs-chip:hover i {
    color: var(--vs-brand);
}

.vs-chip-category {
    background: var(--vs-cream);
    border-color: transparent;
}

.vs-chip-category i {
    color: var(--vs-gold);
}

/* Popular cards */

.vs-popular {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.vs-card {
    display: block;
    min-width: 0;
    color: var(--vs-ink);
}

.vs-card-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 14px;
    background: #f3ece2;
}

.vs-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.vs-card:hover .vs-card-img img {
    transform: scale(1.06);
}

.vs-card-img em {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--vs-gold);
    color: #ffffff;
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    text-transform: uppercase;
}

.vs-card strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vs-card:hover strong {
    color: var(--vs-brand);
}

.vs-card > span:last-child {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Results ---------- */

.vs-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vs-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--vs-ink);
    transition: background .15s ease;
}

.vs-item:hover,
.vs-item.active {
    background: var(--vs-cream);
    color: var(--vs-ink);
}

.vs-item-img {
    flex: 0 0 auto;
    width: 54px;
    height: 66px;
    overflow: hidden;
    border-radius: 10px;
    background: #f3ece2;
}

.vs-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-item-text {
    flex: 1 1 auto;
    min-width: 0;
}

.vs-item-text strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-item-text mark {
    padding: 0 1px;
    border-radius: 3px;
    background: rgba(207, 156, 44, .28);
    color: inherit;
}

.vs-item-text small {
    display: block;
    margin-top: 3px;
    color: var(--vs-muted);
    font-size: 12px;
}

.vs-oos {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #fdecec;
    color: #c0292b;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
}

.vs-item-price {
    flex: 0 0 auto;
    text-align: right;
}

.vs-item-price strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.vs-item-price del {
    color: var(--vs-muted);
    font-size: 12px;
}

.vs-item-price em {
    display: block;
    margin-top: 2px;
    color: #1f8a4c;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.vs-item-go {
    flex: 0 0 auto;
    color: var(--vs-brand);
    font-size: 12px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

.vs-item:hover .vs-item-go,
.vs-item.active .vs-item-go {
    opacity: 1;
    transform: none;
}

.vs-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    margin-top: 14px;
    border-radius: 30px;
    background: var(--vs-brand);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease;
}

.vs-all:hover {
    background: #8a004d;
    color: #ffffff;
}

/* Empty */

.vs-empty {
    padding: 34px 10px 22px;
    text-align: center;
}

.vs-empty-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--vs-cream);
    color: var(--vs-gold);
    font-size: 22px;
}

.vs-empty strong {
    display: block;
    color: var(--vs-ink);
    font-size: 16px;
    font-weight: 500;
}

.vs-empty p {
    margin: 6px 0 0;
    color: var(--vs-muted);
    font-size: 13px;
}

/* ---------- Phones: full screen ---------- */

@media (max-width: 575.98px) {
    .vs-modal .modal-dialog {
        margin: 0;
    }

    .vs-modal .modal-content {
        border-radius: 0;
    }

    .vs-bar {
        padding: 10px 12px 10px 16px;
    }

    .vs-bar input {
        font-size: 16px; /* avoids iOS zoom on focus */
    }

    .vs-close-key {
        display: none;
    }

    .vs-close .vs-close-icon {
        display: flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--vs-cream);
        color: var(--vs-ink);
        font-size: 16px;
    }

    .vs-body {
        max-height: none;
        flex: 1 1 auto;
        padding: 18px 16px 28px;
    }

    .vs-popular {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .vs-item {
        padding: 10px 6px;
    }

    .vs-item-go {
        display: none;
    }

    .vs-item-text strong {
        display: -webkit-box;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.35;
    }
}
