/*======================================================*/
/* MOBILE OPTIMIZATION - ARTWORKS DIGITAL TEMPLATE     */
/* Version responsive complète pour tous les appareils */
/*======================================================*/

/*------------------------------------------------*/
/* 1. NAVIGATION MOBILE AM�LIORéE */
/*------------------------------------------------*/

/* Amélioration du hamburger menu */
@media (max-width: 768px) {
    /* Navigation container */
    nav {
        padding: 12px 20px;
        min-height: 60px;
    }

    nav .logo {
        font-size: 20px;
        z-index: 1001;
        position: relative;
    }

    /* Hamburger amélioré */
    .hamburger {
        z-index: 1001;
        position: relative;
        padding: 8px;
        border-radius: 8px;
        transition: background 0.3s;
    }

    .hamburger:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .hamburger span {
        transition: all 0.3s ease;
    }

    /* Animation hamburger → X */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Menu mobile amélioré */
    nav ul {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: calc(100vh - 60px);
        background: linear-gradient(180deg, var(--color-primary, #1E3A8A), var(--color-secondary, #3B65C4));
        padding: 25px 20px;
        flex-direction: column;
        text-align: left;
        gap: 8px;
        display: flex;
        box-shadow: -5px 0 25px rgba(0,0,0,0.3);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
        z-index: 999;
    }

    nav ul.show {
        right: 0;
    }

    /* Overlay pour fermer le menu */
    nav ul.show::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Items du menu mobile */
    nav ul li {
        opacity: 0;
        transform: translateX(30px);
        animation: slideIn 0.3s forwards;
    }

    nav ul.show li:nth-child(1) { animation-delay: 0.1s; }
    nav ul.show li:nth-child(2) { animation-delay: 0.15s; }
    nav ul.show li:nth-child(3) { animation-delay: 0.2s; }
    nav ul.show li:nth-child(4) { animation-delay: 0.25s; }
    nav ul.show li:nth-child(5) { animation-delay: 0.3s; }
    nav ul.show li:nth-child(6) { animation-delay: 0.35s; }
    nav ul.show li:nth-child(7) { animation-delay: 0.4s; }
    nav ul.show li:nth-child(8) { animation-delay: 0.45s; }

    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Liens du menu mobile */
    nav ul li a {
        display: block;
        padding: 14px 16px;
        border-radius: 8px;
        font-size: 16px;
        transition: all 0.3s;
        border-left: 3px solid transparent;
    }

    nav ul li a:hover {
        background: rgba(255, 255, 255, 0.15);
        border-left-color: rgba(255, 255, 255, 0.8);
        transform: translateX(5px);
    }
}

/*------------------------------------------------*/
/* 2. MEGA MENU UTILISATEUR MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    /* Le mega menu devient un menu vertical pleine largeur */
    .user-menu-content {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        border-radius: 0 !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.3) !important;
    }

    .user-menu-content.show {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Sections du mega menu */
    .user-menu-links {
        border-right: none !important;
        border-bottom: 1px solid #f0f0f0;
        padding: 20px 20px !important;
    }

    .user-menu-links:last-child {
        border-bottom: none;
    }

    /* Section titre mobile */
    .user-menu-section-title {
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--token-color-primary);
    }

    /* Liens du mega menu */
    .user-menu-links a {
        font-size: 15px !important;
        padding: 12px 14px !important;
        margin: 4px 0;
    }

    .user-menu-links a:hover {
        transform: translateX(0) !important;
        padding-left: 18px !important;
    }

    /* Aperçu panier mobile */
    .cart-preview {
        padding: 20px !important;
        max-height: 400px;
        overflow-y: auto;
    }

    .cart-item {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .cart-item img {
        width: 70px !important;
        height: 70px !important;
    }

    .cart-item-details {
        font-size: 13px !important;
    }

    .cart-item-details p:first-child {
        font-size: 14px !important;
    }

    /* Bouton panier mobile */
    .mega-menu-cart-btn {
        width: calc(100% - 40px) !important;
        margin: 15px 20px !important;
        padding: 14px !important;
        font-size: 15px !important;
    }
}

/*------------------------------------------------*/
/* 3. BOUTON PREVIEW "LANCER MON SITE" MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .preview-fab {
        left: 50% !important;
        bottom: 20px !important;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 400px;
    }

    .preview-fab .preview-launch-btn {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 15px !important;
        gap: 10px !important;
        justify-content: space-between;
    }

    .preview-price {
        padding: 10px 14px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .preview-fab {
        bottom: 15px !important;
        width: calc(100% - 24px);
    }

    .preview-fab .preview-launch-btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        gap: 8px !important;
    }

    .preview-price {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
}

/*------------------------------------------------*/
/* 4. FLASH MESSAGES MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .flash-container {
        top: 65px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100vw - 20px) !important;
    }

    .flash-message {
        padding: 14px 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
}

@media (max-width: 480px) {
    .flash-container {
        top: 70px !important;
    }

    .flash-message {
        padding: 12px 14px !important;
        font-size: 13px !important;
    }
}

/*------------------------------------------------*/
/* 5. MODAL SIGNUP EMAIL MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    #signupModal > div {
        max-width: 90% !important;
        width: 90% !important;
        padding: 30px 20px !important;
        margin: 0 auto;
    }

    #signupModal h2 {
        font-size: 22px !important;
    }

    #signupModal p {
        font-size: 13px !important;
    }

    #domainDisplay {
        padding: 14px 18px !important;
        margin-bottom: 20px !important;
    }

    #domainName {
        font-size: 16px !important;
        word-break: break-all;
    }

    #signupModal input {
        font-size: 15px !important;
        padding: 12px !important;
    }

    #signupModal button {
        font-size: 15px !important;
        padding: 13px !important;
    }
}

@media (max-width: 480px) {
    #signupModal > div {
        max-width: 95% !important;
        padding: 25px 15px !important;
    }

    #signupModal h2 {
        font-size: 20px !important;
    }

    #domainDisplay {
        padding: 12px 15px !important;
    }

    #domainName {
        font-size: 14px !important;
    }
}

/*------------------------------------------------*/
/* 6. HERO SECTION MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .hero {
        height: 50vh !important;
        min-height: 350px;
        border-radius: 20px !important;
        margin-bottom: 20px;
    }

    .hero-overlay {
        padding: 25px 20px !important;
    }

    .hero-overlay h1 {
        font-size: 28px !important;
        margin-bottom: 12px !important;
    }

    .hero-overlay p {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .hero-overlay .btn {
        padding: 12px 24px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 45vh !important;
        min-height: 300px;
        border-radius: 15px !important;
    }

    .hero-overlay {
        padding: 20px 15px !important;
    }

    .hero-overlay h1 {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }

    .hero-overlay p {
        font-size: 14px !important;
    }

    .hero-overlay .btn {
        padding: 11px 20px !important;
        font-size: 14px !important;
    }
}

/*------------------------------------------------*/
/* 7. GALERIE MOBILE OPTIMISÉE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .latest-gallery,
    .paintings-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .painting-card,
    .latest-artwork {
        border-radius: 12px !important;
    }

    .painting-card img,
    .latest-artwork img {
        height: 220px !important;
        object-fit: cover;
    }

    .painting-info,
    .artwork-info {
        padding: 12px !important;
    }

    .painting-info h3,
    .artwork-info h3 {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }

    .painting-info p,
    .artwork-info p {
        font-size: 13px !important;
    }

    /* Boutons d'action sur les cartes */
    .painting-actions,
    .artwork-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .painting-actions .btn,
    .artwork-actions .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        font-size: 13px !important;
        padding: 10px 12px !important;
    }
}

