/*
 * ============================================================================
 * PAGE BOUTIQUE - CHAPELLERIE VINTAGE
 * Design: 100% cohérent avec la homepage
 * ============================================================================
 */

/* ========================================
   MASQUER LA SIDEBAR
   ======================================== */
.woocommerce .sidebar,
.woocommerce aside.widget-area,
#secondary,
.widget-area {
    display: none !important;
}

/* ========================================
   CONTAINERS ET STRUCTURE
   ======================================== */
.woocommerce-content-wrapper {
    width: 100%;
    max-width: 100%;
}

.woocommerce-content-wrapper .section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1024px) {
    .woocommerce-content-wrapper .section-container {
        padding: 0 2.5rem;
    }
}

/* ========================================
   HEADER TITRE PAGE
   ======================================== */
.woocommerce-products-header {
    margin-bottom: 3rem;
}

.woocommerce-products-header .page-title {
    font-family: var(--font-accent);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-cream);
    margin-bottom: 1rem;
    text-align: center;
}

.woocommerce-products-header .term-description {
    text-align: center;
    color: var(--color-gray-400);
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   BARRE DE RECHERCHE - PLEINE LARGEUR
   ======================================== */
.shop-search-bar {
    background: var(--color-charcoal);
    padding: 2rem 0;
    margin-bottom: 3rem;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.shop-search-bar .section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1024px) {
    .shop-search-bar .section-container {
        padding: 0 2.5rem;
    }
}

.woocommerce-product-search {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.woocommerce-product-search .search-field {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--color-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-light);
    font-family: var(--font-body);
    transition: all var(--transition);
}

.woocommerce-product-search .search-field:focus {
    outline: none;
    border-color: var(--color-orange);
    background: var(--color-dark);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.woocommerce-product-search .search-field::placeholder {
    color: var(--color-gray-400);
}

.woocommerce-product-search .search-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--color-orange);
    color: var(--color-dark);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition);
}

.woocommerce-product-search .search-submit:hover {
    background: var(--color-orange-light);
    transform: translateY(-2px);
}

.woocommerce-product-search .search-text {
    display: none;
}

@media (min-width: 640px) {
    .woocommerce-product-search .search-text {
        display: inline;
    }
}

/* ========================================
   BREADCRUMB
   ======================================== */
.woocommerce-breadcrumb {
    padding: 1rem 0;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--color-gray-400);
}

.woocommerce-breadcrumb a {
    color: var(--color-gray-400);
    transition: color var(--transition);
}

.woocommerce-breadcrumb a:hover {
    color: var(--color-orange);
}

/* ========================================
   TOOLBAR - Compteur et Tri (EN DEHORS de la grille)
   ======================================== */
.woocommerce-before-shop-loop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
    width: 100% !important; /* Force pleine largeur */
}

.woocommerce-result-count {
    color: var(--color-gray-400);
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0;
}

.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: var(--color-charcoal) !important;
    color: var(--color-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff6b35' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
}

.woocommerce-ordering select:hover {
    border-color: rgba(255, 107, 53, 0.3) !important;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--color-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* ========================================
   GRILLE PRODUITS - Exactement comme homepage
   ======================================== */

/* Assurer que breadcrumb et toolbar ne sont PAS dans la grille */
.woocommerce-breadcrumb,
.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce-before-shop-loop,
.woocommerce-after-shop-loop {
    display: block !important;
    grid-column: auto !important;
}

/* SEULEMENT ul.products utilise la grille */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md) !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Désactiver les pseudo-éléments qui prendraient une place dans la grille */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

@media (min-width: 640px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: var(--spacing-lg) !important;
    }
}

/* S'assurer que les produits sont bien dans la grille */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
}

/* Désactiver les pseudo-éléments sur les li aussi */
.woocommerce ul.products li::before,
.woocommerce ul.products li::after {
    display: none !important;
    content: none !important;
}

/* ========================================
   CARD PRODUIT - Style homepage exact
   ======================================== */
.woocommerce ul.products li.product {
    background: var(--color-charcoal) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden !important;
    transition: all var(--transition) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-8px) !important;
    box-shadow: var(--shadow-xl) !important;
    border-color: rgba(255, 107, 53, 0.3) !important;
}

/* Container image (comme .product-image-wrapper) */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-dark);
    display: block !important;
}

