/**
 * cofisczelastic16 — Popup search styly pro PS 1.6
 * 3-sloupcový layout sladěný s PS 8 designem
 */

/* ==========================================================================
   1. Base / Reset
   ========================================================================== */

.czel16-popup-wrapper *,
.czel16-popup-wrapper *::before,
.czel16-popup-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   2. Overlay (zatmaveni stranky za popupem)
   ========================================================================== */

.czel16-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    opacity: 0;
    -webkit-transition: opacity 250ms ease;
    transition: opacity 250ms ease;
    pointer-events: none;
}

.czel16-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   3. Wrapper
   ========================================================================== */

.czel16-popup-wrapper {
    --czel16-primary: #018c95;
    --czel16-primary-hover: #017580;
    --czel16-primary-rgb: 1, 140, 149;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    padding-top: 6px;
    animation: czel16SlideIn 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   3. Popup kontejner
   ========================================================================== */

.czel16-popup {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 50px -8px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   4. Hlavičky sekcí
   ========================================================================== */

.czel16-popup__section-title {
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: #9ca3af;
    font-weight: 700;
    margin: 0 0 10px 0;
}

/* ==========================================================================
   5. Suggestions / Populární dotazy (nahoře)
   ========================================================================== */

.czel16-popup__suggestions {
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.czel16-popup__suggestions-list {
    display: flex;
    flex-wrap: wrap;
    margin: -3px;
}

.czel16-popup__suggestion {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    margin: 3px;
    border-radius: 20px;
    background: #f5f5f7;
    color: #1f2937;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.czel16-popup__suggestion:hover {
    background: rgba(var(--czel16-primary-rgb), 0.1);
    color: var(--czel16-primary);
    text-decoration: none;
}

.czel16-popup__suggestion svg {
    width: 13px;
    height: 13px;
    margin-right: 5px;
    color: #9ca3af;
    flex-shrink: 0;
}

.czel16-popup__suggestion:hover svg {
    color: var(--czel16-primary);
}

/* ==========================================================================
   6. Tři sloupce
   ========================================================================== */

.czel16-popup__columns {
    display: flex;
    min-height: 280px;
}

.czel16-popup__col {
    padding: 18px;
}

/* Levý sloupec — kategorie + značky */
.czel16-popup__col--categories {
    width: 190px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;
    background: #fafbfc;
}

/* Prostřední sloupec — top produkt */
.czel16-popup__col--top {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;
}

/* Pravý sloupec — produkty grid */
.czel16-popup__col--products {
    flex: 1;
    min-width: 0;
}

/* Default popup: prostřední sloupec flexibilnější */
.czel16-popup--default .czel16-popup__col--top {
    width: auto;
    flex: 1;
}

/* Novinky v prostředním sloupci — 1 sloupec */
.czel16-popup__col--top .czel16-popup__products-grid {
    grid-template-columns: 1fr;
}

.czel16-popup--default .czel16-popup__col--products {
    flex: 2;
}

/* ==========================================================================
   7. Kategorie
   ========================================================================== */

.czel16-popup__categories {
    display: flex;
    flex-direction: column;
}

.czel16-popup__category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.czel16-popup__category:hover {
    background: #fff;
    color: var(--czel16-primary);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.czel16-popup__category svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-3px);
    transition: all 0.15s ease;
}

.czel16-popup__category:hover svg {
    opacity: 1;
    transform: translateX(0);
    color: var(--czel16-primary);
}

/* ==========================================================================
   8. Značky / Výrobci
   ========================================================================== */

.czel16-popup__brands {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.czel16-popup__brands .czel16-popup__section-title {
    margin-bottom: 8px;
}

.czel16-popup__brands-list {
    display: flex;
    flex-direction: column;
}

.czel16-popup__brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.czel16-popup__brand:hover {
    background: #fff;
    color: var(--czel16-primary);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.czel16-popup__brand svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-3px);
    transition: all 0.15s ease;
}

.czel16-popup__brand:hover svg {
    opacity: 1;
    transform: translateX(0);
    color: var(--czel16-primary);
}

/* ==========================================================================
   9. Top produkt (prostřední sloupec)
   ========================================================================== */

.czel16-popup__top-product {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1f2937;
    border-radius: 12px;
    padding: 10px;
    transition: all 0.2s ease;
}

.czel16-popup__top-product:hover {
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
}

.czel16-popup__top-product-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f7;
    margin-bottom: 12px;
}

.czel16-popup__top-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.czel16-popup__top-product:hover .czel16-popup__top-product-image {
    transform: scale(1.04);
}

.czel16-popup__top-product-info {
    display: flex;
    flex-direction: column;
}

.czel16-popup__top-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.czel16-popup__top-product-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--czel16-primary);
}

