/* Products catalog page overrides */

/* Hide search_results block when empty or all elements hidden */
.filter_products .about_block .search_filter .search_results:empty {
    display: none !important;
}
.filter_products .about_block .search_filter .search_results {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
}
.filter_products .about_block .search_filter .search_results:not(:has(span:not([hidden]):not([style*="display: none"]):not([style*="display:none"]))) {
    display: none !important;
}

/* Hide inf_cards (product card tags) when all tags are hidden */
.inf_cards:empty,
.inf_cards:not(:has(a:not([hidden]):not([style*="display: none"]):not([style*="display:none"]))) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
}

/* Fix card stretching in catalog Trending slider */
.filter_products .about_block .trending_cards .swiper-slide {
    height: auto !important;
}
.filter_products .about_block .trending_cards .swiper-wrapper {
    height: auto !important;
}
.filter_products .about_block .trending_cards .swiper-slide > .item {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    height: auto !important;
    justify-content: flex-start !important;
}

/* ── Compact hero with travel photo ── */
.products-hero-compact {
    padding: 40px 0 !important;
}

/* ── Trending toggle ── */
.trending-toggle-wrap {
    margin-bottom: 16px;
}
.trending-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.trending-toggle-btn:hover {
    border-color: #FC7361;
    color: #FC7361;
}
.trending-toggle-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Products toolbar (results count + sort) ── */
.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.products-results-count {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* ── Active filter chips ── */
.products-active-filters {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.products-active-filters:not(:empty) {
    display: flex;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #f3f2f2;
    border-radius: 16px;
    font-size: 13px;
    color: #212121;
    line-height: 1.3;
}
.filter-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #a4a0a0;
    padding: 0 2px;
    line-height: 1;
}
.filter-chip-remove:hover {
    color: #FC7361;
}
.filter-chips-clear-all {
    font-size: 13px;
    color: #FC7361 !important;
    text-decoration: underline !important;
    cursor: pointer;
}

/* ── Load More button ── */
.products-load-more {
    width: 100%;
    text-align: center;
    padding: 30px 0;
}
.btn-load-more {
    display: inline-block;
    padding: 12px 40px;
    background: #FC7361;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.btn-load-more:hover {
    background: #e65946;
}
.btn-load-more.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Empty state ── */
.products-empty-state {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
}
.products-empty-img {
    max-width: 200px;
    margin: 0 auto 20px;
    display: block;
}
.products-empty-state h3 {
    font-size: 20px;
    color: #212121;
    margin-bottom: 8px;
}
.products-empty-state p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}
.products-empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-clear-filters {
    padding: 10px 24px;
    background: #FC7361;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-clear-filters:hover {
    background: #e65946;
}
.btn-browse-all {
    padding: 10px 24px;
    background: #fff;
    color: #212121 !important;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.btn-browse-all:hover {
    border-color: #FC7361;
}

/* ── Product card: seller name ── */
.product-card-seller {
    font-size: 12px;
    line-height: 1.3;
    min-height: 1rem;
}
.product-card-seller-link {
    color: #a4a0a0 !important;
    transition: color 0.2s;
}
.product-card-seller-link:hover {
    color: #FC7361 !important;
}

/* ── Product card: social proof ── */
.product-card-social-proof {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
}
.product-card-social-proof svg {
    width: 14px;
    height: 14px;
    color: #FC7361;
}

/* ── Product card: tags +N more ── */
.product-tags-more {
    font-size: 11px;
    color: #a4a0a0;
    padding: 2px 6px;
    background: #f3f2f2;
    border-radius: 4px;
    white-space: nowrap;
}


/* ── Quick View button on card ── */
.product-quick-view {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
}
.img_products:hover .product-quick-view {
    opacity: 1;
}
.product-quick-view:hover {
    background: #fff;
}
.product-quick-view svg {
    width: 16px;
    height: 16px;
    color: #212121;
}

