/* ==========================================================================
   ADAPTACIONES RESPONSIVE COMPLETAS - Dark Luxury Gold - Colchones Gandia
   Totalmente adaptado y verificado para:
   - Ultra-wide & Desktop (> 1200px)
   - Tablets Landscape & iPad Pro (1025px - 1200px)
   - Tablets Portrait & Standard Tablets (769px - 1024px)
   - Móviles y Phablets (481px - 768px)
   - Móviles Pequeños (<= 480px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   TABLETS LANDSCAPE, IPAD PRO Y PANTALLAS COMPACTAS (HASTA 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  /* Cabecera: Activar navegación móvil/drawer para evitar desbordamientos */
  .main-nav {
    display: none !important;
  }

  .menu-toggle-btn {
    display: inline-flex !important;
  }

  .header-advisor-btn {
    display: none !important;
  }

  .site-header {
    height: 72px;
  }

  .header-inner {
    height: 72px;
    gap: 0.75rem;
  }

  .brand-logo-img {
    height: 46px;
  }

  /* Barra Superior Ticker */
  .top-bar-ticker {
    font-size: 0.72rem;
    padding: 0.4rem 0;
  }
  .ticker-group {
    gap: 2.25rem;
    padding-right: 2.25rem;
  }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-2xl);
  }

  .hero-title {
    font-size: clamp(2rem, 3.8vw, 2.75rem);
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }

  /* Categorías y Beneficios */
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Catálogo */
  .catalog-layout {
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   TABLETS PORTRAIT Y TABLETS ESTÁNDAR (HASTA 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Cabecera */
  .site-header {
    height: 68px;
  }

  .header-inner {
    height: 68px;
  }

  .brand-logo-img {
    height: 56px;
    width: auto;
    max-width: 140px;
  }

  /* Hero en formato Tablet Vertical / Apilado Armónico */
  .hero-section {
    padding: var(--space-2xl) 0 var(--space-3xl) 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero-content {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  .hero-subtitle {
    max-width: 100%;
    font-size: var(--font-size-base);
  }

  .hero-media-wrap {
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
  }

  .hero-trust-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    justify-items: start;
    width: 100%;
  }

  .hero-floating-card {
    bottom: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1rem;
  }

  /* Beneficios en 2 columnas */
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Categorías en 2 columnas */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Rejilla de Productos en 2 columnas */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Catálogo y Filtros en Drawer Móvil/Tablet */
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background-color: var(--color-bg-dark);
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-sidebar.is-mobile-open {
    display: block;
    animation: fadeInDown 250ms ease-out forwards;
  }

  .mobile-filter-close {
    display: inline-flex !important;
  }

  .mobile-filter-apply-btn {
    display: block !important;
  }

  .mobile-filter-trigger {
    display: inline-flex !important;
  }

  /* Visor Anatómico de Capas */
  .anatomy-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .layer-info-pane {
    padding: 1.75rem;
  }

  /* Comparativa de Tecnologías Móvil (Cero scroll horizontal) */
  .tech-desktop-only {
    display: none !important;
  }

  .tech-cards-mobile {
    display: block !important;
    width: 100%;
    max-width: 100%;
  }

  /* Comparador Modal Móvil */
  .compare-desktop-table {
    display: none !important;
  }

  .compare-mobile-cards {
    display: flex !important;
  }

  /* Recomendador Quiz */
  .quiz-card-wrapper {
    max-width: 100%;
  }

  .quiz-body {
    padding: 2rem 1.5rem;
  }

  .quiz-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Blog en 2 columnas */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Nosotros en Tablet */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Contacto */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form-card {
    padding: 2rem;
  }

  /* Pie de página */
  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Modales en Tablet */
  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
  }

  .checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .modal-container {
    max-width: 90vw;
  }
}

/* --------------------------------------------------------------------------
   MÓVILES Y TABLETS VERTICALES (HASTA 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --space-4xl: 3.25rem;
    --space-3xl: 2.25rem;
    --space-2xl: 1.75rem;
  }

  /* Barra Superior Ticker */
  .top-bar-ticker {
    font-size: 0.6875rem;
    padding: 0.35rem 0;
  }
  .ticker-group {
    gap: 1.75rem;
    padding-right: 1.75rem;
  }

  /* Cabecera */
  .site-header {
    height: 66px;
  }

  .header-inner {
    height: 66px;
    gap: 0.5rem;
  }

  .brand-logo-img {
    height: 52px;
    width: auto;
    max-width: 130px;
  }

  .brand-logo-img-footer {
    height: 68px;
    width: auto;
    max-width: 160px;
  }

  .header-action-btn {
    width: 38px;
    height: 38px;
  }

  /* Hero Móvil: Centrado armónico y directo */
  .hero-section {
    padding: var(--space-xl) 0 var(--space-2xl) 0;
  }

  .hero-content {
    align-items: center;
    text-align: center;
    width: 100%;
    margin: 0 auto;
  }

  .hero-eyebrow {
    margin: 0 auto 0.5rem auto;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.25rem);
    line-height: 1.15;
    text-align: center;
  }

  .hero-subtitle {
    font-size: var(--font-size-sm);
    text-align: center;
    margin: 0 auto 1.25rem auto;
    max-width: 95%;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
    align-items: center;
  }

  .hero-cta-group .btn {
    width: 100%;
    max-width: 280px;
    padding: 0.55rem 1.25rem;
    font-size: 0.8125rem;
    min-height: 38px;
    justify-content: center;
  }

  /* Ocultar en móvil para hacer el Hero directo y evitar scroll pesado */
  .hero-trust-badges,
  .hero-media-wrap {
    display: none !important;
  }

  /* Propuesta de Valor */
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Categorías */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .category-tile {
    padding: 0.6rem 0.85rem;
    gap: 0.75rem;
  }

  .category-tile-media {
    width: 52px;
    height: 52px;
    min-width: 52px;
    max-width: 52px;
  }

  .category-tile-title {
    font-size: 0.875rem;
  }

  .category-tile-count {
    font-size: 0.6875rem;
  }

  .category-tile-arrow {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }

  /* Rejillas de Productos: 2 columnas compactas para navegación ágil sin scroll infinito */
  .products-grid,
  #catalog-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  /* Recomendador Quiz */
  .quiz-header-bar {
    padding: 1rem 1.25rem;
  }

  .quiz-body {
    padding: 1.5rem 1rem;
  }

  .quiz-question-title {
    font-size: 1.25rem;
  }

  .quiz-options-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .quiz-option-card {
    padding: 1rem;
  }

  .quiz-footer-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quiz-footer-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Comparativa de Tecnologías en Móviles Pequeños */
  .tech-mobile-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .tech-tab-btn {
    font-size: 0.72rem;
    padding: 0.5rem 0.2rem;
    gap: 0.25rem;
  }

  .tech-card-item {
    padding: 1.15rem;
  }

  .tech-card-title {
    font-size: 1.1rem;
  }

  .tech-card-specs li {
    font-size: 0.8125rem;
  }

  /* Toolbar de Catálogo */
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .catalog-toolbar > div {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Sección Nosotros Móvil */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .about-stat-card {
    padding: 1rem 0.85rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .about-media-wrap {
    margin-top: 0.75rem;
    max-height: 280px;
  }

  .about-media-wrap img {
    height: 240px;
    object-fit: cover;
  }

  /* Formularios */
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-form-card {
    padding: 1.35rem;
  }

  /* Pie de página Móvil Centrado */
  .site-footer {
    text-align: center;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
  }

  .site-footer .brand-logo {
    display: inline-flex;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
  }

  .brand-logo-img-footer {
    margin: 0 auto;
    display: block;
  }

  .footer-top-grid p {
    margin-left: auto;
    margin-right: auto;
    max-width: 380px;
    text-align: center;
  }

  .footer-col-title {
    text-align: center;
  }

  .footer-col-title::after {
    margin: 6px auto 0 auto;
  }

  .footer-links-list {
    align-items: center;
    text-align: center;
  }

  .footer-links-list a {
    display: inline-block;
  }

  .footer-links-list a:hover {
    transform: none;
  }

  .footer-contact-item {
    justify-content: center;
    text-align: center;
    margin: 0.75rem auto;
    max-width: 320px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-bottom > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
  }

  .footer-bottom a {
    margin-left: 0 !important;
  }

  .footer-legal-links {
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  /* Modales centrados en pantalla en móvil */
  .modal-backdrop {
    padding: 1rem;
    align-items: center;
    justify-content: center;
  }

  .modal-container {
    max-height: 90vh;
    max-width: min(92vw, 600px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-accent-border);
    margin: auto;
  }

  .product-detail-grid {
    grid-template-columns: 1fr !important;
    padding: 1.25rem !important;
    gap: 1.25rem !important;
  }

  .checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .drawer-panel {
    max-width: 100vw;
  }

  .drawer-panel.drawer-panel-left {
    max-width: 82vw;
  }

  /* Barra de comparación en móvil */
  .compare-floating-bar {
    width: calc(100% - 2rem);
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(140px);
    flex-direction: row;
    justify-content: space-between;
    border-radius: var(--radius-full);
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
  }

  .compare-floating-bar.is-visible {
    transform: translateX(-50%) translateY(0);
  }

  .compare-thumb-slot {
    width: 32px;
    height: 32px;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1.5rem;
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   MÓVILES PEQUEÑOS (HASTA 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .brand-logo-img {
    height: 46px;
    width: auto;
    max-width: 115px;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .header-action-btn {
    width: 34px;
    height: 34px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .hero-trust-badges {
    grid-template-columns: 1fr;
  }

  .product-card {
    border-radius: var(--radius-sm);
  }

  .product-card-body {
    padding: 0.5rem 0.55rem;
    gap: 0.25rem;
  }

  .product-card-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding-top: 0.25rem;
  }

  .product-price-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .price-current {
    font-size: 0.95rem;
  }

  .product-card-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.6875rem !important;
    min-height: 26px !important;
  }

  .search-container {
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  .search-modal {
    padding: 1.5rem 0.5rem 1rem 0.5rem;
  }

  .search-input-wrap {
    padding: 0.85rem 1rem;
  }

  .search-results-box {
    padding: 0.85rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   DISPOSITIVOS MUY PEQUEÑOS (HASTA 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  :root {
    --container-padding: 0.75rem;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .brand-logo-img {
    height: 42px;
    width: auto;
    max-width: 105px;
  }

  .header-action-btn {
    width: 32px;
    height: 32px;
  }
}

