/* ===== RESPONSIVE STYLES ===== */

/* Optimisations pour les appareils tactiles */
@media (hover: none) {
    /* Amélioration des interactions tactiles */
    a, button, .btn, .info-card, .pizza-card, .feature-item, .social-icons a {
        transition: transform 0.2s ease;
    }
    
    a:active, button:active, .btn:active {
        transform: scale(0.97);
    }
    
    /* Désactivation des effets de survol qui peuvent être problématiques sur mobile */
    .info-card:hover {
        transform: none;
    }
    
    /* Amélioration du feedback tactile */
    .nav-menu li a:active, .footer-links a:active {
        color: var(--primary-color);
    }
    
    /* Optimisation des animations pour les appareils à faible puissance */
    * {
        animation-duration: 0.5s;
        transition-duration: 0.3s;
    }
}

/* Optimisations pour les performances */
@media screen and (max-width: 768px) {
    /* Optimisation des images pour le mobile */
    img {
        max-width: 100%;
        height: auto;
        opacity: 1 !important;
        display: block;
    }
    
    /* Correction pour les images de pizza */
    .pizza-img {
        height: auto;
        min-height: 180px;
        overflow: visible;
    }
    
    .pizza-img img {
        width: 100%;
        height: auto;
        object-fit: cover;
        opacity: 1 !important;
        display: block;
    }
    
    /* Amélioration des performances d'animation */
    .hero, .features, .popular-pizzas, .testimonials, .contact-info {
        will-change: transform;
    }
    
    /* Optimisation du rendu des polices */
    body {
        text-rendering: optimizeSpeed;
        -webkit-font-smoothing: antialiased;
    }
    
    /* Réduction des animations complexes */
    .feature-icon, .info-icon {
        transform: none !important;
        animation: none !important;
    }
}