@media (max-width: 600px) {
    .latest-gallery,
    .paintings-grid,
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .painting-card img,
    .latest-artwork img {
        height: 280px !important;
    }
}

@media (max-width: 480px) {
    .painting-card img,
    .latest-artwork img {
        height: 240px !important;
    }

    .painting-info h3,
    .artwork-info h3 {
        font-size: 14px !important;
    }

    .painting-info p,
    .artwork-info p {
        font-size: 12px !important;
    }
}

/*------------------------------------------------*/
/* 8. PANIER & CHECKOUT MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .cart-container,
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 15px !important;
    }

    .cart-item {
        flex-direction: row !important;
        align-items: center !important;
        padding: 15px !important;
        gap: 15px;
    }

    .cart-item img {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px;
    }

    .cart-item-details {
        flex: 1;
    }

    .cart-item-details h3 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }

    .cart-item-details p {
        font-size: 13px !important;
    }

    .quantity-controls {
        margin-top: 10px;
        justify-content: flex-start;
    }

    .quantity-controls button {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }

    .quantity-controls span {
        min-width: 40px !important;
        font-size: 15px !important;
    }

    /* Résumé panier mobile */
    .cart-summary,
    .checkout-summary {
        padding: 18px !important;
        position: sticky;
        top: 70px;
    }

    .cart-summary h3,
    .checkout-summary h3 {
        font-size: 18px !important;
    }

    .cart-total,
    .checkout-total {
        font-size: 22px !important;
        padding: 15px 0 !important;
    }

    .cart-summary .btn,
    .checkout-summary .btn {
        width: 100%;
        font-size: 15px !important;
        padding: 14px !important;
    }
}

