/* =========================================================
   Camila — fiche produit (woocommerce/single-product.php)
   Photos à gauche, titre, choix, prix et panier à droite,
   onglets dessous, puis d'autres bijoux (cartes : product-card.css).
   ========================================================= */

.product-main {
    --product-ink: #000;
    --stock-in: #2e7d32;    /* vert, orange et rouge de la maquette, foncés pour le contraste AA */
    --stock-low: #b0601e;
    --stock-last: #b3261e;
    position: relative;
    isolation: isolate;     /* les cœurs décoratifs passent derrière le contenu */
    overflow-x: clip;       /* … et sont coupés au bord de l'écran */
    container-type: inline-size; /* largeur de référence des cœurs (unité cqw) */
    padding-top: clamp(2rem, 1rem + 4vw, 5rem);
}

.product {
    --container: 1300px;
    position: relative;
}

/* ---------- Haut de la fiche : photos | infos ---------- */

.product-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem 45px;
    align-items: center;
}

/* La photo commence un peu sous le titre (maquette) */
.product-gallery {
    padding-top: 36px;
}

.product-photo {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--c-surface);
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pas encore de photo : un cœur pâle */
.product-photo--empty::before {
    content: "";
    width: 28%;
    aspect-ratio: 1;
    background: url("../img/heart.svg") center / contain no-repeat;
    opacity: .25;
}

.product-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0;
    list-style: none;
}

.product-thumb {
    display: block;
    width: 52px;
    aspect-ratio: 1;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--c-surface);
    cursor: pointer;
    transition: border-color .2s;
}

.product-thumb:hover,
.product-thumb[aria-pressed="true"] {
    border-color: var(--c-accent-ink);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Titre et référence ---------- */

.product-title {
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2rem);
}

/* Petite vague rose sous le titre */
.product-title::after {
    content: "";
    display: block;
    width: 130px;
    height: 9px;
    margin-top: 2px;
    background: url("../img/vague-sous-titre.svg") left center / 100% 100% no-repeat;
}

.product-ref {
    margin-top: 0;
    color: var(--c-text-soft);
    font-size: .8125rem;
}

/* ---------- Choix de la déclinaison ---------- */

.product-form {
    margin-top: 1.2rem;
    color: var(--product-ink);
    font-size: 1.25rem;
}

.product-field + .product-field {
    margin-top: .95rem;
}

.product-field label {
    display: block;
    margin-bottom: .15rem;
}

.product-select {
    display: block;
    width: min(100%, 280px);
    height: 36px;
    padding: 0 2.25rem 0 .7rem;
    border: 1px solid var(--c-accent);
    border-radius: 4px;
    /* Petit triangle terracotta à droite */
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M0 0h8L4 6z' fill='%23ce5741'/%3E%3C/svg%3E") right .85rem center / 8px 6px no-repeat;
    color: var(--product-ink);
    font: inherit;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.product-select:hover {
    border-color: var(--c-accent-ink);
    box-shadow: 0 0 0 1px var(--c-accent-ink);
}

/* Une seule valeur possible (ex. un seul style) : simple texte, pas de liste */
.product-field--single {
    color: var(--c-text-soft);
}

/* ---------- Prix, stock, panier ---------- */

.product-price {
    margin-top: 1.25rem;
    color: var(--c-accent);
    font-family: var(--f-title);
    font-size: 1.875rem;
    line-height: 1.1;
}

.product-stock {
    margin-top: 1.5rem;
    color: var(--stock-in);
}

.product-stock[data-level="low"] {
    color: var(--stock-low);
}

.product-stock[data-level="last"] {
    color: var(--stock-last);
}

.product-stock[data-level="out"] {
    color: var(--c-text-soft);
}

.product-buy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1.4rem;
}

.product-qty {
    display: inline-flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid var(--c-accent);
    border-radius: 4px;
    background: #fff;
}

