/* ======= MOBİL AXTARISH VE OVERLAY STİLLƏRİ ======= */

/* Mobil search overlay */
@media (max-width: 768px) {

    /* Search overlay gizli */
    .mobile-search-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 9999 !important;
        display: none !important;
    }

    /* Search panel */
    .mobile-search-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: white !important;
        padding: 20px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
        z-index: 10000 !important;
        display: none !important;
    }

    /* Search header */
    .mobile-search-header {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        margin-bottom: 20px !important;
    }

    /* Geri düyməsi */
    .mobile-search-back {
        background: none !important;
        border: none !important;
        font-size: 24px !important;
        color: #333 !important;
        cursor: pointer !important;
    }

    /* Search input */
    .mobile-search-input {
        flex: 1 !important;
        padding: 12px 16px !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        outline: none !important;
    }

    .mobile-search-input:focus {
        border-color: var(--blue-border) !important;
    }

    /* Search nəticələri */
    .mobile-search-results {
        max-height: 70vh !important;
        overflow-y: auto !important;
    }

    /* Search nəticə kartları */
    .mobile-search-item {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px !important;
        border-bottom: 1px solid #f3f4f6 !important;
        cursor: pointer !important;
    }

    .mobile-search-item img {
        width: 60px !important;
        height: 60px !important;
        object-fit: contain !important;
        border-radius: 6px !important;
    }

    .mobile-search-item-info h3 {
        font-size: 14px !important;
        margin: 0 0 4px 0 !important;
        color: #333 !important;
    }

    .mobile-search-item-info .price {
        font-family: 'Montserrat', sans-serif !important;
        font-size: 16px !important;
        color: #363842 !important;
        font-weight: 600 !important;
    }

    /* No results */
    .mobile-no-results {
        text-align: center !important;
        padding: 40px 20px !important;
        color: #6b7280 !important;
    }
}

@media (max-width: 768px) {
    body.mobile-search-open .mobile-search-overlay {
        display: block !important;
    }

    body.mobile-search-open .mobile-search-panel {
        display: block !important;
    }

    body.mobile-search-open {
        overflow: hidden;
    }

    /* Panel açıqkən scroll kilidi */
}

/* Mobil axtarış komponentlərini default gizlət (hər yerdə) */
.mobile-search-overlay,
.mobile-search-panel {
    display: none;
}

/* Desktopda mütləq gizli saxla */
@media (min-width: 769px) {

    .mobile-search-overlay,
    .mobile-search-panel {
        display: none !important;
    }
}

/* Mobil: panel açıq olanda göstər */
@media (max-width: 768px) {
    body.mobile-search-open .mobile-search-overlay {
        display: block !important;
    }

    body.mobile-search-open .mobile-search-panel {
        display: block !important;
    }

    body.mobile-search-open {
        overflow: hidden;
    }

    /* Panel açıqkən scroll kilidi */
}

