/*
 * Catálogo y arreglos de móvil — arosdebebe.cl
 *
 * Se carga después de style.css/style1.css/style2.css y es lo último que gana.
 *
 * Los componentes del catálogo usan clases propias con prefijo `c-` en vez de las del
 * tema. El tema trae ~20 media queries que se pisan entre sí (`.product-men` termina en
 * 33% de ancho bajo 414px, y por eso la grilla se salía de la pantalla en el teléfono);
 * pelear con esa cascada archivo por archivo era peor que escribir componentes nuevos.
 *
 * Está escrito móvil primero: lo de arriba vale para todos los tamaños y los `min-width`
 * van agregando columnas.
 */

/* ---------------------------------------------------------------- grilla */

.c-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px;
  margin: 0 0 40px;
  padding: 0;
}

@media (min-width: 700px)  { .c-grid { grid-template-columns: repeat(3, 1fr); gap: 30px; } }
@media (min-width: 1000px) { .c-grid { grid-template-columns: repeat(4, 1fr); gap: 36px 30px; } }

.c-card {
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid #f2f2f2;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.c-card:hover,
.c-card:focus {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .07);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.c-card__tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: #fbf1f2;
  color: #c08386;
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.c-card__img {
  display: block;
  position: relative;
  background: #fff;
  padding: 18px 18px 6px;
}

.c-card__img img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity .3s;
}

.c-card__img--back {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 6px;
  left: 18px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
}

/* El cambio de foto al pasar el mouse sólo tiene sentido donde hay mouse. */
@media (hover: hover) {
  .c-card:hover .c-card__img--back { opacity: 1; }
}

.c-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 12px 18px;
  text-align: center;
  margin-top: auto;
}

