/* --- 1. VARIABLES & THÈMES --- */
:root {
    --bg: #f0f4ff;
    --card: #ffffff;
    --card-border: rgba(37, 99, 235, 0.12);
    --accent: #2563eb;
    --sub: #64748b;
    --text: #0f172a;
    --success: #10b981;
    --error: #ef4444;
    --nav-bg: rgba(255, 255, 255, 0.88);
    --glass: rgba(37, 99, 235, 0.03);
    --glass-border: rgba(37, 99, 235, 0.12);
}

body.dark {
    --bg: #030b18;
    --card: #071428;
    --card-border: rgba(37, 99, 235, 0.18);
    --text: #e8f0fe;
    --sub: #7da3cc;
    --nav-bg: rgba(4, 12, 28, 0.88);
    --accent: #3b6fff;
    --glass: rgba(37, 99, 235, 0.05);
    --glass-border: rgba(37, 99, 235, 0.18);
}

/* --- 2. RESET & BASE --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Fond MRC Protocol — dégradé navy + lueur atmosphérique */
body.dark {
    background:
        radial-gradient(ellipse 120% 55% at 50% 105%, rgba(37, 99, 235, 0.10) 0%, transparent 65%),
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(14, 165, 233, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #030b18 0%, #040e22 100%);
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    padding-bottom: 110px;
}

/* --- 3. PRÉSENTATION "HERO" IMMERSIVE --- */
.product-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.6);
    transform: scale(1.2);
    opacity: 0.8;
}

.hero-image-container {
    position: relative;
    z-index: 1;
    width: 85%;
    height: 75%;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.9));
}

.hero-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* --- 4. NAVIGATION BOUTON RETOUR --- */
.back-nav {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    left: 20px;
    z-index: 1000;
}

.back-nav a {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    transition: 0.3s;
}

/* --- 5. CARTES & COMPOSANTS --- */
.card {
    background: var(--card);
    border-radius: 22px;
    padding: 20px;
    border: 1px solid var(--card-border);
    margin-bottom: 20px;
}

.cert-card {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 35px 35px 0 0;
    margin-top: -40px;
    position: relative;
    z-index: 10;
    padding: 30px 25px;
}

/* --- 6. GRILLE DE SPÉCIFICATIONS (BLEU NÉON) --- */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.meta-item {
    background: rgba(37, 99, 235, 0.06);
    padding: 12px 15px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.meta-label {
    font-size: 9px;
    color: #60a5fa;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.meta-value {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* --- 7. GALERIE GRID & SUPPRESSION --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.art-card {
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
}

.art-img-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #040e22;
}

.art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-delete-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 8. NAVIGATION BASSE (BLUR) --- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 85px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    border-top: 0.5px solid var(--card-border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    text-decoration: none;
    color: var(--sub);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
}

.nav-item.active { color: var(--accent); }

/* --- 9. BOUTON PRINCIPAL --- */
.btn-primary {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: center;
}
.btn-primary:active { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- 10. ANIMATIONS --- */
.spinner, .loader-spinner {
    width: 30px; height: 30px;
    border: 3px solid var(--card-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
