/* ========================================
   Site Search — Overlay + AJAX Results
   ======================================== */

/* Search trigger button in header */
.search-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #176DAA;
    transition: opacity 0.2s ease;
}
.search-trigger:hover {
    opacity: 0.7;
}
.search-trigger svg {
    width: 20px;
    height: 20px;
}

/* ---- Fullscreen overlay ---- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.search-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.search-overlay__bg {
    position: absolute;
    inset: 0;
    background: rgba(2, 16, 52, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-overlay__container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    width: 94%;
    margin: 0 auto;
    padding-top: 90px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Close button */
.search-overlay__close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.search-overlay__close:hover {
    color: #fff;
    transform: rotate(90deg);
}
.search-overlay__close svg {
    width: 28px;
    height: 28px;
}

/* ---- Input area ---- */
.search-overlay__input-wrap {
    position: relative;
    margin-bottom: 28px;
    flex-shrink: 0;
}

.search-overlay__input {
    width: 100%;
    padding: 20px 60px 20px 28px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: Manrope, sans-serif;
    font-size: 20px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
    box-sizing: border-box;
}
.search-overlay__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}
.search-overlay__input:focus {
    border-color: #176DAA;
    background: rgba(255, 255, 255, 0.12);
}

.search-overlay__input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    transition: color 0.2s ease;
}
.search-overlay__input:focus ~ .search-overlay__input-icon {
    color: #176DAA;
}

/* Spinner */
.search-overlay__spinner {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #176DAA;
    border-radius: 50%;
    animation: searchSpin 0.6s linear infinite;
    display: none;
}
.search-overlay__spinner.active {
    display: block;
}
.search-overlay__spinner.active ~ .search-overlay__input-icon {
    display: none;
}
@keyframes searchSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ---- Hint text ---- */
.search-overlay__hint {
    color: rgba(255, 255, 255, 0.35);
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    padding: 40px 0;
    flex-shrink: 0;
}

/* ---- Results ---- */
.search-overlay__results {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.search-overlay__results::-webkit-scrollbar {
    width: 4px;
}
.search-overlay__results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Results grid */
.search-results__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* Single result card */
.search-result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.search-result-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(23, 109, 170, 0.4);
}

.search-result-card__img {
    width: 64px;
    height: 64px;
    border-radius: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.search-result-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-result-card__info {
    flex: 1;
    min-width: 0;
}

.search-result-card__name {
    font-family: Manrope, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-card__price {
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #3CA5EF;
}
.search-result-card__price del {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
    margin-right: 6px;
}
.search-result-card__price ins {
    text-decoration: none;
}

/* Category result card */
.search-result-card--category .search-result-card__img {
    background: rgba(23, 109, 170, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-result-card--category .search-result-card__count {
    font-family: Manrope, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
}

/* Section headings inside results */
.search-results__section-title {
    font-family: Manrope, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 4px 10px;
    margin: 0;
}
.search-results__section-title:not(:first-child) {
    margin-top: 20px;
}

/* No results */
.search-results__empty {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-family: Manrope, sans-serif;
    font-size: 15px;
    font-weight: 500;
}
.search-results__empty svg {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.3;
}

/* View all link — sticky at bottom */
.search-results__view-all {
    display: block;
    text-align: center;
    padding: 16px;
    border-radius: 0;
    background: #176DAA;
    border: none;
    color: #fff;
    font-family: Manrope, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 16px;
}
.search-results__view-all:hover {
    background: #3CA5EF;
    color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .search-results__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .search-overlay__container {
        padding-top: 80px;
        width: 92%;
    }
    .search-overlay__input {
        font-size: 17px;
        padding: 18px 50px 18px 20px;
    }
    .search-results__grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .search-overlay__close {
        top: 18px;
        right: 18px;
    }
}

@media (max-width: 480px) {
    .search-overlay__container {
        padding-top: 70px;
    }
}

/* ========================================
   Search Results PAGE (search.php)
   ======================================== */

.search-page-categories {
    padding: 0 0 20px;
}

.search-page__section-title {
    font-family: Manrope, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 20px 0 -10px !important;
    padding: 0;
}

.search-page__no-results {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    font-family: Manrope, sans-serif;
    font-size: 16px;
    font-weight: 500;
}
.search-page__no-results svg {
    display: block;
    margin: 0 auto 20px;
    opacity: 0.3;
}
.search-page__no-results p {
    margin: 0;
}

/* Pagination */
.pagination-wrap {
    padding: 40px 0;
    display: flex;
    justify-content: center;
}
.pagination-wrap .nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.pagination-wrap .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    font-family: Manrope, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #176DAA;
    background: rgba(23, 109, 170, 0.08);
    border: 1px solid rgba(23, 109, 170, 0.2);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.pagination-wrap .page-numbers:hover {
    background: rgba(23, 109, 170, 0.15);
    border-color: rgba(23, 109, 170, 0.4);
}
.pagination-wrap .page-numbers.current {
    background: #176DAA;
    border-color: #176DAA;
    color: #fff;
}
.pagination-wrap .page-numbers.dots {
    background: none;
    border: none;
    color: #999;
}
.pagination-wrap .page-numbers.prev,
.pagination-wrap .page-numbers.next {
    font-size: 18px;
}
