/**
 * Pages catégories / boutique : modèle Elementor « Archive des produits »
 * et sa carte produit « Produit - Boutique ».
 * Chargé sur la boutique et la recherche (voir inc/Assets.php → isShop).
 *
 * Classes / ID posés dans Elementor :
 *  - .mon-fil-ariane          widget Fil d'Ariane
 *  - .ptc-shop-layout         conteneur « Produits » (sidebar + grille)
 *  - Filtres et tri : [ptc_filters], voir assets/css/shop-filters.css
 *  - .ptc-product-card        carte produit (modèle de boucle)
 *  - .ptc-product-price       prix dans la carte
 *  - .product-info-size       tailles dans la carte ([product_size_range])
 *  - .product-info-color      bulles de couleur dans la carte
 *
 * (anciennement CSS personnalisé du modèle et de ses éléments, en preprod)
 */

/* Fil d'Ariane : style commun à tout le site, voir assets/css/base.css.
   Ici, espaces resserrés : 20 px sous l'en-tête, 14 px avant le titre */
.elementor-13339 .e-con:has(> .e-con-inner > .mon-fil-ariane) {
    margin-top: 0 !important;
}
.elementor-13339 .e-con:has(> .e-con-inner > .mon-fil-ariane) > .e-con-inner {
    padding-top: 20px !important;
    padding-bottom: 14px !important;
}
.elementor-13339 .mon-fil-ariane .woocommerce-breadcrumb {
    margin: 0 !important;
}
@media (max-width: 767px) {
    .elementor-13339 .e-con:has(> .e-con-inner > .mon-fil-ariane) > .e-con-inner {
        padding-top: 14px !important;
        padding-bottom: 10px !important;
    }
}

/* ==========================================================================
   Mise en page : sidebar + grille
   ========================================================================== */

.ptc-shop-layout {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ==========================================================================
   Carte produit
   ========================================================================== */

.ptc-product-price .price {
    margin: 0 !important;
}

.ptc-product-card .product-info-size {
    font-size: 0.75rem;
}

/* Tailles cachées ; sur ordinateur, elles remplacent les couleurs au survol */
.ptc-product-card .product-info-size {
    display: none;
}

@media (min-width: 1024px) {
    .ptc-product-card .product-info-size,
    .ptc-product-card .product-info-color {
        height: 30px !important;
    }

    .ptc-product-card:hover .product-info-size {
        display: flex;
        align-items: center !important;
    }

    .ptc-product-card:hover .product-info-color {
        display: none;
    }
}

/* ==========================================================================
   En-tête de rubrique ([ptc_shop_header]) : titre Londrina, nombre de
   produits, phrase d'introduction, pastilles des sous-catégories
   ========================================================================== */

.ptc-shop-head {
    margin: 4px 0 0;
}

.ptc-shop-head__top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
}

/* Page d'un artiste : portrait rond devant le nom */
.ptc-shop-head__top:has(.ptc-shop-head__avatar) {
    align-items: center;
}

.elementor .ptc-shop-head__avatar,
.ptc-shop-head__avatar {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #f4f4f4;
}

@media (max-width: 767px) {
    .elementor .ptc-shop-head__avatar,
    .ptc-shop-head__avatar {
        width: 52px;
        height: 52px;
    }
}

.ptc-shop-head__title {
    margin: 0;
    color: #000;
    font-family: "Londrina Solid", sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 400;
    line-height: 0.95;
    text-transform: uppercase;
}

.ptc-shop-head__intro {
    max-width: 640px;
    margin: 12px 0 0;
    color: #3a3a3a;
    font-size: 16px;
    line-height: 1.55;
}

/* Sous-catégories : onglets soulignés sur une ligne fine (navigation), bien
   distincts des boutons de filtre gris (barre en dessous) */
.ptc-shop-chips {
    margin-top: 26px;
    border-bottom: 1px solid #e6e6e6;
}

.ptc-shop-chips ul {
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}

.ptc-shop-chips ul::-webkit-scrollbar {
    display: none;
}

.ptc-shop-chips li {
    flex: 0 0 auto;
}