@media (max-width: 480px) {
    .cart-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .cart-item img {
        width: 100% !important;
        height: 200px !important;
        max-height: 200px;
    }

    .quantity-controls {
        width: 100%;
        justify-content: center;
    }
}

/*------------------------------------------------*/
/* 9. FORMULAIRES MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .form-container,
    .checkout-form,
    .contact-form {
        padding: 20px !important;
    }

    .form-group label {
        font-size: 14px !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 15px !important;
        padding: 12px !important;
    }

    .form-group textarea {
        min-height: 120px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .form-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .form-actions button,
    .form-actions .btn {
        width: 100% !important;
        font-size: 15px !important;
        padding: 13px !important;
    }
}

@media (max-width: 480px) {
    .form-container,
    .checkout-form,
    .contact-form {
        padding: 15px !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px !important;
        padding: 11px !important;
    }
}

/*------------------------------------------------*/
/* 10. ABOUT & CONTACT MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .about-container {
        flex-direction: column !important;
        text-align: center !important;
        gap: 20px !important;
    }

    .about-container img {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto;
    }

    .about-container p,
    .about-text {
        font-size: 15px !important;
        line-height: 1.7 !important;
        text-align: left !important;
    }

    .contact-info {
        flex-direction: column !important;
        gap: 20px !important;
    }

    .contact-item {
        width: 100% !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .about-container img {
        max-width: 250px !important;
    }

    .about-container p,
    .about-text {
        font-size: 14px !important;
    }
}

/*------------------------------------------------*/
/* 11. FOOTER MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .site-footer {
        padding: 35px 20px 20px 20px !important;
    }

    .footer-container {
        flex-direction: column !important;
        text-align: center !important;
        gap: 30px !important;
    }

    .footer-about,
    .footer-links,
    .footer-contact {
        width: 100% !important;
        max-width: 100% !important;
    }

    .footer-about h3,
    .footer-links h4,
    .footer-contact h4 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }

    .footer-links ul {
        padding: 0;
    }

    .footer-links li {
        margin: 8px 0 !important;
    }

    .footer-bottom {
        margin-top: 25px !important;
        font-size: 13px !important;
    }

    .social-links {
        justify-content: center !important;
        gap: 15px !important;
    }

    .social-links a {
        font-size: 22px !important;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 30px 15px 18px 15px !important;
    }

    .footer-container {
        gap: 25px !important;
    }

    .footer-about h3,
    .footer-links h4,
    .footer-contact h4 {
        font-size: 16px !important;
    }

    .footer-about p,
    .footer-links a,
    .footer-contact p {
        font-size: 13px !important;
    }
}

/*------------------------------------------------*/
/* 12. BOUTONS & ÉLÉMENTS INTERACTIFS MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px !important;
        font-size: 15px !important;
        min-height: 44px; /* Taille minimale recommandée pour le tactile */
    }

    .btn-small {
        padding: 10px 16px !important;
        font-size: 13px !important;
        min-height: 40px;
    }

    /* Amélioration des zones de touche */
    a, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Espacement pour éviter les clics accidentels */
    .btn + .btn {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 11px 18px !important;
        font-size: 14px !important;
    }

    .btn-small {
        padding: 9px 14px !important;
        font-size: 12px !important;
    }
}

