/**
 * RESPONSIVE UTILITIES
 * Stili responsive aggiuntivi per tutto il sito
 * Ristorante Valastro
 */

/* =============================================================================
   MOBILE OPTIMIZATION (< 768px)
   ============================================================================= */

@media (max-width: 768px) {
  /* Typography mobile */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.1;
  }
  
  h2 {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    line-height: 1.2;
  }
  
  h3 {
    font-size: clamp(1.25rem, 4vw, 1.75rem) !important;
    line-height: 1.3;
  }
  
  p {
    font-size: 1rem;
  }
  
  /* Spacing mobile */
  section {
    padding: 4rem 1.5rem !important;
  }
  
  /* Container mobile */
  .container,
  .container-sm,
  .container-xs {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
  }
  
  /* Buttons mobile */
  .btn {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 1rem 2rem;
    text-align: center;
  }
  
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }
  
  /* Grid mobile - sempre 1 colonna */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto-fit,
  .grid-auto-fit-sm {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  /* Card mobile */
  .card {
    margin-bottom: 1rem;
  }
  
  .card-padding {
    padding: 1.5rem;
  }
  
  /* Images mobile */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Video background mobile - nascondere su schermi piccoli per performance */
  .video-background video {
    display: block;
    min-height: 100vh;
  }
  
  /* Scroll indicator mobile */
  .scroll-down {
    font-size: 0.7rem;
    bottom: 1.5rem;
  }
  
  /* Footer mobile */
  .footer {
    padding: 3rem 1.5rem;
    text-align: center;
  }
  
  .footer-container {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    text-align: center;
  }
  
  .footer-section {
    margin-bottom: 1.5rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  /* Nascondi separatori | su mobile */
  .footer-links span {
    display: none !important;
  }
  
  .payment-icons {
    justify-content: center;
    gap: 1rem;
  }
  
  /* Tables mobile - scroll horizontal */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  
  /* Forms mobile */
  .field-row {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  .form-step {
    padding: 2rem 1.5rem !important;
  }
  
  /* Navigation mobile improvements */
  .sections-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .sections-nav::-webkit-scrollbar {
    height: 4px;
  }
  
  .sections-nav::-webkit-scrollbar-thumb {
    background: var(--color-valastro-blue);
    border-radius: 2px;
  }
}

/* =============================================================================
   EXTRA SMALL MOBILE (< 480px)
   ============================================================================= */

@media (max-width: 480px) {
  /* Typography extra small */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  /* Spacing extra small */
  section {
    padding: 3rem 1rem !important;
  }
  
  /* Buttons extra small */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.85rem;
  }
  
  .btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
  }
  
  /* Card extra small */
  .card-padding {
    padding: 1.25rem;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
  }
  
  .card-icon svg {
    width: 24px;
    height: 24px;
  }
  
  /* Footer extra small */
  .footer {
    padding: 2.5rem 1rem;
  }
  
  .footer-section h4 {
    font-size: 0.75rem;
  }
  
  .footer-section p,
  .footer-section a {
    font-size: 0.875rem;
  }
  
  /* Hero extra small */
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .scroll-down {
    font-size: 0.65rem;
    bottom: 1rem;
  }
}

/* =============================================================================
   TABLET (769px - 1024px)
   ============================================================================= */

@media (min-width: 769px) and (max-width: 1024px) {
  /* Container tablet */
  .container {
    max-width: 900px;
    padding: 0 2rem;
  }
  
  /* Grid tablet */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-auto-fit {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Typography tablet */
  h1 {
    font-size: clamp(3rem, 7vw, 5rem) !important;
  }
  
  h2 {
    font-size: clamp(2rem, 5vw, 3rem) !important;
  }
  
  /* Section spacing tablet */
  section {
    padding: 7rem 2rem !important;
  }
  
  /* Card tablet */
  .card-padding {
    padding: 2rem;
  }
}

/* =============================================================================
   LANDSCAPE MOBILE (< 768px and landscape)
   ============================================================================= */

@media (max-width: 768px) and (orientation: landscape) {
  /* Hero landscape */
  .hero {
    min-height: auto;
    padding: 3rem 0;
  }
  
  .hero-content {
    padding: 2rem;
  }
  
  .hero-content h1 {
    font-size: 2rem !important;
  }
  
  .scroll-down {
    display: none;
  }
  
  /* Sections landscape */
  section {
    padding: 3rem 1.5rem !important;
  }
}

/* =============================================================================
   UTILITIES RESPONSIVE
   ============================================================================= */

/* Hide on mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Text alignment responsive */
@media (max-width: 768px) {
  .text-center-mobile {
    text-align: center !important;
  }
  
  .text-left-mobile {
    text-align: left !important;
  }
}

/* Spacing utilities mobile */
@media (max-width: 768px) {
  .mt-mobile-0 { margin-top: 0 !important; }
  .mt-mobile-sm { margin-top: 0.5rem !important; }
  .mt-mobile-md { margin-top: 1rem !important; }
  .mt-mobile-lg { margin-top: 1.5rem !important; }
  
  .mb-mobile-0 { margin-bottom: 0 !important; }
  .mb-mobile-sm { margin-bottom: 0.5rem !important; }
  .mb-mobile-md { margin-bottom: 1rem !important; }
  .mb-mobile-lg { margin-bottom: 1.5rem !important; }
  
  .p-mobile-0 { padding: 0 !important; }
  .p-mobile-sm { padding: 0.5rem !important; }
  .p-mobile-md { padding: 1rem !important; }
  .p-mobile-lg { padding: 1.5rem !important; }
}

/* =============================================================================
   TOUCH OPTIMIZATIONS
   ============================================================================= */

/* Aumenta l'area di tocco per elementi interattivi su mobile */
@media (max-width: 768px) {
  button,
  .btn,
  a[role="button"],
  input[type="submit"],
  input[type="button"] {
    min-height: 44px; /* iOS raccomandato */
    min-width: 44px;
  }
  
  /* Migliora lo scroll su mobile */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  
  /* Smooth scrolling su mobile */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent zoom on input focus iOS */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important; /* Previene zoom automatico iOS */
  }
}

/* =============================================================================
   PERFORMANCE OPTIMIZATIONS MOBILE
   ============================================================================= */

@media (max-width: 768px) {
  /* Riduci animazioni pesanti su mobile */
  @media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
      transition-duration: 0.4s;
    }
    
    .card:hover {
      transform: translateY(-3px);
    }
  }
  
  /* Ottimizza rendering immagini */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}
