/* assets/css/templates/shop.css
   Boutique (gabarit shop) et fiches objets (gabarit product).
   Même langage que la page Projets : photos carrées, titres en Averia,
   prix en italique comme les catégories. Chargé par snippets/header.php. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-fallback);
    line-height: 1.6;
    color: #333;
    background: white;
    /* Pied de page en bas de l'écran même quand la page est courte (peu
       d'objets) : le contenu (main) prend toute la hauteur libre. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* width : dans une colonne flex, « margin: 0 auto » réduirait le bloc à son contenu. */
main.shop,
main.product {
    flex: 1 0 auto;
    width: 100%;
}

/* ---------- Boutique ---------- */

.shop {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 2rem;
}

.shop-intro {
    max-width: 36rem;
    margin: 0 auto 2.5rem;
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
}

.shop-intro p + p {
    margin-top: 0.8em;
}

.shop-thanks {
    max-width: 36rem;
    margin: 0 auto 2.5rem;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 223, 0, 0.25);
    font-family: var(--font-serif);
    text-align: center;
}

.shop-empty {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    color: #666;
    margin: 4rem 0;
}

/* auto-fit + largeur plafonnée : avec peu d'objets, la grille reste centrée */
.shop-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
    justify-content: center;
    gap: 15px;
}

.shop-item-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.shop-item-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f4f4;
}

.shop-item-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.shop-item-link:hover .shop-item-image img,
.shop-item-link:focus-visible .shop-item-image img {
    transform: scale(1.02);
}

.shop-item.is-unavailable .shop-item-image img {
    opacity: 0.45;
}

.shop-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: white;
    font-family: var(--font-fallback);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #333;
}

.shop-item-title {
    margin-top: 1rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
    color: #333;
}

.shop-item-subtitle {
    margin-top: 0.15rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
    color: #555;
}

.shop-item-price {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: #666;
}

.shop-shipping {
    max-width: 36rem;
    margin: 4rem auto 0;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: #555;
    text-align: center;
}

.shop-shipping h2,
.product-shipping h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

/* ---------- Fiche objet ---------- */

.product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.product-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: #666;
    text-decoration: none;
}

.product-back:hover {
    color: #000;
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
    gap: 5rem;
    align-items: start;
}

/* La galerie est le snippet des projets : on neutralise seulement ses marges. */
.product-media .project-gallery {
    margin: 0;
}

.product-meta {
    position: sticky;
    top: 5rem;
}

.product-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
}

.product-subtitle {
    margin-top: 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 400;
    line-height: 1.3;
    color: #555;
}

.product-price {
    margin-top: 0.4rem;
    font-family: var(--font-serif);
    /* font-style: italic; */
    font-size: 1.6rem;
    color: #555;
}

.product-buy {
    margin: 1.5rem 0 2rem;
}

.buy-button {
    display: inline-block;
    padding: 0.8rem 2.4rem;
    background: #111;
    color: white;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background 0.2s ease;
}

.buy-button:hover,
.buy-button:focus-visible {
    background: #bd0300;
}

.buy-button.is-disabled,
.buy-button.is-disabled:hover {
    background: #ddd;
    color: #777;
}

.product-stock {
    margin-top: 0.8rem;
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.product-secure {
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 0.03em;
}

.product-description {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.4;
    color: #444;
}

.product-description p + p {
    margin-top: 1em;
}

.product-details {
    margin-top: 2rem;
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) 2fr;
    gap: 1rem;
    padding: 0.4rem 0;
    border-top: 1px solid #eee;
}

.product-detail dt {
    font-style: italic;
    color: #777;
}

.product-shipping {
    margin-top: 2rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: #555;
}

/* ---------- Téléphone ---------- */

@media (max-width: 768px) {
    .shop {
        padding: 1rem 1rem 2rem;
    }

    .shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .shop-item-title {
        font-size: 1.05rem;
        margin-top: 0.6rem;
    }

    .shop-item-subtitle {
        font-size: 0.9rem;
    }

    .shop-item-price {
        font-size: 0.95rem;
    }

    .product {
        padding: 1rem 1rem 2rem;
    }

    .product-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .product-meta {
        position: static;
    }

    /* La galerie fixe la hauteur des photos (--slide-height, 70vh) : sur téléphone,
       on laisse chaque photo à sa hauteur naturelle, sans bandes blanches,
       pour que le bouton « Acheter » arrive vite. */
    .product-media .slider-item img {
        --slide-height: auto;
    }
}
