/* ========================================
   MOBILE-FIRST CSS - FCPAM
   Optimisation mobile complète
   ======================================== */

/* ========================================
   VARIABLES MOBILE
   ======================================== */
:root {
  /* Touch targets - Apple Guidelines */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
  
  /* Spacing mobile */
  --mobile-space-xs: 8px;
  --mobile-space-sm: 12px;
  --mobile-space-md: 16px;
  --mobile-space-lg: 20px;
  --mobile-space-xl: 24px;
  --mobile-space-2xl: 32px;
  
  /* Typography mobile */
  --mobile-font-xs: 12px;
  --mobile-font-sm: 14px;
  --mobile-font-base: 16px;
  --mobile-font-lg: 18px;
  --mobile-font-xl: 20px;
  --mobile-font-2xl: 24px;
  --mobile-font-3xl: 28px;
  
  /* Breakpoints */
  --mobile: 480px;
  --tablet: 768px;
  --desktop: 1024px;
  --large: 1200px;
}

/* ========================================
   BASE MOBILE OPTIMIZATIONS
   ======================================== */

/* Prevent zoom on input focus */
input, select, textarea {
  font-size: 16px !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Touch callouts disabled */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection for inputs */
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

/* Header mobile improvements */
@media (max-width: 768px) {
  header.site {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  }
  
  .nav {
    position: relative;
    z-index: 100;
  }
  
  .logo {
    z-index: 1001;
  }
}

/* Mobile menu improvements */
@media (max-width: 768px) {
  .menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--mobile-space-2xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .menu.active {
    left: 0;
  }
  
  .menu a {
    display: block;
    padding: var(--mobile-space-lg) 0;
    font-size: var(--mobile-font-xl);
    font-weight: 600;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: center;
    min-height: var(--touch-target-comfortable);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
  }
  
  .burger {
    position: relative;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #000;
    border-radius: 8px;
    font-size: 24px;
    color: white;
    padding: var(--mobile-space-sm);
    min-width: var(--touch-target-comfortable);
    min-height: var(--touch-target-comfortable);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  
  .burger:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
  }
  
  .burger.active {
    background: #ffd700;
    color: #000;
    border-color: #ffd700;
  }
}

/* ========================================
   MOBILE BOUTIQUE
   ======================================== */

@media (max-width: 768px) {
  /* Hero section mobile */
  .boutique-hero {
    padding: var(--mobile-space-2xl) 0;
    text-align: center;
  }
  
  .boutique-hero h1 {
    font-size: var(--mobile-font-3xl);
    line-height: 1.2;
    margin-bottom: var(--mobile-space-lg);
  }
  
  .boutique-hero p {
    font-size: var(--mobile-font-base);
    line-height: 1.6;
    margin-bottom: var(--mobile-space-xl);
  }
  
  .boutique-stats {
    flex-direction: column;
    gap: var(--mobile-space-lg);
  }
  
  .boutique-stat {
    padding: var(--mobile-space-lg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }
  
  /* Filters mobile */
  .filters-container {
    flex-direction: column;
    gap: var(--mobile-space-md);
    padding: var(--mobile-space-lg);
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: var(--mobile-space-lg) 0;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-select, .search-input {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    font-size: var(--mobile-font-base);
    padding: var(--mobile-space-md);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
  }
  
  .filter-select:focus, .search-input:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  }
  
  .search-group {
    margin-left: 0;
    width: 100%;
  }
  
  .search-btn {
    min-height: var(--touch-target-comfortable);
    padding: var(--mobile-space-md) var(--mobile-space-lg);
    font-size: var(--mobile-font-base);
  }
  
  /* Products grid mobile */
  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-space-lg);
    padding: 0 var(--mobile-space-md);
  }
  
  .products-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--mobile-space-md);
    padding: 0 var(--mobile-space-md);
  }
  
  .products-header h2 {
    font-size: var(--mobile-font-2xl);
  }
  
  .products-count {
    font-size: var(--mobile-font-sm);
    color: #6c757d;
  }
}

/* ========================================
   MOBILE PRODUCT CARDS
   ======================================== */