/* ── Quick View modal ── */
.quick-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.quick-view-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}
.quick-view-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    line-height: 1;
}
.quick-view-close:hover {
    color: #212121;
}
.quick-view-loading {
    text-align: center;
    padding: 60px 0;
}
.quick-view-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e5e5;
    border-top-color: #FC7361;
    border-radius: 50%;
    animation: qv-spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes qv-spin {
    to { transform: rotate(360deg); }
}
.quick-view-error {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

/* Quick View content layout */
.quick-view-body {
    display: flex;
    gap: 24px;
}
.quick-view-image {
    flex: 0 0 300px;
    max-width: 300px;
}
.quick-view-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
.quick-view-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.quick-view-title {
    font-size: 20px;
    font-weight: 600;
    color: #212121;
    line-height: 1.3;
}
.quick-view-seller {
    font-size: 13px;
    color: #a4a0a0;
}
.quick-view-seller a {
    color: #a4a0a0 !important;
    transition: color 0.2s;
}
.quick-view-seller a:hover {
    color: #FC7361 !important;
}
.quick-view-price {
    font-size: 22px;
    font-weight: 600;
    color: #212121;
}
.quick-view-price .price-old {
    font-size: 16px;
    color: #a4a0a0;
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 8px;
}
.quick-view-price .price-discount-badge {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #FC7361;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}
.quick-view-price .price-free-badge {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #22c55e;
    padding: 4px 12px;
    border-radius: 4px;
}
.quick-view-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}
.quick-view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.quick-view-tags a {
    font-size: 12px;
    padding: 3px 10px;
    background: #f3f2f2;
    border-radius: 12px;
    color: #666 !important;
    transition: background 0.2s;
}
.quick-view-tags a:hover {
    background: #e5e5e5;
}
.quick-view-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    align-items: center;
}
.quick-view-actions .btn-add-to-cart {
    padding: 10px 24px;
    background: #FC7361;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.quick-view-actions .btn-add-to-cart:hover {
    background: #e65946;
}
.quick-view-actions .btn-add-to-cart.in-cart {
    background: #212121;
}
.quick-view-view-full {
    font-size: 13px;
    color: #FC7361 !important;
}

/* ── Mobile filter drawer ── */
.mobile-filter-toggle {
    display: none;
}
.mobile-filter-overlay {
    display: none;
}
.mobile-filter-header {
    display: none;
}

@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        font-size: 14px;
        color: #212121;
        cursor: pointer;
        margin-bottom: 12px;
    }
    .mobile-filter-toggle svg {
        width: 16px;
        height: 16px;
    }

    .filter_products .about_block .filter_products_group .filter {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85vw !important;
        max-width: 360px !important;
        height: 100vh !important;
        z-index: 1050 !important;
        background: #fff !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        padding: 20px !important;
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    }
    .filter_products .about_block .filter_products_group .filter.drawer-open {
        left: 0 !important;
    }

    .mobile-filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049;
    }
    .mobile-filter-overlay.active {
        display: block;
    }

    .mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 16px;
        margin-bottom: 16px;
        border-bottom: 1px solid #e5e5e5;
        font-size: 18px;
        font-weight: 600;
    }
    .mobile-filter-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #666;
    }

    /* Add to cart always visible on mobile */
    .filter_products .filter_cards_group .item .img_products .to_basket,
    .filter_products .trending_cards .item .img_products .to_basket {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        left: auto !important;
        transform: none !important;
        margin-top: 8px;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    /* Quick View always visible on mobile */
    .product-quick-view {
        opacity: 1;
    }

    /* Quick View modal responsive */
    .quick-view-modal {
        padding: 20px;
        max-height: 90vh;
    }
    .quick-view-body {
        flex-direction: column;
    }
    .quick-view-image {
        flex: none;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .products-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .products-hero-compact {
        padding: 28px 0 !important;
    }

    .quick-view-modal {
        padding: 16px;
        border-radius: 8px;
    }
    .quick-view-close {
        top: 8px;
        right: 12px;
    }
}
