/* ORDEN 0071 (etapa 1) — estilos de los 9 widgets de venta.
   Prefijo hcy-w- para no chocar con el tema de la tienda. */

.hcy-w { box-sizing: border-box; }
.hcy-w * { box-sizing: border-box; }

/* W1 — etiqueta */
.hcy-w-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #fff; background: #111;
}
.hcy-w-badge--rojo { background: #dc2626; }
.hcy-w-badge--verde { background: #16a34a; }
.hcy-w-badge--naranja { background: #ea580c; }
.hcy-w-badge--negro { background: #111; }

/* W2 — título descriptivo */
.hcy-w-titulo { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; color: inherit; }
.hcy-w-subtitulo { margin: 4px 0 0; font-size: 14px; opacity: .75; }

/* W3 — precio avanzado */
.hcy-w-precio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.hcy-w-precio-chip { padding: 3px 8px; border-radius: 6px; background: #ecfdf5; color: #047857; font-weight: 600; }
.hcy-w-precio-cuotas { opacity: .8; }
.hcy-w-precio-cond { width: 100%; font-size: 12px; opacity: .65; }

/* W4 — banner promo */
.hcy-w-banner { padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; }

/* W5 — etiquetas de envío */
.hcy-w-envio { display: flex; flex-wrap: wrap; gap: 6px; }
.hcy-w-envio-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
    border: 1px solid rgba(0,0,0,.12); border-radius: 6px; font-size: 12px; font-weight: 600;
}

/* W6 — beneficios */
.hcy-w-beneficios { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hcy-w-beneficios--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hcy-w-beneficios--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hcy-w-beneficio { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; }
.hcy-w-beneficio-ic { flex: 0 0 auto; font-size: 15px; line-height: 1.2; }

/* W7 — tabla de talles */
.hcy-w-talles { font-size: 14px; }
.hcy-w-talles summary { cursor: pointer; font-weight: 700; text-decoration: underline; }
.hcy-w-talles-tabla { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.hcy-w-talles-tabla th, .hcy-w-talles-tabla td { border: 1px solid rgba(0,0,0,.12); padding: 6px 8px; text-align: left; }

/* W21 — WhatsApp flotante */
.hcy-w-wa {
    position: fixed; bottom: 18px; z-index: 9998;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 999px; background: #25d366; color: #fff;
    font-size: 13px; font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.hcy-w-wa--derecha { right: 18px; }
.hcy-w-wa--izquierda { left: 18px; }
.hcy-w-wa svg { width: 20px; height: 20px; }

/* W22 — barra de anuncio */
.hcy-w-barra {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
    padding: 8px 14px; background: #111; color: #fff; font-size: 13px; font-weight: 600;
}
.hcy-w-barra-boton { padding: 4px 10px; border-radius: 6px; background: #fff; color: #111; text-decoration: none; font-weight: 700; }
.hcy-w-barra-tiempo { font-variant-numeric: tabular-nums; opacity: .85; }

/* En móvil los widgets de ficha no se desbordan. */
@media (max-width: 640px) {
    .hcy-w-beneficios--2, .hcy-w-beneficios--3 { grid-template-columns: 1fr; }
    .hcy-w-wa { bottom: 12px; }
}

/* ===========================================================================
   ORDEN 0072 (etapa 2) — estilos de los widgets de la VENTA (W8 a W23).
   =========================================================================== */

.hcy-w8, .hcy-w9, .hcy-w11, .hcy-w12, .hcy-w23 { margin: 0 0 18px; }
.hcy-w8-titulo, .hcy-w9-titulo, .hcy-w11-titulo, .hcy-w12-titulo {
    margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: .01em;
}

/* --- W8: selector de variantes ------------------------------------------- */
.hcy-grupo { margin-bottom: 12px; }
.hcy-grupo-cabecera { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.hcy-grupo-nombre { font-weight: 700; }
.hcy-grupo-elegido { opacity: .7; }
.hcy-grupo-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.hcy-opcion {
    position: relative; cursor: pointer; background: transparent; color: inherit;
    border: 1px solid rgba(0,0,0,.18); border-radius: 8px; padding: 7px 14px;
    font-size: 13px; font-weight: 600; line-height: 1.1;
}
.hcy-opcion:hover { border-color: rgba(0,0,0,.45); }
.hcy-opcion.is-elegida { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
.hcy-opcion.is-agotada {
    cursor: not-allowed; opacity: .45; text-decoration: line-through;
    background-image: linear-gradient(to top left, transparent 47%, rgba(0,0,0,.35) 50%, transparent 53%);
}
.hcy-opcion.is-agotada:hover { border-color: rgba(0,0,0,.18); }
.hcy-opcion-agotado { display: block; font-size: 10px; font-weight: 500; text-decoration: none; opacity: .9; }
.hcy-cuadritos .hcy-opcion {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 8px; font-size: 12px;
}
.hcy-swatch {
    width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.3); flex: 0 0 auto;
}
.hcy-opcion-chica { padding: 5px 10px; font-size: 12px; }
.hcy-w8-mensaje { min-height: 18px; font-size: 12px; opacity: .8; }

/* --- W9: packs ----------------------------------------------------------- */
.hcy-packs-lista { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hcy-pack-card {
    position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left;
    padding: 14px 12px; border: 1.5px solid rgba(0,0,0,.15); border-radius: 12px;
    background: #fff; color: inherit; cursor: pointer;
}
.hcy-pack-card:hover { border-color: rgba(0,0,0,.4); }
.hcy-pack-card.is-elegida { border-color: #111; box-shadow: inset 0 0 0 1.5px #111; }
.hcy-pack-card.is-destacado { border-color: #c08a2d; }
.hcy-pack-chip {
    align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: #111; color: #fff;
    font-size: 10px; font-weight: 800; letter-spacing: .05em;
}
.hcy-pack-titulo { font-size: 16px; font-weight: 800; }
.hcy-pack-subtitulo { font-size: 12px; opacity: .75; }
.hcy-pack-precios { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.hcy-pack-tachado { font-size: 12px; opacity: .6; }
.hcy-pack-final { font-size: 18px; font-weight: 800; }
.hcy-pack-ahorro { font-size: 12px; font-weight: 600; color: #047857; }
.hcy-pack-unidades { margin-top: 12px; padding: 12px; border: 1px dashed rgba(0,0,0,.2); border-radius: 10px; }
.hcy-pack-unidades-titulo { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.hcy-pack-unidad { padding: 8px 0; border-top: 1px solid rgba(0,0,0,.08); }
.hcy-pack-unidad:first-of-type { border-top: 0; }
.hcy-pack-unidad-titulo { font-size: 12px; font-weight: 700; opacity: .75; margin-bottom: 6px; }
.hcy-pack-grupo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.hcy-pack-grupo-nombre { font-size: 12px; opacity: .7; min-width: 62px; }
.hcy-pack-resumen { min-height: 20px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.hcy-pack-agregar { margin-top: 8px; }

/* --- W10: barra fija del celular ---------------------------------------- */
.hcy-w10 {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9997;
    box-sizing: border-box; width: 100%; max-width: 100vw; overflow-x: hidden;
    /* El área segura del iPhone: la barra no queda debajo de la barra de gestos. */
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 -6px 18px rgba(0,0,0,.08);
}
.hcy-w10[hidden] { display: none; }
.hcy-w10-caja { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 900px; margin: 0 auto; overflow: hidden; }
.hcy-w10-foto { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); }
.hcy-w10-datos { min-width: 0; flex: 1 1 0; }
.hcy-w10-nombre { font-size: 12px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcy-w10-precio { font-size: 16px; font-weight: 800; }
.hcy-w10-boton { flex: 0 1 auto; max-width: 52%; white-space: normal; line-height: 1.15; font-size: 13px; padding: 8px 12px; }
@media (max-width: 420px) {
    .hcy-w10-boton { font-size: 12px; padding: 7px 10px; max-width: 48%; }
}
/* Sólo en el celular: en escritorio la barra no existe. */
@media (min-width: 768px) {
    .hcy-w10.hcy-solo-movil { display: none !important; }
}

/* --- W11: línea de tiempo de entrega ------------------------------------ */
.hcy-w11 { padding: 12px 14px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; }
.hcy-w11-pasos { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hcy-w11-paso { flex: 1 1 0; position: relative; padding-top: 14px; }
.hcy-w11-punto { position: absolute; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%; background: #111; }
.hcy-w11-paso + .hcy-w11-paso::before {
    content: ''; position: absolute; top: 4px; left: -8px; right: 50%; height: 1px; background: rgba(0,0,0,.2);
}
.hcy-w11-etiqueta { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.hcy-w11-fecha { display: block; font-size: 14px; font-weight: 700; }
.hcy-w11-corte { margin-top: 8px; font-size: 12px; opacity: .7; }

/* --- W12: complementarios ----------------------------------------------- */
.hcy-w12-lista { display: grid; gap: 10px; }
.hcy-w12.hcy-cols-2 .hcy-w12-lista { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hcy-w12.hcy-cols-3 .hcy-w12-lista { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hcy-w12.hcy-cols-4 .hcy-w12-lista { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hcy-w12-card { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.hcy-w12-foto-link img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }
.hcy-w12-nombre { font-weight: 600; line-height: 1.25; text-decoration: none; color: inherit; }
.hcy-w12-precio { font-weight: 800; }
.hcy-w12-boton { margin-top: 4px; }
/* TAREA 0383 (B): la casilla y el botón que agrega los elegidos. */
.hcy-w12-casilla { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; cursor: pointer; }
.hcy-w12-casilla input { width: 16px; height: 16px; accent-color: currentColor; cursor: pointer; }
.hcy-w12-pie { margin-top: 10px; display: flex; justify-content: flex-end; }

/* --- W9 tramos (TAREA 0383 A): tabla de cantidad y precio por unidad ----- */
.hcy-w9-tramos { margin-top: 14px; }
.hcy-w9-tramos-titulo { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.hcy-w9-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.hcy-w9-tabla th, .hcy-w9-tabla td { padding: 8px 6px; border-bottom: 1px solid rgba(0,0,0,.08); text-align: left; }
.hcy-w9-tabla thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.hcy-w9-tramo-cantidad { white-space: nowrap; font-weight: 700; }
.hcy-w9-tramo-precio s { opacity: .6; margin-left: 6px; }
.hcy-w9-tramo-off { margin-left: 6px; font-size: 11px; font-weight: 700; color: #15803d; }
.hcy-w9-tramo-accion { text-align: right; white-space: nowrap; }
@media (max-width: 480px) {
  .hcy-w9-tabla th, .hcy-w9-tabla td { padding: 6px 4px; }
  .hcy-w9-tramo-accion .btn { font-size: 12px; padding: 4px 8px; }
}

/* --- W23: barra de progreso del carrito --------------------------------- */
.hcy-w23 { padding: 12px 14px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; background: #fafafa; }
.hcy-w23-texto { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.hcy-w23-barra { height: 8px; border-radius: 999px; background: rgba(0,0,0,.1); overflow: hidden; }
.hcy-w23-relleno { display: block; height: 100%; background: #16a34a; transition: width .25s ease; }
.hcy-w23-sugeridos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 12px; }
.hcy-w23-sugerido { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.hcy-w23-sugerido img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; }
.hcy-w23-sugerido-nombre { font-weight: 600; line-height: 1.2; }
.hcy-w23-sugerido-precio { font-weight: 800; }

/* El aviso de pack incompleto en el carrito. */
.chip-warning { background: #fef3c7; color: #92400e; }

/* --- ORDEN 0382: información de envío y de despacho --------------------- */
/* Los dos leen el panel de envíos; acá sólo se dibujan. */
.hcy-w-envio-info {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
    background: #fbfbfb;
}
.hcy-w-envio-info-titulo { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.hcy-w-envio-info-fechas { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hcy-w-envio-info-pie { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.hcy-w-envio-info-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.06); }
.hcy-w-envio-info-chip--feed { background: #eef2ff; color: #3730a3; }
.hcy-w-envio-info--texto .hcy-w-envio-info-fechas { font-weight: 600; }

.hcy-w-despacho {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
    background: #fbfbfb;
}
.hcy-w-despacho-titulo { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.hcy-w-despacho-cuando { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hcy-w-despacho-hoy { color: #047857; }
.hcy-w-despacho-corte { font-size: 12px; opacity: .75; }
.hcy-w-despacho--texto .hcy-w-despacho-cuando { font-weight: 600; }

@media (max-width: 640px) {
    .hcy-w12.hcy-cols-3 .hcy-w12-lista, .hcy-w12.hcy-cols-4 .hcy-w12-lista { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hcy-w11-pasos { flex-direction: column; gap: 12px; }
    .hcy-w11-paso + .hcy-w11-paso::before { display: none; }
}

/* ====================================================================== */
/* ORDEN 0381 — etiquetas y bloques que muestran datos que YA existen.     */
/* Prefijo hcy-w- como el resto: no choca con el tema de la tienda.       */
/* ====================================================================== */

/* Etiquetas de cuotas y de descuento por transferencia (listado y ficha). */
.hcy-w-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 700; line-height: 1.3;
    background: #ecfdf5; color: #047857;
}
.hcy-w-chip--verde { background: #ecfdf5; color: #047857; }
.hcy-w-chip--negro { background: #111; color: #fff; }
.hcy-w-chip--naranja { background: #fff7ed; color: #c2410c; }
.hcy-w-chip--rojo { background: #fef2f2; color: #b91c1c; }

/* Mensaje de garantía debajo del botón de compra. */
.hcy-w-garantia {
    display: flex; align-items: flex-start; gap: 7px;
    margin: 6px 0 12px; font-size: 13px; font-weight: 600; line-height: 1.35;
}
.hcy-w-garantia-ic { display: inline-flex; flex: 0 0 auto; margin-top: 1px; }
.hcy-w-garantia-txt { white-space: pre-line; }

/* Medios de pago + sello de pago seguro. */
.hcy-w-pagos { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.hcy-w-pagos-titulo { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.hcy-w-pagos-lista { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hcy-w-pagos-medio {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px; border: 1px solid rgba(0,0,0,.12); border-radius: 8px;
    background: #fff; color: inherit; font-size: 12px; font-weight: 600;
}
.hcy-w-pagos-logo { display: block; max-height: 20px; width: auto; }
.hcy-w-pagos--chico .hcy-w-pagos-medio { padding: 3px 7px; font-size: 11px; }
.hcy-w-pagos--chico .hcy-w-pagos-logo { max-height: 14px; }
.hcy-w-pagos--grande .hcy-w-pagos-medio { padding: 8px 12px; font-size: 14px; }
.hcy-w-pagos--grande .hcy-w-pagos-logo { max-height: 28px; }
.hcy-w-pagos-sello {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: #047857;
}

/* Caja de opiniones (los datos salen de las reseñas de pedidos entregados). */
.hcy-w-opiniones {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px; border: 1px solid rgba(0,0,0,.1); border-radius: 10px;
}
.hcy-w-opiniones-cabeza { display: flex; flex-direction: column; gap: 4px; }
.hcy-w-opiniones-titulo { margin: 0; font-size: 16px; font-weight: 800; }
.hcy-w-opiniones-resumen { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.hcy-w-opiniones-promedio { font-weight: 800; }
.hcy-w-opiniones-cantidad { opacity: .7; }
.hcy-w-opiniones-lista { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hcy-w-opinion { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,.08); font-size: 13px; }
.hcy-w-opinion:first-child { padding-top: 0; border-top: 0; }
.hcy-w-opinion-cabeza { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hcy-w-opinion-nombre { font-weight: 700; }
.hcy-w-opinion-sello { font-size: 11px; font-weight: 700; color: #047857; }
.hcy-w-opinion-fecha { font-size: 11px; opacity: .6; }
.hcy-w-opinion-texto { margin: 0; line-height: 1.45; }
.hcy-w-opinion-foto { max-width: 120px; height: auto; border-radius: 8px; }

/* Carrusel: la misma caja, en una fila que se corre de costado. */
.hcy-w-opiniones--carrusel .hcy-w-opiniones-lista {
    grid-auto-flow: column; grid-auto-columns: minmax(240px, 80%);
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
}
.hcy-w-opiniones--carrusel .hcy-w-opinion { scroll-snap-align: start; border-top: 0; padding-top: 0; }

/* Las estrellas del bloque (mismo dibujo que el bloque de reseñas). */
.hcy-w-opiniones .hcy-estrellas { letter-spacing: 1px; font-size: 13px; }
.hcy-w-opiniones .hcy-estrella.is-llena, .hcy-w-opiniones .hcy-estrella.is-media { color: #f5a623; }
.hcy-w-opiniones .hcy-estrella.is-vacia { color: rgba(0,0,0,.2); }

@media (max-width: 640px) {
    .hcy-w-opiniones--carrusel .hcy-w-opiniones-lista { grid-auto-columns: minmax(220px, 88%); }
}
