:root {
    --color-primary: #1d4ed8;
    --color-primary-dark: #1e3a8a;
    --color-accent: #f97316;
    --color-bg: #f5f7fb;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-success: #16a34a;
    --color-error: #dc2626;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

    /* "Stade" brand identity — dark navy / lime, header, footer & homepage */
    --stade-bg: #0f202f;
    --stade-bg-deep: #0a1826;
    --stade-border: #1c3448;
    --stade-text: #f4f5f0;
    --stade-muted: #9fb3c2;
    --stade-muted-2: #7e93a3;
    --stade-muted-3: #5b7386;
    --stade-lime: #c8ff4d;
    --stade-lime-dark: #7fbf1f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}
body.home { background: var(--stade-bg); }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Admin "building an order for a client" banner (shown on the public site,
   see includes/layout_header.php) */
.admin-mode-banner {
    background: var(--stade-lime);
    color: var(--stade-bg-deep);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    justify-content: space-between;
}
.admin-mode-banner-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.admin-mode-banner a { color: var(--stade-bg-deep); text-decoration: underline; font-weight: 700; }

/* Header */
.site-header {
    background: var(--stade-bg);
    border-bottom: 1px solid var(--stade-border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.logo { display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.logo-img { display: block; height: 34px; width: auto; }
.main-nav {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}
.main-nav a { color: var(--stade-muted); font-weight: 600; font-size: 0.9rem; }
.main-nav a:hover { color: var(--stade-text); text-decoration: none; }
.cart-link {
    background: transparent;
    border: 1px solid var(--stade-border);
    color: var(--stade-text) !important;
    padding: 9px 18px;
    border-radius: 2px;
    font-weight: 600;
}
.cart-link:hover { background: transparent; border-color: var(--stade-lime); color: var(--stade-lime) !important; text-decoration: none; }

.page-main { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }
body.home .page-main { padding-top: 0; padding-bottom: 0; }

.site-footer {
    background: var(--stade-bg);
    border-top: 1px solid var(--stade-border);
    color: var(--stade-muted-3);
    padding: 28px 0;
    margin-top: 40px;
    font-size: 0.85rem;
}
.site-footer a { color: var(--stade-muted-2); }
.site-footer a:hover { color: var(--stade-lime); }
.footer-logo { display: block; height: 26px; width: auto; margin-bottom: 12px; }

/* Flash messages */
.flash-stack { margin-bottom: 20px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-weight: 500;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

/* Hero — homepage only, full-bleed dark "Stade" banner */
.hero {
    position: relative;
    overflow: hidden;
    text-align: left;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 0;
    padding: 64px 20px 90px;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(200,255,77,.14), transparent 60%),
        linear-gradient(180deg, var(--stade-bg) 0%, var(--stade-bg-deep) 100%);
    color: var(--stade-text);
    border-radius: 0;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(120deg, rgba(255,255,255,.035) 0 2px, transparent 2px 90px);
    pointer-events: none;
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.hero .kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--stade-lime); margin-bottom: 22px;
}
.hero .kicker::before { content: ""; width: 22px; height: 2px; background: var(--stade-lime); display: block; }
.hero h1 {
    font-family: 'Anton', sans-serif; font-weight: 400;
    font-size: clamp(34px, 6vw, 72px); line-height: 1; letter-spacing: .005em;
    max-width: 760px; text-transform: uppercase; margin: 0;
}
.hero h1 em { font-style: normal; color: var(--stade-lime); }
.hero p.lead {
    margin: 22px 0 0; font-size: 17px; line-height: 1.6; color: var(--stade-muted); max-width: 500px; opacity: 1;
}
.hero .cta-row { display: flex; gap: 16px; margin-top: 34px; flex-wrap: wrap; align-items: center; }
.btn-primary-stade {
    display: inline-block;
    background: var(--stade-lime); color: var(--stade-bg); font-weight: 800; font-size: 15px;
    padding: 16px 28px; border-radius: 2px; letter-spacing: .02em;
    transition: .2s;
}
.btn-primary-stade:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(200,255,77,.45); text-decoration: none; }
.btn-secondary-stade {
    display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--stade-text);
    padding: 16px 6px;
}
.btn-secondary-stade:hover { color: var(--stade-lime); text-decoration: none; }
.hero .mini-note {
    margin-top: 30px; display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--stade-muted-2);
}
.hero .mini-note b { color: var(--stade-lime); }

