/**
 * Custom Product Archive - Category Pages
 * Theme: Hello Elementor Child
 * Version: 1.1.0 - Fixed Mobile Responsive
 */

/* Hide default WooCommerce elements */
.woocommerce-products-header {
    display: none !important;
}
.woocommerce-result-count {
    display: none !important;
}
.woocommerce-ordering {
    display: none !important;
}
ul.products {
    display: none !important;
}
.woocommerce-pagination {
    display: none !important;
}

.custom-product-archive {
    width: 100%;
    background: #ffffff;
}

/* Breadcrumb */
.cpa-breadcrumb {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
}

.cpa-breadcrumb a {
    color: #666666;
    text-decoration: none;
    transition: color 0.3s;
}

.cpa-breadcrumb a:hover {
    color: #c1a35f;
}

.cpa-breadcrumb span {
    color: #1a1a1a;
    font-weight: 600;
}

/* Header catégorie */
.cpa-header {
    max-width: 100%;
    margin: 0 auto;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    border-radius: 20px;
    margin-bottom: 40px;
}

/* Masquer les catégories sur les cartes produit */
.cpa-product-categories {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cpa-header-title {
    font-size: 56px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.2;
}

.cpa-header-description {
    font-size: 18px;
    color: #666666;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Barre de contrôles */
.cpa-controls {
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f7;
    border-radius: 16px;
    gap: 20px;
    box-sizing: border-box;
}

.cpa-result-count {
    font-size: 16px;
    color: #666666;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}

.cpa-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-wrap: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.cpa-sort-label {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}

.cpa-sort-select {
    padding: 10px 40px 10px 20px;
    border: 2px solid #e5e5e5;
    background: #ffffff;
    border-radius: 20px;
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23000' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    width: auto;
    max-width: 250px;
    flex-shrink: 1;
    margin: 0;
    box-sizing: border-box;
}

.cpa-sort-select:hover {
    border-color: #c1a35f;
}

.cpa-sort-select:focus {
    outline: none;
    border-color: #c1a35f;
}

/* Grille de produits */
.cpa-products-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.cpa-product-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.cpa-product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(193, 163, 95, 0.2);
    border-color: #c1a35f;
}

.cpa-product-image-link {
    text-decoration: none;
    display: block;
}

.cpa-product-image {
    position: relative;
    padding-top: 100%;
    background: #fafafa;
    overflow: hidden;
}

.cpa-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpa-product-card:hover .cpa-product-image img {
    transform: scale(1.08);
}

.cpa-badge-promo {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #c1a35f;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(193, 163, 95, 0.3);
}

.cpa-product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cpa-product-categories {
    font-size: 12px;
    color: #c1a35f;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.cpa-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 50px;
}

.cpa-product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cpa-price-old {
    color: #999999;
    text-decoration: line-through;
    font-size: 16px;
}

.cpa-price-new {
    color: #c1a35f;
    font-size: 24px;
    font-weight: 700;
}

.cpa-price-regular {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
}

.cpa-product-button {
    display: block;
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #ffffff;
    text-align: center;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-top: auto;
}

.cpa-product-card:hover .cpa-product-button {
    background: #c1a35f;
    transform: translateY(-2px);
}

/* Pagination */
.cpa-pagination {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.cpa-pagination .page-numbers {
    padding: 12px 20px;
    background: #ffffff;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid #e5e5e5;
}

.cpa-pagination .page-numbers:hover {
    background: #c1a35f;
    color: #ffffff;
    border-color: #c1a35f;
}

.cpa-pagination .page-numbers.current {
    background: #c1a35f;
    color: #ffffff;
    border-color: #c1a35f;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

/* Tablet Large */
@media screen and (max-width: 1200px) {
    .cpa-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet */
@media screen and (max-width: 968px) {
    .cpa-header {
        padding: 40px 30px;
    }

    .cpa-header-title {
        font-size: 42px;
    }

    .cpa-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 0 30px 40px;
        gap: 20px;
    }

    .cpa-controls {
        flex-direction: row;
        align-items: center;
        padding: 20px 30px;
    }

    .cpa-sorting {
        flex: 1;
        justify-content: flex-end;
    }

    .cpa-sort-select {
        min-width: 150px;
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .cpa-header {
        padding: 30px 16px;
        margin-bottom: 20px;
        border-radius: 0;
    }

    .cpa-header-title {
        font-size: 28px;
    }

    .cpa-header-description {
        font-size: 15px;
    }

    /* FORCE 1 COLONNE SUR MOBILE */
    .cpa-products-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        padding: 0 16px 40px !important;
        gap: 16px !important;
    }

    /* Card produit mobile */
    .cpa-product-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px;
    }

    .cpa-product-info {
        padding: 16px;
    }

    .cpa-product-categories {
        font-size: 11px;
    }

    .cpa-product-name {
        font-size: 16px;
        min-height: auto;
        margin-bottom: 10px;
    }

    .cpa-price-new,
    .cpa-price-regular {
        font-size: 20px;
    }

    .cpa-product-button {
        padding: 12px;
        font-size: 14px;
    }

    /* Breadcrumb mobile */
    .cpa-breadcrumb {
        padding: 16px;
        font-size: 13px;
    }

    /* Contrôles mobile */
    .cpa-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
        padding: 16px;
        margin: 0 16px 20px;
        border-radius: 12px;
    }

    .cpa-result-count {
        font-size: 14px;
        text-align: center;
        order: 1;
    }

    .cpa-sorting {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        order: 2;
    }

    .cpa-sort-label {
        display: none;
    }

    .cpa-sort-select {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        font-size: 14px;
        padding: 12px 40px 12px 16px;
    }

    /* Pagination mobile */
    .cpa-pagination {
        padding: 0 16px;
        flex-wrap: wrap;
    }

    .cpa-pagination .page-numbers {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Très petits écrans (iPhone SE, etc.) */
@media screen and (max-width: 375px) {
    .cpa-header-title {
        font-size: 24px;
    }

    .cpa-header-description {
        font-size: 14px;
    }

    .cpa-products-grid {
        padding: 0 12px 30px !important;
        gap: 12px !important;
    }

    .cpa-product-info {
        padding: 12px;
    }

    .cpa-product-name {
        font-size: 15px;
    }

    .cpa-price-new,
    .cpa-price-regular {
        font-size: 18px;
    }
}