/* ═══════════════════════════════════════════
   SANARE CAPILAR — Overlays
   (Product Sheet · Diagnosis · Article · Identify)
   ═══════════════════════════════════════════ */

/* ── Shared overlay backdrop ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45); backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

/* ══════════════════════════════════════
   PRODUCT BOTTOM SHEET
══════════════════════════════════════ */
.product-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 501;
  background: var(--white); border-radius: 28px 28px 0 0;
  max-height: 92vh; overflow-y: auto; scrollbar-width: none;
  transform: translateY(100%); transition: transform .42s var(--ease);
  /* Sin padding-bottom: la barra fija (.sheet-ctas, sticky bottom:0) debe quedar
     pegada al borde real del contenedor. El safe-area inset se aplica dentro de
     .sheet-ctas, no aquí (si no, dejaba un hueco blanco bajo la barra). */
}
.product-sheet::-webkit-scrollbar { display: none; }
.product-sheet.open { transform: translateY(0); }

.sheet-handle {
  display: flex; justify-content: center; padding: 14px 0 10px;
  position: sticky; top: 0; background: white; z-index: 3;
  border-radius: 28px 28px 0 0;
}
.sheet-handle-bar { width: 40px; height: 4px; border-radius: 2px; background: rgba(27,27,27,.15); }

.sheet-toprow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px 0; position: sticky; top: 27px; background: white; z-index: 2;
}
.sheet-toprow-label { font-size: 12px; font-weight: 600; color: rgba(27,27,27,.35); letter-spacing: .4px; }
.sheet-toprow-actions { display: flex; align-items: center; gap: 8px; }
.sheet-close, .sheet-share {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(27,27,27,.15); background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text); transition: all .2s;
}
.sheet-close:hover { background: var(--text); color: white; }
.sheet-share { color: var(--green); border-color: rgba(74,124,89,.3); }
.sheet-share:hover { background: var(--green); color: white; border-color: var(--green); }
.sheet-share svg { width: 16px; height: 16px; }

.sheet-img-wrap {
  margin: 12px 20px 4px; border-radius: 20px; overflow: hidden;
  background: #fff; border: 1px solid rgba(27,27,27,.06);
  display: flex; align-items: center; justify-content: center;
  height: 56vh; max-height: 460px; min-height: 300px; padding: 16px;
}
.sheet-img-wrap img { width: 100%; height: 100%; object-fit: contain; }

.sheet-body { padding: 0 24px 8px; }
.sheet-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-name { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.15; margin-bottom: 8px; }
.sheet-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-stars { color: #F5A623; font-size: 14px; }
.sheet-rating-txt { font-size: 13px; color: rgba(27,27,27,.45); }
.sheet-price { display: flex; align-items: baseline; gap: 10px; font-size: 30px; font-weight: 700; color: var(--green); margin-bottom: 18px; }
.sheet-price .price-was { font-size: 17px; font-weight: 500; color: rgba(27,27,27,.4); text-decoration: line-through; }
.sheet-desc { font-size: 14px; color: rgba(27,27,27,.7); line-height: 1.65; margin-bottom: 20px; }

.sheet-section-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--text); margin-bottom: 12px; margin-top: 24px;
}
.sheet-benefits { display: flex; flex-direction: column; gap: 10px; }
.sheet-benefit {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg); border-radius: var(--r-sm); padding: 12px 14px;
}
.sheet-benefit-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.sheet-benefit-text { font-size: 13px; color: rgba(27,27,27,.72); line-height: 1.45; }

.sheet-ingredients {
  background: var(--bg); border-radius: 16px; padding: 16px;
  font-size: 13px; color: rgba(27,27,27,.68); line-height: 1.7;
}
.sheet-mode-steps { display: flex; flex-direction: column; gap: 10px; }
.sheet-mode-step { display: flex; align-items: flex-start; gap: 12px; }
.sheet-step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green);
  color: white; font-size: 12px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.sheet-step-text { font-size: 13px; color: rgba(27,27,27,.72); line-height: 1.5; padding-top: 4px; }

.sheet-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-result-card { background: var(--bg); border-radius: 14px; padding: 14px 12px; text-align: center; }
.sheet-result-icon { font-size: 24px; margin-bottom: 6px; }
.sheet-result-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.sheet-result-time { font-size: 11px; color: rgba(27,27,27,.4); }

