/* mescreations.ch — thème pastel sobre */
:root {
    --bg: #fdfbf8;
    --surface: #ffffff;
    --text: #3d3a40;
    --muted: #8a8590;
    --line: #ece7e2;
    --accent: #c98ba0;
    --accent-dark: #a86a80;
    --radius: 18px;
    --shadow: 0 6px 24px rgba(61, 58, 64, .06);
    --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Palette des événements */
    --rose: #f7d9e3;    --rose-ink: #9c4f6a;
    --menthe: #d4efe2;  --menthe-ink: #3f7d62;
    --beurre: #fbf0c8;  --beurre-ink: #8a7224;
    --lavande: #e6dcf5; --lavande-ink: #6b569a;
    --ciel: #d6e9f8;    --ciel-ink: #3f6c92;
    --peche: #fde0cf;   --peche-ink: #a35f3b;
    --sauge: #e0e8d6;   --sauge-ink: #5d7048;
    --corail: #fbd6d1;  --corail-ink: #a5504a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2em 0 .4em; }
h2 { font-size: 1.5rem; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin: 0; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: 2.5rem 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 3rem 0; }

/* ---------- Couleurs d'événement ---------- */
.c-rose    { --ev: var(--rose);    --ev-ink: var(--rose-ink); }
.c-menthe  { --ev: var(--menthe);  --ev-ink: var(--menthe-ink); }
.c-beurre  { --ev: var(--beurre);  --ev-ink: var(--beurre-ink); }
.c-lavande { --ev: var(--lavande); --ev-ink: var(--lavande-ink); }
.c-ciel    { --ev: var(--ciel);    --ev-ink: var(--ciel-ink); }
.c-peche   { --ev: var(--peche);   --ev-ink: var(--peche-ink); }
.c-sauge   { --ev: var(--sauge);   --ev-ink: var(--sauge-ink); }
.c-corail  { --ev: var(--corail);  --ev-ink: var(--corail-ink); }

/* ---------- En-tête ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding: .9rem 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; margin: 0; }
.brand-mark {
    width: 28px; height: 28px; border-radius: 9px;
    background: linear-gradient(135deg, var(--rose), var(--lavande) 50%, var(--menthe));
}
.event-nav { flex: 1; overflow-x: auto; }
.event-nav ul { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; justify-content: flex-end; }
.chip {
    display: inline-block; padding: .3rem .85rem; border-radius: 999px;
    background: var(--ev, var(--line)); color: var(--ev-ink, var(--text));
    font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    border: 2px solid transparent; transition: border-color .15s;
}
.chip:hover, .chip[aria-current="page"] { border-color: var(--ev-ink, var(--text)); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.5rem 0 0; }

/* ---------- Accueil ---------- */
.hero { padding: 3.5rem 0 1rem; text-align: center; }
.hero p { max-width: 38rem; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }

.grid { display: grid; gap: 1.25rem; }
.event-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.event-tile {
    position: relative; display: flex; flex-direction: column; gap: .4rem;
    min-height: 170px; padding: 1.4rem; border-radius: var(--radius);
    background: var(--ev); color: var(--ev-ink); text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.event-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.event-tile h3 { font-size: 1.35rem; }
.event-tile p { margin: 0; font-size: .95rem; opacity: .85; }
.event-tile .count { margin-top: auto; font-size: .85rem; font-weight: 700; }

.badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px;
    background: rgba(255,255,255,.85); color: var(--text); font-size: .75rem; font-weight: 700;
}
.event-tile .badge { align-self: flex-start; }

/* ---------- Cartes article ---------- */
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.card:hover { transform: translateY(-3px); }
.card a { color: inherit; text-decoration: none; display: block; }
.card-img { position: relative; aspect-ratio: 1; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .badge { position: absolute; top: .7rem; left: .7rem; }
.card-body { padding: .9rem 1.1rem 1.1rem; }
.price { margin: .25rem 0 0; font-weight: 700; color: var(--accent-dark); }
.price.big { font-size: 1.5rem; margin: 0 0 1rem; }
.placeholder { display: block; width: 100%; height: 100%; min-height: 200px; background: repeating-linear-gradient(45deg, var(--line), var(--line) 10px, #f6f2ee 10px, #f6f2ee 20px); }

/* ---------- Page événement ---------- */
.event-hero { background: var(--ev); color: var(--ev-ink); padding: 2.5rem 0; }
.event-hero p { margin: 0; max-width: 40rem; }
.event-hero .breadcrumb a { color: inherit; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin: 0 0 .5rem; }
.event-hero .breadcrumb { color: inherit; opacity: .8; }

/* ---------- Fiche article ---------- */
.product-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: start; }
.gallery-main { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.gallery-main img { width: 100%; }
.gallery-thumbs { list-style: none; display: flex; gap: .6rem; padding: 0; margin: .8rem 0 0; flex-wrap: wrap; }
.gallery-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.availability { display: inline-block; background: var(--menthe); color: var(--menthe-ink); padding: .3rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 600; }
.description { margin: 1.2rem 0; }
.order-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-top: 1.5rem; }
.order-box p { margin-top: 0; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block; padding: .65rem 1.3rem; border-radius: 999px; border: 0;
    background: var(--accent); color: #fff; font: inherit; font-weight: 700;
    text-decoration: none; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--line); }
.btn-danger { background: #f3d0cd; color: #8e3a33; }
.btn-danger:hover { background: #ebb8b3; }
.btn-sm { padding: .3rem .8rem; font-size: .85rem; }

/* ---------- Pages texte ---------- */
.prose { max-width: 46rem; }
.todo { background: var(--beurre); color: var(--beurre-ink); padding: .6rem 1rem; border-radius: 10px; font-weight: 600; }
.error-page { text-align: center; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--rose-ink); margin: 0; opacity: .5; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); }

@media (max-width: 760px) {
    .product-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .event-nav { flex-basis: 100%; margin: 0 -1.25rem; padding: 0 1.25rem .2rem; }
    .event-nav ul { justify-content: flex-start; }
    .header-inner { gap: .7rem; }
    .hero { padding-top: 2rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
    .event-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
    .event-tile { min-height: 130px; padding: 1rem; }
    .event-tile p { display: none; }
    .card-body { padding: .7rem .8rem .9rem; }
    .card-body h3 { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Formulaires (public) ---------- */
.flashes { padding-top: 1rem; }
.flash { padding: .8rem 1.1rem; border-radius: 12px; margin: 0 0 1rem; font-weight: 600; }
.flash-success { background: var(--menthe); color: var(--menthe-ink); }
.flash-info { background: var(--ciel); color: var(--ciel-ink); }
.flash-error { background: var(--corail); color: var(--corail-ink); }
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form input[type=number], .form select, .form textarea {
    font: inherit; font-weight: 400; padding: .6rem .8rem; border: 1.5px solid var(--line);
    border-radius: 12px; background: var(--surface); color: var(--text); width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--rose); }
.form fieldset { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0; background: var(--surface); display: flex; flex-direction: column; gap: .8rem; }
.form legend { font-weight: 700; padding: 0 .4rem; }
.form .check-line { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.form .row-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; }
.field-error { color: var(--corail-ink); font-size: .85rem; font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn[disabled] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: .6rem; }
.add-row { display: flex; gap: .8rem; align-items: flex-end; }
.add-row .qty { width: 6.5rem; }

/* ---------- Panier ---------- */
.cart-link { font-weight: 700; color: var(--text); text-decoration: none; padding: .3rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); white-space: nowrap; }
.cart-link:hover, .cart-link[aria-current="page"] { border-color: var(--accent); }
.cart-count { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8rem; text-align: center; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-lines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 1rem; align-items: center; background: var(--surface); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); }
.cart-thumb img, .cart-thumb .placeholder { width: 72px; height: 72px; min-height: 0; object-fit: cover; border-radius: 12px; }
.cart-info { display: flex; flex-direction: column; font-size: .95rem; }
.cart-info a { color: var(--text); text-decoration: none; }
.cart-qty { display: flex; gap: .3rem; align-items: center; }
.cart-qty input { width: 4rem; font: inherit; padding: .35rem .5rem; border: 1.5px solid var(--line); border-radius: 10px; }
.cart-total { font-weight: 700; min-width: 6rem; text-align: right; }
.summary { background: var(--surface); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); position: sticky; top: 5rem; }
.summary h2 { font-size: 1.2rem; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0 0 .5rem; }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .total { font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: .5rem; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .95rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 1rem; }

/* ---------- Commande / QR-facture ---------- */
.lead { font-size: 1.1rem; }
.payment-box { background: var(--surface); border: 2px solid var(--menthe); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 2rem; }
.qr-bill { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; margin: 1rem 0; }
.qr-code svg { display: block; width: 46mm; height: 46mm; }
.qr-info { margin: 0; font-size: .95rem; }
.qr-info dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: .7rem; }
.qr-info dt:first-child { margin-top: 0; }
.qr-info dd { margin: .1rem 0 0; }
.qr-info .amount { font-size: 1.3rem; font-weight: 800; }

