/* ═══════════════════════════════════════════════
   Boutique West Up — Styles
   (alignés sur la charte du site public, html/westup.css)
   ═══════════════════════════════════════════════ */

:root {
    --primary: #8c6a9e;
    --primary-light: #efe4f5;
    --primary-dark: #6b4d7d;
    --success: #2e7d32;
    --error: #c62828;
    --bg: #fdf8f4;
    --surface: #ffffff;
    --text: #2b2a35;
    --text-muted: #5f5a66;
    --border: rgba(43, 42, 53, .12);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 14px 35px rgba(35, 32, 54, .09);
    --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    --c2: #f6a5a7;
    --c3: #d5aac8;
    --c5: #b4aee9;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at 4% 12%, rgba(246, 165, 167, 0.4), transparent 28%),
        radial-gradient(circle at 88% 2%, rgba(180, 174, 233, 0.48), transparent 26%),
        linear-gradient(180deg, #fff8f2 0%, #f6f9ff 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

/* ── Layout ───────────────────────────────────── */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header/nav alignés sur ceux du site public (html/westup.css) : mêmes
   classes (.site-header, .brand, .menu-toggle, .main-nav), dupliquées ici
   plutôt que chargées depuis l'autre sous-domaine, pour garder la boutique
   indépendante du site principal. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(10px);
    background: rgba(253, 248, 244, 0.88);
    border-bottom: 1px solid rgba(43, 42, 53, 0.08);
    color: var(--text);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
}

.brand-badge {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
    display: inline-block;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.menu-toggle {
    display: none;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    padding: .5rem .95rem;
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    padding: .45rem .8rem;
    border-radius: 999px;
}

.main-nav a:hover {
    background: rgba(181, 202, 233, .35);
}

.main-nav a.is-current {
    background: rgba(246, 165, 167, .28);
}

.shop-cart-link {
    background: var(--primary-light);
    padding: .4rem .8rem;
    border-radius: 999px;
}

@media (max-width: 760px) {
    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 3;
        padding-top: .7rem;
    }

    .main-nav.is-open {
        display: flex;
        flex-direction: column;
    }

    .main-nav a {
        background: rgba(255, 255, 255, .78);
    }
}

.shop-back {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: var(--text-muted);
    text-decoration: none;
}

.shop-back:hover { color: var(--primary); }

.shop-section {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.shop-section--narrow {
    max-width: 640px;
}

@media (max-width: 700px) {
    .shop-section { padding: 1.25rem 1rem; }
}

.shop-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: .8rem;
    color: var(--text-muted);
}

/* ── Cards / grid ─────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-body { padding: 1.25rem; }

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

.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.product-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-card img,
.product-card .img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--primary-light);
}

.product-card .card-body { padding: .9rem 1rem 1.1rem; }

.product-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .2rem;
}

.product-card .category-tag {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.product-card .card-price {
    margin-top: auto;
    font-weight: 700;
    color: var(--primary-dark);
}

.special-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.special-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--primary);
}

.special-card .category-tag {
    color: var(--primary-dark);
}

/* ── Product detail ───────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 700px) {
    .product-detail { grid-template-columns: 1fr; }
}

.product-detail img,
.product-detail .img-placeholder {
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--primary-light);
}

.product-name { font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.product-desc { color: var(--text-muted); margin-bottom: 1rem; white-space: pre-line; }

.price-block { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.price { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.price-member { font-size: .9rem; color: var(--success); font-weight: 500; }

/* ── Forms ────────────────────────────────────── */
.field { margin-bottom: 1rem; }

.field label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: .25rem;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: var(--font);
    transition: border-color .2s;
}

.field input[type="checkbox"],
.field input[type="radio"] {
    width: auto;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.field textarea { min-height: 80px; resize: vertical; }

.field-hint {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.field label.field-checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 500;
    font-size: .9rem;
    cursor: pointer;
    margin-bottom: 0;
}

.field-checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-right: 1rem;
    font-weight: 400;
    font-size: .9rem;
    cursor: pointer;
}

/* Quantity control */
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.qty-control input {
    width: 60px;
    text-align: center;
    padding: .5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    /* boutons +/- personnalisés juste à côté : flèches natives inutiles/redondantes */
    -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.qty-btn:hover { background: var(--primary-light); }
.qty-btn:active { transform: scale(.95); }

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.25rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--primary);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn:hover { background: var(--primary-light); }

.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-block { width: 100%; padding: .9rem; font-size: 1rem; }

/* ── Cart / order table ───────────────────────── */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-table th,
.cart-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: .9rem;
}

.cart-table th { background: #f3f0ff; font-weight: 600; }
.cart-table tr:last-child td { border-bottom: none; }

.order-total,
.order-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
}