/*------------------------------------------------*/
/* 13. COOKIE CONSENT MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    #cookie-consent-banner {
        left: 10px !important;
        right: 10px !important;
        bottom: 15px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
    }

    #cookie-consent-banner .cc-text {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    #cookie-consent-banner .cc-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    #cookie-consent-banner .cc-btn {
        width: 100% !important;
        padding: 12px !important;
        font-size: 14px !important;
    }

    #cookie-manage-btn {
        left: 10px !important;
        bottom: 10px !important;
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    #cookie-consent-banner {
        left: 8px !important;
        right: 8px !important;
        bottom: 12px !important;
        padding: 14px !important;
    }

    #cookie-consent-banner .cc-text {
        font-size: 12px !important;
    }

    #cookie-consent-banner .cc-btn {
        padding: 11px !important;
        font-size: 13px !important;
    }
}

/*------------------------------------------------*/
/* 14. AMÉLIORATIONS TACTILES GÉNÉRALES */
/*------------------------------------------------*/

@media (max-width: 768px) {
    /* Augmenter la taille des zones cliquables */
    .favorite-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 20px !important;
    }

    /* Désactiver le hover sur mobile (éviter les effets collants) */
    @media (hover: none) {
        *:hover {
            transition: none !important;
        }
    }

    /* Améliorer le scroll sur mobile */
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Empêcher le zoom sur les inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* 16px minimum pour éviter le zoom auto */
    }

    /* Améliorer la lisibilité */
    p, li, span {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/*------------------------------------------------*/
/* 15. ORIENTATION LANDSCAPE MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) and (orientation: landscape) {
    /* Réduire les hauteurs en mode paysage */
    nav {
        padding: 8px 20px !important;
        min-height: 50px !important;
    }

    nav .logo {
        font-size: 18px !important;
    }

    .hero {
        height: 70vh !important;
        min-height: 250px !important;
    }

    .hero-overlay {
        padding: 20px !important;
    }

    .hero-overlay h1 {
        font-size: 24px !important;
    }

    .hero-overlay p {
        font-size: 14px !important;
    }

    /* Menu mobile en paysage */
    nav ul {
        top: 50px !important;
        height: calc(100vh - 50px) !important;
        width: 240px !important;
    }

    .user-menu-content {
        top: 50px !important;
        max-height: calc(100vh - 50px) !important;
    }
}

/*------------------------------------------------*/
/* 16. PERFORMANCE MOBILE */
/*------------------------------------------------*/

@media (max-width: 768px) {
    /* Désactiver les animations coûteuses sur mobile */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* Optimiser les images */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/*------------------------------------------------*/
/* 17. DARK MODE SUPPORT (bonus) */
/*------------------------------------------------*/

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    /* Support du dark mode système sur mobile */
    .user-menu-content {
        background: #1a1a1a !important;
    }

    .user-menu-links {
        border-color: #333 !important;
    }

    .cart-preview {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
    }

    .cart-item {
        background: #2a2a2a !important;
        border-color: #333 !important;
    }
}

/*================================================*/
/* FIN DE L'OPTIMISATION MOBILE                   */
/*================================================*/
