/* ═══════════════════════════════════════════════════════════
   Chenfy Design System — E-commerce moderne
   Palette : Bleu #2563eb → Violet #7c3aed (dégradé)
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-warm: #f1f5f9;
    --surface-muted: #e2e8f0;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --brand: #2563eb;
    --brand-deep: #1d4ed8;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-soft: #ede9fe;
    --accent-deep: #5b21b6;
    --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --gradient-soft: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);

    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 3px rgba(15,23,42,.06);
    --shadow-md: 0 8px 24px rgba(15,23,42,.08);
    --shadow-lg: 0 20px 50px rgba(15,23,42,.12);
    --focus-ring: 0 0 0 3px rgba(37,99,235,.25);
    --transition: .2s ease;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Manrope, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }

/* ─── Utilities ─── */
.container { width: min(100% - 2rem, 1280px); margin: 0 auto; }
.container-narrow { width: min(100% - 2rem, 900px); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }

/* PLACEHOLDER - MORE CSS BELOW */

/* ─── Layout ─── */
.shell { min-height: 100dvh; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1 0 auto; }
.page { padding: 2.5rem 0 4rem; }

/* ─── Topbar ─── */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(248,250,252,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; padding: .5rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; }
.brand-dark { color: var(--text); }
.brand-gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-mark { color: var(--accent); }

/* ─── Navigation ─── */
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a, .nav-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: var(--radius-full); font-weight: 600; font-size: .875rem; color: var(--text-soft); border: 1px solid transparent; background: transparent; cursor: pointer; transition: all var(--transition); }
.nav a:hover, .nav-btn:hover { background: var(--surface-warm); color: var(--text); }
.nav-cta { background: var(--gradient) !important; color: #fff !important; border-color: transparent !important; }
.nav-cta:hover { opacity: .9 !important; }

/* Mobile nav */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); cursor: pointer; }
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }
.nav-toggle span + span { margin-top: 4px; }

@media (max-width: 768px) {
    .nav-toggle { display: flex; flex-direction: column; }
    .nav { position: fixed; top: 0; right: 0; width: min(80vw, 300px); height: 100dvh; flex-direction: column; align-items: stretch; padding: 1.5rem; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .3s ease; z-index: 100; gap: .5rem; }
    .nav.is-open { transform: translateX(0); }
    .nav a, .nav-btn { width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm); justify-content: flex-start; }
    .nav-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s; }
    .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.25rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem; cursor: pointer; transition: all var(--transition); min-height: 44px; text-align: center; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--gradient); color: #fff; border-color: transparent; }
.btn-primary:hover { opacity: .9; }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(220,38,38,.15); }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; color: var(--text-soft); padding: .5rem .75rem; }
.btn-ghost:hover { color: var(--brand); background: var(--accent-soft); }

/* ─── Cards ─── */
.card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.5rem; transition: box-shadow var(--transition), transform var(--transition); }
.card:hover { box-shadow: var(--shadow-md); }
.card-warm { background: var(--surface-warm); border-color: var(--border); }
.card-accent { background: var(--accent-soft); border-color: rgba(245,158,11,.2); }
.card-dark { background: var(--brand); color: #fff; border-color: transparent; }
.card-dark .text-muted { color: rgba(255,255,255,.7); }

/* ─── Product cards ─── */
.product-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.product-card { display: flex; flex-direction: column; gap: .75rem; overflow: hidden; padding: 0; }
.product-card .product-img { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.product-card .product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .product-img img { transform: scale(1.04); }
.product-card .product-body { padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-card .product-category { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-deep); }
.product-card .product-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.product-card .product-desc { font-size: .875rem; color: var(--muted); line-height: 1.5; flex: 1; }
.product-card .product-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border-light); }
.product-price { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.product-price small { font-size: .75rem; font-weight: 600; color: var(--muted); margin-left: .15rem; }

/* ─── Forms ─── */
.form-group { display: grid; gap: .4rem; }
label { font-size: .875rem; font-weight: 600; color: var(--text); }
input, select, textarea { width: 100%; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); transition: border-color var(--transition), box-shadow var(--transition); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; gap: 1rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .25rem; }

