:root {
    --pink: #fae7fa;
    --gold: #daa520;
    --gold-dark: #c8961e;
    --ink: #333;
    --white: #fff;
    --card: #ffffff;
    --muted: #666;
    --shadow: 0 4px 20px rgba(0,0,0,.08);
    --radius: 12px;
    --font-body: 'Open Sans', system-ui, sans-serif;
    --font-nav: 'Quicksand', system-ui, sans-serif;
    --font-script: 'Pacifico', cursive;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--pink);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 60px 0; }

/* ═══════════ Header ═══════════ */
.site-header {
    background: var(--pink);
    padding: 20px 0 0;
    text-align: center;
}
.header-inner {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding-top: 10px; padding-bottom: 0;
}
.brand {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-family: var(--font-nav); font-weight: 700;
    font-size: 1rem; color: var(--gold);
}
.brand-logo {
    width: 300px; height: auto; display: block;
    margin: 0 auto;
}
.main-nav {
    display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
    padding: 12px 0; border-top: 1px solid rgba(218,165,32,.25);
    margin-top: 8px; width: 100%;
}
.main-nav a {
    font-family: var(--font-nav); font-weight: 600; font-size: .95rem;
    color: var(--gold); padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color .2s;
}
.main-nav a:hover { border-color: var(--gold); }

/* ═══════════ Hero Carousel ═══════════ */
.hero-carousel {
    position: relative; overflow: hidden;
    width: 100%;
    max-height: 480px;
}
.hero-slides {
    display: flex; width: 100%; height: 100%;
    animation: heroSlide 18s ease-in-out infinite;
}
.hero-slide {
    min-width: 100%; min-height: 400px; position: relative;
    background-size: cover; background-position: center;
}
.hero-slide::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(transparent 20%, rgba(0,0,0,.55));
}
.hero-slide-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 2; text-align: center; padding: 30px 20px 40px;
    color: var(--white);
}
.hero-slide-content h2 {
    font-family: var(--font-script); font-size: clamp(2rem, 5.5vw, 3.8rem);
    margin: 0 0 8px; text-shadow: 0 2px 12px rgba(0,0,0,.6);
    font-weight: 400; color: var(--white);
}
.hero-slide-content p {
    font-family: var(--font-nav); font-size: 1.05rem; margin: 0 0 18px;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.hero-dots {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    z-index: 3; display: flex; gap: 8px;
}
.hero-dot {
    width: 12px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,.5); border: none; cursor: pointer;
    transition: all .3s;
}
.hero-dot.active { width: 24px; background: var(--white); }

@keyframes heroSlide {
    0%,28%   { transform: translateX(0); }
    33%,61%  { transform: translateX(-100%); }
    66%,94%  { transform: translateX(-200%); }
    100%     { transform: translateX(0); }
}

/* Fallback hero (no carousel) */
.hero {
    text-align: center;
    padding: 70px 20px 50px;
    background: var(--pink);
}
.hero h1 {
    font-family: var(--font-script); font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 12px;
}
.hero .hl { color: var(--gold); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0 auto 24px; }

