/**
 * Affair3D - Stylesheet Principal
 * Boutique en ligne d'impressions 3D custom de Playmobils
 * Design moderne et original
 */

/* ========== IMPORTS DE POLICES ========== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Sora:wght@300;400;500;600;700;800&display=swap');

/* ========== VARIABLES CSS ========== */
:root {
    /* Couleurs principales */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c94f5;
    --secondary: #764ba2;
    --accent: #f093fb;

    /* Couleurs de fond */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9ff;
    --bg-dark: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Couleurs de texte */
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;

    /* Bordures */
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-sm: 8px;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);

    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Polices */
    --font-primary: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Space Grotesk', monospace, sans-serif;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--primary-dark);
}

/* ========== TYPOGRAPHIE ========== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.875rem;
    font-weight: 600;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ========== LAYOUT ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* ========== HEADER & NAVIGATION ========== */
.site-header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-secondary);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo img {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-menu a {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.nav-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.cart-icon {
    position: relative;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    color: #3b82f6;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-icon:hover {
    background: #f8f9fa;
    color: #3b82f6;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.user-dropdown-toggle:hover {
    background: white;
    border-color: var(--primary);
}

.user-icon {
    font-size: 1.25rem;
}

.user-name {
    font-size: 0.95rem;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.user-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.dropdown-icon {
    font-size: 1.125rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.btn-login {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-login:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 40px;
    height: 40px;
    z-index: 1001;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-icon {
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    bottom: -8px;
}

.mobile-menu-toggle.active .hamburger-icon {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .hamburger-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

body.menu-open {
    overflow: hidden;
}

/* ========== HERO SECTION ========== */
.hero {
    background: var(--bg-gradient);
    color: white;
    padding: var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23ffffff" opacity="0.03"/><path d="M0 0L50 50M50 0L100 50M0 50L50 100M50 50L100 100" stroke="%23ffffff" opacity="0.1"/></svg>');
    animation: heroPattern 20s linear infinite;
}

@keyframes heroPattern {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(100px) translateY(100px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
    font-weight: 400;
    color: white;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-lg);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-secondary);
    text-decoration: none;
    background: #3b82f6;
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background: #60a5fa;
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background: #60a5fa;
    color: #ffffff;
}

.btn-secondary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #60a5fa;
    color: #ffffff;
}

.btn-gradient {
    background: #3b82f6;
    color: #ffffff;
}

.btn-gradient:hover {
    background: #60a5fa;
    color: #ffffff;
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    padding: 1rem;
    background: #f8f9fa;
}

.card-body {
    padding: var(--spacing-md);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== GRID ========== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== SECTIONS ========== */
section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--bg-gradient);
    margin: var(--spacing-sm) auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
    font-size: 1.25rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* ========== UTILITIES ========== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .navbar {
        position: relative;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        padding: 1rem 0;
        flex-direction: column;
        gap: 0;
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        border-radius: 0;
    }

    .nav-menu .cart-icon {
        justify-content: flex-start;
        border-radius: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* User dropdown on mobile */
    .user-dropdown {
        width: 100%;
    }

    .user-dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.5rem;
    }

    .user-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--bg-secondary);
        display: none;
    }

    .user-dropdown.active .user-dropdown-menu {
        display: block;
    }

    .dropdown-item {
        padding-left: 3rem;
        background: var(--bg-secondary);
    }

    .btn-login {
        display: block;
        width: calc(100% - 3rem);
        margin: 1rem 1.5rem;
        text-align: center;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .nav-logo img {
        height: 40px;
    }

    .nav-logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
}
