/* ==================== VARIABLES & RESET ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

:root {
    --primary: #14141f;
    --primary-soft: #1f1f2e;
    --accent: #e94560;
    --accent-hover: #d63652;
    --accent-soft: #fdeef1;
    --gold: #c9a15a;
    --bg: #faf9f7;
    --card-bg: #ffffff;
    --border: #ece9e4;
    --text: #1a1a22;
    --text-muted: #7a7a8c;
    --success: #1e9e5a;
    --success-bg: #e5f8ee;
    --error: #d43f3f;
    --error-bg: #fdeaea;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(20,20,31,.06);
    --shadow-md: 0 8px 24px rgba(20,20,31,.08);
    --shadow-lg: 0 20px 48px rgba(20,20,31,.14);
    --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--accent); }
.container { max-width: 1220px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; margin-bottom: 1rem; }
h2 { font-size: 1.4rem; margin-bottom: .8rem; }
h3 { font-size: 1.1rem; margin-bottom: .5rem; }
p { margin-bottom: .6rem; }

/* ==================== HEADER ==================== */
.site-header { background: var(--primary); color: #fff; padding: 14px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.logo { font-size: 1.3rem; font-weight: 700; color: #fff; }
.main-nav a { color: #d6d6e6; margin-right: 18px; font-weight: 500; }
.main-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-link { color: #d6d6e6; font-weight: 500; }
.header-link:hover { color: #fff; }
.admin-link { color: #ffd166; }
.cart-link { position: relative; }
.badge {
    background: var(--accent); color: #fff; border-radius: 50%;
    padding: 2px 7px; font-size: .72rem; margin-left: 4px;
}

/* Bouton hamburger (masqué sur desktop) */
.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cart-link-mobile { display: none; color: #fff; font-size: 1.1rem; }

/* Panneau menu mobile (masqué sur desktop) */
.mobile-nav {
    display: none; flex-direction: column; background: var(--primary);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
}
.mobile-nav.open { display: flex; max-height: 600px; }
.mobile-nav a {
    color: #e4e4f0; padding: 14px 20px; font-weight: 500; border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 8px;
}
.mobile-nav a:active { background: rgba(255,255,255,.06); }
.mobile-nav hr { border-color: rgba(255,255,255,.15); margin: 0; }
body.nav-open { overflow: hidden; }

/* ==================== ALERTS ==================== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 14px 0; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b7ecd0; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f3c1c1; }

/* ==================== HERO / HOME ==================== */
.hero {
    text-align: center; padding: 64px 20px 40px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.6rem; margin-bottom: .5rem; }
.hero p { color: var(--text-muted); margin-bottom: 28px; font-size: 1.05rem; }

/* ---- Barre de recherche avancée avec suggestions ---- */
.search-wrap { max-width: 480px; margin: 0 auto; position: relative; }
.search-form { display: flex; gap: 8px; }
.search-form input {
    flex: 1; padding: 14px 18px; border-radius: 50px; border: 1px solid var(--border);
    font-size: .95rem; background: #fff; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s;
}
.search-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-form button {
    border-radius: 50px; padding: 14px 26px;
}
.search-suggestions {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff;
    border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    overflow: hidden; z-index: 50; text-align: left; display: none;
}
.search-suggestions.open { display: block; }
.search-suggestion-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; transition: background .12s;
}
.search-suggestion-item:hover, .search-suggestion-item.highlighted { background: var(--bg); }
.search-suggestion-item img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #f0f0f5; flex-shrink: 0; }
.search-suggestion-item .sugg-info { flex: 1; min-width: 0; }
.search-suggestion-item .sugg-name { font-weight: 600; font-size: .88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggestion-item .sugg-price { font-size: .8rem; color: var(--accent); font-weight: 600; }
.search-suggestion-empty { padding: 16px; color: var(--text-muted); font-size: .88rem; text-align: center; }
.search-suggestion-footer { padding: 10px 16px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--accent); font-weight: 600; text-align: center; }

/* ---- Filtres & tri ---- */
.toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0 18px; }
.category-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.category-filters a {
    padding: 9px 18px; border-radius: 50px; background: #fff; border: 1px solid var(--border);
    color: var(--text); font-size: .86rem; font-weight: 500; transition: all .15s;
}
.category-filters a.active, .category-filters a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.sort-select {
    padding: 9px 16px; border-radius: 50px; border: 1px solid var(--border); background: #fff;
    font-size: .86rem; font-weight: 500; color: var(--text); cursor: pointer;
}

/* ==================== PRODUCT GRID ==================== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px; margin: 10px 0 60px; }
.product-card {
    background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; display: block;
    position: relative;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.product-image { height: 260px; background: #f3f2ee; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.product-card:hover .product-image img { transform: scale(1.06); }
.no-image { font-size: 2.4rem; color: #d7d5cf; }
.no-image.large { font-size: 6rem; height: 340px; display: flex; align-items: center; justify-content: center; background: #f3f2ee; border-radius: var(--radius); }
.product-info { padding: 16px 16px 18px; }
.product-info h3 { font-family: var(--font-body); font-weight: 600; font-size: .95rem; color: var(--text); margin-bottom: 4px; }
.price { color: var(--text); font-weight: 700; margin-top: 2px; font-size: 1.02rem; }
.product-quickadd {
    position: absolute; bottom: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%;
    background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s, background .15s;
    box-shadow: var(--shadow-md);
}
.product-card:hover .product-quickadd { opacity: 1; transform: translateY(0); }
.product-quickadd:hover { background: var(--accent); }

/* ==================== PRODUCT DETAIL ==================== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 30px 0 60px; align-items: start; }
.product-detail > * { min-width: 0; }
.category-tag { color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.price-large { font-size: 1.8rem; color: var(--accent); font-weight: 700; margin: 10px 0; }
.variant-form { display: flex; flex-direction: column; gap: 14px; max-width: 320px; margin-top: 20px; }
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }

/* ==================== FORMS ==================== */
.form-page { max-width: 480px; margin: 40px auto; }
.card-form { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card-form label { display: flex; flex-direction: column; font-size: .88rem; font-weight: 600; color: var(--text); gap: 5px; }
.card-form input, .card-form select, .card-form textarea {
    padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: .95rem; font-weight: 400;
    font-family: inherit; background: #fff;
}
.card-form input:focus, .card-form select:focus, .card-form textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: end; gap: 12px; }
.inline-form label { min-width: 140px; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block; padding: 11px 20px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    font-weight: 600; font-size: .88rem; text-align: center; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-soft); box-shadow: var(--shadow-md); }
.btn-secondary { background: #eceff4; color: var(--text); }
.btn-secondary:hover { background: #dfe3ea; }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: #f7d4d4; }
.btn-small { padding: 6px 12px; font-size: .8rem; }
.btn-large { padding: 15px 28px; font-size: .95rem; border-radius: var(--radius-sm); }

/* ==================== CART / CHECKOUT ==================== */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.cart-table, .admin-table { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td, .admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; }
.cart-table th, .admin-table th { background: #f0f0f7; font-weight: 700; color: var(--text-muted); font-size: .8rem; text-transform: uppercase; }
.cart-summary { max-width: 420px; margin: 30px 0; background: var(--card-bg); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); }
.promo-form { display: flex; gap: 8px; align-items: end; margin-bottom: 16px; }
.promo-form label { flex: 1; display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; gap: 4px; }
.promo-form input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
.totals-table { width: 100%; margin: 10px 0; }
.totals-table td { padding: 6px 0; }
.total-row td { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 10px; }

.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; margin: 20px 0 60px; }
.order-summary { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; height: fit-content; }
.summary-list { list-style: none; margin-bottom: 14px; }
.summary-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
@media (max-width: 760px) { .checkout-layout { grid-template-columns: 1fr; } }

.confirmation-box { max-width: 600px; margin: 40px auto; background: var(--card-bg); padding: 30px; border-radius: var(--radius); border: 1px solid var(--border); }
.confirmation-box .btn { margin-right: 10px; margin-top: 16px; }

/* ==================== STATUS BADGES ==================== */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; text-transform: capitalize; }
.status-en_attente { background: #fff3cd; color: #8a6d1d; }
.status-payee { background: #d7ecff; color: #1a5c9a; }
.status-en_preparation { background: #e6d9ff; color: #5b32a3; }
.status-expediee { background: #d0e9ff; color: #1c5f9e; }
.status-livree { background: var(--success-bg); color: var(--success); }
.status-annulee { background: var(--error-bg); color: var(--error); }
.badge-stock { background: #eceff4; padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: .8rem; }

/* ==================== TABS ==================== */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 18px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

/* ==================== FOOTER ==================== */
.site-footer { background: var(--primary); color: #b8b8c8; margin-top: 60px; }
.footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
    padding: 44px 20px 34px;
}
.footer-brand .footer-logo { font-size: 1.25rem; font-weight: 700; color: #fff; display: inline-block; margin-bottom: 10px; }
.footer-tagline { color: #9c9cb0; font-size: .88rem; max-width: 260px; line-height: 1.6; }
.footer-col h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: #b8b8c8; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-col li { color: #9c9cb0; font-size: .9rem; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom-inner {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 16px 20px; font-size: .8rem; color: #8484a0;
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 34px 20px 26px; }
    .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
.main-content { min-height: 60vh; padding-bottom: 20px; }

/* ==================== ADMIN LAYOUT ==================== */
.admin-body { background: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--primary); color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-logo { font-weight: 700; font-size: 1.1rem; padding: 0 20px 20px; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a { color: #c8c8da; padding: 11px 20px; font-weight: 500; font-size: .92rem; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav hr { border-color: rgba(255,255,255,.15); margin: 10px 20px; }
.admin-content { flex: 1; padding: 30px 36px; overflow-x: auto; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: .85rem; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .admin-grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.admin-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }
.admin-thumb.no-image { display: flex; align-items: center; justify-content: center; background: #f0f0f5; font-size: 1.2rem; }
.admin-thumb-large { max-width: 200px; border-radius: 8px; margin: 8px 0; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar a { padding: 6px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--border); font-size: .85rem; color: var(--text); }
.filter-bar a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.row-warning { background: #fff8e6; }
.hint { color: var(--text-muted); font-style: italic; }

/* ==================== ADMIN TOPBAR (mobile) ==================== */
.admin-topbar {
    display: none; align-items: center; gap: 14px; background: var(--primary); color: #fff;
    padding: 12px 16px; position: sticky; top: 0; z-index: 200;
}
.admin-topbar-title { font-weight: 700; font-size: 1rem; }
.admin-nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 36px; height: 36px; background: none; border: none; cursor: pointer; padding: 0;
}
.admin-nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 190; }
.admin-overlay.open { display: block; }

/* ==================== RESPONSIVE : TABLETTE (≤ 900px) ==================== */
@media (max-width: 900px) {
    .admin-grid-2 { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; gap: 24px; }
}

/* ==================== RESPONSIVE : MOBILE (≤ 720px) ==================== */
@media (max-width: 720px) {
    .container { padding: 0 16px; }

    /* --- Navigation client --- */
    .main-nav, .header-actions { display: none; }
    .nav-toggle { display: flex; }
    .cart-link-mobile { display: inline-flex; align-items: center; gap: 2px; }
    .header-inner { flex-wrap: nowrap; }
    .logo { flex: 1; }

    /* --- Titres et espacement --- */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.15rem; }
    .hero { padding: 30px 0 20px; }
    .hero h1 { font-size: 1.7rem; }

    /* --- Grilles produits --- */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-image { height: 140px; }
    .category-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .category-filters a { flex-shrink: 0; }
    .search-form { max-width: 100%; }

    /* --- Formulaires --- */
    .form-row { grid-template-columns: 1fr; }
    .form-page { margin: 20px auto; max-width: 100%; }
    .card-form { padding: 18px; }
    .card-form input, .card-form select, .card-form textarea { font-size: 16px; } /* évite le zoom auto iOS */
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form label { min-width: 0; }

    /* --- Boutons pleine largeur pour actions principales --- */
    .btn-large { width: 100%; }
    .checkout-layout .card-form .btn-large { width: 100%; }
    .confirmation-box .btn { display: block; width: 100%; margin: 8px 0 0; }

    /* --- Panier --- */
    .cart-summary { max-width: 100%; }
    .promo-form { flex-direction: column; align-items: stretch; }

    /* --- Tableaux : garantir le défilement horizontal fluide --- */
    .cart-table, .admin-table { min-width: 500px; }
    .cart-table td, .cart-table th, .admin-table td, .admin-table th { padding: 10px; font-size: .82rem; }

    /* --- Tabs compte client --- */
    .tabs { overflow-x: auto; white-space: nowrap; }

    /* --- Zones tactiles confortables --- */
    .btn, .btn-small { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .category-filters a, .filter-bar a, .tabs a { min-height: 38px; display: inline-flex; align-items: center; }
    select, input[type="number"], input[type="text"], input[type="email"], input[type="password"], input[type="date"] { min-height: 40px; }

    /* --- Admin : sidebar devient un tiroir --- */
    .admin-topbar { display: flex; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 210;
        transform: translateX(-100%); transition: transform .25s ease;
        width: 250px; overflow-y: auto;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { padding: 18px 16px; width: 100%; }
    .page-header-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-header-row .btn { width: 100%; text-align: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter-bar a { flex-shrink: 0; }

    /* --- Boutons d'action groupés dans les tableaux : empilement tactile --- */
    .admin-table form { margin-bottom: 4px; }
}

/* ==================== RESPONSIVE : TRÈS PETIT ÉCRAN (≤ 420px) ==================== */
@media (max-width: 420px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-info { padding: 10px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ==================== GALERIE IMAGES PAR COULEUR (admin) ==================== */
.variant-image-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.variant-image-item { position: relative; width: 100px; }
.variant-image-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.variant-image-item form { position: absolute; top: -8px; right: -8px; }
.variant-image-item .btn-small { padding: 3px 8px; border-radius: 50%; line-height: 1; }

/* ==================== GALERIE PRODUIT (client) ==================== */
.product-detail-image { display: flex; gap: 14px; max-width: 100%; align-self: start; }
.product-detail-image > * { min-width: 0; }
.gallery-main {
    background: #f3f2ee; border-radius: var(--radius); overflow: hidden; flex: 1; order: 2;
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs {
    display: flex; flex-direction: column; gap: 10px; width: 78px; flex-shrink: 0; order: 1;
    max-height: 520px; overflow-y: auto; padding-right: 2px;
}
.gallery-thumbs::-webkit-scrollbar { width: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.gallery-thumb {
    width: 78px; height: 78px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer;
    border: 2px solid transparent; opacity: .65; transition: opacity .18s, border-color .18s, transform .18s;
    flex-shrink: 0; background: #f3f2ee;
}
.gallery-thumb:hover { opacity: 1; transform: scale(1.03); }
.gallery-thumb.active { border-color: var(--primary); opacity: 1; box-shadow: var(--shadow-sm); }

@media (max-width: 720px) {
    .product-detail-image { flex-direction: column; }
    .gallery-main { order: 1; }
    .gallery-thumbs {
        order: 2; flex-direction: row; width: auto; max-height: none; overflow-x: auto; overflow-y: visible;
        padding-right: 0; padding-bottom: 2px;
    }
    .gallery-thumb { width: 58px; height: 58px; }
}

/* Le placeholder "pas d'image" doit remplir le conteneur carré de la galerie */
.gallery-main .no-image.large { width: 100%; height: 100%; border-radius: 0; }

/* Colonne d'upload d'images dans le tableau des variantes */
.admin-table input[type="file"] { font-size: .78rem; padding: 2px; }

/* ==================== FILTRES AVANCÉS & ÉTAT VIDE ==================== */
.filter-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-input { width: 90px; padding: 9px 12px; border-radius: 50px; border: 1px solid var(--border); font-size: .84rem; background: #fff; }
.price-sep { color: var(--text-muted); }
.result-count { color: var(--text-muted); font-size: 1rem; font-weight: 400; font-family: var(--font-body); }

.empty-state {
    grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: #fff;
    border-radius: var(--radius); border: 1px dashed var(--border);
}
.empty-state-icon { font-size: 2.4rem; margin-bottom: 10px; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

/* ==================== FICHE PRODUIT PREMIUM ==================== */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-muted); margin: 18px 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.category-tag { color: var(--gold); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.price-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.price-large { font-size: 1.9rem; font-weight: 700; font-family: var(--font-display); }
.stock-badge { padding: 5px 12px; border-radius: 20px; font-size: .76rem; font-weight: 700; }
.stock-ok { background: var(--success-bg); color: var(--success); }
.stock-low { background: #fff3cd; color: #8a6d1d; }
.stock-out { background: var(--error-bg); color: var(--error); }
.product-description { color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; overflow-wrap: anywhere; word-break: break-word; }

.variant-form { display: flex; flex-direction: column; gap: 20px; max-width: 420px; margin-top: 10px; }
.selector-group { display: flex; flex-direction: column; gap: 10px; }
.selector-label { font-size: .84rem; font-weight: 600; color: var(--text); }
.selector-label strong { color: var(--accent); font-weight: 700; margin-left: 4px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-pill {
    padding: 9px 18px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff;
    font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .15s; color: var(--text);
}
.swatch-pill:hover { border-color: var(--text); }
.swatch-pill.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.swatch-pill:disabled, .swatch-pill.unavailable {
    opacity: .4; cursor: not-allowed; text-decoration: line-through; border-style: dashed;
    background: #fff; color: var(--text-muted);
}
.swatch-pill:disabled:hover { border-color: var(--border); }
.swatch-size { min-width: 46px; text-align: center; }
.variant-stock-hint { font-size: .82rem; color: var(--error); min-height: 1.2em; }

.add-to-cart-row { display: flex; gap: 12px; align-items: stretch; }
.qty-stepper { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-stepper button {
    width: 40px; background: #fff; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text);
    transition: background .12s;
}
.qty-stepper button:hover { background: var(--bg); }
.qty-stepper input {
    width: 46px; text-align: center; border: none; border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border);
    font-size: .95rem; padding: 10px 0; -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-to-cart-row .btn-large { flex: 1; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Barre d'achat sticky (mobile) */
.sticky-cart-bar {
    position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border);
    padding: 12px 16px; display: none; align-items: center; justify-content: space-between; gap: 14px;
    box-shadow: 0 -6px 20px rgba(0,0,0,.08); z-index: 150; transform: translateY(100%); transition: transform .25s ease;
}
.sticky-cart-bar.visible { transform: translateY(0); }
.sticky-cart-price { font-weight: 700; font-size: 1.1rem; font-family: var(--font-display); }
@media (max-width: 720px) {
    .sticky-cart-bar { display: flex; }
    .add-to-cart-row .btn-large { min-height: 46px; }
}

/* ==================== PANIER PREMIUM ==================== */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 30px; margin: 20px 0 60px; align-items: start; }
.cart-items-list { display: flex; flex-direction: column; gap: 14px; }
.cart-item-card {
    display: flex; gap: 16px; background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; align-items: center; transition: box-shadow .15s;
}
.cart-item-card:hover { box-shadow: var(--shadow-sm); }
.cart-item-thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #f3f2ee; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-details h3 { font-family: var(--font-body); font-size: .96rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-variant { font-size: .82rem; color: var(--text-muted); margin-bottom: 4px; }
.cart-item-unit-price { font-size: .8rem; color: var(--text-muted); margin-bottom: 0; }
.cart-item-warning { font-size: .78rem; color: #b8860b; margin-top: 4px; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item-subtotal { font-weight: 700; font-size: .98rem; white-space: nowrap; }
.cart-item-remove {
    background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .95rem;
    padding: 4px; border-radius: 6px; transition: color .15s, background .15s;
}
.cart-item-remove:hover { color: var(--error); background: var(--error-bg); }
.cart-qty-input { width: 42px !important; }

.cart-summary {
    background: var(--card-bg); padding: 22px; border-radius: var(--radius); border: 1px solid var(--border);
    position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px;
}
.promo-form { display: flex; gap: 8px; align-items: end; }
.promo-form label { flex: 1; display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; gap: 4px; }
.promo-form input { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); }
.promo-applied {
    display: flex; justify-content: space-between; align-items: center; background: var(--success-bg);
    color: var(--success); padding: 10px 14px; border-radius: 8px; font-size: .86rem;
}
.promo-remove-btn { background: none; border: none; color: var(--success); cursor: pointer; font-weight: 700; }
.totals-discount-row td { color: var(--success); }
.continue-shopping-link { text-align: center; font-size: .86rem; color: var(--text-muted); }
.continue-shopping-link:hover { color: var(--accent); }

@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}
@media (max-width: 560px) {
    .cart-item-card { flex-wrap: wrap; }
    .cart-item-actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; margin-top: 8px; }
}

/* ==================== BANNIÈRE PUBLICITAIRE (accueil) ==================== */
.promo-section { display: flex; flex-direction: column; gap: 18px; margin: 44px 0; }
.promo-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    background: linear-gradient(120deg, var(--primary) 0%, #2a2a40 100%); color: #fff;
    border-radius: var(--radius); padding: 56px 56px; overflow: hidden; position: relative;
    min-height: 200px;
}
.promo-banner-main { min-height: 340px; padding: 70px 60px; }
.promo-banner-bg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: .5;
}
.promo-banner-bg + .promo-banner-text { position: relative; z-index: 1; }
.promo-banner::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,31,.75) 20%, rgba(20,20,31,.15) 100%);
    z-index: 0; pointer-events: none;
}
.promo-banner-text { max-width: 520px; position: relative; z-index: 1; }
.promo-banner-tag {
    display: inline-block; background: rgba(255,255,255,.12); color: var(--gold); font-size: .76rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 6px 14px; border-radius: 20px;
    margin-bottom: 14px;
}
.promo-banner-main h2 { font-size: 2.1rem; }
.promo-banner h2 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.promo-banner p { color: #d4d4e2; margin-bottom: 20px; font-size: 1rem; }
.promo-banner .btn-primary { background: #fff; color: var(--primary); }
.promo-banner .btn-primary:hover { background: var(--gold); color: #fff; }
.promo-banner-visual { font-size: 6.5rem; opacity: .9; flex-shrink: 0; position: relative; z-index: 1; }
.promo-banner-main .promo-banner-visual { font-size: 8.5rem; }

@media (max-width: 720px) {
    .promo-banner { flex-direction: column; text-align: center; padding: 40px 26px; }
    .promo-banner-main { padding: 44px 26px; min-height: 260px; }
    .promo-banner-text { max-width: 100%; }
    .promo-banner-visual { font-size: 4.2rem; }
    .promo-banner-main h2 { font-size: 1.6rem; }
}

/* ==================== EN-TÊTES DE SECTION (accueil) ==================== */
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 44px 0 4px; }
.section-heading h2 { margin-bottom: 0; }
.section-link { font-size: .86rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.section-subtitle { color: var(--text-muted); font-size: .92rem; margin-bottom: 18px; }

/* ==================== PAGE DE RECHERCHE ==================== */
.search-page-header { padding: 30px 0 10px; text-align: center; }
.search-wrap-page { max-width: 560px; margin: 18px auto 0; }

/* ==================== LISTE PUBLICITÉS (admin) ==================== */
.pub-list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.pub-list-item:last-child { border-bottom: none; }
.pub-list-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.pub-list-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pub-list-info .hint { font-size: .8rem; }
.pub-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Liste de contact dans le footer (marque) */
.footer-contact-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.footer-contact-list li { color: #9c9cb0; font-size: .85rem; }
.footer-contact-list a { color: #b8b8c8; }
.footer-contact-list a:hover { color: #fff; }

/* ==================== PAGES LÉGALES ==================== */
.legal-page { max-width: 760px; margin: 30px auto 60px; background: var(--card-bg); padding: 40px 44px; border-radius: var(--radius); border: 1px solid var(--border); }
.legal-updated { color: var(--text-muted); font-size: .85rem; margin-bottom: 24px; }
.legal-page h2 { font-size: 1.15rem; margin-top: 28px; margin-bottom: 10px; }
.legal-page p { color: var(--text); line-height: 1.75; margin-bottom: 12px; }
.legal-page ul { margin: 0 0 14px 20px; }
.legal-page li { margin-bottom: 6px; line-height: 1.6; }
.legal-page a { text-decoration: underline; }
@media (max-width: 720px) {
    .legal-page { padding: 26px 22px; margin: 16px auto 40px; }
}
