/* =====================================================================
   COSISEGE · Ajustes SOLO para móvil (≤ 640 px)
   ---------------------------------------------------------------------
   En un teléfono la tienda mostraba demasiado en muy poco espacio:
   barra de anuncios de dos líneas, barra de marcas, tipo de cambio
   flotante, un hero de pantalla completa y tarjetas con descripción,
   especificaciones y disponibilidad. El catálogo empezaba a 2.000 px.

   Este archivo no toca la versión de escritorio: todo va dentro de un
   media query y se carga después de las hojas principales.
   ===================================================================== */

@media (max-width: 640px) {

  /* ---------- Barra superior: una sola línea ---------- */
  .announcement.store-meta {
    padding: 7px 14px;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
  }

  /* La fecha del servidor no aporta al cliente en el móvil. */
  .store-meta time,
  .store-meta .announcement-date {
    display: none;
  }

  /* Logotipos de marcas: decorativos, ocupan una franja entera. */
  .brand-rail {
    display: none;
  }

  /* El tipo de cambio flotaba sobre la cabecera y no se leía. */
  .exchange-widget,
  .exchange-widget-store {
    display: none;
  }

  /* ---------- Hero compacto ---------- */
  .hero {
    padding: 26px 18px 24px;
    min-height: 0;
  }

  .hero h1 {
    font-size: clamp(26px, 8vw, 32px);
    line-height: 1.12;
    margin-bottom: 10px;
  }

  .hero .eyebrow {
    margin-bottom: 8px;
    font-size: 10px;
  }

  /* Dos líneas de texto: el resto de la promoción no se lee en un móvil. */
  .hero-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
  }

  .hero-actions {
    display: grid;
    gap: 8px;
  }

  .hero-actions .button,
  .hero-actions a {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13.5px;
  }

  /* ---------- Buscador y categorías en una franja ---------- */
  .catalog-sidebar,
  .product-filter-sidebar {
    position: static;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .catalog-sidebar .search-box,
  .listing-search {
    margin-bottom: 10px;
  }

  .sidebar-label {
    margin: 4px 0 8px;
    font-size: 10.5px;
  }

  /* La lista vertical pasa a carrusel horizontal de etiquetas. */
  .category-filters,
  .catalog-sidebar .filter-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-filters::-webkit-scrollbar,
  .catalog-sidebar .filter-list::-webkit-scrollbar {
    display: none;
  }

  .category-button,
  .catalog-sidebar .filter-chip {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    padding: 8px 13px;
    font-size: 12px;
    border-radius: 999px;
  }

  /* ---------- Tarjetas: dos por fila y sin ruido ---------- */
  .detailed-product-grid,
  .product-grid,
  .productos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .detail-card,
  .product-card {
    border-radius: 12px;
    overflow: hidden;
  }

  .detail-image,
  .product-image {
    height: 128px;
    aspect-ratio: auto;
  }

  .detail-image img,
  .product-image img {
    padding: 6px;
  }

  .product-sin-foto__marca {
    font-size: 14px;
  }

  .product-sin-foto__nota {
    font-size: 8.5px;
  }

  .detail-body,
  .product-info {
    padding: 8px 9px 9px;
  }

  /* Marca pequeña arriba, título a dos líneas, precio. Nada más. */
  .detail-category,
  .product-tag {
    font-size: 8.5px;
    padding: 3px 7px;
    margin-bottom: 5px;
  }

  .detail-sku,
  .product-code,
  .detail-description,
  .product-info > p:not(.product-code):not(.product-card-link),
  .spec-list,
  .product-availability,
  .price-label,
  .price-disclaimer {
    display: none;
  }

  .detail-body h3,
  .product-info h3 {
    font-size: 12.5px;
    line-height: 1.3;
    min-height: 0;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card-link {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .product-price,
  .detail-price strong {
    font-size: 15.5px;
  }

  /* Sin selector de cantidad en la tarjeta: se ajusta en el carrito. */
  .detail-purchase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .product-quantity {
    display: none;
  }

  .quote-button,
  .add-to-cart {
    width: 100%;
    padding: 9px 8px;
    font-size: 12px;
    border-radius: 9px;
  }

  /* ---------- Ficha de producto ---------- */
  .ficha {
    padding: 0 14px 28px;
  }

  .ficha-barra {
    padding: 10px 0;
  }

  /* Las migas de cuatro niveles no caben: queda el botón de volver. */
  .ficha-barra .migas {
    display: none;
  }

  .ficha-sesion {
    margin-left: auto;
  }

  .ficha-figura {
    min-height: 0;
    padding: 8px;
    border-radius: 14px;
  }

  .ficha-figura img {
    width: 100%;
    max-height: 250px;
  }

  .ficha h1 {
    font-size: clamp(20px, 6vw, 24px);
    line-height: 1.2;
  }

  .ficha-resumen,
  .ficha-desc,
  .ficha-tabla td,
  .ficha-tabla th {
    font-size: 13.5px;
    line-height: 1.55;
  }

  .ficha-precio strong {
    font-size: 26px;
  }

  /*
   * El botón de compra acompaña el desplazamiento, como en las tiendas de
   * móvil: el cliente no tiene que subir para comprar después de leer.
   */
  .ficha-btn--main {
    position: sticky;
    bottom: 10px;
    z-index: 6;
    box-shadow: 0 8px 22px rgba(16, 45, 74, .22);
  }

  .ficha-compra {
    gap: 8px;
  }

  /* ---------- Bloques que estorban ---------- */
  .marquee,
  .brand-rail,
  .site-footer .footer-brands {
    display: none;
  }

  /* Las rejillas de dos columnas dentro de bloques anchos se apilan. */
  .service-grid,
  .benefits,
  .store-highlights {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {

  /* La ilustración del hero y su globo ocupan media pantalla y no informan. */
  .hero-art,
  .hero-orbit {
    display: none;
  }

  .hero-note {
    margin-top: 12px;
    font-size: 11.5px;
  }

  /* La franja de ventajas pasa a tres líneas compactas. */
  .service-strip {
    display: grid;
    gap: 0;
    padding: 4px 14px;
  }

  .service-strip > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f6;
  }

  .service-strip > div:last-child {
    border-bottom: 0;
  }

  .service-strip small {
    display: none;
  }

  .service-strip strong {
    font-size: 12.5px;
    font-weight: 700;
  }

  .service-icon {
    width: 26px;
    height: 26px;
    font-size: 11px;
    flex: 0 0 auto;
  }

  /* Cabecera del catálogo más corta. */
  .catalog .section-heading {
    padding: 18px 14px 8px;
  }

  .catalog .section-heading h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .catalog .section-heading p.section-text,
  .catalog .section-heading .section-text {
    display: none;
  }

  .catalog-tools {
    padding: 6px 14px 10px;
  }
}
@media (max-width: 640px) {

  /* Una tarjeta por fila, con la foto a la izquierda y el texto a la derecha.
     La rejilla de dos columnas desbordaba el ancho del teléfono y el texto se
     montaba sobre la imagen. */
  .detailed-product-grid,
  .product-grid,
  .productos-grid {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .detail-card,
  .product-card {
    display: grid !important;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: stretch;
    min-height: 104px;
  }

  .product-image-link,
  .detail-image,
  .product-image {
    height: 100%;
    min-height: 104px;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .detail-image img,
  .product-image img {
    padding: 5px;
    object-fit: contain;
  }

  .product-sin-foto {
    padding: 6px;
  }

  .product-sin-foto__marca {
    font-size: 12px;
    line-height: 1.15;
  }

  .product-sin-foto__nota {
    font-size: 7.5px;
    letter-spacing: .04em;
  }

  .detail-body,
  .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 9px 11px;
    min-width: 0;
  }

  .detail-category,
  .product-tag {
    align-self: flex-start;
    margin: 0;
    font-size: 8.5px;
    padding: 2px 6px;
  }

  .detail-body h3,
  .product-info h3 {
    font-size: 12.5px;
    line-height: 1.28;
    margin: 0;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card-link {
    font-size: 11px;
    margin: 0;
  }

  .product-price,
  .detail-price strong {
    font-size: 14.5px;
    margin: 0;
  }

  .detail-purchase {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .quote-button,
  .add-to-cart {
    width: auto;
    padding: 7px 12px;
    font-size: 11.5px;
  }

  .detail-buy {
    margin: 0;
  }
}
@media (max-width: 640px) {

  /* El bloque del catálogo seguía en dos columnas (220 px de barra lateral +
     30 px de separación), y de ahí el hueco enorme antes de las tarjetas. */
  .catalog-layout,
  .product-catalog-layout {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 14px !important;
  }

  .catalog .section-heading,
  .listing-heading {
    padding: 4px 14px 0 !important;
  }

  .catalog-tools,
  .listing-controls {
    padding: 0 14px 8px !important;
    margin: 0 !important;
  }

  .product-total,
  .results-count {
    font-size: 12px;
    margin: 0;
  }
}
@media (max-width: 640px) {

  /* Nada debe generar desplazamiento horizontal en un teléfono. */
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .catalog-results,
  .product-results,
  .product-grid,
  .detailed-product-grid {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* El buscador y las categorías acompañan el desplazamiento: el cliente puede
     cambiar de categoría sin volver arriba. */
  .catalog-sidebar,
  .product-filter-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    box-shadow: 0 6px 16px rgba(16, 45, 74, .07);
    border-radius: 0 0 14px 14px;
  }
}
@media (max-width: 640px) {

  /* ---------- Selector de categorías ---------- */
  .category-select-mobile {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 11px 14px;
    border: 1px solid #d7e2ea;
    border-radius: 11px;
    background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23657584' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 18px;
    font: 700 13.5px/1.2 'DM Sans', Arial, sans-serif;
    color: #102d4a;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 2px 8px rgba(16, 45, 74, .06);
  }

  .category-select-mobile:focus {
    outline: 2px solid #246ba0;
    outline-offset: 1px;
  }

  /* La fila de etiquetas sobra cuando hay selector. */
  .filtros-ocultos-movil {
    display: none !important;
  }

  /* ---------- Botón «Ver más» ---------- */
  .ver-mas-productos {
    display: block;
    width: calc(100% - 28px);
    margin: 14px auto 6px;
    padding: 14px 18px;
    border: 1px solid #d7e2ea;
    border-radius: 12px;
    background: #fff;
    color: #102d4a;
    font: 800 13px/1 'DM Sans', Arial, sans-serif;
    cursor: pointer;
  }

  .ver-mas-productos:active {
    background: #eef4f9;
  }

  /* ---------- Marca dentro del recuadro sin foto ---------- */
  .product-sin-foto {
    padding: 4px;
    gap: 2px;
    overflow: hidden;
  }

  .product-sin-foto__marca {
    font-size: 10.5px;
    line-height: 1.15;
    letter-spacing: .02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .product-sin-foto__nota {
    display: none;
  }

  /* ---------- WhatsApp más discreto ---------- */
  .whatsapp-float,
  .whatsapp-float.whatsapp-float-compact {
    width: 46px;
    height: 46px;
    right: 12px;
    bottom: 74px;
    padding: 2px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
  }

  .whatsapp-float img,
  .whatsapp-float.whatsapp-float-compact img {
    width: 42px;
    height: 42px;
  }
}
@media (max-width: 640px) {

  /*
   * El filtrado y la paginación ocultan tarjetas con el atributo `hidden`.
   * El estilo del navegador para [hidden] es display:none, pero la regla
   * anterior de esta hoja imponía display:grid con !important y lo anulaba:
   * las tarjetas «ocultas» seguían viéndose y parecía que nada filtraba.
   */
  .product-card[hidden],
  .detail-card[hidden],
  .product-grid [hidden],
  .detailed-product-grid [hidden] {
    display: none !important;
  }

  /* La marca del recuadro sin foto cabe mejor en tres líneas finas. */
  .product-sin-foto__marca {
    font-size: 10px;
    -webkit-line-clamp: 3;
  }
}