/* ==========================================================================
   10. Produkty — 2-sloupcový grid
   ========================================================================== */

.czel16-popup__products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.czel16-popup__product {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: #1f2937;
    transition: all 0.15s ease;
}

.czel16-popup__product:hover {
    background: #f5f5f7;
    text-decoration: none;
    color: #1f2937;
}

.czel16-popup__product--active {
    background: #f0f9fa;
}

.czel16-popup__product-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f5f7;
    padding: 3px;
    margin-right: 10px;
}

.czel16-popup__product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.czel16-popup__product-name {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.czel16-popup__product-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--czel16-primary);
}

.czel16-popup__price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.75rem;
    margin-right: 4px;
}

/* ==========================================================================
   10b. Cart / Variant ikony
   ========================================================================== */

.czel16-popup__product-cart {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(var(--czel16-primary-rgb), 0.08);
    color: var(--czel16-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.czel16-popup__product-cart:hover {
    background: var(--czel16-primary);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(var(--czel16-primary-rgb), 0.35);
}

.czel16-popup__product-cart--small {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.czel16-popup__product-cart--small svg {
    width: 14px;
    height: 14px;
}

.czel16-popup__product-cart svg {
    width: 17px;
    height: 17px;
}

.czel16-popup__product-cart--added {
    background: #059669;
    color: #fff;
    transform: scale(1.1);
}

.czel16-popup__product-cart--adding {
    opacity: 0.6;
    pointer-events: none;
}

.czel16-popup__product-cart--variant {
    background: rgba(107, 114, 128, 0.08);
    color: #6b7280;
}

.czel16-popup__product-cart--variant:hover {
    background: #6b7280;
    color: #fff;
    box-shadow: 0 3px 10px rgba(107, 114, 128, 0.3);
}

/* Inline cart button (pod cenou u top produktu) */
.czel16-popup__product-cart--inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: auto;
    padding: 8px 18px;
    border-radius: 10px;
    background: var(--czel16-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.czel16-popup__product-cart--inline:hover {
    background: var(--czel16-primary-hover);
    box-shadow: 0 4px 14px rgba(var(--czel16-primary-rgb), 0.3);
    color: #fff;
    transform: translateY(-1px) scale(1);
}

.czel16-popup__product-cart--inline span {
    white-space: nowrap;
}

.czel16-popup__product-cart--inline svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.czel16-popup__product-cart--variant.czel16-popup__product-cart--inline {
    background: #6b7280;
}

.czel16-popup__product-cart--variant.czel16-popup__product-cart--inline:hover {
    background: #4b5563;
    box-shadow: 0 4px 14px rgba(107, 114, 128, 0.3);
}

/* ==========================================================================
   11. Highlight
   ========================================================================== */

.czel16-popup mark {
    background: rgba(var(--czel16-primary-rgb), 0.12);
    color: var(--czel16-primary);
    padding: 0 1px;
    border-radius: 2px;
    font-style: normal;
}

/* ==========================================================================
   12. Footer
   ========================================================================== */

.czel16-popup__footer {
    border-top: 1px solid #f0f0f0;
    padding: 14px 20px;
}

.czel16-popup__show-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 24px;
    border-radius: 10px;
    background: var(--czel16-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.czel16-popup__show-all:hover {
    background: var(--czel16-primary-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(var(--czel16-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.czel16-popup__show-all:active {
    transform: translateY(0);
}

.czel16-popup__show-all svg {
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.czel16-popup__show-all:hover svg {
    transform: translateX(3px);
}

/* ==========================================================================
   13. Zavírací tlačítko
   ========================================================================== */

.czel16-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1;
}

.czel16-popup__close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* ==========================================================================
   14. Prázdný stav
   ========================================================================== */

.czel16-popup__empty {
    text-align: center;
    padding: 48px 24px 32px;
    color: #6b7280;
}

.czel16-popup__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
}

.czel16-popup__empty-icon svg {
    width: 22px;
    height: 22px;
}

.czel16-popup__empty-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.czel16-popup__empty-hint {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ==========================================================================
   15. Animace
   ========================================================================== */

@keyframes czel16SlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   15. Responzivní — mobil (breakpoint 1349px = shodný s tématem RealGeek)
   ========================================================================== */

@media (max-width: 1349px) {
    .czel16-popup-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding-top: 0;
        z-index: 99999 !important;
        background: #fff;
        animation: czel16MobileSlideIn 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .czel16-popup {
        border-radius: 0;
        height: 100%;
        max-height: 100vh;
        overflow-y: auto;
    }

    /* Mobilní search header uvnitř popupu */
    .czel16-popup__mobile-header {
        display: flex;
        align-items: center;
        padding: 10px 14px;
        background: var(--czel16-primary);
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .czel16-popup__mobile-input {
        flex: 1;
        height: 40px;
        padding: 0 12px;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-family: inherit;
        background: #fff;
        color: #1f2937;
        outline: none;
        -webkit-appearance: none;
    }

    .czel16-popup__mobile-input::placeholder {
        color: #9ca3af;
    }

    .czel16-popup__mobile-input:focus {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    }

    .czel16-popup__close--mobile {
        position: static;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    .czel16-popup__close--mobile:hover {
        background: rgba(255, 255, 255, 0.3);
        color: #fff;
    }

    .czel16-popup__suggestions {
        padding: 10px 14px 8px;
    }

    .czel16-popup__columns {
        flex-direction: column;
        min-height: auto;
    }

    .czel16-popup__col {
        border-right: none;
        width: 100% !important;
        padding: 12px 14px;
    }

    .czel16-popup__col--categories {
        border-bottom: 1px solid #f0f0f0;
        padding: 10px 14px;
    }

    /* Kategorie na mobilu — horizontální pills */
    .czel16-popup__categories {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .czel16-popup__category {
        padding: 5px 12px;
        background: #fff;
        border-radius: 20px;
        border: 1px solid #e5e7eb;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .czel16-popup__category:hover {
        border-color: var(--czel16-primary);
        box-shadow: none;
    }

    .czel16-popup__category svg {
        display: none;
    }

    /* Značky na mobilu — horizontální pills */
    .czel16-popup__brands-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .czel16-popup__brand {
        padding: 5px 12px;
        background: #fff;
        border-radius: 20px;
        border: 1px solid #e5e7eb;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .czel16-popup__brand:hover {
        border-color: var(--czel16-primary);
        box-shadow: none;
    }

    .czel16-popup__brand svg {
        display: none;
    }

    .czel16-popup__brands {
        margin-top: 10px;
        padding-top: 10px;
    }

    /* Oba režimy: skrýt prostřední sloupec (novinky / top produkt) — shodné s PS 8 */
    .czel16-popup__col--top {
        display: none;
    }

    /* Search režim: skrýt značky — shodné s PS 8 */
    .czel16-popup__brands {
        display: none;
    }

    /* Default popup na mobilu: skrýt kategorie — shodné s PS 8 */
    .czel16-popup--default .czel16-popup__col--categories {
        display: none;
    }

    /* Produkty na mobilu — 1 sloupec */
    .czel16-popup__products-grid {
        grid-template-columns: 1fr;
    }

    .czel16-popup__product-image {
        width: 52px;
        height: 52px;
    }

    .czel16-popup__product-cart--small {
        width: 28px;
        height: 28px;
    }

    .czel16-popup__product-cart--inline {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    .czel16-popup__footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 10px 14px;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Skrýt desktop close button na mobilu (máme close v mobile headeru) */
    .czel16-popup__close:not(.czel16-popup__close--mobile) {
        display: none;
    }
}

/* Telefony — menší fonty, kompaktnější layout */
@media (max-width: 480px) {
    .czel16-popup__mobile-input {
        font-size: 14px;
        height: 38px;
    }
}

@keyframes czel16MobileSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