/* Tablettes et petits écrans */
@media screen and (max-width: 992px) {
    /* Ajustement pour la section contact-info */
    .contact-info .container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .info-card {
        padding: var(--spacing-md);
    }
    /* Ajustements généraux */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Header et navigation */
    .nav-menu {
        gap: var(--spacing-md);
    }
    
    /* Page À Propos */
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sections avec grilles */
    .menu-items {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Mobiles et petits écrans */
@media screen and (max-width: 768px) {
    /* Ajustements généraux */
    :root {
        --spacing-xl: 2.5rem;
        --spacing-lg: 1.5rem;
    }
    
    body {
        font-size: 15px;
        overflow-x: hidden;
    }
    
    /* Correction pour assurer la visibilité de toutes les images */
    img, .pizza-img, .feature-icon, .info-icon, .hero, .testimonial, .info-card, .pizza-card, .feature-item {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Désactivation des animations qui pourraient cacher les images */
    [class*="animation"], [class*="fade"], [class*="slide"] {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
        width: 100%;
        max-width: 100%;
    }
    
    /* Header et navigation */
    header .container {
        padding: var(--spacing-sm);
    }
    
    .mobile-menu-btn {
        display: block;
        cursor: pointer;
        z-index: 101;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease;
        background-color: var(--primary-color);
        border-radius: 2px;
    }
    
    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: var(--spacing-xl) 0;
        z-index: 100;
        overflow-y: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: var(--spacing-md) 0;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
        transition-delay: calc(0.1s * var(--i, 0));
    }
    
    .nav-menu li:nth-child(1) { --i: 1; }
    .nav-menu li:nth-child(2) { --i: 2; }
    .nav-menu li:nth-child(3) { --i: 3; }
    .nav-menu li:nth-child(4) { --i: 4; }
    
    .nav-menu li a {
        font-size: 1.2rem;
        padding: 10px 20px;
        display: inline-block;
        position: relative;
    }
    
    .nav-menu li a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--primary-color);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }
    
    .nav-menu li a:active::after,
    .nav-menu li a.active::after {
        width: 50%;
    }
    
    /* Hero section */
    .hero {
        min-height: 80vh;
        background-position: center;
        background-size: cover;
        padding: var(--spacing-lg) 0;
        opacity: 1 !important;
    }
    
    .hero-content {
        padding: var(--spacing-lg);
        max-width: 100%;
        text-align: center;
        opacity: 1 !important;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    /* Page banner */
    .page-banner {
        padding: var(--spacing-lg) 0;
    }
    
    .banner-content h2 {
        font-size: 1.8rem;
    }
    
    /* Page À Propos */
    .about-story .container,
    .about-quality .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .story-content,
    .quality-content {
        order: 2;
    }
    
    .story-image,
    .quality-image {
        order: 1;
    }
    
    /* Centrer les titres et les barres en version mobile */
    .story-content h2,
    .quality-content h2 {
        text-align: center;
    }
    
    .story-content h2::after,
    .quality-content h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Menu */
    .menu-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu-tab {
        margin-bottom: var(--spacing-sm);
        flex: 0 0 calc(50% - var(--spacing-sm));
    }
    
    .menu-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .menu-item-header .price {
        margin-top: var(--spacing-xs);
    }
    
    /* Features section */
    .features .container {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .feature-item {
        width: 100%;
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
        text-align: center;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        background-color: var(--white);
        opacity: 1 !important;
        display: block;
    }
    
    .feature-icon {
        margin-bottom: var(--spacing-sm);
        opacity: 1 !important;
        display: block;
    }
    
    .feature-icon i {
        opacity: 1 !important;
        display: inline-block;
    }
    
    /* Popular pizzas section */
    .popular-pizzas {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        margin-bottom: var(--spacing-md);
        text-align: center;
    }
    
    .pizza-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .pizza-card {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }
    
    .pizza-img {
        height: 180px;
    }
    
    .pizza-info {
        padding: var(--spacing-sm);
    }
    
    .pizza-info h3 {
        margin-bottom: 5px;
    }
    
    .pizza-info p {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }
    
    .price {
        font-weight: bold;
        color: var(--primary-color);
    }
    
    /* Contact */
    .contact-info,
    .contact-form {
        padding: var(--spacing-md);
    }
    
    .form-group {
        margin-bottom: var(--spacing-md);
    }
    
    /* Testimonials section */
    .testimonials {
        padding: var(--spacing-lg) 0;
        background-attachment: scroll;
    }
    
    .testimonial-slider {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .testimonial {
        padding: var(--spacing-md);
        border-radius: 8px;
        background-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        margin: 0 auto;
        max-width: 90%;
        opacity: 1 !important;
        display: block;
    }
    
    .stars {
        margin-bottom: var(--spacing-xs);
        color: #FFD700;
    }
    
    .quote {
        font-style: italic;
        margin-bottom: var(--spacing-xs);
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .author {
        font-weight: bold;
        text-align: right;
    }
    
    /* Contact info section */
    .contact-info {
        padding: var(--spacing-md) 0;
    }
    
    .contact-info .container {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .info-card {
        padding: var(--spacing-md);
        border-radius: 8px;
        background-color: var(--white);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        text-align: center;
        transition: transform 0.3s ease;
        opacity: 1 !important;
        display: block;
    }
    
    .info-card:hover {
        transform: translateY(-5px);
    }
    
    .info-icon {
        font-size: 2rem;
        color: var(--primary-color);
        margin-bottom: var(--spacing-xs);
        opacity: 1 !important;
        display: block;
    }
    
    .info-card h3 {
        margin-bottom: var(--spacing-xs);
    }
    
    .info-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .info-card a {
        color: var(--text-color);
        text-decoration: none;
        transition: color 0.3s ease;
    }
    
    .info-card a:hover {
        color: var(--primary-color);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-contact li {
        justify-content: center;
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .footer-logo,
    .footer-links,
    .footer-contact,
    .footer-social {
        margin-bottom: var(--spacing-md);
    }
    
    .footer-logo h2 {
        font-size: 1.5rem;
    }
    
    .footer-logo p {
        font-size: 0.9rem;
    }
    
    .footer-links ul li {
        margin-bottom: 8px;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-icons {
        display: flex;
        justify-content: center;
        gap: var(--spacing-sm);
    }
    
    .social-icons a {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        transition: all 0.3s ease;
    }
    
    .social-icons a:hover {
        transform: translateY(-3px);
        background-color: var(--secondary-color);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
        padding-top: var(--spacing-md);
    }
    
    .legal-links {
        justify-content: center;
    }
}

/* Animations et transitions optimisées pour mobile */
@media screen and (max-width: 768px) {
    /* Amélioration des animations de chargement */
    @keyframes fadeIn {
        from { opacity: 0.5; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .hero-content, .feature-item, .pizza-card, .testimonial, .info-card {
        animation: fadeIn 0.5s ease-out forwards;
        opacity: 1 !important;
    }
    
    /* Décalage des animations pour un chargement progressif */
    .feature-item:nth-child(1) { animation-delay: 0.1s; opacity: 1 !important; }
    .feature-item:nth-child(2) { animation-delay: 0.2s; opacity: 1 !important; }
    .feature-item:nth-child(3) { animation-delay: 0.3s; opacity: 1 !important; }
    
    .pizza-card:nth-child(1) { animation-delay: 0.1s; opacity: 1 !important; }
    .pizza-card:nth-child(2) { animation-delay: 0.2s; opacity: 1 !important; }
    .pizza-card:nth-child(3) { animation-delay: 0.3s; opacity: 1 !important; }
    
    .info-card:nth-child(1) { animation-delay: 0.1s; opacity: 1 !important; }
    .info-card:nth-child(2) { animation-delay: 0.2s; opacity: 1 !important; }
    .info-card:nth-child(3) { animation-delay: 0.3s; opacity: 1 !important; }
    .info-card:nth-child(4) { animation-delay: 0.4s; opacity: 1 !important; }
    
    /* Amélioration des transitions pour les boutons */
    .btn {
        position: relative;
        overflow: hidden;
    }
    
    .btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        background: rgba(255, 255, 255, 0.5);
        opacity: 0;
        border-radius: 100%;
        transform: scale(1, 1) translate(-50%, -50%);
        transform-origin: 50% 50%;
    }
    
    .btn:active::after {
        opacity: 1;
        transform: scale(20, 20) translate(-50%, -50%);
        transition: all 0.5s ease-out;
    }
    
    /* Amélioration de l'accessibilité des éléments interactifs */
    .btn, a, button, .menu-tab, .info-card {
        touch-action: manipulation;
    }
}

/* Très petits écrans */
@media screen and (max-width: 480px) {
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-logo,
    .footer-links,
    .footer-contact,
    .footer-social {
        margin-bottom: var(--spacing-lg);
    }
    /* Ajustement pour la section contact-info */
    .contact-info .container {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    /* Ajustements généraux */
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.25rem;
        --spacing-md: 0.75rem;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    /* Header */
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    /* Hero section */
    .hero {
        min-height: 70vh;
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    /* Features section */
    .feature-item {
        padding: var(--spacing-sm);
    }
    
    .feature-icon i {
        font-size: 2rem;
    }
    
    /* Popular pizzas section */
    .pizza-img {
        height: 150px;
    }
    
    .pizza-info h3 {
        font-size: 1.1rem;
    }
    
    .pizza-info p {
        font-size: 0.85rem;
    }
    
    /* Testimonials */
    .testimonial {
        padding: var(--spacing-sm);
    }
    
    .quote {
        font-size: 0.85rem;
    }
    
    /* Menu */
    .menu-tab {
        flex: 0 0 100%;
        margin-right: 0;
    }
    
    /* Valeurs */
    .value-card {
        padding: var(--spacing-md);
    }
    
    /* Équipe */
    .member-photo {
        width: 150px;
        height: 150px;
    }
    
    /* Boutons */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Ajustements pour les boutons de navigation */
    .text-center .btn {
        width: 100%;
        max-width: 200px;
    }
    
    /* Ajustements pour les cartes d'info */
    .info-icon {
        font-size: 1.8rem;
    }
    
    /* Ajustements pour le footer */
    .social-icons a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* Ajustements pour les marges et espacements */
    section {
        padding: var(--spacing-md) 0;
    }
    
    .section-title {
        margin-bottom: var(--spacing-sm);
    }
    
    /* Amélioration de la lisibilité */
    p {
        line-height: 1.5;
    }
    
    /* Amélioration des transitions */
    .btn, .info-card, .pizza-card, .feature-item {
        transition: all 0.2s ease;
    }
    
    /* Amélioration du contraste */
    .btn-primary, .btn-secondary {
        font-weight: bold;
    }
    
    /* Amélioration de l'accessibilité */
    a:active, button:active {
        transform: scale(0.98);
    }
}