/* Sweet Coco — Modern site search */

.sc-search {
    --sc-search-chocolate: #2a1814;
    --sc-search-brown: #4a2f26;
    --sc-search-gold: #b8925a;
    --sc-search-gold-light: #dcc9a3;
    --sc-search-cream: #f8f4ed;
    --sc-search-cream-dark: #eee8dc;
    --sc-search-text: #241812;
    --sc-search-muted: #87796a;
    --sc-search-white: #fffcf7;
    --sc-search-radius: 999px;
    --sc-search-height: 48px;
    --sc-search-font: "Jost", "Segoe UI", sans-serif;
    position: relative;
    font-family: var(--sc-search-font);
}

/* ─── Input shell ─── */
.sc-search__form {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: var(--sc-search-height) !important;
    margin: 0 auto !important;
    padding: 4px 4px 4px 18px !important;
    background: var(--sc-search-white) !important;
    border: 1.5px solid rgba(184, 146, 90, 0.28) !important;
    border-radius: var(--sc-search-radius) !important;
    box-shadow:
        0 2px 8px rgba(42, 24, 20, 0.06),
        0 8px 24px rgba(42, 24, 20, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    overflow: visible !important;
    float: none !important;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease !important;
}

.sc-search__form:focus-within {
    border-color: var(--sc-search-gold) !important;
    background: #fff !important;
    box-shadow:
        0 0 0 4px rgba(184, 146, 90, 0.14),
        0 8px 28px rgba(42, 24, 20, 0.1) !important;
}

.sc-search__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--sc-search-gold);
    font-size: 15px;
    opacity: 0.85;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.sc-search__form:focus-within .sc-search__icon {
    color: var(--sc-search-brown);
    opacity: 1;
}

.sc-search__input {
    flex: 1 1 auto !important;
    width: auto !important;
    height: 100% !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    float: none !important;
    font-family: var(--sc-search-font) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    color: var(--sc-search-text) !important;
    text-align: left !important;
}

.sc-search__input::placeholder {
    color: var(--sc-search-muted);
    font-weight: 400;
    opacity: 0.85;
}

.sc-search__btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(184, 146, 90, 0.22) !important;
    border-radius: 50% !important;
    background: var(--sc-search-cream) !important;
    color: var(--sc-search-gold) !important;
    cursor: pointer !important;
    float: none !important;
    position: static !important;
    box-shadow: none;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease !important;
}

.sc-search__btn:hover {
    background: rgba(184, 146, 90, 0.14) !important;
    border-color: rgba(184, 146, 90, 0.38) !important;
    color: var(--sc-search-brown) !important;
}

.sc-search__btn:active {
    background: rgba(184, 146, 90, 0.22) !important;
}

.sc-search__form:focus-within .sc-search__btn {
    background: rgba(184, 146, 90, 0.1) !important;
    border-color: rgba(184, 146, 90, 0.32) !important;
}

.sc-search__btn i {
    font-size: 13px;
    line-height: 1;
    opacity: 0.75;
}

.sc-search__btn:hover i {
    opacity: 1;
}

.sc-search__btn svg {
    width: 16px !important;
    height: 16px !important;
    color: var(--sc-search-gold) !important;
    opacity: 0.75;
}

/* ─── Desktop placement ─── */
.main-search.sc-search {
    margin: 0;
    align-self: center;
}

@media only screen and (min-width: 768px) {
    .main-search.sc-search {
        max-width: 460px;
        width: 100%;
        justify-self: center;
    }
}

/* ─── Live results dropdown ─── */
.sc-search .search_result {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 999999;
}

.sc-search .search_product {
    position: relative;
    top: auto;
    width: 100%;
    background: var(--sc-search-white);
    border: 1px solid rgba(184, 146, 90, 0.2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 12px 40px rgba(42, 24, 20, 0.12),
        0 4px 12px rgba(42, 24, 20, 0.06);
    animation: scSearchDropIn 0.22s ease;
}

@keyframes scSearchDropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sc-search .search_product ul {
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 340px;
    overflow-y: auto;
}

.sc-search .search_product a {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.sc-search .search_product a:hover {
    background: var(--sc-search-cream);
}

.sc-search .search_product li {
    display: grid !important;
    grid-template-columns: 56px 1fr !important;
    gap: 14px !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-bottom: none !important;
    margin: 0 !important;
    width: 100% !important;
    transition: none !important;
}

.sc-search .search_product ul li:hover {
    background: transparent;
}

.sc-search .search_product img {
    width: 56px !important;
    height: 56px !important;
    margin-top: 0 !important;
    border-radius: 12px !important;
    object-fit: cover;
    border: 1px solid rgba(184, 146, 90, 0.15);
}

.sc-search .search_content .name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sc-search-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-search .search_content .price {
    margin: 0;
    font-size: 14px;
    font-weight: 700 !important;
    color: var(--sc-search-brown) !important;
}

.sc-search .search_content .price del {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--sc-search-muted);
}

/* ─── Mobile variant ─── */
.sc-search--mobile {
    --sc-search-height: 46px;
}

.mobile-search.sc-search {
    background: linear-gradient(180deg, var(--sc-search-cream) 0%, var(--sc-search-white) 100%);
    padding: 12px 16px 14px !important;
    border-bottom: 1px solid rgba(184, 146, 90, 0.12);
}

.mobile-search.sc-search .search_result {
    left: 16px;
    right: 16px;
}

.sc-search--mobile .sc-search__form {
    box-shadow:
        0 2px 10px rgba(42, 24, 20, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.sc-search--mobile .sc-search__input {
    font-size: 15px !important;
}

.mobile-search.sc-search .sc-search__btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    flex: 0 0 38px !important;
    aspect-ratio: 1 / 1 !important;
    position: static !important;
    border-radius: 50% !important;
}

/* ─── Scrollbar in results ─── */
.sc-search .search_product ul::-webkit-scrollbar {
    width: 5px;
}

.sc-search .search_product ul::-webkit-scrollbar-thumb {
    background: rgba(184, 146, 90, 0.35);
    border-radius: 99px;
}