/* Image produit */
.woocommerce ul.products li.product img,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin: 0 !important;
    display: block !important;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.08) !important;
}

/* Badge PROMO (comme .product-badge) */
.woocommerce ul.products li.product .onsale {
    position: absolute !important;
    top: var(--spacing-sm) !important;
    right: var(--spacing-sm) !important;
    left: auto !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    border-radius: var(--radius-sm) !important;
    text-transform: uppercase !important;
    background: var(--color-orange) !important;
    color: white !important;
    margin: 0 !important;
    z-index: 10 !important;
}

/* Titre produit (comme .product-title) */
.woocommerce ul.products li.product .woocommerce-loop-category__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3 {
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm) !important;
    margin: 0 !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--color-cream) !important;
    line-height: 1.4 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title a {
    color: var(--color-cream) !important;
    text-decoration: none !important;
    transition: color var(--transition);
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__title a,
.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--color-orange) !important;
}

/* Prix (comme .product-price) */
.woocommerce ul.products li.product .price {
    padding: 0 var(--spacing-md) var(--spacing-sm) !important;
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--color-red) !important;
    display: block !important;
}

.woocommerce ul.products li.product .price del {
    color: var(--color-gray-400) !important;
    font-size: 1.125rem !important;
    opacity: 0.7 !important;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none !important;
    color: var(--color-red) !important;
}

/* Bouton Ajouter au panier (comme .product-btn-cart) */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .product_type_simple,
.woocommerce ul.products li.product .product_type_variable,
.woocommerce ul.products li.product .added_to_cart {
    display: block !important;
    margin: 0 var(--spacing-md) var(--spacing-md) !important;
    padding: 0.75rem !important;
    background: var(--color-red) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-align: center !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all var(--transition) !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover,
.woocommerce ul.products li.product .product_type_simple:hover,
.woocommerce ul.products li.product .product_type_variable:hover {
    background: var(--color-orange) !important;
    transform: translateY(-2px) !important;
    color: white !important;
}

/* Bouton "Voir les options" (comme .product-btn-view) */
.woocommerce ul.products li.product .product_type_variable {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--color-cream) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.woocommerce ul.products li.product .product_type_variable:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--color-red) !important;
    color: var(--color-cream) !important;
    transform: translateY(-2px) !important;
}

/* ========================================
   PAGINATION
   ======================================== */
.woocommerce-pagination,
.woocommerce nav.woocommerce-pagination {
    margin: 3rem 0 2rem;
    text-align: center;
}

.woocommerce-pagination ul,
.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

.woocommerce-pagination ul li,
.woocommerce nav.woocommerce-pagination ul li {
    margin: 0;
    padding: 0;
    border: none !important;
    border-right: none !important;
    float: none;
    display: inline-block;
}

/* Supprimer les pseudo-éléments qui créent la barre blanche */
.woocommerce-pagination ul li::before,
.woocommerce-pagination ul li::after,
.woocommerce-pagination ul li a::before,
.woocommerce-pagination ul li a::after,
.woocommerce-pagination ul li span::before,
.woocommerce-pagination ul li span::after {
    display: none !important;
    content: none !important;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    background: #e85a25;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1 !important;
    text-align: center;
    vertical-align: middle;
}

.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: var(--color-orange) !important;
    color: #ffffff !important;
}

.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--color-red) !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* ========================================
   MESSAGES / NOTICES
   ======================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background: var(--color-charcoal) !important;
    color: var(--color-cream) !important;
    border-left: 3px solid var(--color-orange) !important;
    padding: 1rem 1.25rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: var(--radius-md);
}

.woocommerce-message a.button,
.woocommerce-info a.button {
    background: var(--color-orange) !important;
    color: var(--color-dark) !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.875rem;
}

/* ========================================
   PAS DE PRODUITS
   ======================================== */
.woocommerce .woocommerce-info {
    text-align: center;
    padding: 2.5rem !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .shop-search-bar {
        padding: 1.5rem 0;
    }

    .woocommerce-product-search {
        flex-direction: column;
    }

    .woocommerce-product-search .search-submit {
        width: 100%;
        justify-content: center;
    }

    .woocommerce-before-shop-loop {
        flex-direction: column;
        align-items: flex-start;
    }
}