@media (max-width: 768px) {
  .product-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .product-card:active {
    transform: scale(0.98);
  }
  
  .product-image {
    height: 200px;
    position: relative;
    overflow: hidden;
  }
  
  .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
  
  .product-card:hover .product-image img {
    transform: scale(1.05);
  }
  
  .product-info {
    padding: var(--mobile-space-lg);
  }
  
  .product-name {
    font-size: var(--mobile-font-lg);
    line-height: 1.3;
    margin-bottom: var(--mobile-space-sm);
  }
  
  .product-description {
    font-size: var(--mobile-font-sm);
    line-height: 1.5;
    margin-bottom: var(--mobile-space-md);
    color: #6c757d;
  }
  
  .product-price {
    font-size: var(--mobile-font-xl);
    font-weight: 700;
    margin-bottom: var(--mobile-space-md);
  }
  
  /* Colors and sizes mobile */
  .colors-label, .sizes-label {
    font-size: var(--mobile-font-sm);
    font-weight: 600;
    margin-bottom: var(--mobile-space-sm);
  }
  
  .color-options {
    gap: var(--mobile-space-sm);
    margin-bottom: var(--mobile-space-md);
  }
  
  .color-option {
    width: 40px;
    height: 40px;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
  }
  
  .size-options {
    gap: var(--mobile-space-sm);
    margin-bottom: var(--mobile-space-lg);
  }
  
  .size-option {
    min-width: var(--touch-target-comfortable);
    min-height: var(--touch-target-comfortable);
    padding: var(--mobile-space-sm) var(--mobile-space-md);
    font-size: var(--mobile-font-sm);
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Product actions mobile */
  .product-actions {
    flex-direction: column;
    gap: var(--mobile-space-sm);
  }
  
  .btn-add-cart, .btn-view-details {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    padding: var(--mobile-space-md) var(--mobile-space-lg);
    font-size: var(--mobile-font-base);
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .btn-add-cart {
    background: #000;
    color: white;
  }
  
  .btn-add-cart:hover:not(:disabled) {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  .btn-add-cart:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
  }
  
  .btn-view-details {
    background: white;
    color: #000;
    border: 2px solid #000;
  }
  
  .btn-view-details:hover {
    background: #000;
    color: white;
  }
}

/* ========================================
   MOBILE MODAL
   ======================================== */

@media (max-width: 768px) {
  .modal-overlay {
    padding: var(--mobile-space-md);
  }
  
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }
  
  .modal-header {
    padding: var(--mobile-space-lg);
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
  }
  
  .modal-title {
    font-size: var(--mobile-font-xl);
  }
  
  .modal-close {
    width: var(--touch-target-comfortable);
    height: var(--touch-target-comfortable);
    font-size: 24px;
  }
  
  .modal-body {
    padding: var(--mobile-space-lg);
    max-height: calc(95vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-product-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-space-lg);
  }
  
  .modal-product-image {
    height: 250px;
    border-radius: 16px;
  }
  
  .modal-product-name {
    font-size: var(--mobile-font-xl);
  }
  
  .modal-product-price {
    font-size: var(--mobile-font-2xl);
  }
  
  .modal-color-options, .modal-size-options {
    gap: var(--mobile-space-md);
  }
  
  .modal-color-option {
    width: 56px;
    height: 56px;
    min-width: var(--touch-target-comfortable);
    min-height: var(--touch-target-comfortable);
  }
  
  .modal-size-option {
    min-width: var(--touch-target-comfortable);
    min-height: var(--touch-target-comfortable);
    padding: var(--mobile-space-md) var(--mobile-space-lg);
    font-size: var(--mobile-font-base);
  }
  
  .modal-btn-add-cart {
    min-height: var(--touch-target-comfortable);
    font-size: var(--mobile-font-lg);
    font-weight: 700;
    border-radius: 16px;
  }
}

/* ========================================
   MOBILE CART
   ======================================== */

@media (max-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: var(--mobile-space-lg);
  }
  
  .cart-item {
    flex-direction: column;
    gap: var(--mobile-space-md);
    padding: var(--mobile-space-lg);
    border-radius: 16px;
  }
  
  .cart-item-image {
    width: 100%;
    height: 120px;
    border-radius: 12px;
  }
  
  .cart-item-details {
    width: 100%;
  }
  
  .cart-item-name {
    font-size: var(--mobile-font-lg);
    margin-bottom: var(--mobile-space-sm);
  }
  
  .cart-item-size, .cart-item-color {
    font-size: var(--mobile-font-sm);
    margin-bottom: var(--mobile-space-xs);
  }
  
  .cart-item-price {
    font-size: var(--mobile-font-lg);
    font-weight: 700;
    margin-bottom: var(--mobile-space-md);
  }
  
  .cart-item-controls {
    flex-direction: column;
    gap: var(--mobile-space-md);
  }
  
  .quantity-controls {
    justify-content: space-between;
    width: 100%;
  }
  
  .quantity-btn {
    width: var(--touch-target-comfortable);
    height: var(--touch-target-comfortable);
    border-radius: 50%;
    font-size: var(--mobile-font-lg);
    font-weight: 700;
  }
  
  .quantity-display {
    font-size: var(--mobile-font-lg);
    font-weight: 600;
  }
  
  .remove-item-btn {
    width: var(--touch-target-comfortable);
    height: var(--touch-target-comfortable);
    border-radius: 50%;
    font-size: var(--mobile-font-lg);
  }
  
  .summary-card {
    position: sticky;
    bottom: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: var(--mobile-space-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .btn-checkout {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    font-size: var(--mobile-font-lg);
    font-weight: 700;
    border-radius: 16px;
  }
}

/* ========================================
   MOBILE DASHBOARD
   ======================================== */

@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
    gap: var(--mobile-space-lg);
  }
  
  .dashboard-sidebar {
    order: 2;
    position: static;
  }
  
  .dashboard-main {
    order: 1;
  }
  
  .dashboard-card {
    padding: var(--mobile-space-lg);
    border-radius: 16px;
  }
  
  .dashboard-card h3 {
    font-size: var(--mobile-font-lg);
    margin-bottom: var(--mobile-space-md);
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: var(--mobile-space-md);
  }
  
  .form-group input, .form-group select, .form-group textarea {
    min-height: var(--touch-target-comfortable);
    font-size: var(--mobile-font-base);
    padding: var(--mobile-space-md);
    border-radius: 12px;
  }
  
  .btn {
    min-height: var(--touch-target-comfortable);
    padding: var(--mobile-space-md) var(--mobile-space-lg);
    font-size: var(--mobile-font-base);
    border-radius: 12px;
  }
}