/* Görünməyən, lakin əlçatan element (Enter üçün submit) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- MOBİL AXTARIŞ İNKİŞAFI: yalnız mobil --- */
@media (max-width: 768px) {

    /* Panel ölçü və yerləşmə: container-dən asılı olmayaraq sabit qalır */
    .mobile-search-panel {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 12px 16px !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    /* Başlıq sırası: geri düyməsi + forma yan‑yana, sıx boşluq */
    .mobile-search-header {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
    }

    /* Geri düyməsi: toxunma sahəsi 44x44 (tapılması rahat) */
    .mobile-search-back {
        width: 44px !important;
        height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 20px !important;
        /* ikon/font ölçüsü */
        line-height: 1 !important;
        background: none !important;
        border: none !important;
        color: #333 !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* Forma və input: bütün eni doldursun, sabit hündürlük */
    .mobile-search-form {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        /* overflow-un qarşısını almaq üçün */
    }

    .mobile-search-input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        height: 44px !important;
        padding: 10px 14px !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        outline: none !important;
        background: #fff !important;
    }

    .mobile-search-input:focus {
        border-color: var(--blue-border) !important;
    }

    /* Overlay bir az daha tünd – diqqəti axtarışa yönəltmək üçün */
    .mobile-search-overlay {
        background: rgba(0, 0, 0, 0.6) !important;
    }
}

/* === WooCommerce MOBİL AXTARIŞ - MİNİMALİST VERSİYA === */

/* Desktop-da WC mobil elementlərini tamamilə gizlət */
@media (min-width: 769px) {

    .wc-mobile-search-overlay,
    .wc-mobile-search-panel,
    .wc-mobile-search-header,
    .wc-mobile-search-back,
    .wc-mobile-search-form-wrapper,
    .wc-mobile-search-panel .search-field,
    .wc-mobile-search-panel button[type="submit"],
    .wc-mobile-search-panel form {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
}

/* Mobil: WC axtarış elementləri */
@media (max-width: 768px) {

    .wc-mobile-search-overlay,
    .wc-mobile-search-panel {
        display: none;
        position: fixed;
        z-index: 99999;
    }

    /* Overlay: tam ekran qaraltma */
    .wc-mobile-search-overlay {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
    }

    /* Panel: minimalist, alçaq */
    .wc-mobile-search-panel {
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        padding: 12px 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 12px 12px;
        transform: translateY(-100%);
        transition: transform 0.25s ease;
    }

    /* Panel açıq olanda */
    body.wc-mobile-search-open .wc-mobile-search-overlay {
        display: block !important;
    }

    body.wc-mobile-search-open .wc-mobile-search-panel {
        display: block !important;
        transform: translateY(0);
    }

    body.wc-mobile-search-open {
        overflow: hidden;
    }

    /* Header: kompakt düzən */
    .wc-mobile-search-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0;
    }

    /* Geri düyməsi: kiçik, sadə */
    .wc-mobile-search-back {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f3f4f6;
        border: none;
        border-radius: 8px;
        color: #6b7280;
        font-size: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .wc-mobile-search-back:hover,
    .wc-mobile-search-back:active {
        background: #e5e7eb;
        color: #374151;
    }

    /* Form wrapper */
    .wc-mobile-search-form-wrapper {
        flex: 1;
        min-width: 0;
    }

    .wc-mobile-search-form-wrapper form {
        display: flex;
        align-items: center;
        background: #f9fafb;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        transition: all 0.2s ease;
    }

    .wc-mobile-search-form-wrapper form:focus-within {
        border-color: #00aeef;
        background: white;
        box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
    }

    /* Axtarış input: kompakt */
    .wc-mobile-search-panel .search-field {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        padding: 10px 12px;
        font-size: 15px;
        color: #374151;
        min-width: 0;
    }

    .wc-mobile-search-panel .search-field::placeholder {
        color: #9ca3af;
        font-weight: 400;
    }

    /* Submit düyməsi: minimalist */
    .wc-mobile-search-panel button[type="submit"] {
        background: #00aeef;
        border: none;
        color: white;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
        min-width: 60px;
    }

    .wc-mobile-search-panel button[type="submit"]:hover,
    .wc-mobile-search-panel button[type="submit"]:active {
        background: #17678b;
    }

    /* Animasiya: sadə */
    .wc-mobile-search-overlay {
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    body.wc-mobile-search-open .wc-mobile-search-overlay {
        opacity: 1;
    }
}

/* Mobil landscape üçün */
@media (max-width: 768px) and (orientation: landscape) {
    .wc-mobile-search-panel {
        padding: 8px 16px;
    }

    .wc-mobile-search-back {
        width: 32px;
        height: 32px;
    }

    .wc-mobile-search-panel .search-field {
        padding: 8px 10px;
    }

    .wc-mobile-search-panel button[type="submit"] {
        padding: 8px 12px;
    }
}

/* Submit düyməsi: Qara Bold variant */
.wc-mobile-search-panel button[type="submit"] {
    background: #374151 !important;
    border: none !important;
    color: white !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    min-width: 60px !important;
}

.wc-mobile-search-panel button[type="submit"]:active {
    background: #1f2937 !important;
    transform: scale(0.95) !important;
}

/* Mobil landscape üçün düzəliş */
@media (max-width: 768px) and (orientation: landscape) {
    .wc-mobile-search-panel button[type="submit"] {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}