/* ========================================
   RESPONSIVE DESIGN ENHANCEMENTS
   ======================================== */

/* Mobile First Approach */

/* Base styles for all devices */
html {
    font-size: 16px;
}

.container {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
    max-width: 1200px;
}

.section {
    padding: 60px 0;
    overflow: hidden;
}

/* Flexbox grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col {
    flex: 1 0 0%;
    padding: 15px;
}

/* Grid columns for different sizes */
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

/* Extra Small devices (phones, 480px and down) */
@media (max-width: 480px) {
  :root {
    --font-size-base: 14px;
    --space-4: 0.75rem;
    --space-6: 1rem;
    --space-8: 1.25rem;
  }
  
  .container {
    padding: 0 var(--space-3);
  }
  
  .banner-title {
    font-size: var(--font-size-4xl);
    line-height: 1.1;
  }
  
  .banner-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .cta-buttons {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    max-width: 250px;
  }
  
  .gallery {
    height: 200px;
    gap: var(--space-1);
  }
  
  .card {
    height: 180px;
    max-width: 60px;
  }
  
  .card .name {
    font-size: var(--font-size-xs);
    letter-spacing: 1px;
  }
  
  .purpose-cards {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .purpose-card {
    padding: var(--space-6);
  }
  
  .products {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .product-features {
    align-items: center;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  /* Columnas en móvil */
  .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
  .col-xs-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 481px) and (max-width: 576px) {
  .gallery {
    height: 250px;
  }
  
  .card {
    height: 220px;
    max-width: 70px;
  }
  
  .banner-title {
    font-size: var(--font-size-5xl);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 577px) and (max-width: 768px) {
  .gallery {
    height: 300px;
  }
  
  .card {
    height: 260px;
    max-width: 80px;
  }
  
  .purpose-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  
  .products {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 769px) and (max-width: 992px) {
  .gallery {
    height: 350px;
  }
  
  .card {
    height: 300px;
    max-width: 90px;
  }
  
  .purpose-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .products {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
  
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 993px) {
  .gallery {
    height: 400px;
  }
  
  .card {
    height: 320px;
    max-width: 100px;
  }
  
  .purpose-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
  
  .products {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-20);
  }
  
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   MOBILE MENU ENHANCEMENTS
   ======================================== */

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: var(--z-fixed);
  }
  
  .hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: var(--space-8);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: var(--z-dropdown);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-menu li {
    margin: var(--space-2) 0;
  }
  
  .nav-menu a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
  }
  
  .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ========================================
   TOUCH DEVICE ENHANCEMENTS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }
  
  .card:active {
    transform: scale(0.98);
  }
  
  .btn:hover {
    transform: none;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .purpose-card:hover {
    transform: none;
  }
  
  .purpose-card:active {
    transform: scale(0.98);
  }
  
  .social-icon:hover {
    transform: none;
  }
  
  .social-icon:active {
    transform: scale(0.9);
  }
}

/* ========================================
   HIGH DPI DISPLAYS
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .product-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .banner,
  .navbar,
  .mobile-menu-toggle,
  .cta-buttons,
  .social-icons,
  .animated-background {
    display: none !important;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .section {
    padding: var(--space-4) 0;
    page-break-inside: avoid;
  }
  
  .purpose-card,
  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
  
  .btn {
    border: 1px solid #000;
    background: none;
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Reduced motion preferences */
@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;
  }
  
  .bubble {
    animation: none !important;
  }
  
  .card {
    transition: none !important;
  }
  
  .btn {
    transition: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #0000FF;
    --color-secondary: #000080;
    --color-text-primary: #000000;
    --color-text-secondary: #000000;
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #FFFFFF;
  }
  
  .card {
    border: 2px solid #000000;
  }
  
  .btn {
    border: 2px solid #000000;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #E5E7EB;
    --color-text-muted: #9CA3AF;
    --color-bg-primary: #111827;
    --color-bg-secondary: #1F2937;
    --color-bg-tertiary: #374151;
  }
  
  .purpose-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-gray-600);
  }
  
  .card {
    background: var(--color-gray-800);
  }
}

/* ========================================
   CONTAINER QUERIES (Future-proofing)
   ======================================== */

@supports (container-type: inline-size) {
  .gallery {
    container-type: inline-size;
  }
  
  @container (max-width: 600px) {
    .card {
      height: 200px;
    }
  }
  
  @container (min-width: 601px) {
    .card {
      height: 320px;
    }
  }
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
   ======================================== */

.hidden-mobile {
  display: block;
}

.hidden-desktop {
  display: none;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
  
  .hidden-desktop {
    display: block;
  }
}

.text-responsive {
  font-size: clamp(var(--font-size-base), 4vw, var(--font-size-xl));
}

.spacing-responsive {
  padding: clamp(var(--space-4), 5vw, var(--space-8));
}

.container-responsive {
  width: 100%;
  max-width: min(1200px, 90vw);
  margin: 0 auto;
  padding: 0 clamp(var(--space-4), 5vw, var(--space-8));
}