/* ========================================
   MOBILE ANIMATIONS
   ======================================== */

/* Smooth transitions for mobile */
@media (max-width: 768px) {
  * {
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  
  /* Haptic feedback simulation */
  .btn:active, .product-card:active, .color-option:active, .size-option:active {
    transform: scale(0.95);
  }
  
  /* Loading states */
  .loading {
    opacity: 0.6;
    pointer-events: none;
  }
  
  /* Success states */
  .success {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
  }
}

/* ========================================
   MOBILE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  /* Hide on mobile */
  .desktop-only {
    display: none !important;
  }
  
  /* Show only on mobile */
  .mobile-only {
    display: block !important;
  }
  
  /* Text alignment */
  .text-center-mobile {
    text-align: center;
  }
  
  /* Spacing utilities */
  .p-mobile-sm { padding: var(--mobile-space-sm); }
  .p-mobile-md { padding: var(--mobile-space-md); }
  .p-mobile-lg { padding: var(--mobile-space-lg); }
  
  .m-mobile-sm { margin: var(--mobile-space-sm); }
  .m-mobile-md { margin: var(--mobile-space-md); }
  .m-mobile-lg { margin: var(--mobile-space-lg); }
  
  /* Full width on mobile */
  .w-full-mobile {
    width: 100% !important;
  }
  
  /* Stack on mobile */
  .stack-mobile {
    flex-direction: column !important;
  }
}

/* ========================================
   ACCESSIBILITY MOBILE
   ======================================== */

@media (max-width: 768px) {
  /* Focus indicators */
  .btn:focus, .color-option:focus, .size-option:focus, 
  .filter-select:focus, .search-input:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
  }
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .product-card {
      border: 2px solid #000;
    }
    
    .btn {
      border: 2px solid #000;
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .menu, .burger, .btn, .modal-overlay {
    display: none !important;
  }
  
  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
}