.c-card__name  { color: #f65a5b; font-size: 13px; line-height: 1.3; }
.c-card__cod   { color: #555;    font-size: 12px; }
.c-card__price { color: #111;    font-size: 16px; font-weight: 700; }

@media (min-width: 700px) {
  .c-card__name  { font-size: 14px; }
  .c-card__price { font-size: 18px; }
}

/* ------------------------------------------------------------ relacionados */

.c-rel { margin: 34px 0 10px; }

.c-rel__title {
  font-size: 16px;
  color: #444;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

/* En el teléfono es una tira que se arrastra; en escritorio, una grilla. */
.c-rel__strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}

.c-rel__strip > .c-card { scroll-snap-align: start; }

@media (min-width: 700px) {
  .c-rel__strip {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    overflow: visible;
  }
  .c-rel__strip > .c-card:nth-child(n+9) { display: none; }
}

/* ------------------------------------------------------------------ ficha */

.c-ficha { display: grid; gap: 22px; margin: 20px 0 10px; }

@media (min-width: 800px) {
  .c-ficha { grid-template-columns: 420px 1fr; gap: 40px; align-items: start; }
}

.c-ficha__principal {
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
}

.c-ficha__miniaturas { display: flex; gap: 8px; margin-top: 10px; }

.c-ficha__miniaturas img {
  width: 64px;
  height: auto;
  border: 1px solid #eee;
  border-radius: 3px;
  cursor: pointer;
  opacity: .65;
}

.c-ficha__miniaturas img.is-activa,
.c-ficha__miniaturas img:hover { opacity: 1; border-color: #f65a5b; }

.c-ficha__info h1 { font-size: 24px; margin: 0 0 4px; color: #333; line-height: 1.25; }
@media (min-width: 800px) { .c-ficha__info h1 { font-size: 30px; } }

.c-ficha__cod    { color: #f65a5b; margin: 0 0 10px; }
.c-ficha__precio { font-size: 28px; font-weight: 700; color: #29b6d8; margin: 0 0 18px; }

.c-ficha__vars { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.c-ficha__vars > span { color: #777; font-size: 13px; margin-right: 4px; }

.c-var {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 5px 11px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
}

.c-var:hover { border-color: #f65a5b; color: #f65a5b; text-decoration: none; }
.c-var.is-activa { border-color: #f65a5b; background: #f65a5b; color: #fff; }

.c-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 18px;
  border-radius: 4px;
  font-size: 15px;
  margin-bottom: 10px;
  text-decoration: none;
}

.c-btn--wa  { background: #25d366; color: #fff; }
.c-btn--wa:hover  { background: #1eb658; color: #fff; text-decoration: none; }
.c-btn--sec { background: #fff; color: #555; border: 1px solid #ddd; }
.c-btn--sec:hover { border-color: #f65a5b; color: #f65a5b; text-decoration: none; }

@media (min-width: 800px) { .c-btn { display: inline-block; width: auto; margin-right: 8px; } }

.c-ficha__campos { margin-top: 22px; border-top: 1px solid #eee; padding-top: 16px; }
.c-ficha__campos p { margin: 0 0 8px; color: #f65a5b; font-size: 13px; }
.c-ficha__campos span { display: inline-block; min-width: 82px; color: #555; }

/* ------------------------------------------------------------------ varios */

.c-vacio { padding: 40px 10px; text-align: center; color: #666; }
.c-vacio h1 { font-size: 22px; color: #333; }

.c-arbol__grupo > strong { display: block; margin: 10px 0 4px; color: #333; }
.c-arbol__grupo ul { list-style: none; padding-left: 12px; margin: 0 0 8px; }
.c-arbol__grupo a { color: #777; font-size: 13px; line-height: 1.9; }

/* ================================================================ móvil ==
 * Arreglos sobre el tema. En el teléfono había ~1.000 px de cabecera, banners y
 * logo antes de ver un solo producto, y el modal de bienvenida se salía de la pantalla.
 */

@media (max-width: 767px) {

  /* El tema deja .product-men en 33% de ancho bajo 414px y la grilla se sale. */
  .product-men { float: none !important; width: auto !important; }

  /* Barra de contacto de arriba: en una línea y más baja. */
  .header-top .top-nav-right,
  .header-top .top-nav-left { text-align: center; }
  .header-top ul li { font-size: 12px; }
  .header-top img { max-height: 26px; width: auto; }

  /* Logo: ocupaba media pantalla. */
  .logo img, .header-bot .logo img { max-width: 190px; height: auto; }

  /* Los dos banners de promesa se leen igual más chicos. */
  .header-bot .col-md-4 img,
  .top-nav-right img { max-width: 100%; height: auto; }

  /* El modal de bienvenida se salía por la derecha. */
  .modal-dialog { width: auto; margin: 12px; }
  .modal-body p { font-size: 14px; }
  .modal-header h3 { font-size: 18px; }
  .modal-header img { max-width: 60%; height: auto; }

  /* Columna de producto y columna lateral, una debajo de otra. */
  .products-left, .products-right { width: 100%; float: none; padding: 0 12px; }
  .products-left { margin-bottom: 24px; }

  /* Nada debe provocar arrastre horizontal. */
  .container { padding-left: 12px; padding-right: 12px; }
}

/* `clip` y no `hidden`: `overflow: hidden` convierte al elemento en contenedor de scroll
 * y eso deja sin efecto cualquier `position: sticky` de adentro. Medido: no hay desborde
 * horizontal en ninguna página, así que esto es sólo una red de seguridad. */
html, body { overflow-x: clip; }

/* --------------------------------------------------------- 404 y contacto */

.c-404 { padding: 30px 0 50px; text-align: center; }
.c-404 h1 { font-size: 26px; color: #333; margin: 0 0 12px; }
.c-404 p { color: #666; margin: 0 0 18px; }
.c-404 .c-btn { display: inline-block; width: auto; margin: 0 6px 10px; }

.c-wa-form__intro { color: #666; margin-bottom: 16px; }
.c-wa-form__alt { color: #777; font-size: 13px; margin-top: 14px; }
.c-wa-form input[type="submit"] {
  background: #25d366;
  border: 0;
  width: auto;          /* el tema le pone un ancho fijo y cortaba la última letra */
  padding: 0 26px;
  white-space: nowrap;
}
.c-wa-form input[type="submit"]:hover { background: #1eb658; }
