/*
  ============================================
  BGF WELDING - RESPONSIVE STYLES
  Media queries y optimizaciones responsive
  ============================================
*/

/* ========== DESKTOP ONLY ========== */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .desktop-nav {
    display: none !important;
  }
}

/* ========== MOBILE ONLY ========== */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* ========== EXTRA LARGE DESKTOP (1400px+) ========== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  section {
    padding: var(--spacing-5xl) 0;
  }
}

/* ========== LARGE DESKTOP (1200px - 1399px) ========== */
@media (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
}

/* ========== MEDIUM DESKTOP (992px - 1199px) ========== */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
  
  :root {
    --spacing-4xl: 5rem;
    --spacing-5xl: 6rem;
  }
  
  section {
    padding: var(--spacing-3xl) 0;
  }
}

/* ========== TABLET (768px - 991px) ========== */
@media (max-width: 991px) {
  .container {
    max-width: 720px;
  }
  
  /* Grid ajustes */
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Hero section */
  .hero {
    min-height: 90vh;
  }
  
  .hero-features {
    gap: var(--spacing-lg);
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  /* About section */
  .grid-cols-2 {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }
  
  .about-image {
    order: 2;
  }
  
  .about-content {
    order: 1;
  }
  
  /* Services section */
  .services-grid {
    gap: var(--spacing-lg);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== MOBILE LARGE (577px - 767px) ========== */
@media (max-width: 767px) {
  .container {
    max-width: 540px;
    padding-left: var(--container-padding-mobile);
    padding-right: var(--container-padding-mobile);
  }
  
  :root {
    --spacing-3xl: 3rem;
    --spacing-4xl: 4rem;
    --spacing-5xl: 5rem;
  }
  
  /* Header */
  .header-content {
    min-height: 70px;
    padding: var(--spacing-sm) 0;
  }
  
  .logo img {
    width: 120px;
    height: auto;
  }
  
  /* Mobile menu */
  .mobile-menu-toggle {
    display: block;
  }
  
  .mobile-nav {
    display: block;
  }
  
  /* Hero section */
  .hero {
    min-height: 85vh;
    padding-top: 80px;
  }
  
  .hero-content {
    padding: 0 var(--spacing-md);
  }
  
  .hero-badge .badge {
    font-size: 0.75rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .hero-features {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .feature-item {
    font-size: var(--font-size-body);
  }
  
  .hero-scroll {
    display: none;
  }
  
  /* Sections */
  section {
    padding: var(--spacing-2xl) 0;
  }
  
  section.section-sm {
    padding: var(--spacing-xl) 0;
  }
  
  /* Grid system */
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .grid {
    gap: var(--grid-gap-mobile);
  }
  
  /* Section headers */
  .section-header {
    margin-bottom: var(--spacing-xl);
  }
  
  .section-label {
    font-size: 0.75rem;
  }
  
  /* Service cards */
  .service-card {
    padding: var(--spacing-xl);
  }
  
  .service-icon {
    font-size: 2.5rem;
  }
  
  /* About section */
  .values-grid {
    grid-template-columns: 1fr !important;
  }
  
  .about-tagline {
    font-size: var(--font-size-h6);
  }
  
  /* Contact form */
  .contact-form-wrapper,
  .contact-info {
    order: 0;
  }
  
  .contact-form {
    margin-bottom: var(--spacing-xl);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .footer-column {
    text-align: center;
  }
  
  /* Back to top button */
  .back-to-top {
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    width: 45px;
    height: 45px;
  }
}

/* ========== MOBILE MEDIUM (481px - 576px) ========== */
@media (max-width: 576px) {
  .container {
    max-width: 100%;
  }
  
  /* Hero section */
  .hero {
    min-height: 80vh;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .hero-description {
    font-size: var(--font-size-body);
  }
  
  /* Buttons */
  .btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-body);
  }
  
  /* Services guarantee */
  .guarantee-badge {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-small);
  }
  
  /* Contact info */
  .info-card {
    padding: var(--spacing-lg);
  }
  
  .info-item {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
  
  /* Social icons */
  .social-icon {
    width: 40px;
    height: 40px;
  }
}

/* ========== MOBILE SMALL (320px - 480px) ========== */
@media (max-width: 480px) {
  :root {
    --font-size-base: 14px;
    --spacing-2xl: 2rem;
    --spacing-3xl: 2.5rem;
  }
  
  /* Header */
  .header-content {
    min-height: 60px;
  }
  
  .logo img {
    width: 100px;
  }
  
  .lang-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  /* Hero section */
  .hero {
    min-height: 75vh;
  }
  
  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-description {
    font-size: var(--font-size-small);
  }
  
  .hero-cta {
    gap: var(--spacing-md);
  }
  
  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-small);
  }
  
  /* Section headers */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  .section-description {
    font-size: var(--font-size-small);
  }
  
  /* Service cards */
  .service-card {
    padding: var(--spacing-lg);
  }
  
  .service-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
  }
  
  .service-title {
    font-size: var(--font-size-h5);
  }
  
  .service-description {
    font-size: var(--font-size-small);
  }
  
  /* Form inputs */
  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-small);
  }
  
  /* Info items */
  .info-icon {
    font-size: 1.5rem;
  }
  
  .info-title {
    font-size: var(--font-size-body);
  }
  
  .info-text {
    font-size: var(--font-size-small);
  }
  
  /* Back to top */
  .back-to-top {
    width: 40px;
    height: 40px;
  }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding-top: 70px;
    padding-bottom: var(--spacing-xl);
  }
  
  .hero-content {
    padding: var(--spacing-md) 0;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-description {
    font-size: var(--font-size-small);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-features {
    margin-bottom: var(--spacing-md);
  }
  
  section {
    padding: var(--spacing-xl) 0;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  /* Ocultar elementos no necesarios */
  header,
  .mobile-menu-toggle,
  .back-to-top,
  .hero-scroll,
  .social-icons,
  footer {
    display: none !important;
  }
  
  /* Ajustar layout para impresión */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  section {
    padding: 1cm 0;
    page-break-inside: avoid;
  }
  
  /* Evitar cortes de página en elementos */
  .service-card,
  .info-card,
  .value-item {
    page-break-inside: avoid;
  }
  
  /* Mostrar URLs de enlaces */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Optimizar colores para impresión */
  * {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
}

/* ========== TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
  /* Aumentar áreas táctiles */
  .nav-link,
  .mobile-nav-link,
  .btn,
  .form-input,
  .form-textarea,
  .form-select {
    min-height: 44px;
  }
  
  /* Eliminar hover effects en touch */
  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }
  
  /* Mejorar tap targets */
  a, button {
    -webkit-tap-highlight-color: rgba(255, 107, 53, 0.2);
  }
}

/* ========== HIGH DPI SCREENS ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimizar imágenes y gráficos para pantallas retina */
  .logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ========== DARK MODE (Opcional) ========== */
@media (prefers-color-scheme: dark) {
  /* Implementar si se desea soporte para modo oscuro */
  /* Por ahora comentado, puede activarse en futuras versiones */
}

/* ========== UTILITY CLASSES RESPONSIVE ========== */

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

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

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

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