/* ============================================================
   RESPONSIVE.CSS - Ajustes específicos por dispositivo
   Medica LFM - Landing Page
   ============================================================ */

/* ----------------------------------------
   BASE - Ajustes globales
   ---------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

/* ----------------------------------------
   DISPOSITIVOS MÓVILES PEQUEÑOS (hasta 375px)
   iPhone SE, Galaxy A series
   ---------------------------------------- */
@media screen and (max-width: 375px) {
    h1 { font-size: 2rem !important; }
    .text-5xl { font-size: 2rem !important; }
    .text-7xl { font-size: 2.5rem !important; }
    .text-4xl { font-size: 1.75rem !important; }
    .text-3xl { font-size: 1.5rem !important; }
    
    body { font-size: 14px; }
    
    #products-grid { gap: 0.75rem !important; }
    .product-card { padding: 1rem !important; }
    .product-card .h-40 { height: 8rem !important; }
    
    #product-modal > div { padding: 0.75rem !important; border-radius: 1rem !important; }
    #product-modal .p-8, #product-modal .md\:p-12 { padding: 1.25rem !important; }
    #modal-title { font-size: 1.75rem !important; }
    #modal-concentration { font-size: 1rem !important; padding: 0.25rem 0.75rem !important; }
    
    .contact-card { padding: 1.5rem !important; }
}

/* ----------------------------------------
   DISPOSITIVOS MÓVILES (hasta 480px)
   iPhone 12, 13, 14, 15, Android
   ---------------------------------------- */
@media screen and (max-width: 480px) {
    .blob-shape { opacity: 0.85; }
    .animate-float, .animate-float-delayed, .animate-float-reverse { animation-duration: 8s; }
    
    nav .text-2xl { font-size: 1.25rem; }
    
    main#inicio { margin-top: 2rem; }
    main#inicio .text-5xl { font-size: 2.75rem !important; }
    main#inicio .text-7xl { font-size: 3.5rem !important; }
    
    section { padding-top: 4rem !important; padding-bottom: 4rem !important; }
    
    .product-card .h-40 { height: 9rem; }
    
    #product-modal > div { max-height: 95vh !important; }
    #product-modal .p-8, #product-modal .md\:p-12 { padding: 1.25rem !important; }
    #product-modal .gap-10 { gap: 1.5rem !important; }
    
    #modal-image { max-height: 220px !important; }
}

/* ----------------------------------------
   MÓVILES GRANDES Y PHABLETS (481px - 767px)
   ---------------------------------------- */
@media screen and (min-width: 481px) and (max-width: 767px) {
    main#inicio .text-5xl { font-size: 3rem !important; }
    main#inicio .text-7xl { font-size: 4rem !important; }
    
    #products-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ----------------------------------------
   TABLETS (768px - 1023px)
   iPad, Galaxy Tab
   ---------------------------------------- */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    main#inicio { padding-left: 2rem; padding-right: 2rem; }
    main#inicio .text-7xl { font-size: 4.5rem; }
    
    #products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1.5rem; }
    
    #product-modal > div { max-width: 90vw !important; }
}

/* ----------------------------------------
   TABLETS GRANDES Y LAPTOPS (1024px - 1279px)
   ---------------------------------------- */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
    #products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ----------------------------------------
   DESKTOP (1280px - 1535px)
   ---------------------------------------- */
@media screen and (min-width: 1280px) {
    #products-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ----------------------------------------
   DESKTOP XL (1536px+)
   ---------------------------------------- */
@media screen and (min-width: 1536px) {
    main#inicio, nav > div, section > div { max-width: 1400px; }
    #products-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 2rem; }
}

/* ----------------------------------------
   PANTALLAS RETINA / ALTA DENSIDAD
   ---------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img { image-rendering: -webkit-optimize-contrast; }
}

/* ----------------------------------------
   ORIENTACIÓN LANDSCAPE EN MÓVILES
   ---------------------------------------- */
@media screen and (max-height: 500px) and (orientation: landscape) {
    main#inicio { min-height: auto; padding-bottom: 2rem; }
    main#inicio .text-7xl { font-size: 3rem !important; }
    #product-modal > div { max-height: 100vh !important; }
}

/* ----------------------------------------
   DISPOSITIVOS TÁCTILES (sin hover real)
   ---------------------------------------- */
@media (hover: none) {
    .hover\:scale-105:hover, .hover\:-translate-y-2:hover { transform: none !important; }
    .hover\:shadow-2xl:hover { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important; }
}

/* ----------------------------------------
   ACCESIBILIDAD - REDUCIR MOVIMIENTO
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in-up { opacity: 1 !important; transform: none !important; }
}

/* ----------------------------------------
   IMPRESIÓN
   ---------------------------------------- */
@media print {
    nav, #product-modal, .animate-float, .animate-float-delayed, .animate-float-reverse { display: none !important; }
    body { background: white !important; color: black !important; }
    .blob-shape { display: none; }
    section { padding: 1rem 0 !important; }
}