@media (max-width: 860px) {
    .cart-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .cart-line { grid-template-columns: 56px 1fr; }
    .cart-thumb img, .cart-thumb .placeholder { width: 56px; height: 56px; }
    .cart-qty, .cart-total { grid-column: 2; }
    .cart-total { text-align: left; }
}
@media print {
    .site-header, .site-footer, .summary .btn { display: none; }
}
.summary-lines li > span:last-child { white-space: nowrap; }

/* ---------- Page de maintenance ---------- */
body.maintenance { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background: radial-gradient(circle at 15% 20%, var(--rose) 0, transparent 40%),
                radial-gradient(circle at 85% 80%, var(--menthe) 0, transparent 40%),
                radial-gradient(circle at 80% 15%, var(--lavande) 0, transparent 35%), var(--bg); }
.maint-card { width: min(560px, 100%); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
    padding: 2.5rem 2rem; text-align: center; }
.maint-card .brand { justify-content: center; margin-bottom: 1.5rem; }
.maint-card h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.maint-card .lead { color: var(--muted); }
.maint-note { background: var(--beurre); color: var(--beurre-ink); border-radius: 12px; padding: .7rem 1rem; font-weight: 600; }

/* Couches qui s'empilent, comme une impression 3D */
.layers { position: relative; width: 150px; height: 108px; margin: 0 auto 1.5rem;
    display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.layers span:not(.nozzle) { display: block; height: 14px; border-radius: 7px; background: var(--ev);
    border: 1px solid var(--ev-ink); width: 100%; transform-origin: left center;
    animation: layer 6s ease-in-out infinite; opacity: 0; }
.layers span:nth-child(2) { width: 92%; animation-delay: .5s; }
.layers span:nth-child(3) { width: 84%; animation-delay: 1s; }
.layers span:nth-child(4) { width: 76%; animation-delay: 1.5s; }
.layers span:nth-child(5) { width: 68%; animation-delay: 2s; }
.layers span:nth-child(6) { width: 60%; animation-delay: 2.5s; }
.layers .nozzle { position: absolute; top: -14px; left: 50%; width: 22px; height: 14px; margin-left: -11px;
    background: var(--text); clip-path: polygon(0 0, 100% 0, 70% 100%, 30% 100%);
    animation: nozzle 1.5s ease-in-out infinite alternate; }
@keyframes layer { 0% { opacity: 0; transform: scaleX(0); } 8%, 80% { opacity: 1; transform: scaleX(1); } 92%, 100% { opacity: 0; transform: scaleX(1); } }
@keyframes nozzle { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
@media (prefers-reduced-motion: reduce) { .layers span { animation: none !important; opacity: 1 !important; transform: none !important; } }

/* ---------- Logo texte espacé ---------- */
.logo { font-weight: 600; font-size: 1.05rem; letter-spacing: .38em; text-transform: lowercase;
    margin-right: -.38em; /* compense l'espacement après la dernière lettre */ white-space: nowrap; color: var(--text); }
.brand:hover .logo { color: var(--accent-dark); }
@media (max-width: 760px) { .logo { font-size: .9rem; letter-spacing: .28em; margin-right: -.28em; } }
@media (max-width: 760px) {
    .cart-link { order: 2; margin-left: auto; }
    .event-nav { order: 3; }
}
.logo-mark { width: 44px; height: auto; flex: none; }
@media (max-width: 760px) { .logo-mark { width: 34px; } }
/* Page de maintenance : l'animation suffit, pas de logo graphique en double */
.maint-card .logo-mark { display: none; }