.ptc-shop-chips .ptc-chip {
    position: relative;
    display: block;
    padding: 0 0 13px;
    color: #6e6e6e;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.ptc-shop-chips .ptc-chip::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #e63c69;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.ptc-shop-chips .ptc-chip:hover {
    color: #111;
}

.ptc-shop-chips .ptc-chip.is-active,
.ptc-shop-chips .ptc-chip.is-active:hover {
    color: #111;
}

.ptc-shop-chips .ptc-chip.is-active::after {
    transform: scaleX(1);
}

/* Rythme vertical : les marges des blocs Elementor autour de l'en-tête et des
   filtres sont neutralisées, l'espacement vient d'ici et de shop-filters.css */
.e-con:has(> .e-con-inner > .elementor-widget-shortcode .ptc-shop-head),
.e-con:has(> .elementor-widget-shortcode .ptc-shop-head) {
    --padding-bottom: 0px !important;
}

.e-con:has(> .e-con-inner > .elementor-widget-shortcode .ptc-shop-head) > .e-con-inner {
    padding-bottom: 0 !important;
}

.ptc-shop-layout .e-con:has(> .elementor-widget-shortcode .ptc-filters) {
    gap: 0 !important;
    row-gap: 0 !important;
}

@media (max-width: 767px) {
    .ptc-shop-head__intro {
        font-size: 15px;
    }

    /* Onglets qui défilent bord à bord */
    .ptc-shop-chips {
        margin-top: 20px;
        margin-right: -16px;
        margin-left: -16px;
    }

    .ptc-shop-chips ul {
        gap: 22px;
        padding: 0 16px;
    }

    .ptc-shop-chips .ptc-chip {
        font-size: 14px;
    }
}

/* ==========================================================================
   Grille : écarts équilibrés
   ========================================================================== */

.ptc-shop-layout .elementor-widget-loop-grid {
    --grid-column-gap: 20px !important;
    --grid-row-gap: 40px !important;
}

@media (max-width: 767px) {
    .ptc-shop-layout .elementor-widget-loop-grid {
        --grid-column-gap: 12px !important;
        --grid-row-gap: 28px !important;
    }
}

/* ==========================================================================
   Carte produit : photo sur fond gris (comme les fiches et les menus),
   badge « Personnalisable », seconde photo au survol, mention du prix
   ========================================================================== */

.ptc-product-card .ptc-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1; /* carré : convient aux vêtements portés comme aux objets */
    margin-bottom: 10px !important;
    border-radius: 16px;
    background: #f4f4f4;
    isolation: isolate;
    --padding-top: 0px;
    --padding-right: 0px;
    --padding-bottom: 0px;
    --padding-left: 0px;
}

.ptc-product-card .ptc-card-media .elementor-widget-theme-post-featured-image,
.ptc-product-card .ptc-card-media .elementor-widget-theme-post-featured-image > .elementor-widget-container,
.ptc-product-card .ptc-card-media .elementor-widget-theme-post-featured-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.ptc-product-card .ptc-card-media img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: cover;
    mix-blend-mode: multiply;
    transition: transform 0.45s ease, opacity 0.3s ease;
}

/* Photo détourée (fond blanc) : en entier, avec une marge */
.ptc-product-card .ptc-card-media:has(.ptc-card-fit) .elementor-widget-theme-post-featured-image img {
    padding: 9%;
    object-fit: contain;
}

.ptc-product-card .ptc-card-media .elementor-widget-shortcode {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ptc-product-card .ptc-card-media .ptc-card-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

/* Seconde photo détourée : en entier, avec une marge */
.ptc-product-card .ptc-card-media .ptc-card-hover.is-fit {
    padding: 9%;
    object-fit: contain;
}

.ptc-product-card .ptc-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 40px;
    background: #fff;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.15);
}

@media (hover: hover) {
    .ptc-product-card:hover .ptc-card-media img {
        transform: scale(1.04);
    }

    /* Au survol, la seconde photo remplace la première (qui s'efface :
       sinon les deux se superposent par transparence) */
    .ptc-product-card:has(.ptc-card-hover):hover .elementor-widget-theme-post-featured-image img {
        opacity: 0;
    }

    .ptc-product-card:hover .ptc-card-media .ptc-card-hover {
        opacity: 1;
    }
}