.sheet-faq { display: flex; flex-direction: column; gap: 10px; }
.sheet-faq-item { background: var(--bg); border-radius: 14px; padding: 14px 16px; cursor: pointer; }
.sheet-faq-q { font-size: 13px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.sheet-faq-chevron { transition: transform .2s; font-size: 12px; opacity: .5; }
.sheet-faq-item.open .sheet-faq-chevron { transform: rotate(180deg); }
.sheet-faq-a { font-size: 13px; color: rgba(27,27,27,.62); line-height: 1.55; margin-top: 10px; display: none; }
.sheet-faq-item.open .sheet-faq-a { display: block; }

.sheet-testimonials { display: flex; flex-direction: column; gap: 10px; }
.sheet-t-card { background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.sheet-t-stars { color: #F5A623; font-size: 12px; margin-bottom: 6px; }
.sheet-t-text { font-size: 13px; color: rgba(27,27,27,.68); line-height: 1.5; margin-bottom: 8px; }
.sheet-t-name { font-size: 12px; font-weight: 600; color: var(--text); }

.sheet-ctas {
  padding: 14px 20px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid rgba(74,124,89,.12); margin-top: 28px;
  position: sticky; bottom: 0; background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px); z-index: 5; box-shadow: 0 -6px 24px rgba(27,27,27,.07);
}
.sheet-bar-main { display: flex; align-items: center; gap: 14px; }
.sheet-bar-price { display: flex; flex-direction: column; line-height: 1.1; flex-shrink: 0; }
.sheet-bar-price-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: rgba(27,27,27,.45); }
#sheetBarPrice { font-size: 23px; font-weight: 700; color: var(--green); }
.sheet-bar-main .btn-sheet-wa { flex: 1; width: auto; padding: 15px; }
.btn-sheet-wa {
  background: var(--wa); color: white; border: none;
  padding: 16px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; transition: background .2s;
}
.btn-sheet-wa:hover { background: var(--wa-dark); }
.btn-sheet-rutina {
  background: transparent; color: var(--green); border: 1.5px solid var(--green);
  padding: 14px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font-body);
  width: 100%; transition: all .2s;
}
.btn-sheet-rutina:hover { background: var(--green); color: white; }

/* ══════════════════════════════════════
   DIAGNOSIS QUIZ OVERLAY
══════════════════════════════════════ */
.diag-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: var(--bg); overflow-y: auto;
  transform: translateX(100%); transition: transform .42s var(--ease);
}
.diag-overlay.open { transform: translateX(0); }

.diag-header {
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 18px 24px; background: var(--white);
  border-bottom: 1px solid rgba(74,124,89,.08);
  position: sticky; top: 0; z-index: 10;
}
.diag-logo { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--green); }
.diag-back {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(74,124,89,.22); background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; color: var(--green); transition: all .2s; flex-shrink: 0;
}
.diag-back:hover { background: var(--green); color: white; }
.diag-progress-wrap { padding: 18px 24px 0; background: white; }
.diag-bar-outer { height: 6px; background: rgba(74,124,89,.14); border-radius: 3px; overflow: hidden; }
.diag-bar-inner { height: 100%; background: var(--green); border-radius: 3px; transition: width .4s ease; }
.diag-step-label { font-size: 12px; color: rgba(27,27,27,.4); margin-top: 8px; padding-bottom: 6px; }

.diag-screen { display: none; padding: 0 24px 48px; flex-direction: column; }
.diag-screen.active { display: flex; }
.diag-q-num { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--green); margin-bottom: 10px; margin-top: 28px; }
.diag-q-text { font-family: var(--font-display); font-size: clamp(22px,5vw,30px); font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 30px; }

.diag-options { display: flex; flex-direction: column; gap: 12px; }
.diag-opt {
  background: white; border: 1.5px solid rgba(74,124,89,.2); border-radius: 16px;
  padding: 16px 20px; font-size: 15px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: all .2s; text-align: left;
  font-family: var(--font-body); display: flex; align-items: center; gap: 12px;
}
.diag-opt:hover { border-color: var(--green); background: rgba(74,124,89,.04); }
.diag-opt.selected { border-color: var(--green); background: rgba(74,124,89,.09); color: var(--green); font-weight: 600; }
.diag-opt-icon { font-size: 22px; flex-shrink: 0; }

.diag-opts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diag-opt-grid {
  background: white; border: 1.5px solid rgba(74,124,89,.2); border-radius: 16px;
  padding: 18px 12px; font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: all .2s; text-align: center; font-family: var(--font-body);
}
.diag-opt-grid:hover { border-color: var(--green); background: rgba(74,124,89,.04); }
.diag-opt-grid.selected { border-color: var(--green); background: rgba(74,124,89,.09); color: var(--green); font-weight: 600; }
.diag-opt-grid-icon { font-size: 28px; display: block; margin-bottom: 8px; }

