/* ===== SEARCH OVERLAY ===== */

/* Search Trigger Button */
.ss-search-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    display: inline-block;
    padding: 0 1rem;
    line-height: 7.2rem;
    font-family: inherit;
    color: inherit;
}

.ss-search-trigger:hover {
    opacity: 0.7;
}

/* Search Overlay Container */
#ss-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    z-index: 999;
    transform: translateY(-15px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
    box-shadow: none;
}

#ss-search-overlay.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Search Inner Container */
.ss-search__inner {
    max-width: 140rem;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

@media (min-width: 768px) {
    .ss-search__inner {
        padding: 1.5rem 3.2rem;
    }
}

/* Search Bar */
.ss-search__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Search Form */
.ss-search__form {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
}

/* Search Icon */
.ss-search__icon {
    flex-shrink: 0;
    line-height: 0;
}

.ss-search__icon svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 991px) {
    .ss-search__icon svg {
        width: 14px;
        height: 14px;
    }
}

/* Search Input */
.ss-search__input {
    flex: 1;
    border: none;
    outline: none;
    box-shadow: none;
    font-size: 19px;
    font-family: inherit;
    line-height: 1;
    padding: 0;
    background: transparent;
    color: #000;
    -webkit-appearance: none;
    appearance: none;
}

.ss-search__input:focus,
.ss-search__input:active {
    border: none;
    outline: none;
    box-shadow: none;
}

.ss-search__input::placeholder {
    color: #000;
    opacity: 1;
}

.ss-search__input::-webkit-search-cancel-button,
.ss-search__input::-webkit-search-decoration,
.ss-search__input::-webkit-search-results-button,
.ss-search__input::-webkit-search-results-decoration {
    display: none;
}

/* Close Button */
.ss-search__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
}

.ss-search__close img {
    width: 14px;
    height: 14px;
}

.ss-search__close:hover {
    opacity: 0.7;
}

/* Search Results Container */
.ss-search__results {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

@media (min-width: 768px) {
    .ss-search__results {
        margin-top: 2.5rem;
        padding-top: 2.5rem;
    }
}

.ss-search__results.has-results {
    display: block;
}

/* Results Header */
.ss-search__results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ss-search__results-count {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
}

.ss-search__view-all {
    font-size: 1.4rem;
    text-decoration: underline;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ss-search__view-all:hover {
    opacity: 0.7;
}

/* Products Grid */
.ss-search__products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .ss-search__products {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
}

/* Product Card */
.ss-search__product {
    position: relative;
}

.ss-search__product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ss-search__product-image-wrapper {
    position: relative;
    background-color: #f5f5f5;
    padding-top: 100%;
    overflow: hidden;
}

.ss-search__product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ss-search__product-link:hover .ss-search__product-image {
    transform: scale(1.02);
}

/* Product Badge */
.ss-search__product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #fff;
    border-radius: 2px;
    font-size: 8px;
    letter-spacing: 0.7px;
    line-height: 1;
    padding: 0.25rem 0.3125rem 0.125rem;
    text-transform: uppercase;
    z-index: 1;
}

/* Product Meta */
.ss-search__product-meta {
    padding: 9px 8px 0;
}

.ss-search__product-title {
    font-size: 11px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: uppercase;
    margin: 0;
}

.ss-search__product-price {
    font-size: 11px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-top: 4px;
    color: #000;
}

.ss-search__product-soldout {
    font-size: 10px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-top: 4px;
    color: #989898;
    text-transform: uppercase;
}

/* No Results */
.ss-search__no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.4rem;
}

/* Loading State */
.ss-search__loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.ss-search__loading.is-loading {
    display: flex;
}

.ss-search__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #eee;
    border-top-color: #000;
    border-radius: 50%;
    animation: ss-spin 0.8s linear infinite;
}

@keyframes ss-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Search Backdrop */
#ss-search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#ss-search-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Body class when search is open */
body.ss-search-open {
    overflow: hidden;
}