/* ===== STYLE MOBILE - MIYOSHOP ===== */

/* Variables CSS Netflix */
:root {
    --netflix-red: #E50914;
    --netflix-dark-red: #B20710;
    --netflix-black: #000000;
    --netflix-dark-gray: #141414;
    --netflix-white: #FFFFFF;
    --netflix-gray: #808080;
    --netflix-light-gray: #333333;
}

/* ===== MASQUER LE PANIER MOBILE SUR DESKTOP ===== */
.mobile-cart-item {
    display: none;
}

/* ===== RÈGLES MOBILES GÉNÉRALES ===== */
@media (max-width: 768px) {
    /* Afficher le panier mobile sur les petits écrans */
    .mobile-cart-item {
        display: block;
    }
    * {
        box-sizing: border-box;
    }
    
    /* ===== LOADING SCREEN MOBILE ===== */
    .loading-container {
        padding: 0 20px;
    }
    
    .logo-image {
        width: 80px;
        height: 80px;
    }
    
    .loading-spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner-ring:nth-child(2) {
        width: 45px;
        height: 45px;
        top: 7.5px;
        left: 7.5px;
    }
    
    .spinner-ring:nth-child(3) {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .loading-text h2 {
        font-size: 2rem;
    }
    
    .loading-text p {
        font-size: 1rem;
    }

    body {
        font-size: 14px;
        line-height: 1.4;
    }

    /* ===== HEADER MOBILE ===== */
    .header {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo {
        margin-bottom: 10px;
    }
    
    .logo .logo-image {
        height: 40px;
        width: auto;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--netflix-dark-gray);
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        padding: 15px 0;
        border-bottom: 1px solid var(--netflix-light-gray);
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
    }

    /* ===== PANIER DANS LE MENU MOBILE ===== */
    .mobile-cart-item {
        border-top: 2px solid var(--netflix-red);
        margin-top: 10px;
        padding-top: 10px;
    }

    .mobile-cart-link {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
        color: var(--netflix-white);
        text-decoration: none;
        transition: all 0.3s ease;
        position: relative;
    }

    .mobile-cart-link:hover {
        color: var(--netflix-red);
        background: rgba(229, 9, 20, 0.1);
        padding-left: 10px;
    }

    .mobile-cart-link i {
        font-size: 1.3rem;
        color: var(--netflix-red);
        width: 20px;
        text-align: center;
    }

    .mobile-cart-link span:first-of-type {
        font-size: 1.1rem;
        font-weight: 500;
    }

    .cart-badge {
        background: var(--netflix-red);
        color: var(--netflix-white);
        border-radius: 50%;
        width: 25px;
        height: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: bold;
        margin-left: auto;
        animation: pulse 2s infinite;
    }

    .cart-badge:empty {
        display: none;
    }

    @keyframes pulse {
        0% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
        100% {
            transform: scale(1);
        }
    }

    .burger-menu {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 5px;
    }

    .burger-menu span {
        width: 25px;
        height: 3px;
        background: var(--netflix-white);
        margin: 3px 0;
        transition: 0.3s;
    }

    .search-bar {
        width: 100%;
        margin: 10px 0;
        order: 3;
    }

    .search-bar input {
        width: 100%;
        padding: 10px 15px;
        font-size: 16px;
    }

    .user-menu {
        position: absolute;
        top: 15px;
        right: 15px;
    }

    /* ===== MASQUER LE PANIER DESKTOP SUR MOBILE ===== */
    .cart-link {
        display: none !important;
    }

    /* ===== HERO SECTION MOBILE ===== */
    .hero {
        padding: 80px 20px 40px;
        text-align: center;
        min-height: 60vh;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }

    /* ===== CATÉGORIES MOBILE ===== */
    .categories {
        padding: 40px 20px;
    }

    .categories h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-card {
        padding: 20px;
        min-height: 120px;
    }

    .category-card h3 {
        font-size: 1.3rem;
    }

    /* ===== PRODUITS MOBILE ===== */
    .products {
        padding: 40px 20px;
    }

    .products h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        padding: 20px;
        min-height: 200px;
    }

    .product-card h3 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 1.5rem;
        margin: 15px 0;
    }

    .add-to-cart {
        padding: 12px 20px;
        font-size: 1rem;
        width: 100%;
    }

    /* ===== FOOTER MOBILE ===== */
    .footer {
        padding: 30px 20px;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }

    .footer-section {
        width: 100%;
        margin-bottom: 20px;
    }

    .footer-section h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .footer-section ul {
        list-style: none;
        padding: 0;
    }

    .footer-section ul li {
        margin-bottom: 8px;
    }

    .footer-section ul li a {
        font-size: 0.9rem;
    }

    /* ===== MUSIQUE MOBILE ===== */
    .music-control {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        z-index: 1001;
    }
    

    /* ===== ANIMATIONS MOBILE ===== */
    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    @keyframes slideOut {
        from { transform: translateX(0); opacity: 1; }
        to { transform: translateX(100%); opacity: 0; }
    }

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

    .fade-in {
        animation: fadeIn 0.5s ease;
    }
}

/* ===== RÈGLES POUR TRÈS PETITS ÉCRANS ===== */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .categories h2,
    .products h2 {
        font-size: 1.6rem;
    }

    .category-card h3 {
        font-size: 1.2rem;
    }

    .product-card h3 {
        font-size: 1.3rem;
    }

    .product-price {
        font-size: 1.4rem;
    }

    .add-to-cart {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .music-control {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 15px;
        right: 15px;
    }

    .header {
        padding: 8px 12px;
    }

    .logo .logo-image {
        height: 35px;
        width: auto;
    }

    .nav-menu {
        top: 50px;
        height: calc(100vh - 50px);
    }

    .nav-menu a {
        padding: 12px 0;
        font-size: 1rem;
    }

    .search-bar input {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* ===== PANIER MOBILE POUR TRÈS PETITS ÉCRANS ===== */
    .mobile-cart-link {
        padding: 12px 0;
        gap: 12px;
    }

    .mobile-cart-link i {
        font-size: 1.2rem;
        width: 18px;
    }

    .mobile-cart-link span:first-of-type {
        font-size: 1rem;
    }

    .cart-badge {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
}

/* ===== ORIENTATION PAYSAGE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 50vh;
        padding: 60px 20px 30px;
    }

    .nav-menu {
        height: calc(100vh - 50px);
        overflow-y: auto;
    }

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

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

/* ===== ACCESSIBILITÉ MOBILE ===== */
@media (max-width: 768px) {
    /* Améliorer la lisibilité */
    .product-card,
    .category-card {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    /* Boutons plus grands pour le tactile */
    button,
    .add-to-cart,
    .cta-button {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Espacement pour éviter les clics accidentels */
    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Focus visible */
    button:focus,
    input:focus,
    a:focus {
        outline: 2px solid var(--netflix-red);
        outline-offset: 2px;
    }
}
