/* ===== STYLES RESPONSIVES AVANCÉS ===== */

/* Points de rupture personnalisés */
@media (max-width: 1536px) {
    .container {
        max-width: 1280px;
    }
}

@media (max-width: 1280px) {
    .container {
        max-width: 1024px;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 768px;
        padding: 0 1.5rem;
    }
    
    /* Ajustements layout tablette */
    .header-container {
        padding: 1rem 1.5rem;
    }
    
    .main-nav ul {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Navigation mobile */
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        width: 100%;
    }
    
    .main-nav li {
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 0.8rem 1rem;
        border-radius: 6px;
        transition: all 0.3s ease;
    }
    
    .main-nav a:hover {
        background: var(--neutral-light);
    }
    
    .header-actions {
        width: 100%;
        text-align: center;
    }
    
    .user-menu, .auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .user-menu .button,
    .auth-buttons .button {
        width: 100%;
        margin: 0;
    }
    
    /* Dashboard mobile */
    .plusmoins-dashboard {
        padding: 1rem;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .pleasure-budget-card {
        padding: 1.5rem;
    }
    
    .budget-amount {
        font-size: 2.5rem;
    }
    
    /* Grilles responsives */
    .offers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .savings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .features-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    /* Cartes mobile */
    .offer-card,
    .savings-card,
    .feature-card,
    .category-card {
        margin-bottom: 1rem;
    }
    
    /* Footer mobile */
    .footer-content {
        text-align: center;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    /* Ajustements mobile petit */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Boutons mobile */
    .button-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Statistiques hero */
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item {
        text-align: center;
    }
    
    /* Forms mobile */
    .moinsplus-form {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Pagination mobile */
    .pagination .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-numbers {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    /* Ajustements mobile très petit */
    .container {
        padding: 0 0.5rem;
    }
    
    .plusmoins-dashboard {
        padding: 0.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    
    .pleasure-budget-card {
        padding: 1rem;
    }
    
    .budget-amount {
        font-size: 2rem;
    }
    
    /* Textes mobile */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    /* Cartes très compactes */
    .offer-content,
    .savings-card,
    .stat-card {
        padding: 1rem;
    }
    
    .offer-details {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    /* Masquer certains éléments sur mobile très petit */
    .hero-stats .stat-label {
        font-size: 0.8rem;
    }
    
    .user-greeting {
        display: none;
    }
}

@media (max-width: 360px) {
    /* Ajustements pour très petits écrans */
    .logo {
        font-size: 1.3rem;
    }
    
    .hero-title {
        font-size: 1.7rem;
    }
    
    .budget-amount {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}

/* Orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .homepage-hero {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .plusmoins-login-container {
        margin: 1rem auto;
        padding: 1rem;
    }
    
    .pleasure-budget-card {
        padding: 1rem;
    }
}

/* Support pour les préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Support mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --neutral-dark: #f9fafb;
        --neutral-gray: #d1d5db;
        --neutral-light: #374151;
        --neutral-white: #1f2937;
    }
    
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .site-header {
        background: #1f2937;
        border-bottom-color: #374151;
    }
    
    .main-nav a {
        color: #d1d5db;
    }
    
    .main-nav a:hover {
        color: #60a5fa;
        background: #374151;
    }
}

/* Impression */
@media print {
    .site-header,
    .site-footer,
    .header-actions,
    .offer-button,
    .button {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .plusmoins-dashboard {
        padding: 0;
    }
    
    .pleasure-budget-card {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .offer-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Hauteur d'écran spécifique */
@media (max-height: 700px) {
    .homepage-hero {
        padding: 2rem 1rem;
    }
    
    .pleasure-budget-card {
        padding: 1.5rem;
    }
    
    .dashboard-header {
        margin-bottom: 2rem;
    }
}

/* Support pour les écrans très larges */
@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }
    
    .offers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .savings-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Correction pour iOS Safari */
@supports (-webkit-touch-callout: none) {
    .homepage-hero {
        background-attachment: scroll;
    }
    
    .pleasure-budget-card {
        background-attachment: scroll;
    }
}

/* Support pour les navigateurs modernes */
@supports (backdrop-filter: blur(10px)) {
    .site-header {
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    @media (prefers-color-scheme: dark) {
        .site-header {
            background: rgba(31, 41, 55, 0.95);
        }
    }
}