/* ds_aisearch — dropdown autosugestii */

/* ============================
   Base — domyślnie ukryty
   ============================ */
.ds-aisearch-dropdown {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e4e4e4;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    padding: 22px 20px 18px;
    width: 820px;
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
}

.ds-aisearch-dropdown.ds-ac-visible {
    display: block;
}

/* Przycisk zamknij */
.ds-aisearch-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 4px 7px;
    z-index: 10;
    transition: color 0.15s;
}
.ds-aisearch-close:hover { color: #222; }

/* ============================
   Desktop — 3 kolumny
   ============================ */
.ds-aisearch-columns {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.ds-aisearch-col-left {
    flex: 0 0 200px;
    min-width: 0;
    padding-right: 20px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.ds-aisearch-col-middle {
    flex: 0 0 210px;
    min-width: 0;
    padding: 0 20px;
    border-right: 1px solid #f0f0f0;
}

.ds-aisearch-col-right {
    flex: 1;
    min-width: 0;
    padding-left: 20px;
}

/* ============================
   Nagłówki sekcji
   ============================ */
.ds-ac-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #aaa;
    text-transform: uppercase;
    margin: 0 0 10px;
}
.ds-ac-section-title--cats { margin-top: 18px; }

/* ============================
   Chipy zapytań
   ============================ */
.ds-aisearch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ds-aisearch-chip {
    display: inline-flex;
    align-items: center;
    background: #111;
    color: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    line-height: 1.4;
    transition: background 0.15s;
    white-space: nowrap;
}
.ds-aisearch-chip:hover { background: #555; }

/* ============================
   Kategorie
   ============================ */
.ds-aisearch-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ds-aisearch-categories li { margin-bottom: 4px; }
.ds-aisearch-categories a {
    font-size: 12px;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    transition: color 0.12s;
}
.ds-aisearch-categories a::before {
    content: '›';
    font-size: 14px;
    color: #bbb;
    flex-shrink: 0;
    line-height: 1;
}
.ds-aisearch-categories a:hover { color: #5eb756; }

/* ============================
   Baner (lewa kolumna, na dole)
   ============================ */
.ds-ac-banner {
    display: block;
    margin-top: auto;
    padding-top: 18px;
    text-decoration: none;
    line-height: 0;
}
.ds-ac-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================
   Popularny produkt (środek)
   ============================ */
.ds-aisearch-product--featured {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ds-aisearch-product--featured:hover .ds-aisearch-product__name { color: #5eb756; }

.ds-aisearch-product--featured .ds-aisearch-product__img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
}
.ds-aisearch-product--featured .ds-aisearch-product__img-placeholder {
    width: 100%;
    height: 190px;
    background: #f5f5f5;
    margin-bottom: 10px;
}

/* ============================
   Grid produktów (prawa kolumna)
   ============================ */
.ds-aisearch-products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.ds-aisearch-product {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.ds-aisearch-product:hover .ds-aisearch-product__name { color: #5eb756; }

.ds-aisearch-product .ds-aisearch-product__img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    display: block;
    margin-bottom: 6px;
}
.ds-aisearch-product .ds-aisearch-product__img-placeholder {
    width: 100%;
    height: 96px;
    background: #f5f5f5;
    margin-bottom: 6px;
}

/* Info produktu */
.ds-aisearch-product__info { padding: 0 1px; }
.ds-aisearch-product__name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 3px;
    color: #111;
    transition: color 0.12s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ds-aisearch-product__prices {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
}
.ds-aisearch-product__price {
    font-size: 12px;
    font-weight: 700;
    color: #c00;
}
.ds-aisearch-product__price-old {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
}

/* ============================
   Przycisk "Pokaż wszystkie"
   ============================ */
.ds-ac-showall {
    display: block;
    text-align: center;
    background: #111;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 10px 14px;
    transition: background 0.15s;
    cursor: pointer;
}
.ds-ac-showall:hover { background: #555; }

/* ============================
   Mobile elements (ukryte na desktop)
   ============================ */
.ds-ac-mobile-chips,
.ds-ac-mobile-tabs,
.ds-ac-mobile-panel {
    display: none;
}

/* ============================
   MOBILE — full-screen overlay
   ============================ */
@media (max-width: 767px) {

    /* Body lock */
    body.ds-ac-body-lock {
        overflow: hidden;
    }

    /* Full-screen overlay */
    .ds-aisearch-dropdown.ds-ac-visible {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    /* Przycisk zamknij — pełna szerokość, prawy górny róg */
    .ds-aisearch-close {
        position: relative;
        top: auto;
        right: auto;
        align-self: flex-end;
        font-size: 20px;
        padding: 14px 18px;
        color: #444;
        flex-shrink: 0;
    }

    /* Ukryj desktop kolumny */
    .ds-aisearch-columns { display: none !important; }

    /* Chipy mobile */
    .ds-ac-mobile-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        padding: 4px 16px 14px;
        flex-shrink: 0;
    }

    /* Zakładki */
    .ds-ac-mobile-tabs {
        display: flex;
        flex-shrink: 0;
        border-bottom: 2px solid #ebebeb;
        padding: 0 16px;
    }
    .ds-ac-mobile-tab {
        flex: 1;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        margin-bottom: -2px;
        padding: 12px 6px;
        font-size: 13px;
        font-weight: 600;
        color: #999;
        cursor: pointer;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        transition: color 0.15s, border-color 0.15s;
    }
    .ds-ac-mobile-tab--active {
        color: #111;
        border-bottom-color: #111;
    }

    /* Panele zakładek */
    .ds-ac-mobile-panel {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 14px 16px;
        overflow-y: auto;
    }
    .ds-ac-mobile-panel--hidden {
        display: none !important;
    }

    /* Lista produktów mobile */
    .ds-ac-products-list { flex: 1; }
    .ds-ac-mp {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: inherit;
        padding: 10px 0;
        border-bottom: 1px solid #f2f2f2;
        transition: background 0.1s;
    }
    .ds-ac-mp:last-child { border-bottom: none; }
    .ds-ac-mp:hover .ds-ac-mp__name { color: #c00; }

    .ds-ac-mp__img {
        width: 64px;
        height: 64px;
        object-fit: cover;
        flex-shrink: 0;
        display: block;
    }
    .ds-ac-mp__img-placeholder {
        width: 64px;
        height: 64px;
        background: #f0f0f0;
        flex-shrink: 0;
    }
    .ds-ac-mp__info { flex: 1; min-width: 0; }
    .ds-ac-mp__name {
        font-size: 13px;
        font-weight: 500;
        line-height: 1.35;
        color: #111;
        margin-bottom: 4px;
        transition: color 0.12s;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Kategorie mobile */
    .ds-aisearch-categories--mobile li { margin-bottom: 2px; }
    .ds-aisearch-categories--mobile a { font-size: 14px; padding: 6px 0; }

    /* Pokaż wszystkie — mobile */
    .ds-ac-showall--mobile {
        display: block;
        margin-top: 16px;
        flex-shrink: 0;
    }
}