.diag-nav { display: flex; gap: 12px; margin-top: 32px; }
.diag-btn-back {
  background: transparent; color: rgba(27,27,27,.45);
  border: 1.5px solid rgba(27,27,27,.15); padding: 14px 24px;
  border-radius: var(--r-pill); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: all .2s;
}
.diag-btn-back:hover { border-color: var(--text); color: var(--text); }
.diag-btn-next {
  flex: 1; background: var(--green); color: white; border: none;
  padding: 14px 24px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font-body);
  opacity: .45; pointer-events: none; transition: opacity .2s, background .2s;
}
.diag-btn-next.enabled { opacity: 1; pointer-events: all; }
.diag-btn-next.enabled:hover { background: var(--green-dark); }

/* Diagnosis Result */
.diag-result { display: none; padding: 0 24px 48px; flex-direction: column; }
.diag-result.active { display: flex; }
.diag-result-card {
  background: linear-gradient(135deg,var(--green),var(--green-dark));
  border-radius: 24px; padding: 30px 26px;
  margin-top: 28px; margin-bottom: 28px; position: relative; overflow: hidden;
}
.diag-result-card::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; background: rgba(255,255,255,.06); border-radius: 50%;
}
.diag-result-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.diag-result-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: white; line-height: 1.2; margin-bottom: 8px; }
.diag-result-sub { font-size: 14px; color: rgba(255,255,255,.78); line-height: 1.55; margin-bottom: 22px; }
.diag-bars { display: flex; flex-direction: column; gap: 12px; }
.diag-bar-row { }
.diag-bar-lbl { font-size: 12px; color: rgba(255,255,255,.72); margin-bottom: 5px; display: flex; justify-content: space-between; }
.diag-bar-outer2 { height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.diag-bar-fill { height: 100%; border-radius: 3px; background: white; transition: width 1s ease .5s; }

.diag-reco-section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.diag-reco-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.diag-reco-item {
  display: flex; align-items: center; gap: 14px; background: white;
  border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .2s;
}
.diag-reco-item:hover { transform: translateX(4px); }
.diag-reco-thumb {
  width: 58px; height: 58px; flex-shrink: 0; overflow: hidden;
  background: #fff; border: 1px solid rgba(27,27,27,.07); padding: 3px;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.diag-reco-thumb img { width: 100%; height: 100%; object-fit: contain; }
.diag-reco-info { flex: 1; }
.diag-reco-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.diag-reco-why { font-size: 12px; color: rgba(27,27,27,.5); line-height: 1.4; }
.diag-reco-price { font-size: 15px; font-weight: 700; color: var(--green); flex-shrink: 0; }

.diag-cta-wa {
  background: var(--wa); color: white; border: none; width: 100%;
  padding: 18px; border-radius: var(--r-pill); font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 12px; transition: background .2s;
}
.diag-cta-wa:hover { background: var(--wa-dark); }
.diag-cta-back {
  background: transparent; color: rgba(27,27,27,.5); border: 1.5px solid rgba(27,27,27,.15);
  width: 100%; padding: 14px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: all .2s;
}
.diag-cta-back:hover { border-color: var(--text); color: var(--text); }

/* ══════════════════════════════════════
   ARTICLE OVERLAY
══════════════════════════════════════ */
.article-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: var(--white); overflow-y: auto;
  transform: translateX(100%); transition: transform .42s var(--ease);
}
.article-overlay.open { transform: translateX(0); }

.article-header {
  display: flex; align-items: center; gap: 14px; padding: 18px 24px;
  border-bottom: 1px solid rgba(74,124,89,.08);
  position: sticky; top: 0; background: white; z-index: 10;
  box-shadow: 0 2px 12px rgba(74,124,89,.05);
}
.article-back {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(74,124,89,.22); background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; color: var(--green); transition: all .2s;
}
.article-back:hover { background: var(--green); color: white; }
.article-header-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); }

