/* =========================================================
   Système de design — boutique d'objets de dévotion, Lourdes
   Palette ancrée dans le lieu : la pierre de la grotte de
   Massabielle, le bleu du manteau de l'apparition, l'or des
   cierges des processions aux flambeaux.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Work+Sans:wght@400;500;600&display=swap');

:root {
    /* Couleur — bleu dominant en écho à l'identité historique, or de cierge
       conservé comme seul accent fonctionnel (CTA, prix), rose en motif
       décoratif dédié (jamais sur les éléments interactifs). */
    --stone:      #DCE3EF; /* bleu brume, fond principal (remplace la pierre) */
    --paper:      #F3F5FA; /* panneaux de contenu, légèrement plus clair */
    --stone-line: #C2CEE0; /* filets, séparateurs — bleu-gris doux */
    --ink:        #1E2A3C; /* texte principal — ardoise-nuit, pas un noir pur */
    --ink-soft:   #57647A; /* texte secondaire */
    --marian:     #223A5E; /* bleu marial profond — nav, titres, structure */
    --marian-dim: #35577F;
    --candle:     #B9812F; /* or de cierge — accent fonctionnel unique (CTA, prix) */
    --candle-dim: #8F6423;
    --rose:       #A24F72; /* rose du motif décoratif — jamais utilisé pour l'interactif */
    --rose-dark:  #7C3A57;
    --rose-light: #C98CA8;

    /* Typo */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--stone);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.15;
    margin: 0 0 0.5em;
    color: var(--marian);
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 500; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--marian); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--candle);
    outline-offset: 2px;
}

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

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- En-tête --- */
.site-header {
    border-bottom: 1px solid var(--stone-line);
    background: var(--paper);
}
.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    max-width: 1080px;
    margin: 0 auto;
    gap: 24px;
    flex-wrap: wrap;
}
.site-header__brand {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--marian);
    letter-spacing: 0.01em;
}
.site-header__nav {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.site-header__nav a {
    color: var(--ink);
    font-size: 0.95rem;
}
.site-header__nav a:hover { color: var(--marian); text-decoration: none; }
.site-header__meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.lang-switch { display: flex; gap: 10px; color: var(--ink-soft); }
.lang-switch a { color: var(--ink-soft); }
.lang-switch a.current { color: var(--marian); font-weight: 600; }
.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--marian);
    font-weight: 500;
}
.cart-count {
    background: var(--candle);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
}