/* Homepage sections below the hero */
.home-section { padding: 70px 0 90px; }
.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.home-section-title {
    font-family: 'Anton', sans-serif; font-weight: 400; text-transform: uppercase;
    font-size: clamp(24px, 3.2vw, 36px); line-height: 1; color: var(--stade-text); margin: 0;
}
.home-section-sub { color: var(--stade-muted-2); font-size: 14px; margin: 0; }

/* ---------- mobile: header + hero + homepage sections ---------- */
@media (max-width: 640px) {
    .header-inner { padding-top: 14px; padding-bottom: 14px; }
    .main-nav { gap: 14px; }
    .main-nav a:not(.cart-link) { display: none; }
    .cart-link { padding: 8px 14px; font-size: 0.8rem; }

    .hero { padding: 36px 20px 52px; }
    .hero .kicker { font-size: 11px; margin-bottom: 16px; }
    .hero h1 { font-size: clamp(30px, 10vw, 42px); line-height: 1.05; letter-spacing: 0; }
    .hero p.lead { font-size: 15.5px; margin-top: 18px; }
    .hero .cta-row { margin-top: 26px; flex-direction: column; align-items: stretch; gap: 12px; }
    .btn-primary-stade { text-align: center; padding: 15px 20px; }
    .btn-secondary-stade { justify-content: center; padding: 6px; }
    .hero .mini-note { margin-top: 24px; }

    .home-section { padding: 48px 0 60px; }
    .home-section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 30px; }
    .step { padding-top: 20px; }
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    background: var(--color-accent);
    color: #fff;
}
.btn:hover { background: #ea580c; text-decoration: none; }
.btn-secondary { background: var(--color-surface); color: var(--color-primary-dark); border: 2px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-danger { background: var(--color-error); }
.btn-danger:hover { background: #b91c1c; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-small { padding: 6px 16px; font-size: 0.9rem; }

/* How it works — homepage only */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    margin: 0;
}
.step {
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 26px 0 0;
    text-align: left;
    border-top: 2px solid var(--stade-border);
}
.step .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 2px;
    background: var(--stade-lime);
    color: var(--stade-bg);
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    font-size: 15px;
    margin-bottom: 18px;
}
.step h3 { font-size: 17px; font-weight: 800; margin: 0 0 10px; color: var(--stade-text); }
.step p.muted { font-size: 14px; color: var(--stade-muted-2); line-height: 1.6; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Card grids */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.card-media {
    aspect-ratio: 4/3;
    background: #eef1f6 url('data:image/svg+xml;utf8,') center/cover;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--color-text); }
.card-price { font-weight: 700; color: var(--color-primary-dark); margin-top: auto; padding-top: 10px; }
.club-card .card-body { align-items: center; text-align: center; }
.club-card .card-media { background-color: var(--color-primary-dark); }

/* Shop header */
.shop-banner {
    height: 200px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #334155, #0f172a) center/cover;
    display: flex; align-items: flex-end;
    color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}
.shop-banner img.banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.shop-banner .shop-banner-text { position: relative; z-index: 1; }
.shop-banner h1 { margin: 0; font-size: 1.8rem; }
.section-title { margin: 32px 0 8px; font-size: 1.3rem; color: var(--color-primary-dark); }
.section-subtitle { color: var(--color-muted); margin-bottom: 12px; }

/* Product/pack detail */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 720px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-media { background: #eef1f6; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; display:flex; align-items:center; justify-content:center; color: var(--color-muted); }
.detail-media img { width: 100%; height: 100%; object-fit: contain; }
.detail-price { font-size: 1.5rem; font-weight: 800; color: var(--color-primary-dark); margin: 10px 0 20px; }
.pack-includes { list-style: none; padding: 0; margin: 0 0 20px; }
.pack-includes li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }

/* Forms */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-field input[type=text], .form-field input[type=email], .form-field input[type=password],
.form-field input[type=tel], .form-field input[type=number], .form-field input[type=date],
.form-field select, .form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
.form-field textarea { min-height: 90px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-field { flex: 1; min-width: 180px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field label { margin: 0; font-weight: 500; }
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 16px; padding: 14px; }
legend { font-weight: 700; padding: 0 6px; }
.pack-item-config {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    background: var(--color-surface, #fff);
}
.pack-item-config .fieldset,
.pack-item-config fieldset { margin-bottom: 0; }
.pack-item-config fieldset + fieldset { margin-top: 14px; }
.pack-item-config-title { margin: 0 0 12px; font-size: 1.05rem; }
.size-options { display: flex; gap: 8px; flex-wrap: wrap; }
.size-options label {
    border: 1px solid var(--color-border);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.size-options input { margin-right: 6px; }
.size-options label.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}
.auth-card { max-width: 420px; margin: 0 auto; background: var(--color-surface); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card h1 { margin-top: 0; font-size: 1.5rem; }
.muted { color: var(--color-muted); }
.small { font-size: 0.85rem; }

/* Product/pack photo gallery (detail pages) */
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gallery-thumb {
    width: 56px; height: 56px; padding: 0; border-radius: 8px; overflow: hidden;
    border: 2px solid var(--color-border); background: #eef1f6; cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb.active { border-color: var(--color-primary); }

/* Admin: multi-photo manager (product_form.php / pack_form.php) */
.image-manager-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.image-manager-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 100px; padding: 8px; border: 1px solid var(--color-border); border-radius: 8px;
    cursor: pointer; font-size: 0.78rem; text-align: center;
}
.image-manager-item img { width: 100%; height: 80px; object-fit: contain; background: #eef1f6; border-radius: 6px; }
.image-manager-remove { display: flex; align-items: center; gap: 4px; color: var(--color-error); }

/* Admin: per-size stock inputs (product_form.php) */
.size-stock-rows { display: flex; flex-wrap: wrap; gap: 10px; }
.size-stock-row {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--color-border); border-radius: 8px; padding: 6px 10px;
}
.size-stock-label { font-weight: 700; min-width: 28px; }
.size-stock-row input { width: 72px; padding: 6px; border: 1px solid var(--color-border); border-radius: 6px; }

/* Admin: dynamic flocage-option rows (product_form.php / pack_form.php) */
.option-row { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: #fafbfc; }
.pack-item-block { border-bottom: 1px solid var(--color-border); padding-bottom: 12px; margin-bottom: 12px; }
.pack-item-options { margin: 8px 0; }
.pack-item-options:empty { margin: 0; }

/* Cart & checkout tables */
.cart-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.cart-table img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #eef1f6; }
.pack-size-list { list-style: disc; margin: 4px 0 0; padding-left: 18px; }
.pack-size-list li { line-height: 1.5; }
.qty-input { width: 64px; padding: 6px; border: 1px solid var(--color-border); border-radius: 6px; }
.cart-summary { max-width: 340px; margin-left: auto; margin-top: 24px; background: var(--color-surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.cart-summary .total { font-weight: 800; font-size: 1.2rem; border-top: 1px solid var(--color-border); margin-top: 8px; padding-top: 12px; }
.club-group { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.club-group h3 { margin-top: 0; }
.pickup-note { background: #eff6ff; border: 1px solid #bfdbfe; padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-top: 10px; }

/* Status badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge-received { background: #e0e7ff; color: #3730a3; }
.badge-preparing { background: #fef3c7; color: #92400e; }
.badge-ready { background: #dcfce7; color: #166534; }
.badge-collected { background: #e5e7eb; color: #374151; }
.badge-restricted { background: #fee2e2; color: #991b1b; }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #111827; color: #d1d5db; padding: 24px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #d1d5db; padding: 10px 24px; font-weight: 500; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #1f2937; color: #fff; text-decoration: none; }
.admin-sidebar .brand { color: #fff; font-weight: 800; padding: 0 24px 20px; font-size: 1.2rem; }
.admin-content { flex: 1; padding: 32px; max-width: 1200px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 12px 16px; border-bottom: 1px solid var(--color-border); text-align: left; }
.data-table th { background: #f9fafb; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-muted); }
.data-table img.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.stock-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.stock-table { box-shadow: none; white-space: nowrap; }
.stock-table th, .stock-table td { padding: 10px 14px; }
.stock-col-product { position: sticky; left: 0; background: var(--color-surface); white-space: normal; min-width: 180px; }
.stock-table thead .stock-col-product { background: #f9fafb; }
.stock-zero { color: var(--color-error); font-weight: 600; }
.badge-shared { background: #dbeafe; color: #1e40af; margin-left: 6px; white-space: nowrap; }
.badge-instore { background: #ede9fe; color: #5b21b6; }
.badge-count { background: var(--stade-lime); color: var(--stade-bg-deep); }
.admin-order-club-list { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--color-primary-dark); }
.stat-card .stat-label { color: var(--color-muted); font-size: 0.9rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; background: var(--color-surface); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 6px; }
.actions-row { display: flex; gap: 8px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-muted); }

@media (max-width: 640px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 12px 0; }
    .admin-sidebar .brand { display: none; }
    .admin-sidebar a { padding: 8px 14px; white-space: nowrap; }
    .admin-content { padding: 20px; }
}
