/* Urban Mobile Fix 1.0.2 - correcciones móviles.
   Todos los selectores llevan el prefijo "html body" para ganar en especificidad al CSS del tema,
   porque esta hoja se carga ANTES que el bundle del tema (theme-*.css) y, a igual especificidad, ganaría el tema. */

/* 1. Listados: el título tenía width:140px + nowrap + ellipsis y se cortaba el nombre del perfume. */
@media (max-width: 480px) {
  /* El tema limita el titulo a 2 lineas (-webkit-line-clamp:2), con ancho fijo y altura fija.
     Se permiten hasta 4 lineas y se reserva siempre el hueco de 4 lineas para que todas las tarjetas
     de una fila queden alineadas (foto y estrellas a la misma altura). */
  html body .card-product__body .product_name .h3 {
    white-space: normal;
    width: auto;
    height: auto;
    min-height: 4.8em;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: clip;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 4;
  }
  /* Fila de estrellas: una sola linea; se oculta la palabra "Opiniones" (queda solo el numero),
     porque al saltar de linea la cortaba la foto. */
  html body .card-product__body .product_review {
    height: auto;
    min-height: 28px;
  }
  html body .card-product__body .product_review .comments-note {
    flex-wrap: nowrap;
    align-items: center;
    height: auto;
  }
  html body .card-product__body .product_review .xto-reviews-comments-nb span {
    display: none;
  }
  /* Títulos con ancho fijo de 275px */
  html body .image-text-information__title {
    width: auto;
    max-width: 100%;
    white-space: normal;
  }
  /* Estrellas: sin ancho mínimo que fuerce la columna */
  html body .card-product .xto-reviews-grade-stars {
    min-width: 0;
  }
}

@media (max-width: 767px) {
  /* 2. Cuadrícula de 2 columnas que no se sale de la pantalla (minmax(0,1fr) permite encoger). */
  html body #js-product-list-category .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* 3. Banners de la home: alto fijo 100vh + padding 100px cortaba el contenido en móvil. */
  html body .xto--bannerFooter .banner-white,
  html body .xto--bannerFooter .banner-white-home,
  html body .xto--bannerFooter .banner-black-home {
    height: auto;
    min-height: 100vh;
    padding: 40px 20px;
  }

  /* 4. Barra fija inferior de la ficha: se salía 1px a la derecha y la barra del iPhone la tapaba. */
  html body .container-buttons-mobile {
    left: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* 5. 100vh en iPhone incluye la barra de direcciones: se usa 100dvh donde está soportado. */
@supports (height: 100dvh) {
  html body .blockcart #blockcart-content {
    height: calc(100dvh - 200px);
  }
  @media (max-width: 890px) {
    html body .blockcart #_desktop_blockcart-content {
      min-height: calc(100dvh - 45px);
      max-height: calc(100dvh - 125px);
    }
  }
  @media (max-width: 767px) {
    html body .xto--bannerFooter .banner-white,
    html body .xto--bannerFooter .banner-white-home,
    html body .xto--bannerFooter .banner-black-home {
      min-height: 100dvh;
    }
  }
}