.article-hero {
  height: 220px; background: linear-gradient(135deg,#e4ede5,#ccd9c7);
  display: flex; align-items: center; justify-content: center; font-size: 72px;
}
.article-hero.has-img { background-size: cover; background-position: center; }
.article-hero.has-img svg { display: none; }
.article-hero-photo { margin: 4px 0 20px; border-radius: var(--r-lg); overflow: hidden; }
.article-hero-photo img { width: 100%; height: 260px; object-fit: cover; display: block; }
.article-body-wrap { padding: 28px 24px 80px; max-width: 680px; margin: 0 auto; }
.article-content-tag { display: inline-block; background: rgba(74,124,89,.1); color: var(--green); font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; text-transform: uppercase; margin-bottom: 12px; }
.article-content-title { font-family: var(--font-display); font-size: clamp(22px,4vw,32px); font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 10px; }
.article-meta { font-size: 13px; color: rgba(27,27,27,.4); margin-bottom: 28px; }
.article-text { font-size: 15px; color: rgba(27,27,27,.72); line-height: 1.8; }
.article-text h3 { font-family: var(--font-display); font-size: 20px; color: var(--text); margin: 28px 0 12px; }
.article-text p { margin-bottom: 16px; }
.article-text ul { padding-left: 20px; margin-bottom: 16px; }
.article-text ul li { margin-bottom: 8px; }
.article-tip {
  background: rgba(74,124,89,.08); border-left: 3px solid var(--green);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 20px 0;
  font-size: 14px; color: var(--green); font-weight: 500; line-height: 1.55;
}
.article-toc {
  background: rgba(74,124,89,.08); border-left: 3px solid var(--green);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 0 0 28px;
}
.article-toc-title { font-size: 12px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.article-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.article-toc a { font-size: 14px; color: var(--text); text-decoration: none; opacity: .8; }
.article-toc a:hover { color: var(--green); text-decoration: underline; }
.article-related-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 16px; margin-top: 40px; }
.article-reco-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.article-reco-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border-radius: 16px; padding: 14px;
  cursor: pointer; transition: transform .2s;
}
.article-reco-card:hover { transform: translateX(4px); }
.article-reco-card .product-heart { position: static; width: 32px; height: 32px; margin-left: auto; flex-shrink: 0; box-shadow: none; background: transparent; }
.article-reco-thumb { width: 52px; height: 52px; background: #fff; border: 1px solid rgba(27,27,27,.07); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;}
.article-reco-thumb img { width: 100%; height: 100%; object-fit: contain; }
.article-reco-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.article-reco-price { font-size: 13px; color: rgba(27,27,27,.45); }
.article-actions { display: flex; gap: 10px; }
.article-cta-wa {
  background: var(--wa); color: white; border: none; flex: 1;
  padding: 18px; border-radius: var(--r-pill); font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s;
}
.article-cta-wa:hover { background: var(--wa-dark); }
.article-share-btn {
  flex-shrink: 0; width: 56px; background: var(--bg); color: var(--green);
  border: 1.5px solid var(--beige); border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.article-share-btn:hover { border-color: var(--green); background: #fff; }
.article-share-btn .ic-svg { width: 19px; height: 19px; }

/* ══════════════════════════════════════
   IDENTIFY MODAL (favoritos → clientes potenciales)
   Mismo lenguaje visual y animación que .product-sheet.
══════════════════════════════════════ */
/* z-index por encima de .article-overlay/.diag-overlay (600): el corazón de
   favoritos puede pulsarse desde dentro de esos overlays, y el modal de
   identificación debe quedar siempre visible por encima, no detrás. */
#identifyOverlay { z-index: 650; }
.identify-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 651;
  background: var(--white); border-radius: 28px 28px 0 0;
  max-height: 92vh; overflow-y: auto; scrollbar-width: none;
  transform: translateY(100%); transition: transform .42s var(--ease);
}
.identify-sheet::-webkit-scrollbar { display: none; }
.identify-sheet.open { transform: translateY(0); }

.identify-body { padding: 4px 24px max(24px, env(safe-area-inset-bottom)); text-align: center; }
.identify-icon {
  width: 56px; height: 56px; margin: 8px auto 16px; border-radius: 50%;
  background: rgba(74,124,89,.1); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.identify-icon .ic-svg { width: 26px; height: 26px; }
.identify-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.identify-body .diag-lead-intro { text-align: left; }
.identify-body .diag-lead-fields { text-align: left; margin-bottom: 4px; }
.identify-optional { font-weight: 400; color: rgba(27,27,27,.4); }
.identify-submit { width: 100%; margin-top: 20px; padding: 16px; font-size: 15px; }
.identify-submit:disabled { opacity: .65; pointer-events: none; }

@media (min-width: 769px) {
  .identify-sheet {
    left: 0; right: 0; width: auto; max-width: 460px; margin: 0 auto;
    bottom: 28px; border-radius: 28px;
    box-shadow: 0 32px 90px rgba(27,27,27,.30);
  }
  .identify-sheet:not(.open) { transform: translateY(calc(100% + 48px)); }
  .identify-sheet .sheet-handle { display: none; }
  .identify-sheet .sheet-toprow { padding: 20px 32px 4px; border-radius: 28px 28px 0 0; }
  .identify-body { padding: 4px 32px 28px; }
}
