/* ==========================================================================
   Base & Variables
   ========================================================================== */
   :root {
    --bg-color: #f4f6f8;
    --text-main: #1A1A1A; /* Charcoal Grey */
    --text-muted: #666666;
    --accent-color: #2563EB; /* Tech Blue pour la confiance et l'action */
    --accent-hover: #1D4ED8;
    --danger-color: #DC2626; /* Warning rouge */
    --surface-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(255, 255, 255, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e5e7eb;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
}

.logo-container img {
    height: 40px;
    margin-right: 12px;
}

.logo-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 1.5rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #1A1A1A 0%, #333333 100%);
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: -webkit-linear-gradient(45deg, #60A5FA, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Products Grid
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card-img-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.badge-grade {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--text-main);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-specs {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eaeaea;
}

.price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* ==========================================================================
   Product Page
   ========================================================================== */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
}

.product-gallery {
    border-radius: 16px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-gallery img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.product-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.warning-box {
    background: #FEF2F2;
    border-left: 4px solid var(--danger-color);
    color: #991B1B;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.specs-list {
    list-style: none;
    margin-bottom: 2rem;
}

.specs-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
}

.specs-list li strong {
    color: var(--text-muted);
}

/* ==========================================================================
   Admin Dashboard & Add Product (Mobile-First)
   ========================================================================== */
.admin-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: rgb(255, 255, 255);
}

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 1rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: var(--accent-color);
    background: #eff6ff;
}

.dropzone.dragover {
    border-color: var(--accent-color);
    background: #eff6ff;
    transform: scale(1.02);
}

/* ==========================================================================
   Footer & Legal
   ========================================================================== */
footer {
    background: var(--text-main);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.875rem;
}

.legal-container {
    max-width: 800px;
    margin: 3rem auto;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.legal-section { margin-bottom: 2rem; }
.legal-section h2 { margin-bottom: 1rem; border-bottom: 2px solid #eee; padding-bottom: 0.5rem; }
.legal-section h3 { margin-top: 1rem; margin-bottom: 0.5rem; color: var(--text-muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    nav a {
        margin: 0 0.5rem;
    }
    
    .admin-container {
        padding: 1.5rem;
        margin: 1rem;
    }
}