/* ─── Tags / Chips ─── */
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: var(--radius-full); font-size: .75rem; font-weight: 700; background: var(--surface-muted); color: var(--text-soft); }
.tag-accent { background: var(--accent-soft); color: var(--accent-deep); }
.tag-blue { background: #dbeafe; color: var(--brand-deep); }

/* ─── Notices ─── */
.notice { padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-warm); color: var(--text-soft); font-size: .9rem; line-height: 1.5; }
.notice-success { background: var(--success-soft); border-color: rgba(22,163,74,.15); color: #166534; }
.notice-error { background: var(--danger-soft); border-color: rgba(220,38,38,.15); color: #991b1b; }
.notice-warning { background: var(--accent-soft); border-color: rgba(245,158,11,.2); color: var(--accent-deep); }

/* ─── Sections ─── */
.section-header { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.5rem; }
.section-header p { color: var(--muted); max-width: 55ch; }
.eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }

/* ─── Grid helpers ─── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* ─── Hero ─── */
.hero { position: relative; padding: 3.5rem 2.5rem; border-radius: var(--radius-lg); overflow: hidden; }
.hero-dark { background: var(--gradient); color: #fff; }
.hero-dark .text-muted { color: rgba(255,255,255,.75); }
.hero-dark .eyebrow { color: rgba(255,255,255,.9); }
.hero-content { position: relative; z-index: 2; display: grid; gap: 1.25rem; max-width: 580px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; }
.hero p { font-size: 1.05rem; }
.hero-img { position: absolute; right: 0; top: 0; bottom: 0; width: 42%; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.hero-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(37,99,235,.9) 0%, transparent 60%); z-index: 1; }
@media (max-width: 900px) {
    .hero { padding: 2.5rem 1.5rem; }
    .hero-img { position: relative; width: 100%; height: 200px; border-radius: var(--radius); margin-top: 1.5rem; }
    .hero-img::before { background: linear-gradient(180deg, rgba(37,99,235,.6) 0%, transparent 80%); }
    .hero-content { max-width: 100%; }
}
@media (max-width: 480px) {
    .hero { padding: 2rem 1.25rem; border-radius: var(--radius); }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: .95rem; }
    .hero-img { height: 160px; }
}

/* ─── Feature icons ─── */
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius); background: var(--gradient-soft); color: var(--brand); margin-bottom: .5rem; }
.feature-icon svg { width: 24px; height: 24px; }

/* ─── Footer ─── */
.footer { flex-shrink: 0; padding: 2rem 0; border-top: 1px solid var(--border-light); background: var(--surface); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { font-weight: 800; font-size: 1.1rem; }
.footer-brand span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; font-size: .875rem; color: var(--muted); }
.footer-links a:hover { color: var(--accent-deep); }
.footer-copy { font-size: .8rem; color: var(--muted); }

/* ─── Auth pages ─── */
.auth-shell { display: grid; place-items: center; min-height: 60vh; }
.auth-card { max-width: 420px; width: 100%; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.auth-divider span:first-child, .auth-divider span:last-child { flex: 1; height: 1px; background: var(--border); }
.social-btn { width: 100%; justify-content: center; }
.social-btn svg { flex-shrink: 0; }

/* ─── Sticky sidebar ─── */
.sidebar-sticky { position: sticky; top: 84px; }

/* ─── Icons ─── */
.ui-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ─── Misc ─── */
.split { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 .4rem; border-radius: var(--radius-full); background: var(--accent); color: var(--brand); font-size: .7rem; font-weight: 800; }

/* ─── Animations ─── */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fade-in .4s ease both; }

/* ─── Admin product form mode toggle ─── */
[data-product-form] .field[data-field] { display: none; }
[data-product-form][data-mode="quick"] .field[data-field*="quick"] { display: block; }
[data-product-form][data-mode="status"] .field[data-field*="status"] { display: block; }
[data-product-form][data-mode="seo"] .field[data-field*="seo"] { display: block; }
.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Print ─── */
@media print { .topbar, .footer, .nav-toggle, .nav-backdrop { display: none; } .page { padding: 0; } }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .sidebar-sticky { position: static; }
}

@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .page { padding: 1.5rem 0 2.5rem; }
    .card { padding: 1.1rem; }
    h1 { font-size: 1.75rem; }
    .section-header h2 { font-size: 1.25rem; }
    .footer-inner { flex-direction: column; text-align: center; gap: .75rem; }
    .footer-links { justify-content: center; flex-direction: row; }
    .auth-shell { min-height: auto; padding: 1rem 0; }
    .auth-card { max-width: 100%; }
    .footer [style*="grid-template-columns"] { grid-template-columns: 1fr !important; text-align: center; }
    .footer [style*="align-items:flex-end"] { align-items: center !important; }
}

@media (max-width: 480px) {
    .container { width: calc(100% - 1.5rem); }
    .product-card .product-body { padding: .85rem 1rem 1rem; }
    .actions { gap: .5rem; }
    .split { flex-direction: column; align-items: stretch; gap: .5rem; }
    .tag { font-size: .7rem; }
    .btn { padding: .7rem 1rem; font-size: .85rem; }
    .topbar-inner { min-height: 56px; }
    .brand { font-size: 1.2rem; }
}
