/* TABLET */

@media (max-width: 900px) {

  .header-inner {
    grid-template-columns: 1fr auto;
    gap: var(--space-sm);

    padding-block: 14px;
  }

  .nav-inner {
    justify-content: flex-start;
    overflow-x: auto;

    white-space: nowrap;
  }

  .product-grid:not(.product-grid--home) {
    grid-template-columns: repeat(
      auto-fill,
      minmax(250px, 250px)
    );
  }

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

  .contact-grid > :first-child {
    grid-column: 1 / -1;
  }

}


/* MOBILE */

@media (max-width: 600px) {

  :root {
    --container-padding: 16px;
    --space-2xl: 52px;
  }

  .topbar {
    font-size: 0.75rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  .header-actions {
    gap: 6px;
  }

  .cart-button,
  .header-action-button {
    min-width: 44px;
    height: 44px;
    padding-inline: 9px;
  }

  /*
   * Navegación móvil:
   * se mantiene visible y permite desplazamiento horizontal.
   */
  .main-nav {
    display: block;
  }

  .nav-inner {
    justify-content: flex-start;
    gap: 24px;

    min-height: 46px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;

    scrollbar-width: none;
    white-space: nowrap;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  /*
   * Hero móvil:
   * geometría uniforme para todos los slides.
   */
  .hero-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;

    margin-top: 16px;
    margin-bottom: 0;
  }

  .hero-actions .button {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .product-grid:not(.product-grid--home) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .section-heading {
    align-items: flex-start;
  }

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

  .contact-grid > :first-child {
    grid-column: auto;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-inner nav {
    flex-direction: column;
  }

}


/* BRANDS */

@media (max-width: 600px) {

  .brands-marquee {
    gap: 10px;
  }

  .brands-list {
    gap: 10px;
    padding-right: 10px;
  }

}


/* =========================================================
   CATALOG PAGE
   ========================================================= */

@media (max-width: 900px) {

  .catalog-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-filter-toggle {
    width: 100%;
    min-height: 48px;
    margin-bottom: 16px;
    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: var(--color-text);
    background: #fff;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);

    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .catalog-filter-toggle img {
    width: 20px;
    height: 20px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-filters {
    display: none;
    position: static;
  }

  .catalog-filters.is-open {
    display: block;
  }

}


@media (max-width: 600px) {

  .catalog-shop {
    padding-top: 20px;
  }

  .catalog-header {
    gap: 20px;
    margin-bottom: 24px;
  }

  .catalog-sort {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-sort select {
    width: 100%;
  }

  .catalog-filters {
    padding: 18px;
  }

}


/* =========================================================
   COMMERCIAL FOOTER RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

  .footer-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px;
  }

}


@media (max-width: 600px) {

  .footer-info {
    padding: 42px 0 34px;
  }

  .footer-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 34px;
  }

  /*
   * Empresa y Contacto conservan todo el ancho.
   * Catálogo e Información comparten la última fila.
   */
  .footer-info-grid > .footer-column:nth-child(1),
  .footer-info-grid > .footer-column:nth-child(2) {
    grid-column: 1 / -1;
  }

  .footer-column {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
  }

  /*
   * Catálogo e Información quedan lado a lado, por lo que
   * eliminamos el separador inferior entre ambas columnas.
   */
  .footer-info-grid > .footer-column:nth-child(3),
  .footer-info-grid > .footer-column:nth-child(4) {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .footer-description {
    max-width: none;
  }

  .site-footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;

    padding-block: 18px;
  }

}


/* Brand identity */
@media (max-width: 768px) {
  .brand-logo {
    height: 46px;
  }
}


/* =========================================================
   HERO MOBILE - VERTICAL BALANCE
   ========================================================= */

@media (max-width: 600px) {

  .hero-slide {
    min-height: 410px;
  }

  .hero-slide .hero-content {
    align-items: flex-start;

    padding-top: 26px;
    padding-bottom: 46px;
  }

  .hero-slide .hero-copy > .eyebrow {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .hero-slide h1,
  .hero-slide h2 {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .hero-slide .hero-copy > p:not(.eyebrow) {
    min-height: 4.5em;
    margin-bottom: 0;
  }

  .hero-dots {
    bottom: 14px;
  }

}

/* Secciones comerciales compactas */
@media (max-width: 600px) {
  .section--compact {
    padding-block: 12px;
  }

  .section--compact .section-heading {
    align-items: center;
    margin-bottom: 12px;
  }

  .section--compact .section-heading h2 {
    font-size: 1.7rem;
    line-height: 1.1;
  }

}