/* ═══════════ Buttons ═══════════ */
.btn {
    display: inline-block; cursor: pointer;
    background: var(--gold); color: #000;
    border: none; border-radius: 4px;
    padding: 12px 28px; font-family: var(--font-nav);
    font-weight: 700; font-size: .95rem;
    transition: background .2s;
}
.btn:hover { background: var(--gold-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══════════ Section headings ═══════════ */
h2 {
    font-family: var(--font-script); font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin: 50px 0 24px; color: var(--ink);
}

/* ═══════════ Category grid (photo cards) ═══════════ */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
    display: block; position: relative;
    border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 1/1;
    background-size: cover; background-position: center;
    background-color: #d4c4d4;
    transition: transform .2s;
}
.cat-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(transparent 30%, rgba(0,0,0,.5));
    border-radius: var(--radius);
}
.cat-card:hover { transform: scale(1.03); }
.cat-name {
    position: absolute; bottom: 16px; left: 16px; right: 16px;
    z-index: 2; font-family: var(--font-script); font-weight: 400;
    font-size: 1.3rem; color: var(--white);
    text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.cat-desc { display: none; }

/* Text-only fallback (no image) */
.cat-card.no-image {
    background: var(--card);
    display: flex; flex-direction: column; justify-content: center;
    padding: 20px;
}
.cat-card.no-image::after { display: none; }
.cat-card.no-image .cat-name {
    position: static; color: var(--ink); font-family: var(--font-nav);
    font-weight: 700; font-size: 1.1rem; text-shadow: none;
}
.cat-card.no-image .cat-desc {
    display: block; color: var(--muted); font-size: .9rem; margin-top: 4px;
}

/* ═══════════ Product grid ═══════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }

.product-card {
    background: var(--pink); border-radius: 0; overflow: hidden;
    transition: transform .15s;
}
.product-card:hover { transform: translateY(-3px); }
.product-img { aspect-ratio: 1/1; background: #efe0ef; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 10px 4px 16px; }
.product-body h3 { margin: 0 0 4px; font-size: .92rem; font-family: var(--font-body); font-weight: 400; }
.price { font-weight: 700; color: var(--ink); margin: 4px 0 0; font-size: .95rem; }
.price-lg { font-size: 1.6rem; }

/* ═══════════ About section (Bienvenue) ═══════════ */
.about-section {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px;
    align-items: center; margin: 50px 0;
}
.about-section img { border-radius: var(--radius); width: 100%; }
.about-section h2 { margin-top: 0; }
.about-section p { font-size: .95rem; line-height: 1.7; }
@media (max-width: 760px) { .about-section { grid-template-columns: 1fr; } }

/* ═══════════ Chips (filter) ═══════════ */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 28px; }
.chip {
    padding: 8px 16px; border-radius: 999px; background: var(--white);
    box-shadow: var(--shadow); font-family: var(--font-nav);
    font-weight: 600; font-size: .9rem;
}
.chip-active { background: var(--gold); color: #000; }

/* ═══════════ Product detail ═══════════ */
.product-detail {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
    margin: 30px 0; align-items: start;
}
.product-detail-img { background: #efe0ef; border-radius: var(--radius); overflow: hidden; }
.product-detail-info h1 {
    margin: 6px 0 10px;
    font-family: var(--font-script); font-weight: 400;
    font-size: 1.8rem;
}
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }

/* ═══════════ Footer ═══════════ */
.site-footer {
    margin-top: 60px; padding: 30px 0;
    background: var(--pink); text-align: center;
    border-top: 1px solid rgba(0,0,0,.08);
}
.footer-links {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.footer-links a {
    font-family: var(--font-nav); font-size: .9rem;
    color: var(--ink); font-weight: 500;
}
.footer-links a:hover { color: var(--gold); }
.footer-social {
    display: flex; justify-content: center; gap: 16px; margin-bottom: 14px;
}
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    color: var(--ink); font-size: 1.2rem;
    transition: color .2s;
}
.footer-social a:hover { color: var(--gold); }
.site-footer p { margin: 4px 0; font-size: .85rem; }
.site-footer .muted { color: var(--muted); }
.footer-logo { height: 24px; width: 24px; display: inline; vertical-align: middle; border-radius: 50%; margin-right: 4px; }

/* ═══════════ Cart ═══════════ */
.cart-link { position: relative; }
.cart-badge {
    background: var(--gold); color: #000; font-size: .7rem; font-weight: 800;
    padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: super;
}
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--gold); font-size: .85rem; color: var(--muted); }
.cart-table td { padding: 12px 8px; border-bottom: 1px solid #e8d8e8; vertical-align: middle; }
.cart-thumb { width: 64px; }
.cart-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.qty-input { width: 60px; padding: 6px 8px; border: 1px solid #ccc; border-radius: 8px; text-align: center; font-size: 1rem; }
.btn-icon { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.btn-icon:hover { color: #c00; }
.cart-footer { display: flex; align-items: center; gap: 20px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.cart-total { font-size: 1.1rem; font-weight: 600; }
.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }

/* Add to cart form */
.add-to-cart-form { margin-top: 20px; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.qty-row label { font-weight: 600; }

/* ═══════════ Checkout ═══════════ */
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 20px 0 40px; align-items: start; }
.checkout-form { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.checkout-summary { background: #f0daf0; border-radius: var(--radius); padding: 28px; }
.checkout-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e0cce0; }
.checkout-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.checkout-item .price { margin-left: auto; }
.checkout-total { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; margin-top: 8px; font-weight: 700; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } }

/* ═══════════ Forms ═══════════ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 1rem; font-family: inherit;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ═══════════ Admin ═══════════ */
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .num { font-size: 2rem; font-weight: 800; }
.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-danger { background: #c00; color: var(--white); }
.btn-danger:hover { background: #a00; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-ok { background: #d4edda; color: #155724; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--gold); font-size: .85rem; color: var(--muted); }
table td { padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: #d4edda; color: #155724; }
.badge-warn { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-muted { background: #eee; color: #666; }

/* SumUp / paiement */
.btn-sumup { background: #0e6ffd; color: var(--white); }
.btn-sumup:hover { background: #0b5cd5; }
.checkmark-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%; background: #22c55e; color: var(--white);
    font-size: 2rem; font-weight: 800; margin-bottom: 16px;
}

/* Payment page */
.payment-page { max-width: 800px; margin: 0 auto; }
.payment-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; margin-top: 20px; align-items: start; }
.payment-card-area { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.payment-summary-inline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.payment-summary-inline p { margin: 0; }
#sumup-card { min-height: 200px; }
.payment-info { background: #f0daf0; border-radius: var(--radius); padding: 24px; }
.payment-info h3 { margin: 0 0 12px; }
.payment-info p { margin: 4px 0; }
.sumup-badge { display: flex; align-items: center; gap: 6px; margin-top: 16px; color: #22c55e; font-size: .85rem; font-weight: 600; }
.payment-msg { padding: 12px 16px; border-radius: 8px; margin-top: 16px; font-weight: 600; }
.payment-msg-info { background: #dbeafe; color: #1e40af; }
.payment-msg-ok { background: #dcfce7; color: #166534; }
.payment-msg-warn { background: #fef3c7; color: #92400e; }
.payment-msg-error { background: #fee2e2; color: #991b1b; }
@media (max-width: 760px) { .payment-grid { grid-template-columns: 1fr; } }

/* ═══════════ Gestion (inline editing) ═══════════ */
.gestion-bar {
    background: #1a1a2e; color: var(--white); font-size: .85rem;
    position: sticky; top: 0; z-index: 100;
}
.gestion-bar-inner {
    display: flex; align-items: center; gap: 16px;
    padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.gestion-label {
    font-weight: 800; color: var(--gold); letter-spacing: .03em;
    padding: 2px 10px; background: rgba(218,165,32,.15); border-radius: 999px;
}
.gestion-link { color: #ccc; font-weight: 500; }
.gestion-link:hover { color: var(--white); }
.gestion-logout { margin-left: auto; color: #f87171; }
.gestion-mode .site-header { position: relative; top: 0; }

.nav-gestion { opacity: .3; font-size: 1.2rem; }
.nav-gestion:hover { opacity: .7; }

.section-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-header h1, .section-header h2 { margin-right: auto; }

.product-card-wrap, .cat-card-wrap { position: relative; }
.g-overlay {
    position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 5;
    opacity: 0; transition: opacity .15s;
}
.product-card-wrap:hover .g-overlay,
.cat-card-wrap:hover .g-overlay { opacity: 1; }

.g-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 1rem; text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.g-btn-edit { background: var(--gold); color: #000; }
.g-btn-edit:hover { background: var(--gold-dark); }
.g-btn-del { background: var(--white); color: #dc2626; }
.g-btn-del:hover { background: #fee2e2; }

.g-btn-add {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: var(--gold); color: #000; font-weight: 700; font-size: .85rem;
    text-decoration: none; white-space: nowrap;
}
.g-btn-add:hover { background: var(--gold-dark); }

.g-btn-inline {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: var(--gold); color: #000; font-weight: 600; font-size: .8rem;
    text-decoration: none; margin-bottom: 8px;
}
.g-btn-inline:hover { background: var(--gold-dark); }

.g-chip-add {
    background: var(--gold); color: #000; font-weight: 800;
    font-size: 1.1rem; padding: 6px 14px;
}

.g-overlay-cat { top: 6px; right: 6px; }

.g-edit-page { max-width: 700px; margin: 0 auto 40px; }
.g-edit-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.g-edit-form { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.g-edit-actions { display: flex; gap: 12px; margin-top: 24px; }
.g-edit-bottom-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; flex-wrap: wrap; gap: 12px; }
.g-dup-form { }
.g-delete-form { }
.btn-danger-outline {
    background: transparent; color: #dc2626; border: 2px solid #dc2626;
    display: inline-block; padding: 8px 18px; border-radius: 999px;
    font-weight: 700; font-size: .85rem; cursor: pointer;
}
.btn-danger-outline:hover { background: #fee2e2; }
.alert-danger { background: #fee2e2; color: #991b1b; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }

.g-toggles { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.g-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.g-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }

.g-current-img { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.g-current-img img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

.g-login-page { display: flex; align-items: center; justify-content: center; min-height: 50vh; }
.g-login-card {
    background: var(--card); border-radius: var(--radius); padding: 36px;
    box-shadow: var(--shadow); max-width: 380px; width: 100%; text-align: center;
}
.g-login-logo { width: 64px; height: 64px; border-radius: 12px; margin: 0 auto 12px; }
.g-login-card h1 { font-size: 1.3rem; margin: 0 0 20px; }

.g-orders-list { display: flex; flex-direction: column; gap: 12px; }
.g-order-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--card); border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow); transition: transform .1s;
}
.g-order-card:hover { transform: translateY(-2px); }
.g-order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.g-order-info { margin-bottom: 6px; }
.g-order-info span { display: block; }
.g-order-bottom { display: flex; justify-content: space-between; align-items: center; }
.g-order-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 30px; }
.g-order-detail-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.g-order-detail-card h3 { margin: 0 0 8px; font-size: .85rem; color: var(--muted); text-transform: uppercase; }
.g-status-form { display: flex; gap: 8px; align-items: center; }
.g-status-select { padding: 6px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: .9rem; }
.g-order-items { display: flex; flex-direction: column; gap: 8px; }
.g-order-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow);
}
.g-order-item-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.g-order-item-info { flex: 1; }
.g-order-item-info strong { display: block; }

.gestion-sep { color: #555; }

/* ═══════════ Catalog grids (écussons, sangles, tissus) ═══════════ */
.catalog-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px; margin-top: 20px;
}
.catalog-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); position: relative; transition: transform .15s;
}
.catalog-card:hover { transform: translateY(-2px); }
.catalog-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.catalog-no-img {
    display: flex; align-items: center; justify-content: center;
    background: #efe0ef; font-size: 2rem;
}
.catalog-color { display: block; }
.catalog-info { padding: 10px 12px; }
.catalog-info strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.catalog-info span { display: block; font-size: .8rem; }
.catalog-actions {
    position: absolute; top: 6px; right: 6px;
    display: flex; gap: 4px; opacity: 0; transition: opacity .15s;
}
.catalog-card:hover .catalog-actions { opacity: 1; }

/* ═══════════ Configurateur sur mesure ═══════════ */
.configurator { max-width: 1000px; margin: 20px auto 40px; }
.config-steps { display: flex; gap: 6px; margin-bottom: 30px; flex-wrap: wrap; justify-content: center; }
.config-step {
    padding: 8px 18px; border-radius: 999px; font-family: var(--font-nav);
    font-weight: 600; font-size: .85rem; cursor: pointer;
    background: var(--card); box-shadow: var(--shadow); border: 2px solid transparent;
    transition: all .2s;
}
.config-step.active { border-color: var(--gold); background: var(--gold); color: #000; }
.config-step.done { border-color: #22c55e; color: #22c55e; }

.config-panel { display: none; }
.config-panel.active { display: block; }

.config-section-title {
    font-family: var(--font-nav); font-weight: 700; font-size: 1.1rem;
    margin: 0 0 16px; color: var(--ink);
}

.config-choices {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.config-choice {
    cursor: pointer; border: 3px solid transparent; border-radius: var(--radius);
    overflow: hidden; transition: all .2s; background: var(--card);
    box-shadow: var(--shadow);
}
.config-choice:hover { transform: scale(1.04); }
.config-choice.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.config-choice img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.config-choice-color {
    width: 100%; aspect-ratio: 1; display: block;
    border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0 0;
}
.config-choice-label {
    padding: 8px; text-align: center; font-size: .8rem; font-weight: 600;
}

/* Patch configurator (full-width section below product grid) */
.patch-configurator {
    margin: 30px 0; padding: 24px; background: var(--card);
    border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Patch placement grid */
.patch-placer {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    align-items: start; margin: 20px 0;
}
.patch-drop-zone {
    position: relative; background: #efe0ef; border-radius: var(--radius);
    overflow: hidden; user-select: none; touch-action: none;
}
.patch-drop-zone .patron-img { width: 100%; display: block; }
.patch-drop-zone .patch-zone-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.patch-zone-preview {
    position: absolute; transform: translate(-50%, -50%);
    width: 50px; height: 50px; z-index: 2; pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}
.patch-zone-preview img { width: 100%; height: 100%; object-fit: contain; }
.patch-marker {
    position: absolute; transform: translate(-50%, -50%);
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--gold); border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.3); z-index: 3;
    pointer-events: none;
}
.patch-feedback {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.75); color: #fff; padding: 4px 14px;
    border-radius: 20px; font-size: .8rem; opacity: 0; transition: opacity .3s;
    pointer-events: none; white-space: nowrap; z-index: 4;
}
.patch-feedback.show { opacity: 1; }
.patch-placement-info {
    font-size: .85rem; margin: 8px 0 0; min-height: 1.4em; color: var(--gold-dark);
}
.patch-cat-filter { display: flex; gap: 6px; flex-wrap: wrap; }

.patch-picker {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px;
}
.patch-option {
    cursor: pointer; border: 3px solid transparent; border-radius: 8px;
    overflow: hidden; transition: all .2s; background: var(--card);
}
.patch-option:hover { transform: scale(1.05); }
.patch-option.selected { border-color: var(--gold); }
.patch-option img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.patch-option-label { text-align: center; font-size: .75rem; padding: 4px; font-weight: 600; }

/* Config summary */
.config-summary {
    background: var(--card); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); margin-top: 20px;
}
.config-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #eee;
}
.config-summary-row:last-child { border-bottom: none; }
.config-summary-label { font-weight: 600; color: var(--muted); font-size: .85rem; }
.config-summary-value { font-weight: 700; }
.config-summary-total {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; margin-top: 8px; border-top: 2px solid var(--gold);
    font-size: 1.2rem; font-weight: 800;
}

.config-nav { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* Events */
.events-list { display: flex; flex-direction: column; gap: 16px; }
.event-item {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 16px; border-radius: 12px;
    background: var(--bg-card, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.event-date {
    min-width: 140px; font-weight: 700; color: var(--gold);
    font-size: .95rem; white-space: nowrap;
}

/* Reviews */
.reviews-grid { display: flex; flex-direction: column; gap: 20px; }
.review-card {
    padding: 24px; border-radius: 12px;
    background: var(--bg-card, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 2px; }
.review-product { font-size: .85rem; color: #888; margin-bottom: 12px; }
.review-card blockquote {
    margin: 0; padding: 0; font-style: italic; line-height: 1.7;
    border: none; color: inherit;
}

/* ═══════════ Médiathèque ═══════════ */
.g-media-upload-form { margin-bottom: 30px; }
.g-media-upload-zone {
    border: 2px dashed #ccc; border-radius: var(--radius); padding: 40px 20px;
    text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.g-media-upload-zone:hover, .g-media-upload-zone.drag-over {
    border-color: var(--gold); background: rgba(255,193,7,.05);
}
.g-media-upload-icon { font-size: 2.5rem; margin-bottom: 8px; }
.g-media-file-input { display: none; }
.g-media-preview-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.g-media-preview-row { display: flex; gap: 20px; align-items: flex-start; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.g-media-preview-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.g-media-upload-meta { flex: 1; }
.g-media-upload-meta .form-group { margin-bottom: 6px; }
.g-media-upload-meta label { font-size: .8rem; }
.g-media-upload-meta input { padding: 5px 8px; font-size: .85rem; }

.g-media-preview-row.uploading { opacity: .7; }
.g-media-preview-row.uploaded { opacity: .5; }
.g-upload-file-status { font-size: .8rem; margin-top: 4px; font-weight: 500; }
.g-upload-file-status.uploading { color: #2563eb; }
.g-upload-file-status.success { color: #16a34a; }
.g-upload-file-status.error { color: #dc2626; }

.g-upload-progress-bar { width: 100%; height: 10px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.g-upload-progress-fill { height: 100%; background: var(--gold); border-radius: 6px; transition: width .3s ease; width: 0; }
.g-upload-progress-text { font-size: .85rem; font-weight: 500; text-align: center; }

.g-media-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.btn-sm { padding: 5px 14px; font-size: .8rem; }
.btn-active { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-active:hover { background: #e6a800; }

.g-media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.g-media-card {
    text-decoration: none; color: inherit; border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow); overflow: hidden;
    transition: transform .1s;
}
.g-media-card:hover { transform: translateY(-2px); }
.g-media-card-img { aspect-ratio: 1; overflow: hidden; }
.g-media-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-media-card-info { padding: 10px 12px; }
.g-media-card-info strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-media-card-info .muted { font-size: .75rem; }

.g-tags-list { display: flex; flex-direction: column; gap: 2px; }
.g-tag-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border-radius: var(--radius); }
.g-tag-parent { font-weight: 600; }
.g-tag-child { padding-left: 32px; font-weight: 400; }
.g-tag-name { flex: 1; }
.g-tag-actions { display: flex; gap: 6px; align-items: center; }

.stock-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.stock-table th { text-align: left; padding: 8px 12px; font-size: .8rem; color: var(--muted); border-bottom: 2px solid #eee; }
.stock-table td { padding: 6px 12px; border-bottom: 1px solid #f0f0f0; font-size: .85rem; vertical-align: middle; }
.stock-table .qty-input { width: 70px; }
.stock-zero td { background: #fff5f5; }
.stock-ok { color: #4caf50; font-weight: 600; font-size: .8rem; }
.stock-out { color: #e53935; font-weight: 600; font-size: .8rem; }
.stock-hidden td { opacity: .5; }
.badge-hidden { display: inline-block; background: #9e9e9e; color: #fff; font-size: .65rem; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.badge-featured { font-size: .7rem; margin-left: 4px; vertical-align: middle; }

.products-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.products-select-all { margin: 0; }
.products-bulk { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.products-filter { margin-bottom: 12px; }
.search-wrap { position: relative; display: inline-block; width: 100%; max-width: 350px; }
.input-search { width: 100%; padding: 8px 30px 8px 12px; border: 1px solid #ddd; border-radius: var(--radius); font-size: .85rem; box-sizing: border-box; }
.input-search:focus { outline: none; border-color: var(--gold); }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.1rem; color: #999; cursor: pointer; padding: 2px 6px; line-height: 1; }
.search-clear:hover { color: var(--ink); }
.products-table { width: 100%; border-collapse: collapse; }
.products-table th { text-align: left; padding: 8px 10px; font-size: .75rem; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid #eee; user-select: none; }
.sortable { cursor: pointer; position: relative; }
.sortable:hover { color: var(--ink); }
.sortable::after { content: '⇅'; margin-left: 4px; opacity: .3; font-size: .7rem; }
.sort-asc::after { content: '▲'; opacity: .7; }
.sort-desc::after { content: '▼'; opacity: .7; }
.products-table td { padding: 8px 10px; border-bottom: 1px solid #f5f5f5; font-size: .85rem; vertical-align: middle; }
.products-table tr:hover td { background: #fafafa; }
.products-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.products-no-img { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 1.2rem; }
.product-name { color: var(--ink); text-decoration: none; font-weight: 600; }
.product-name:hover { color: var(--gold); }
.product-actions { white-space: nowrap; }
.product-actions .g-btn { width: 28px; height: 28px; font-size: .85rem; }
.g-btn-dup { background: var(--bg); color: var(--ink); }
.g-btn-dup:hover { background: #e0e0e0; }
.g-btn-hide { background: var(--bg); color: var(--ink); font-size: .75rem; }
.g-btn-hide:hover { background: #e0e0e0; }
.g-btn-show { background: #e8f5e9; color: #2e7d32; font-size: .75rem; }
.g-btn-show:hover { background: #c8e6c9; }
.row-hidden td { opacity: .55; }
.row-hidden:hover td { opacity: .85; }
.row-oos td:nth-child(6), .row-oos td:nth-child(7) { color: #e53935; }
.btn-danger { color: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #fee2e2; }

.g-media-detail { display: flex; gap: 24px; flex-wrap: wrap; }
.g-media-detail-img { flex: 1 1 300px; }
.g-media-detail-img img { width: 100%; border-radius: var(--radius); }
.g-media-detail-meta { flex: 1 1 250px; }
.g-media-info-table { width: 100%; border-collapse: collapse; }
.g-media-info-table th { text-align: left; padding: 6px 12px 6px 0; color: var(--muted); font-weight: 500; white-space: nowrap; font-size: .85rem; }
.g-media-info-table td { padding: 6px 0; font-size: .85rem; }
.g-media-url-input { width: 100%; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: .8rem; background: var(--bg); cursor: pointer; }

/* Gallery picker modal */
.g-img-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.gallery-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.gallery-modal-content { background: var(--white); border-radius: var(--radius); width: 90%; max-width: 800px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 40px rgba(0,0,0,.25); }
.gallery-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid #eee; }
.gallery-modal-header h3 { margin: 0; font-size: 1.1rem; }
.btn-icon { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.gallery-search { padding: 10px 20px 0; }
.gallery-search input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: var(--radius); font-size: .85rem; }
.gallery-search input:focus { outline: none; border-color: var(--gold); }
.gallery-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; padding: 16px; overflow-y: auto; }
.gallery-thumb { cursor: pointer; border-radius: 8px; border: 3px solid transparent; transition: border-color .15s; background: var(--bg); }
.gallery-thumb:hover { border-color: var(--gold); }
.gallery-thumb-img { position: relative; width: 100%; padding-bottom: 100%; overflow: hidden; border-radius: 5px 5px 0 0; }
.gallery-thumb-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb-label { padding: 4px 6px; font-size: .7rem; color: var(--dark); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; background: var(--bg); }

.flash-msg { background: #e8f5e9; color: #2e7d32; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }

@media (max-width: 760px) {
    .g-overlay { opacity: 1; }
    .g-edit-form { padding: 20px; }
    .gestion-bar-inner { font-size: .8rem; gap: 10px; }
    .brand-logo { width: 180px; }
    .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .patch-placer { grid-template-columns: 1fr; }
    .config-choices { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .g-media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .g-media-preview-row { flex-direction: column; }
    .g-media-preview-thumb { width: 100%; height: auto; max-height: 200px; }
    .g-media-detail { flex-direction: column; }
}
