/* ══════════════════════════════════════════
   LA TIENDA DEL CABELLO — estilos de las dos tiendas
══════════════════════════════════════════ */
:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-light: #6b6b6b;
  --border: #ece9e3;
  --accent: #c8a96e;
  --accent-dark: #a8894e;
  --accent-light: #f5edd8;
  --fuego: #e8590c;
  --rojo: #c0392b;
  --verde: #1e8e4e;
  --green-wa: #25d366;
  --green-wa-dark: #1da851;
  --promo: #ff8a1f;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg: 0 10px 36px rgba(0,0,0,0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --ancho: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  padding-bottom: 40px;
}
body.sin-scroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, .titulo { font-family: 'Outfit', sans-serif; }
.centro { max-width: var(--ancho); margin: 0 auto; padding: 0 14px; }

/* ── BARRA DE CAMPAÑA ── */
.promo-bar {
  background: #16110d;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
}
.promo-bar b { color: var(--promo); font-weight: 800; font-variant-numeric: tabular-nums; }

.mayorista-banner {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-dark));
  color: #fff;
  text-align: center;
  padding: 7px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* ── ENCABEZADO ── */
.header {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-top { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo img { height: 38px; width: auto; display: block; }
.badge-mayor {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 50px;
}
.buscador { flex: 1; position: relative; min-width: 0; }
.buscador svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-light); pointer-events: none; }
.buscador input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  outline: none;
  font-size: 16px; /* evita el zoom de iOS */
}
.buscador input:focus { border-color: var(--accent); background: #fff; }
.btn-pedido {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 50px;
  background: var(--text);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.btn-pedido svg { width: 17px; height: 17px; }
.cart-badge {
  background: var(--promo);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 50px;
  display: none;
  align-items: center;
  justify-content: center;
}
.cart-badge.show { display: inline-flex; }
.btn-pedido.salto { animation: salto 0.4s ease; }
@keyframes salto { 40% { transform: scale(1.14); } }

.cats { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-btn:hover { border-color: var(--accent); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-btn.cat-fuego.active { background: var(--fuego); border-color: var(--fuego); }

@media (max-width: 640px) {
  .header-top { flex-wrap: wrap; }
  .logo img { height: 32px; }
  .buscador { order: 3; flex-basis: 100%; }
  .btn-pedido { margin-left: auto; }
}

/* ── HERO ── */
.hero { padding-top: 16px; }
.hero-caja {
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  border: 1px solid var(--border);
  display: grid;
  align-items: center;
}
.hero-texto { padding: 24px 20px; }
.hero h1 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 800; line-height: 1.08; letter-spacing: -0.5px; }
.hero-sub { color: var(--text-light); margin-top: 8px; max-width: 520px; }
.hero-promo-titulo { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: clamp(17px, 2.6vw, 22px); color: var(--promo); margin-bottom: 6px; }
.hero-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; display: block; }

.hero.con-promo .hero-caja { background: radial-gradient(120% 140% at 0% 0%, #3a1d07 0%, #16110d 60%); border: 0; color: #fff; }
.hero.con-promo .hero-sub { color: #d9cfc4; }

.cuenta { display: flex; gap: 6px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.cuenta-rotulo { font-size: 12px; color: #d9cfc4; margin-right: 4px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.cuenta-num {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 6px 0;
  width: 52px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
}
.cuenta-num b { display: block; font-size: 20px; font-weight: 800; line-height: 1; color: var(--promo); font-variant-numeric: tabular-nums; }
.cuenta-num span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: #d9cfc4; }

@media (min-width: 800px) {
  .hero-caja.con-img { grid-template-columns: 1.1fr 1fr; }
  .hero-texto { padding: 26px 36px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.btn-oro { background: var(--accent); color: #fff; }
.btn-oro:hover { background: var(--accent-dark); }
.btn-promo { background: var(--promo); color: #16110d; }
.btn-wa { background: var(--green-wa); color: #fff; }
.btn-wa:hover { background: var(--green-wa-dark); }
.btn-claro { background: #fff; color: var(--text); border: 1.5px solid var(--border); }

/* ── CONFIANZA ── */
.confianza { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.confianza a, .confianza div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-light);
}
.confianza strong { display: block; color: var(--text); font-family: 'Outfit', sans-serif; font-size: 13px; }
.confianza .ico { font-size: 20px; display: block; margin-bottom: 2px; }
@media (max-width: 520px) { .confianza { gap: 6px; } .confianza a, .confianza div { font-size: 11px; padding: 9px 4px; } .confianza strong { font-size: 12px; } }

/* ── BARRA DE RESULTADOS ── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 12px; }
.toolbar h2 { font-size: 18px; font-weight: 800; }
.toolbar h2 small { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; color: var(--text-light); margin-left: 6px; }
.sort-select { padding: 8px 30px 8px 14px; border: 1.5px solid var(--border); border-radius: 50px; background: #fff; font-size: 13px; outline: none; }

/* ── PRODUCTOS ── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--accent); transform: translateY(-2px); }
.card.tendencia { border-color: #f6c9a8; }
.card-link { text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.card-img { position: relative; aspect-ratio: 1; background: var(--accent-light); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sin-foto { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 42px; background: var(--accent-light); }
.card-body { padding: 10px 10px 4px; flex: 1; display: flex; flex-direction: column; }
.card-marca { font-size: 10px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.8px; }
.card-nombre {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.22;
  margin: 2px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.44em;
}
.precio { margin-top: auto; font-family: 'Outfit', sans-serif; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.precio strong { font-size: 18px; font-weight: 800; }
.precio s { font-size: 12px; color: var(--text-light); }
.precio .consultar { font-size: 14px; font-weight: 700; color: var(--text-light); }
.tag-promo { display: inline-block; margin-top: 5px; font-size: 10.5px; font-weight: 700; color: #a34700; background: #fff0e0; border-radius: 50px; padding: 2px 8px; align-self: flex-start; }

.insignias { position: absolute; top: 7px; left: 7px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.insignia {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 50px;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.in-fuego { background: linear-gradient(135deg, #ff8a1f, #e8390c); }
.in-oferta { background: var(--rojo); }
.in-nuevo { background: var(--verde); }
.in-agotado { background: #4a4a4a; }
.in-mayor { background: var(--accent-dark); }

.card.agotado .card-img img, .card.agotado .card-nombre, .card.agotado .precio { opacity: 0.5; }

.card-accion { padding: 8px 10px 10px; }
.btn-agregar {
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  transition: background 0.15s, transform 0.1s;
}
.btn-agregar:hover { background: var(--accent-dark); }
.btn-agregar:active { transform: scale(0.97); }
.btn-agregar:disabled { background: #e3e0da; color: #8a8782; cursor: not-allowed; }

.pasos { display: flex; align-items: center; justify-content: space-between; background: var(--accent-light); border-radius: var(--radius-sm); padding: 3px; }
.pasos button { width: 34px; height: 34px; border: 0; border-radius: 7px; background: #fff; font-size: 19px; font-weight: 700; line-height: 1; color: var(--text); }
.pasos button:active { background: var(--accent); color: #fff; }
.pasos span { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 14px; }
.pasos span small { font-weight: 600; font-size: 11px; color: #6b5426; margin-left: 3px; }

.vacio { text-align: center; padding: 56px 16px; color: var(--text-light); }
.vacio .btn { margin-top: 14px; }

/* ── PIE ── */
.pie { margin-top: 40px; background: #16110d; color: #d9cfc4; padding: 32px 0 96px; }
.pie-grid { display: grid; gap: 24px; }
.pie h2 { color: #fff; font-size: 17px; margin-bottom: 8px; }
.pie p { font-size: 14px; margin-bottom: 4px; }
.pie a { color: var(--accent); }
.pie-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pie-legal { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: #8f857a; }
@media (min-width: 760px) { .pie-grid { grid-template-columns: 1.3fr 1fr; } }

/* ── VENTANA DE PRODUCTO ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 80; display: none; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.modal {
  background: #fff;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  position: relative;
  animation: subir 0.25s ease;
}
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }
.modal-cerrar {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.92); box-shadow: var(--shadow-sm); font-size: 22px; line-height: 1;
}
.modal-img { position: relative; background: var(--accent-light); aspect-ratio: 1; max-height: 46vh; width: 100%; }
.modal-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.modal-body { padding: 18px 18px 22px; }
.modal-marca { font-size: 11px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 1px; }
.modal-nombre { font-size: 22px; font-weight: 800; line-height: 1.15; margin: 3px 0 8px; }
.modal-desc { color: var(--text-light); font-size: 14.5px; margin-bottom: 14px; white-space: pre-line; }
.modal .precio strong { font-size: 28px; }
.modal .precio s { font-size: 15px; }
.modal-accion { margin-top: 14px; }
.modal-accion .btn-agregar { padding: 15px; font-size: 16px; border-radius: var(--radius); background: var(--accent-dark); }
.modal-accion .pasos { padding: 5px; border-radius: var(--radius); }
.modal-accion .pasos button { width: 46px; height: 46px; font-size: 22px; }
.modal-accion .pasos span { font-size: 16px; }
.modal-ver-pedido { width: 100%; margin-top: 8px; }
.modal-notas { margin-top: 14px; font-size: 13px; color: var(--text-light); display: grid; gap: 4px; }
.compartir { display: flex; gap: 8px; margin-top: 14px; }
.compartir .btn { flex: 1; padding: 10px; font-size: 13px; }
@media (min-width: 760px) {
  .overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 22px; display: grid; grid-template-columns: 1fr 1fr; }
  .modal-img { max-height: none; height: 100%; min-height: 420px; }
  .modal-body { padding: 34px 28px 28px; align-self: center; }
}

/* ── PEDIDO (carrito) ── */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90; display: none; }
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 100%; max-width: 420px;
  background: #fff;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
.cart-drawer.open { transform: none; box-shadow: var(--shadow-lg); }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cart-header h2 { font-size: 18px; }
.cart-header button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); font-size: 20px; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-vacio { text-align: center; color: var(--text-light); padding: 48px 0; }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item img, .cart-item .sin-foto { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; font-size: 22px; }
.ci-nombre { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.ci-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.ci-sub b { color: var(--text); }
.cart-item .pasos { gap: 6px; }
.cart-item .pasos button { width: 28px; height: 28px; font-size: 16px; }
.cart-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #fff; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-family: 'Outfit', sans-serif; font-weight: 700; margin-bottom: 4px; }
.cart-total b { font-size: 24px; font-weight: 800; }
.cart-nota { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.cart-footer .btn { width: 100%; padding: 15px; font-size: 16px; }
.cart-footer .btn:disabled { background: #cfcbc4; cursor: not-allowed; }

/* Barra fija con el pedido (celular) */
.cart-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--green-wa); color: #fff;
  border: 0; border-radius: 16px; padding: 13px 16px;
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-lg);
  animation: subir 0.25s ease;
}
.cart-bar b { font-weight: 800; }
.cart-bar span:last-child { background: rgba(0,0,0,0.16); padding: 5px 12px; border-radius: 50px; font-size: 13px; }
@media (min-width: 900px) { .cart-bar { left: auto; right: 24px; width: 380px; } }

/* ── WHATSAPP FLOTANTE ── */
.wa-fab {
  position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-wa);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: bottom 0.2s;
}
.wa-fab svg { width: 30px; height: 30px; fill: #fff; }
body.con-pedido .wa-fab { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* ── BURBUJAS ── */
.burbuja {
  position: fixed; left: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 58;
  max-width: min(330px, calc(100vw - 92px));
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 34px 10px 10px;
  box-shadow: var(--shadow-lg);
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.3;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease, bottom 0.2s;
}
.burbuja.ver { transform: none; opacity: 1; pointer-events: auto; }
body.con-pedido .burbuja { bottom: calc(78px + env(safe-area-inset-bottom)); }
.burbuja img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.burbuja b { font-family: 'Outfit', sans-serif; display: block; }
.burbuja small { color: var(--text-light); font-size: 12px; }
.burbuja-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: var(--text-light); width: 26px; height: 26px; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translate(-50%, -80px); z-index: 100;
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 50px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease; max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); }