.product-qty-btn {
    display: grid;
    place-items: center;
    width: 26px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-accent-ink);
    font: inherit;
    font-size: 1.0625rem;
    line-height: 1;
    cursor: pointer;
}

.product-qty-btn:hover {
    color: var(--c-accent-dark);
}

/* Boutons affichés par le script */
.product-qty-btn[hidden] {
    display: none;
}

.product-qty-input {
    width: 2.4em;
    padding: 0;
    border: 0;
    background: none;
    color: var(--product-ink);
    font: inherit;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-qty-input::-webkit-inner-spin-button,
.product-qty-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

/* Bouton .btn du thème (animation au survol et au clic : base.css), en plus petit */
.product-add {
    justify-content: center;
    height: 34px;
    padding: 0 .95rem;
    border: 0;
    border-radius: 4px;
    background: var(--c-accent-ink);
    color: #fff;
    font: inherit;
    letter-spacing: normal;
    cursor: pointer;
    transition: color .45s ease, background-color .2s, opacity .2s;
}

.product-add:disabled {
    background: #bdb4b2;
    cursor: not-allowed;
}

.product-add[aria-busy="true"] {
    background: var(--c-accent-ink);
    opacity: .7;
    cursor: progress;
}

/* Confirmation après l'ajout au panier (assets/js/product.js) */
.product-added:empty {
    display: none;
}

.product-added {
    margin-top: .75rem;
    color: var(--stock-in);
}

.product-added a {
    margin-left: .35em;
    font-weight: 700;
}

/* ---------- Encadrés (caractéristique principale, compatibilité) ---------- */

.product-highlights {
    display: grid;
    justify-items: start;
    gap: 1.4rem;
    margin-top: 1.5rem;
    padding: 0;
    list-style: none;
}

.product-highlight {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 26rem;
    padding: .4rem 1rem;
    border: 1px solid var(--c-accent);
    border-radius: 4px;
    background: #fffafa;
    color: var(--product-ink);
    font-size: 1.25rem;
    line-height: 1.45;
}

.product-highlight-icon {
    flex-shrink: 0;
    color: var(--c-accent);
}

/* Listes des textes (lignes « - » du fichier d'import) : une petite étincelle terracotta,
   comme l'icône des encadrés, au lieu de la puce du navigateur (rond creux une fois imbriquée) */
.product-highlight-text ul,
.product-panel ul {
    padding: 0;
    list-style: none;
}

.product-highlight-text li,
.product-panel li {
    position: relative;
    padding-left: 1.15em;
}

.product-highlight-text li + li,
.product-panel li + li {
    margin-top: .2em;
}

.product-highlight-text li::before,
.product-panel li::before {
    content: "";
    position: absolute;
    top: calc(.5lh - .275em); /* centrée sur la première ligne */
    left: 0;
    width: .55em;
    height: .55em;
    background: var(--c-accent);
    -webkit-mask: var(--list-sparkle) center / contain no-repeat;
    mask: var(--list-sparkle) center / contain no-repeat;
    --list-sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0Q5.6 4.4 10 5 5.6 5.6 5 10 4.4 5.6 0 5 4.4 4.4 5 0Z'/%3E%3C/svg%3E");
}

/* ---------- Onglets ---------- */

.product-tabs {
    margin-top: clamp(3rem, 2rem + 3vw, 4.75rem);
}

.product-tablist {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.product-tablist[hidden] {
    display: none;
}

.product-tab {
    flex-shrink: 0;
    padding: .5rem 1.2rem .5rem;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: var(--c-accent-ink);
    color: #fff;
    font-family: var(--f-title);
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color .2s;
}

.product-tab:hover {
    background: var(--c-accent-dark);
}

.product-tab[aria-selected="true"] {
    background: var(--c-surface);
    color: var(--c-accent-ink);
    cursor: default;
}

.product-tab:focus-visible {
    outline-offset: -4px;
}

.product-panel {
    padding: 1.4rem 1.4rem 1.6rem;
    border-radius: 0 8px 8px 8px ;
    background: var(--c-surface);
    color: var(--product-ink);
    font-size: 1.25rem;
    line-height: 1.55;
    font-weight: 300;
}

/* Sans JavaScript, les contenus se suivent, chacun avec son titre */
.product-panel + .product-panel {
    margin-top: 1rem;
}

.product-panel-title {
    margin-bottom: .6rem;
    font-size: 1.25rem;
}

.product-tabs--js .product-panel-title {
    display: none;
}

.product-tabs--js .product-panel + .product-panel {
    margin-top: 0;
}

.product-panel h3 {
    margin: 1rem 0 .35rem;
    color: var(--c-accent-ink);
    font-family: var(--f-title);
    font-size: 1.25rem;
    font-weight: 400;
}

.product-panel-title + h3,
.product-panel h3:first-child {
    margin-top: 0;
}

.product-missing {
    color: var(--c-text-soft);
    font-style: italic;
}

/* Caractéristiques : nom | valeur */
.product-specs {
    display: grid;
    gap: .6rem;
    margin: 0;
}

.product-spec {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
}

.product-spec dt {
    color: var(--c-accent-ink);
    font-family: var(--f-title);
}

.product-spec dd {
    margin: 0;
}

/* ---------- Autres bijoux ---------- */

.product-related {
    --container: 1300px;
    position: relative;
    margin-top: clamp(4rem, 3rem + 3vw, 5rem);
    margin-bottom: clamp(4rem, 3rem + 3vw, 5rem);
}

.product-related-title {
    font-size: clamp(1.375rem, 1.2rem + .8vw, 1.625rem);
    text-align: center;
}

.product-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem clamp(1.5rem, 3.5vw, 46px);
    margin-top: 10px;
    padding: 0;
    list-style: none;
}

/* ---------- Cœurs décoratifs, coupés au bord de l'écran (écrans larges) ---------- */

/* Cœurs exportés de la maquette, déjà coupés et pâlis : collés au bord de la page
   (50cqw = demi-largeur de .product-main, sans la barre de défilement) */
.product-heart {
    position: absolute;
    z-index: -1;
    height: 465px;
    pointer-events: none;
}

.product-heart--right {
    top: 22px;
    right: calc(50% - 50cqw);
    aspect-ratio: 319 / 465;
    background: url("../img/coeur-droite.svg") center / contain no-repeat;
}

.product-heart--left {
    top: -110px;
    left: calc(50% - 50cqw);
    aspect-ratio: 269 / 465;
    background: url("../img/coeur-gauche.svg") center / contain no-repeat;
}

@media (max-width: 1279px) {
    .product-heart {
        display: none;
    }
}

/* ---------- Tablette et mobile ---------- */

@media (max-width: 799px) {
    .product-top {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-gallery {
        width: min(100%, 450px);
        margin-inline: auto;
        padding-top: 0;
    }

    .product-select {
        width: 100%;
        height: 42px;
    }

    .product-qty,
    .product-add {
        height: 42px;
    }

    .product-qty-btn {
        width: 36px;
    }

    .product-add {
        flex: 1;
    }

    .product-highlight {
        max-width: none;
    }
}

/* Téléphone et petite tablette : les autres bijoux défilent sur une ligne (la carte suivante dépasse) */
@media (max-width: 767px) {
    .product-cards {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(72%, 300px);
        gap: 1rem;
        margin-inline: calc(-1 * var(--gutter));
        padding: .8rem var(--gutter) 2.6rem; /* place pour l'ombre des cartes au survol */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--gutter);
        scrollbar-width: none;
    }

    .product-cards > li {
        scroll-snap-align: start;
    }
}

@media (max-width: 479px) {
    .product-spec {
        grid-template-columns: 1fr;
        gap: .1rem;
    }
}
