/* ═══════════════════════════════════════════════════════════
   Solestra Rental — Product Search Modal
   Trousseau tema tasarım diline uyumlu.
   ═══════════════════════════════════════════════════════════ */

/* ── Search Trigger (Shortcode İkonu) ── */

/* Kare içinde search ikonu — booking-btn-icon-square & user-menu-icon-btn ile
   birebir aynı tasarım. Tema override'larına karşı !important ile sertleştirildi. */
.solestra-search-trigger,
a.solestra-search-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    color: #000 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease-out, color 0.2s ease-out !important;
    line-height: 0 !important;
    font-size: 0 !important;
    vertical-align: middle !important;
}

.solestra-search-trigger:focus { outline: none !important; }
.solestra-search-trigger:focus-visible {
    outline: 2px solid #000 !important;
    outline-offset: 2px !important;
}

.solestra-search-trigger svg {
    stroke: currentColor !important;
    transition: stroke 0.2s ease-out !important;
    display: block !important;
}

.solestra-search-trigger:hover,
.solestra-search-trigger:focus,
a.solestra-search-trigger:hover,
a.solestra-search-trigger:focus {
    background: #000 !important;
    background-color: #000 !important;
    color: #fff !important;
}

.solestra-search-trigger:hover svg,
.solestra-search-trigger:focus svg {
    stroke: #fff !important;
}

/* ── Body Scroll Lock ── */

body.solestra-search-open {
    overflow: hidden;
}

/* ── Overlay ── */

.solestra-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 20px;
    transition: background 0.3s ease;
}

.solestra-search-overlay--visible {
    background: rgba(0, 0, 0, 0.85);
}

/* ── Modal Container ── */

.solestra-search-modal {
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.solestra-search-overlay--visible .solestra-search-modal {
    transform: translateY(0);
    opacity: 1;
}

/* ── Header / Input ── */

.solestra-search-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.solestra-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.solestra-search-icon {
    flex-shrink: 0;
    color: #aaa;
}

.solestra-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: "Muli", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.solestra-search-input::placeholder {
    color: #aaa;
    font-style: normal;
}

/* Temizle (X) butonu */

.solestra-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease-out;
}

.solestra-search-clear:hover {
    color: #000;
}

/* KAPAT butonu */

.solestra-search-close {
    flex-shrink: 0;
    background: none;
    border: 1px solid #ddd;
    padding: 8px 16px;
    font-family: "Muli", sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6a6a6a;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.solestra-search-close:hover {
    border-color: #000;
    color: #000;
}

/* ── Body / Sonuçlar ── */

.solestra-search-body {
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

/* ── Durum Mesajları ── */

.solestra-search-status {
    padding: 0;
    text-align: center;
}

.solestra-search-hint,
.solestra-search-error {
    display: block;
    padding: 32px 24px;
    font-family: "Muli", sans-serif;
    font-size: 13px;
    color: #aaa;
}

.solestra-search-error {
    color: #dc2626;
}

.solestra-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 24px;
    color: #aaa;
}

.solestra-search-no-results svg {
    stroke: #ddd;
}

.solestra-search-no-results span {
    font-family: "Muli", sans-serif;
    font-size: 13px;
    font-weight: 400;
}

/* ── Loading Spinner ── */

.solestra-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.solestra-search-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #eee;
    border-top-color: #000;
    border-radius: 50%;
    animation: solestra-search-spin 0.6s linear infinite;
}

@keyframes solestra-search-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════
   SONUÇ BÖLÜMLERİ (Markalar + Ürünler)
   ═══════════════════════════════════════════════════════════ */

.solestra-search-section {
    border-bottom: 1px solid #f0f0f0;
}

.solestra-search-section:last-child {
    border-bottom: none;
}

.solestra-search-section-title {
    font-family: "Muli", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #aaa;
    margin: 0;
    padding: 16px 24px 10px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Marka Sonuçları ── */

.solestra-search-brands {
    display: flex;
    flex-direction: column;
}

.solestra-search-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s ease-out;
}

.solestra-search-brand:last-child {
    border-bottom: none;
}

.solestra-search-brand:hover {
    background: #fafafa;
}

.solestra-search-brand-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border-radius: 0;
}

.solestra-search-brand-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.solestra-search-brand-name {
    font-family: "Muli", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.solestra-search-brand-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.solestra-search-brand-badge {
    display: inline-block;
    font-family: "Muli", sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #000;
    background: #f0f0f0;
    padding: 3px 7px;
    line-height: 1;
}

/* Kategori özel rengi — markadan ayrı, daha canlı */
.solestra-search-category-badge {
    color: #fff;
    background: #8b6f47;
}

.solestra-search-category-icon {
    background: #8b6f47 !important;
}

.solestra-search-brand-count {
    font-family: "Muli", sans-serif;
    font-size: 11px;
    color: #aaa;
    letter-spacing: 0.02em;
}

/* ── Ürün Sonuç Grid ── */

.solestra-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.solestra-search-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease-out;
}

.solestra-search-product:hover {
    background: #fafafa;
}

/* Çift sütun — dikey ayırıcı (tek sayılarda sağ border) */
.solestra-search-product:nth-child(odd) {
    border-right: 1px solid #f0f0f0;
}

.solestra-search-product-image {
    width: 64px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    background: #fafafa;
}

.solestra-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.solestra-search-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.solestra-search-product-name {
    font-family: "Muli", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.solestra-search-product-price {
    font-family: "Muli", sans-serif;
    font-size: 12px;
    color: #6a6a6a;
    font-weight: 400;
}

/* WooCommerce indirimli fiyat HTML'i */

.solestra-search-product-price del {
    color: #aaa;
    font-size: 11px;
}

.solestra-search-product-price ins {
    text-decoration: none;
    color: #000;
    font-weight: 600;
}

/* ── Tümünü Göster Butonu ── */

.solestra-search-view-all {
    display: flex;
    justify-content: center;
    padding: 16px 24px 20px;
    border-top: 1px solid #eee;
}

.solestra-search-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Muli", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    padding: 10px 24px;
    border: 1px solid #000;
    transition: all 0.2s ease-out;
}

.solestra-search-view-all-btn:hover {
    background: #000;
    color: #fff;
}

.solestra-search-view-all-btn svg {
    transition: transform 0.2s ease-out;
}

.solestra-search-view-all-btn:hover svg {
    transform: translateX(3px);
}

/* ── Responsive ── */

@media (max-width: 680px) {
    .solestra-search-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .solestra-search-modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
    }

    .solestra-search-grid {
        grid-template-columns: 1fr;
    }

    .solestra-search-product:nth-child(odd) {
        border-right: none;
    }
}

@media (max-width: 480px) {
    .solestra-search-modal-header {
        padding: 16px;
        gap: 12px;
    }

    .solestra-search-product {
        padding: 12px 16px;
        gap: 12px;
    }

    .solestra-search-product-image {
        width: 52px;
        height: 68px;
    }

    .solestra-search-input {
        font-size: 15px;
    }
}