/* --- Hero (page d'accueil) --- */
.hero {
    position: relative;
    padding: 72px 24px 56px;
    overflow: hidden;
}
.hero__inner {
    max-width: 1080px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.hero__eyebrow {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--candle-dim);
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.hero h1 { max-width: 14ch; }
.hero__lede {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 46ch;
    margin-top: 18px;
}
.hero__cta {
    margin-top: 30px;
}

/* Rangée de flammes de cierges — le motif caractéristique du lieu (procession
   mariale aux flambeaux), utilisé une seule fois comme signature visuelle. */
.candle-row {
    display: flex;
    gap: 3px;
    margin-top: 44px;
    opacity: 0.9;
}
.candle-row svg { flex: 1; min-width: 0; height: 46px; }

/* Motif de rose — la rose stylisée en signature décorative, jamais utilisée
   pour un élément interactif (boutons, prix restent en or de cierge). */
.rose-mark--hero {
    position: absolute;
    top: 8px;
    right: 0;
    width: clamp(96px, 14vw, 168px);
    opacity: 0.92;
    pointer-events: none;
}
.rose-divider {
    display: flex;
    justify-content: center;
    margin: 0;
}
.rose-divider svg { width: 34px; height: 34px; opacity: 0.55; }

/* --- Section "Notre histoire" (Bernadette / basilique) --- */
.heritage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 28px;
}
.heritage-card__image {
    aspect-ratio: 4 / 5;
    border: 1px solid var(--stone-line);
    overflow: hidden;
    margin-bottom: 18px;
}
.heritage-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
.heritage-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
}
.heritage-card__placeholder svg { width: 40px; height: auto; opacity: 0.5; }
.heritage-card__placeholder code {
    font-family: monospace;
    background: var(--stone);
    padding: 2px 6px;
    border-radius: 3px;
}
.heritage-card h3 { margin-bottom: 8px; }
.heritage-card p { font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 720px) {
    .heritage-grid { grid-template-columns: 1fr; }
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    background: var(--candle);
    color: #fff;
    padding: 12px 26px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--candle-dim); text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--marian);
    border: 1px solid var(--marian);
}
.btn-outline:hover { background: var(--marian); color: #fff; }
.btn-quiet {
    background: none;
    color: var(--ink-soft);
    padding: 12px 4px;
}
.btn-quiet:hover { color: var(--marian); background: none; }

/* --- Sections de contenu --- */
.section { padding: 56px 24px; }
.section--muted { background: var(--paper); border-top: 1px solid var(--stone-line); border-bottom: 1px solid var(--stone-line); }
.page-content { max-width: 68ch; }
.page-content :is(h2, h3) { margin-top: 1.4em; }

/* --- Grille produits --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--stone-line);
}
.product-card {
    padding: 28px 22px;
    border-bottom: 1px solid var(--stone-line);
    border-right: 1px solid var(--stone-line);
}
.product-card:nth-child(3n) { border-right: none; }
.product-card__image {
    aspect-ratio: 4 / 5;
    background: var(--paper);
    border: 1px solid var(--stone-line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__monogram {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 2.4rem;
    color: var(--stone-line);
}
.product-card h3 { margin-bottom: 6px; }
.product-card h3 a { color: var(--ink); }
.product-card h3 a:hover { color: var(--marian); }
.product-card p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 10px; }
.price {
    font-family: var(--font-display);
    color: var(--candle-dim);
    font-size: 1.05rem;
}

@media (max-width: 800px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-card:nth-child(3n) { border-right: 1px solid var(--stone-line); }
    .product-card:nth-child(2n) { border-right: none; }
}
@media (max-width: 520px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-card { border-right: none !important; }
}

/* --- Fiche produit --- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}
.product-detail__image {
    aspect-ratio: 4 / 5;
    background: var(--paper);
    border: 1px solid var(--stone-line);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.breadcrumb { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-soft); }
.product-detail .price { font-size: 1.4rem; margin: 18px 0 26px; }
.qty-form { display: flex; align-items: flex-end; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.qty-form label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
.qty-form input[type=number] {
    width: 70px; padding: 10px; border: 1px solid var(--stone-line);
    border-radius: var(--radius); font-family: var(--font-body); font-size: 1rem;
}
@media (max-width: 760px) {
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
}

/* --- Formulaires légers (panier / checkout) --- */
label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin: 14px 0 6px; }
input[type=email], input[type=text], input[type=number], textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--stone-line);
    border-radius: var(--radius); font-family: var(--font-body); font-size: 1rem; background: #fff;
}
table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--stone-line); }
table th { font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; }

/* Sur petit écran, les tableaux défilent horizontalement plutôt que
   d'écraser leurs colonnes ou de faire déborder toute la page. */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
    .table-wrap table { min-width: 560px; }
}

/* --- Pied de page --- */
.site-footer {
    border-top: 1px solid var(--stone-line);
    padding: 40px 24px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.site-footer__inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.site-footer a { color: var(--ink-soft); }

/* Respecte la préférence de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Resserre les espacements sur petit écran plutôt que de garder les
   mêmes marges généreuses pensées pour le desktop. */
@media (max-width: 600px) {
    .hero { padding: 48px 20px 36px; }
    .section { padding: 40px 20px; }
    .site-header__bar { padding: 16px 20px; }
    .product-detail__image, .product-card__image { aspect-ratio: 1 / 1; }
}
