:root {
    --bg: #0a0f18;
    --surface: #141c2b;
    --surface-2: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #f59e0b;
    --accent-2: #ea580c;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #1e293b;
    --radius: 12px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: linear-gradient(180deg, #0b1020 0%, var(--bg) 120px);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

.container { width: min(1100px, 92%); margin: 0 auto; }

.site-header, .admin-header {
    background: rgba(26, 35, 50, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.header-inner, .admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    flex-wrap: wrap;
}

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

.logo-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.logo-text { line-height: 1.2; }

.footer-brand-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
}

.main-nav, .admin-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.main-nav a, .admin-nav a {
    color: var(--muted);
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.main-nav a.active, .admin-nav a.active { color: var(--text); background: var(--surface-2); }

.user-badge {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.site-main { padding: 2rem 0 3rem; }
.admin-main { padding-top: 1.5rem; }

.hero {
    padding: 2.5rem 0 1rem;
    max-width: 720px;
    position: relative;
}

.hero-with-image {
    max-width: none;
    min-height: 340px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: var(--surface);
}

.hero-with-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    opacity: 0.35;
}

.hero-with-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 20, 25, 0.95) 0%, rgba(15, 20, 25, 0.6) 100%);
}

.hero-content { position: relative; z-index: 1; padding: 2rem; max-width: 720px; }

.home-gallery { margin: 2rem 0; }
.home-gallery h2 { margin-bottom: 1rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: block;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    font-size: 0.9rem;
}

.product-detail-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.image-preview { margin-top: 0.75rem; }
.image-preview img {
    max-width: 280px;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 0.5rem;
}

.table-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.hero-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--accent);
    margin: 0 0 0.5rem;
}

.hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 0.5rem; line-height: 1.15; }
.hero-slogan { color: var(--primary); font-size: 1.1rem; margin: 0 0 0.75rem; }
.hero-desc { color: var(--muted); margin: 0 0 1.5rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.section { margin-top: 2.5rem; }
.section-intro { color: var(--muted); margin-top: -0.25rem; }

.btn {
    display: inline-block;
    padding: 0.65rem 1.1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    color: var(--text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
}
.btn-primary:hover {
    filter: brightness(1.08);
    text-decoration: none;
}
.btn-outline { border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); text-decoration: none; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.9rem; }

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

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.product-card-image-link { display: block; aspect-ratio: 16/10; overflow: hidden; }
.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card-image-link:hover .product-card-image { transform: scale(1.04); }

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

.product-card-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.08em;
}

.product-card h3 { margin: 0.4rem 0; font-size: 1.05rem; }
.product-card h3 a { color: var(--text); text-decoration: none; }
.product-desc { color: var(--muted); font-size: 0.92rem; min-height: 2.8rem; }
.product-price { font-weight: 700; color: var(--primary); }

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.filters { display: flex; gap: 0.5rem; margin: 1rem 0; }
.filters a {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}
.filters a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.product-detail { margin-bottom: 2rem; }
.badge {
    display: inline-block;
    background: var(--surface-2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--accent);
}
.product-price-lg { font-size: 1.6rem; color: var(--primary); font-weight: 700; }

.form-card, .order-form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.form-narrow { max-width: 460px; }

.form-group { margin-bottom: 1rem; display: block; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.radio-row { display: flex; gap: 1.25rem; }
.checkbox-row label { font-weight: normal; display: flex; gap: 0.5rem; align-items: center; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); }
.alert-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.alert-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.form-footer { margin-top: 1rem; color: var(--muted); }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.footer-copy { text-align: center; margin: 1rem 0 0; font-size: 0.85rem; }

.table-wrap { overflow-x: auto; margin-top: 1rem; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th { background: var(--surface-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

.status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.status-en_attente { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-confirme { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-annule { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 0.9rem; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.actions-cell { display: flex; gap: 0.75rem; align-items: center; }
.inline-form { display: inline; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; }
.link-danger:hover { text-decoration: underline; }

.orders-list { display: grid; gap: 1rem; margin-top: 1rem; }

.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.order-details {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.order-details dt { color: var(--muted); font-size: 0.85rem; }
.order-details dd { margin: 0; }

.status-form {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-form select { width: auto; min-width: 140px; }

/* Fiche produit */
.product-page { padding-bottom: 2rem; }
.back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.back-link:hover { color: var(--primary); }

.product-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.product-page-media .product-detail-image {
    width: 100%;
    max-height: none;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 16px;
    margin: 0;
}

.product-detail-placeholder {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 4rem;
    border: 1px solid var(--border);
}

.product-page-info h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0.5rem 0;
    font-weight: 800;
}

.product-view-note {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    color: #38bdf8;
    font-size: 0.9rem;
}

.guest-gate {
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.08), var(--surface));
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-radius: 16px;
}

.guest-gate-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.guest-gate h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.guest-gate p {
    color: var(--muted);
    max-width: 420px;
    margin: 0 auto 1.5rem;
}

.guest-gate-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

@media (max-width: 640px) {
    .order-details { grid-template-columns: 1fr; }
    .order-details dt { margin-top: 0.5rem; }
}
