/* css/produit-page.css — fiche produit */

:root {
    --pp-bg: #faf8f5;
    --pp-surface: #ffffff;
    --pp-ink: #1d1b19;
    --pp-muted: #6b665f;
    --pp-line: #ebe6df;
    --pp-brand: #ff9800;
    --pp-brand-ink: #b35f00;
    --pp-brand-soft: #fff4e5;
    --pp-whatsapp: #128c4a;
    --pp-whatsapp-hover: #0e7a40;
    --pp-success: #1f8a4c;
    --pp-warning: #b36b00;
    --pp-danger: #c0392b;
    --pp-radius: 14px;
    --pp-radius-sm: 10px;
    --pp-shadow: 0 1px 2px rgba(29, 27, 25, .05), 0 8px 24px rgba(29, 27, 25, .06);
    --pp-font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--pp-bg);
    color: var(--pp-ink);
    font-family: var(--pp-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--pp-brand);
    outline-offset: 2px;
}

/* ---------- En-tête ---------- */
.pp-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--pp-line);
}

.pp-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.pp-logo img {
    height: 40px;
    width: auto;
}

.pp-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.pp-icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--pp-ink);
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.pp-icon-btn:hover {
    background: #f2eee8;
}

.pp-cart-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--pp-brand);
    color: #1d1b19;
    font-size: .7rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.pp-cart-count.is-empty {
    display: none;
}

/* ---------- Mise en page ---------- */
.pp-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 16px 48px;
}

.pp-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: .82rem;
    color: var(--pp-muted);
}

.pp-breadcrumb a {
    text-decoration: none;
}

.pp-breadcrumb a:hover {
    color: var(--pp-ink);
    text-decoration: underline;
}

.pp-breadcrumb i {
    font-size: .6rem;
    opacity: .6;
}

.pp-breadcrumb span {
    color: var(--pp-ink);
    font-weight: 600;
}

.pp-product {
    display: grid;
    gap: 24px;
}

@media (min-width: 900px) {
    .pp-product {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 48px;
        align-items: start;
    }

    .pp-gallery {
        position: sticky;
        top: 80px;
    }
}

/* ---------- Photo ---------- */
.pp-photo {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--pp-radius);
    overflow: hidden;
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow);
    aspect-ratio: 1 / 1;
    cursor: zoom-in;
}

.pp-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.pp-photo:hover img {
    transform: scale(1.03);
}

.pp-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--pp-ink);
    font-size: .8rem;
    font-weight: 700;
}

.pp-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
}

.pp-badge-out {
    background: var(--pp-danger);
    color: #fff;
}

/* ---------- Infos produit ---------- */
.pp-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--pp-brand-ink);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
}

.pp-title {
    margin: 0;
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.pp-ref {
    margin: 6px 0 16px;
    color: var(--pp-muted);
    font-size: .85rem;
}

.pp-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.pp-price {
    font-size: 1.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.pp-price-note {
    color: var(--pp-muted);
    font-size: .95rem;
}

.pp-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 20px;
    font-size: .9rem;
    font-weight: 700;
}

.pp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.pp-stock.is-in { color: var(--pp-success); }
.pp-stock.is-low { color: var(--pp-warning); }
.pp-stock.is-out { color: var(--pp-danger); }

.pp-measure {
    margin: 0 0 20px;
    color: var(--pp-muted);
}

.pp-measure i {
    margin-right: 6px;
}

/* ---------- Tailles ---------- */
.pp-sizes {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.pp-sizes legend {
    margin-bottom: 10px;
    font-weight: 800;
}

.pp-size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.pp-size {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1.5px solid var(--pp-line);
    border-radius: var(--pp-radius-sm);
    background: var(--pp-surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.pp-size:hover {
    border-color: #cfc6ba;
}

.pp-size input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pp-size-name {
    font-weight: 800;
}

.pp-size-price {
    color: var(--pp-muted);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.pp-size:has(input:checked) {
    border-color: var(--pp-brand);
    background: var(--pp-brand-soft);
    box-shadow: inset 0 0 0 1px var(--pp-brand);
}

.pp-size:has(input:focus-visible) {
    outline: 2px solid var(--pp-brand);
    outline-offset: 2px;
}

/* ---------- Achat ---------- */
.pp-buy {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.pp-qty {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 52px;
    border: 1.5px solid var(--pp-line);
    border-radius: var(--pp-radius-sm);
    background: var(--pp-surface);
}

.pp-qty-btn {
    width: 42px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--pp-ink);
    cursor: pointer;
}

.pp-qty-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pp-qty input {
    width: 40px;
    border: 0;
    background: transparent;
    text-align: center;
    font: inherit;
    font-weight: 800;
    -moz-appearance: textfield;
}

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

.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--pp-radius-sm);
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.pp-btn:active {
    transform: scale(.98);
}

.pp-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.pp-buy .pp-btn {
    flex: 1;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .pp-qty-btn {
        width: 34px;
    }

    .pp-qty input {
        width: 32px;
    }

    .pp-buy .pp-btn {
        padding: 0 12px;
        gap: 8px;
        font-size: .95rem;
    }
}

.pp-btn-dark {
    background: var(--pp-ink);
    color: #fff;
}

.pp-btn-dark:hover:not(:disabled) {
    background: #34302c;
}

.pp-btn-whatsapp {
    width: 100%;
    background: var(--pp-whatsapp);
    color: #fff;
}

.pp-btn-whatsapp:hover {
    background: var(--pp-whatsapp-hover);
    color: #fff;
}

.pp-btn-whatsapp .fa-whatsapp {
    font-size: 1.3rem;
}

/* ---------- Réassurance ---------- */
.pp-assurances {
    list-style: none;
    margin: 20px 0 24px;
    padding: 16px;
    display: grid;
    gap: 10px;
    border-radius: var(--pp-radius-sm);
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    font-size: .9rem;
}

.pp-assurances li {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.pp-assurances i {
    width: 18px;
    flex-shrink: 0;
    color: var(--pp-brand-ink);
    text-align: center;
}

.pp-assurances a {
    color: var(--pp-whatsapp);
    font-weight: 700;
}

/* ---------- Détails (accordéon) ---------- */
.pp-details {
    border-top: 1px solid var(--pp-line);
}

.pp-details details {
    border-bottom: 1px solid var(--pp-line);
}

.pp-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 2px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.pp-details summary::-webkit-details-marker {
    display: none;
}

.pp-details summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--pp-muted);
    line-height: 1;
}

.pp-details details[open] summary::after {
    content: '−';
}

.pp-details-body {
    padding: 0 2px 16px;
    color: #3d3934;
    font-size: .95rem;
}

.pp-details-body p {
    margin: 0 0 8px;
}

.pp-details-body ul {
    margin: 0;
    padding-left: 18px;
}

.pp-details-body li {
    margin-bottom: 6px;
}

.pp-details-body li::marker {
    color: var(--pp-brand);
}

/* ---------- Produits similaires ---------- */
.pp-similar {
    margin-top: 56px;
}

.pp-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.pp-section-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.pp-section-head a {
    color: var(--pp-brand-ink);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
}

.pp-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .pp-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }
}

.pp-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
}