.order-total { background: #f3f0ff; color: var(--text-muted); font-weight: 500; }
.order-grand-total { background: var(--primary-light); font-size: 1.15rem; font-weight: 700; }
.total-amount { color: var(--primary); font-size: 1.3rem; }

/* ── CGV / CGU box ────────────────────────────── */
.legal-box {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: .5rem;
    font-size: .85rem;
    background: var(--surface);
}

.legal-box h2 { font-size: 1rem; margin: 1.2rem 0 .4rem; color: var(--primary); }
.legal-box h2:first-child { margin-top: 0; }
.legal-box p, .legal-box li { font-size: .85rem; line-height: 1.55; }
.legal-box ul { padding-left: 1.3rem; margin: .4rem 0; }

.cgv-checkbox {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 1rem 0;
    font-size: .85rem;
}

/* ── Member verification box ─────────────────── */
.member-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.member-box h3 { font-size: .95rem; margin-bottom: .6rem; color: var(--primary); }
.member-box form { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.member-box input[type="email"],
.member-box input[type="text"] {
    padding: .5rem .7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    flex: 1;
    min-width: 180px;
}
.member-box .member-ok { color: var(--success); font-weight: 600; }

/* ── Messages ─────────────────────────────────── */
.form-errors {
    background: #fce4ec;
    color: var(--error);
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    margin-bottom: 1rem;
}

.form-notice {
    background: #e8f5e9;
    color: var(--success);
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    margin-bottom: 1rem;
}

/* ── Toast "ajouté au panier" (js/add-to-cart.js) ─────────────── */
#shop-toast-zone {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 320px;
}

.shop-toast {
    background: #e8f5e9;
    color: var(--success);
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    animation: shop-toast-in .2s ease-out;
}

.shop-toast a { color: inherit; font-weight: 600; }

.shop-toast--error {
    background: #fce4ec;
    color: var(--error);
}

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

@media (max-width: 760px) {
    #shop-toast-zone {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
}

/* ── Badges ───────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .15em .6em;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-paid    { background: #e8f5e9; color: #2e7d32; }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-error   { background: #fce4ec; color: #c62828; }

/* ── Confirmation page ────────────────────────── */
.confirm-box {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.confirm-box h1 { font-size: 1.6rem; margin-bottom: 1rem; }

/* ── Easter eggs (Chips) ─────────────────────────────────── */
.chips-spin {
    display: inline-flex;
    animation: chips-spin 700ms ease;
}

@keyframes chips-spin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

.chips-konami {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(43, 42, 53, 0.55);
    cursor: pointer;
    animation: chips-fade-in 200ms ease;
}

.chips-konami__img {
    width: min(240px, 50vw);
    animation: chips-bounce-in 550ms cubic-bezier(.34,1.56,.64,1);
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.35));
}

.chips-konami__confetti {
    position: absolute;
    top: -40px;
    animation: chips-fall 2.4s linear forwards;
    pointer-events: none;
}

@keyframes chips-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes chips-bounce-in {
    0%   { transform: scale(0.2) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.chips-konami--closing {
    animation: chips-fade-out 350ms ease forwards;
}

.chips-konami--closing .chips-konami__img {
    animation: chips-bounce-out 350ms ease forwards;
}

@keyframes chips-fade-out {
    to { opacity: 0; }
}

@keyframes chips-bounce-out {
    to { transform: scale(0.2) rotate(15deg); opacity: 0; }
}

@keyframes chips-fall {
    from { transform: translateY(0) rotate(0deg); opacity: 1; }
    to   { transform: translateY(105vh) rotate(360deg); opacity: 0.8; }
}

.chips-critter {
    position: fixed;
    width: 42px;
    height: 56px;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 300ms ease;
}

.chips-critter.is-visible {
    opacity: 0.92;
    pointer-events: auto;
}

.chips-critter__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: chips-idle-bob 3.4s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.chips-critter--falling {
    animation: chips-mario-fall 900ms cubic-bezier(.55, 0, 1, .45) forwards !important;
    pointer-events: none;
}

@keyframes chips-idle-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

@keyframes chips-mario-fall {
    0%   { transform: translate(0, 0) rotate(var(--fall-rot0, 0deg)); opacity: 1; }
    20%  { transform: translate(calc(var(--fall-x, 0px) * 0.25), -55px) rotate(var(--fall-rot0, 0deg)); opacity: 1; }
    100% { transform: translate(var(--fall-x, 0px), 140vh) rotate(calc(var(--fall-rot0, 0deg) + 600deg)); opacity: 0.4; }
}

@media (max-width: 640px) {
    .chips-critter {
        width: 32px;
        height: 43px;
    }
}

