
/**
 * MycvTop Store - Mobile Optimization
 * Optimisation complète pour smartphones
 */

/* ============================================
   VIEWPORT & BASE MOBILE
   ============================================ */
@media (max-width: 480px) {
    html {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    body {
        font-size: 0.9rem;
        line-height: 1.5;
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Empêcher le scroll horizontal */
    * {
        max-width: 100%;
    }
    
    /* Container mobile */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100%;
    }
    
    /* Typographie mobile */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    h3 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }
    
    p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* ============================================
   HEADER MOBILE
   ============================================ */
@media (max-width: 480px) {
    .nav-wrap {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .brand img {
        height: 80px !important;
        max-width: 100%;
    }
    
    .cart-icon-btn {
        width: 40px;
        height: 40px;
        margin-right: 0.5rem;
    }
    
    .cart-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
        min-width: 16px;
        height: 16px;
        top: -3px;
        right: -3px;
    }
    
    .burger {
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .mobile-panel {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-panel a,
    .mobile-panel button {
        padding: 12px 14px;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

/* ============================================
   HERO SECTION MOBILE
   ============================================ */
@media (max-width: 480px) {
    .hero-section,
    .hero-section-modern {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .hero-content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-title,
    .hero-content h1 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .hero-subtitle,
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-image {
        display: none;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
        width: 100%;
        max-width: 100%;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* ============================================
   PRODUCT GRID MOBILE
   ============================================ */
@media (max-width: 480px) {
    /* Grille produits - 2 colonnes sur mobile */
    .products-grid,
    .products-grid-modern,
    .products-grid-shop {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* Section Featured Products spécifique */
    .featured-products-section .products-grid-modern {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .categories-grid-modern {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem;
    }
    
    .category-image-wrapper {
        aspect-ratio: 1 !important;
        height: auto !important;
    }
    
    .category-card-modern {
        border-radius: 12px;
    }
    
    .category-info-modern {
        padding: 1rem;
    }
    
    .category-info-modern h3 {
        font-size: 0.9rem;
    }
    
    .category-link {
        font-size: 0.8rem;
    }
    
    .product-card,
    .product-card-modern,
    .product-card-shop {
        margin-bottom: 0;
    }
    
    .product-card-modern .product-image-wrapper,
    .product-card-shop .product-image-wrapper,
    .product-image-shop {
        aspect-ratio: 1;
        height: auto;
    }
    
    .product-card-modern .product-info-modern,
    .product-card-shop .product-info-shop {
        padding: 0.75rem;
    }
    
    .product-card-modern .product-name,
    .product-card-shop .product-name-shop {
        font-size: 0.9rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-card-modern .product-description-short {
        display: none;
    }
    
    .product-card-modern .product-price-box,
    .product-card-shop .product-price-box-shop {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .product-card-modern .product-price,
    .product-card-modern .product-price-old,
    .product-card-shop .product-price-shop,
    .product-card-shop .product-price-old-shop {
        font-size: 0.85rem;
    }
    
    .product-card-modern .product-badge,
    .product-card-shop .product-badge-shop {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .product-card-modern .product-footer,
    .product-card-shop .product-footer-shop {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .product-card-modern .btn-add-to-cart,
    .product-card-shop .btn-add-to-cart-shop {
        width: 100%;
        padding: 0.625rem;
        font-size: 0.8rem;
        min-height: 38px;
    }
    
    /* Optimisation spécifique pour product-card-shop */
    .product-card-shop {
        padding: 0.5rem;
    }
    
    .product-card-shop .product-image-wrapper {
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   PRODUCT PAGE MOBILE - OPTIMISÉE
   ============================================ */
@media (max-width: 480px) {
    .product-page {
        padding: 1rem 0 2rem;
        background: #f8f9fa;
    }
    
    .product-detail-container {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
        gap: 1.25rem !important;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    /* Images - Taille moyenne, ne remplit pas toute la page */
    .product-images,
    .product-images-column {
        position: static;
        width: 100%;
        margin-bottom: 1.25rem;
    }
    
    .main-image-wrapper {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .main-image {
        width: 100%;
        max-width: 280px;
        aspect-ratio: 1;
        border-radius: 12px;
        margin: 0 auto;
        display: block;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .image-gallery {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem;
        max-width: 100%;
        margin-top: 0.75rem;
    }
    
    .gallery-item {
        aspect-ratio: 1;
        border-radius: 8px;
    }
    
    /* Informations bien organisées */
    .product-info,
    .product-info-column {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }
    
    .product-header-section {
        padding-bottom: 1rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .product-title {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        color: #713f12;
        font-weight: 800;
    }
    
    .product-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .product-category,
    .product-stock {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
    
    /* Prix bien affiché - En vert */
    .product-price-section,
    .product-price-section-ecommerce {
        background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
        padding: 1.25rem;
        border-radius: 12px;
        border: 2px solid #fef08a;
        margin: 1rem 0;
    }
    
    .price-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }
    
    .price-row:last-child {
        margin-bottom: 0;
    }
    
    .price-label {
        font-size: 0.95rem;
        font-weight: 600;
        color: #666;
    }
    
    .price-old {
        text-decoration: line-through;
        color: #999;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .price-new,
    .price-current {
        color: #ca8a04 !important;
        font-size: 2rem !important;
        font-weight: 900 !important;
        line-height: 1;
    }
    
    .discount-badge,
    .discount-badge-price {
        display: inline-block;
        background: #dc3545;
        color: white;
        padding: 0.4rem 0.8rem;
        border-radius: 8px;
        font-weight: 700;
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }
    
    /* Section Achat - Quantité bien représentée */
    .product-actions-section,
    .product-purchase-section {
        background: #f8f9fa;
        padding: 1.25rem;
        border-radius: 12px;
        border: 1px solid #e9ecef;
        margin-top: 1rem;
    }
    
    .quantity-selector,
    .quantity-selector-ecommerce {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .quantity-selector label,
    .quantity-selector-ecommerce label {
        font-weight: 700;
        font-size: 1rem;
        color: #333;
    }
    
    .quantity-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: white;
        border-radius: 10px;
        padding: 0.25rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 2px solid #e9ecef;
    }
    
    .qty-btn {
        width: 42px;
        height: 42px;
        border: none;
        background: #eab308;
        color: #1c1917;
        border-radius: 8px;
        font-size: 1.3rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .qty-btn:hover {
        background: #ca8a04;
        transform: scale(1.05);
    }
    
    .qty-btn:active {
        transform: scale(0.95);
    }
    
    .quantity-input {
        width: 60px;
        text-align: center;
        border: none;
        font-size: 1.1rem;
        font-weight: 700;
        color: #333;
        background: transparent;
        outline: none;
    }
    
    .btn-add-to-cart-product,
    .btn-add-to-cart-ecommerce {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
        color: #1c1917;
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(234, 179, 8, 0.35);
        min-height: 50px;
        transition: all 0.3s ease;
    }
    
    .btn-add-to-cart-product:hover,
    .btn-add-to-cart-ecommerce:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4);
    }
    
    .btn-add-to-cart-product svg,
    .btn-add-to-cart-ecommerce svg {
        width: 22px;
        height: 22px;
    }
    
    /* Description bien organisée */
    .product-description-section {
        margin: 1.5rem 0 0;
    }
    
    .description-tabs {
        flex-direction: row;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
        background: #f8f9fa;
        padding: 0.5rem;
        border-radius: 10px;
    }
    
    .tab-btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .description-box {
        padding: 1.25rem;
        border-radius: 10px;
        font-size: 0.95rem;
        line-height: 1.7;
    }
}

/* ============================================
   SHOP PAGE MOBILE
   ============================================ */
@media (max-width: 480px) {
    .shop-filters {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .shop-filters input,
    .shop-filters select {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .shop-header {
        padding: 2rem 0 1rem;
    }
    
    .shop-header h1 {
        font-size: 1.75rem;
    }
}

/* ============================================
   CHECKOUT PAGE MOBILE
   ============================================ */
@media (max-width: 480px) {
    .checkout-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .checkout-header {
        margin-bottom: 1.5rem;
    }
    
    .checkout-header h1 {
        font-size: 1.5rem;
    }
    
    .checkout-cart-summary,
    .checkout-form-wrapper {
        padding: 1rem;
    }
    
    .checkout-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .checkout-item-image {
        width: 100%;
        height: 200px;
    }
    
    .checkout-item-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .checkout-quantity-controls {
        width: 100%;
        justify-content: center;
    }
    
    .item-total {
        text-align: center;
        font-size: 1.1rem;
    }
    
    .checkout-form input,
    .checkout-form textarea {
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .promo-input-group {
        flex-direction: column;
    }
    
    .btn-validate-promo {
        width: 100%;
    }
}

/* ============================================
   CART SIDEBAR MOBILE
   ============================================ */
@media (max-width: 480px) {
    .cart-sidebar {
        max-width: 100% !important;
        width: 100%;
    }
    
    .cart-sidebar-header {
        padding: 1rem;
    }
    
    .cart-sidebar-header h2 {
        font-size: 1.25rem;
    }
    
    .cart-close-btn,
    .cart-minimize-btn {
        width: 32px;
        height: 32px;
    }
    
    .cart-sidebar-body {
        padding: 1rem;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
    
    .cart-item-details {
        width: 100%;
    }
    
    .cart-item-quantity {
        width: 100%;
        justify-content: center;
    }
    
    .cart-sidebar-footer {
        padding: 1rem;
    }
    
    .cart-total {
        font-size: 1.1rem;
    }
    
    .btn-checkout {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Sidebar réduite sur mobile */
    .cart-sidebar.minimized {
        max-width: 80px !important;
    }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
@media (max-width: 480px) {
    .main-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-bottom {
        padding-top: 1rem;
        margin-top: 1rem;
    }
}

/* ============================================
   FORMS MOBILE
   ============================================ */
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    textarea {
        min-height: 100px;
        resize: vertical;
    }
}

/* ============================================
   BUTTONS MOBILE
   ============================================ */
@media (max-width: 480px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
        min-width: 44px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .btn-block {
        width: 100%;
    }
    
    .btn-primary {
        font-weight: 700;
    }
    
    .btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   MODALS MOBILE
   ============================================ */
@media (max-width: 480px) {
    .order-modal,
    .thank-you-modal {
        padding: 1rem;
    }
    
    .modal-content-simple,
    .thank-you-modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .modal-icon-success-circle {
        width: 80px;
        height: 80px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   BREADCRUMB MOBILE
   ============================================ */
@media (max-width: 480px) {
    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .breadcrumb .separator {
        margin: 0 0.25rem;
    }
}

/* ============================================
   ALERTS MOBILE
   ============================================ */
@media (max-width: 480px) {
    .alert {
        padding: 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
        margin: 1rem 0;
    }
    
    .alert-error {
        background: #fee;
        border-left: 4px solid #dc3545;
    }
    
    .alert-success {
        background: #efe;
        border-left: 4px solid #ca8a04;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (max-width: 480px) {
    /* Zones de touche plus grandes */
    a,
    button,
    .btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Désactiver le zoom sur les inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Empêche le zoom sur iOS */
    }
    
    /* Améliorer le scroll */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimiser les images */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
}

/* ============================================
   PERFORMANCE MOBILE
   ============================================ */
@media (max-width: 480px) {
    /* Réduire les animations sur mobile */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Optimiser les ombres */
    .product-card,
    .product-card-modern,
    .checkout-item {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Réduire les gradients complexes */
    .btn-primary {
        background: #eab308;
    }
    
    .btn-primary:hover {
        background: #ca8a04;
    }
}

/* ============================================
   UTILITAIRES MOBILE
   ============================================ */
@media (max-width: 480px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    .no-padding-mobile {
        padding: 0 !important;
    }
    
    .small-text-mobile {
        font-size: 0.85rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0;
        min-height: auto;
    }
    
    .nav-wrap {
        padding: 0.5rem 1rem;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* ============================================
   TABLETTE (481px - 768px)
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .products-grid,
    .products-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .checkout-content {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        max-width: 400px;
    }
}