.pp-card-img {
    position: relative;
    display: block;
    margin-bottom: 8px;
    border-radius: var(--pp-radius-sm);
    overflow: hidden;
    background: var(--pp-surface);
    aspect-ratio: 1 / 1;
    box-shadow: var(--pp-shadow);
}

.pp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.pp-card:hover .pp-card-img img {
    transform: scale(1.04);
}

.pp-card-name {
    font-weight: 700;
    line-height: 1.3;
}

.pp-card-price {
    color: var(--pp-muted);
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- Pied de page ---------- */
.pp-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    padding: 28px 16px 96px;
    border-top: 1px solid var(--pp-line);
    background: var(--pp-surface);
    font-size: .88rem;
    color: var(--pp-muted);
}

.pp-footer a {
    text-decoration: none;
    font-weight: 700;
}

.pp-footer p {
    flex-basis: 100%;
    margin: 4px 0 0;
    text-align: center;
}

@media (min-width: 900px) {
    .pp-footer {
        padding-bottom: 28px;
    }
}

/* ---------- Barre fixe mobile ---------- */
.pp-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--pp-surface);
    border-top: 1px solid var(--pp-line);
    box-shadow: 0 -6px 20px rgba(29, 27, 25, .08);
    transform: translateY(110%);
    transition: transform .25s ease;
}

.pp-sticky.is-visible {
    transform: translateY(0);
}

.pp-sticky-price {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.pp-sticky-price small {
    color: var(--pp-muted);
    font-weight: 600;
}

.pp-btn-sm {
    min-height: 46px;
    padding: 0 16px;
    width: auto;
}

@media (min-width: 900px) {
    .pp-sticky {
        display: none;
    }
}

/* ---------- Notifications ---------- */
.pp-toasts {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: grid;
    gap: 8px;
    width: min(92vw, 380px);
}

.pp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--pp-radius-sm);
    background: var(--pp-ink);
    color: #fff;
    font-weight: 700;
    font-size: .92rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    animation: pp-in .25s ease;
}

.pp-toast-success i { color: #5fd38d; }
.pp-toast-error i { color: #ff8a7a; }

.pp-toast.is-leaving {
    animation: pp-out .35s ease forwards;
}

@keyframes pp-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

@keyframes pp-out {
    to { opacity: 0; transform: translateY(-8px); }
}

/* ---------- Photo agrandie ---------- */
.pp-zoom {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 13, 11, .94);
}

.pp-zoom[open] {
    display: grid;
    place-items: center;
}

.pp-zoom img {
    max-width: 96vw;
    max-height: 90vh;
    object-fit: contain;
}

.pp-zoom-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
}

/* ---------- Produit introuvable ---------- */
.pp-notfound main {
    max-width: 480px;
    margin: 20vh auto;
    padding: 0 16px;
    text-align: center;
}

.pp-notfound h1 {
    font-size: 1.6rem;
}

.pp-notfound p {
    color: var(--pp-muted);
    margin-bottom: 24px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
