/**
 * Toolkit - Category Product CSS (consolidated)
 * Theme + Plugin styles for product archive pages
 * Variables defined in global.css
 */

/* =============================================
   THEME CSS — Blocksy archive page customizations
   (migré depuis product-category-theme.css)
   ============================================= */

/* ============================================
   CONTAINER WIDTH
   ============================================ */
[data-sidebar] {
    --theme-normal-container-max-width: 1590px;
}

/* ============================================
   PRODUCT BADGES (Blocksy)
   ============================================ */
.custom-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
    margin-top: -5px;
}

.custom-badges .badge {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--tk-radius-sm);
    color: var(--theme-palette-color-8, #fff);
    text-transform: none;
    gap: 5px;
    background: rgba(0, 0, 0, 0.8);
}

.badge-new,
.badge-sale,
.badge-free {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 480px) {
    .custom-badges .badge {
        font-size: 0.7rem;
        padding: 4px 6px;
        gap: 4px;
    }
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
[data-products] .product figure {
    background-color: var(--theme-palette-color-8);
    outline: 1px solid var(--theme-border-color);
    border-radius: 12px;
    transition: all .3s ease-in-out;
    margin-left: 1px;
}

[data-products="type-1"] .ct-media-container img {
    transition: opacity .3s ease;
}

[data-products="type-1"] .ct-media-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .02);
}

@media (min-width: 768px) {
    [data-products] .product figure:hover {
        box-shadow: 0 0.4rem 0.6rem rgba(0, 0, 0, 0.3);
    }
}

/* ============================================
   SWATCHES
   ============================================ */
.ct-variation-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--swatches-gap, 5px);
}

@media (max-width: 1024px) {
    .ct-card-variation-swatches [data-swatches-type="image"],
    .variations_form.cart [data-swatches-type="image"] {
        --swatch-size: 35px;
    }
}

@media (max-width: 768px) {
    .ct-card-variation-swatches [data-swatches-type="image"],
    .variations_form.cart [data-swatches-type="image"] {
        --swatch-size: 28px;
    }

    .ct-swap {
        display: none;
    }
}

/* ============================================
   FILTER EVERYTHING
   ============================================ */
/* Positionner le bouton Filters mobile en premier */
.wpc-filters-open-button-container,
.wpc_show_bottom_widget .wpc-filters-open-button-container {
    order: 1 !important;
}

/* Bouton filter category product mobile
   !important: Filter Everything charge après toolkit (wp_print_styles) */
body .wpc-filters-open-button-container a.wpc-filters-open-widget,
body .wpc-filters-open-button-container a.wpc-open-close-filters-button {
    border: 1px solid var(--theme-palette-color-5) !important;
    font-size: 13px;
    border-radius: 4px !important;
    line-height: 1 !important;
    padding: 6px 12px !important;
}

.woo-listing-top .woocommerce-ordering select {
    font-size: 14px;
    height: 30px;
    cursor: pointer;
}

@media screen and (max-width: 768px) {
    .woo-listing-top .woocommerce-ordering select {
        width: 30px;
        height: 28px;
    }
}

/* ============================================
   STOCK & SCARCITY (base stock styles in global.css)
   ============================================ */
.ct-product-stock-scarcity,
[class*=ct-shipping-progress] {
    font-size: 15px;
}

.ct-stock-quantity {
    color: var(--tk-stock-red);
}

.ct-progress-bar {
    display: none;
}

/* ============================================
   CATEGORY DESCRIPTION
   ============================================ */
.Product_category_description {
    padding-top: 100px;
}

@media (max-width: 1024px) {
    .Product_category_description {
        padding-top: 70px;
    }
}

@media (max-width: 768px) {
    .Product_category_description {
        padding-top: 50px;
    }
}

/* ===========================================
   PRODUCT HOVER (Wishlist)
   =========================================== */
.ct-woo-card-extra[data-type=type-1] {
    top: 10px !important;
    right: 10px !important;
}

.ct-woo-card-extra[data-type=type-1] .ct-button {
    width: 28px !important;
    min-height: 28px !important;
}

@media (min-width: 768px) {
    .product .ct-woo-card-extra {
        gap: 10px !important;
        right: 0 !important;
        opacity: 0;
        transition: opacity var(--tk-transition-fast), transform var(--tk-transition-fast);
    }

    .product:hover .ct-woo-card-extra {
        opacity: 1;
        transform: translateX(-15px);
    }
}

/* =============================================
   PLUGIN CSS — Category navigation, Best seller slider, ACF description
   (contenu original de category-product.css)
   ============================================= */

/* ===========================================
   CATEGORY NAVIGATION (Internal linking)
   =========================================== */
.category-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 24px;
    cursor: grab;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: var(--tk-radius-lg);
    background: var(--tk-color-bg-light);
    color: var(--tk-color-text);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background var(--tk-transition), color var(--tk-transition);
    border: 1px solid var(--tk-color-border);
    white-space: nowrap;
}

.cat-pill:hover {
    background: var(--tk-color-border);
    color: var(--tk-color-primary);
}

@media (max-width: 767px) {
    .category-scroll {
        gap: 10px;
        padding-bottom: 15px;
    }
    .cat-pill {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* ===========================================
   BEST SELLER SLIDER
   =========================================== */
.best-seller-section {
    margin-top: 2rem;
}

.best-seller-slider {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin: 0;
}

.best-seller-slider ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1rem;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.best-seller-slider ul.products li.product {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 220px !important;
	margin: 1px;
}

@media (max-width: 768px) {
    .best-seller-slider ul.products li.product {
        width: 160px !important;
    }
}

@media (max-width: 480px) {
    .best-seller-slider ul.products li.product {
        width: 140px !important;
    }
}

/* ===========================================
   ACF DESCRIPTION BELOW
   =========================================== */
.acf-description-below {
    margin-top: 50px;
    max-width: 1190px;
    font-size: 14px;
}

.acf-description-below h2 {
    font-size: var(--wp--preset--font-size--large) !important;
}

.acf-description-below h3 {
    font-size: calc(var(--wp--preset--font-size--large) * 0.85) !important;
}

.acf-description-below a {
    color: var(--tk-color-accent);
    text-decoration: underline;
}

/* ===========================================
   DYNAMIC CATEGORY TITLE
   =========================================== */
.dynamic-category-title {
    font-size: var(--wp--preset--font-size--large) !important;
}