.ptc-product-card .woocommerce-loop-product__title,
.ptc-product-card .elementor-widget-woocommerce-product-title .product_title,
.ptc-product-card .elementor-heading-title {
    transition: color 0.2s ease;
}

.ptc-product-card:hover .elementor-widget-woocommerce-product-title .elementor-heading-title {
    color: #e63c69;
}

/* Une carte ne dépasse jamais sa colonne (le nom sur une ligne pourrait
   sinon élargir la colonne de la grille) */
.ptc-shop-layout .elementor-loop-container > *,
.ptc-product-card,
.ptc-product-card .e-con,
.ptc-product-card .elementor-widget {
    min-width: 0;
    max-width: 100%;
}

/* Infos sous la photo : serrées contre l'image, nom sur une ligne */
.ptc-product-card > .e-con-inner,
.ptc-product-card {
    gap: 0 !important;
}

.ptc-product-card .elementor-widget-woocommerce-product-title {
    min-width: 0;
    margin-bottom: 2px !important;
}

.ptc-product-card .elementor-widget-woocommerce-product-title,
.ptc-product-card .elementor-widget-woocommerce-product-title > .elementor-widget-container {
    width: 100% !important;
}

.ptc-product-card .elementor-widget-woocommerce-product-title .elementor-heading-title {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.3 !important;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Prix : « À partir de » devant (produits personnalisables) */
.ptc-product-card .e-con:has(> .ptc-product-price) {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 5px !important;
}

.ptc-product-card .e-con:has(> .ptc-product-price) > .elementor-widget-shortcode {
    order: -1;
    width: auto !important;
}

.ptc-card-price-note {
    color: #6e6e6e;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .ptc-product-card .ptc-card-media {
        border-radius: 12px;
    }

    .ptc-product-card .ptc-card-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }

    .ptc-card-price-note {
        font-size: 12px;
    }
}

/* ==========================================================================
   Texte de présentation de la catégorie ([ptc_shop_seo]), replié au départ
   ========================================================================== */

.ptc-shop-seo-wrap {
    --padding-top: 0px;
}

.ptc-shop-seo {
    max-width: 820px;
    margin: 8px auto 0;
    padding-top: 40px;
    border-top: 1px solid #ececec;
    color: #3a3a3a;
    font-size: 15px;
    line-height: 1.7;
}

.ptc-shop-seo__body {
    position: relative;
    max-height: 230px;
    overflow: hidden;
}

.ptc-shop-seo__body::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 90px;
    background: linear-gradient(to bottom, rgb(255 255 255 / 0), #fff);
    pointer-events: none;
}

.ptc-shop-seo.is-open .ptc-shop-seo__body {
    max-height: none;
}

.ptc-shop-seo.is-open .ptc-shop-seo__body::after {
    display: none;
}

.ptc-shop-seo.is-short .ptc-shop-seo__body {
    max-height: none;
}

.ptc-shop-seo.is-short .ptc-shop-seo__body::after,
.ptc-shop-seo.is-short .ptc-shop-seo__more {
    display: none;
}

.ptc-shop-seo h2,
.ptc-shop-seo h3 {
    margin: 28px 0 10px;
    color: #000;
    font-family: "Londrina Solid", sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.ptc-shop-seo h2:first-child,
.ptc-shop-seo h3:first-child {
    margin-top: 0;
}

.ptc-shop-seo p {
    margin: 0 0 12px;
}

.ptc-shop-seo a {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ptc-shop-seo a:hover {
    color: #e63c69;
}

.ptc-shop-seo .ptc-shop-seo__more {
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: none;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ptc-shop-seo .ptc-shop-seo__more:hover,
.ptc-shop-seo .ptc-shop-seo__more:focus {
    background: none;
    color: #e63c69;
}

/* ==========================================================================
   Grille pleine largeur (les filtres sont au-dessus, plus de colonne à
   gauche) : 4 produits par rang sur ordinateur
   ========================================================================== */

.ptc-shop-layout > .e-con {
    width: 100% !important;
    --width: 100% !important;
}

@media (min-width: 1025px) {
    .ptc-shop-layout .elementor-widget-loop-grid {
        --grid-columns: 4;
    }

    .ptc-shop-layout .elementor-loop-container {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}
