/* ============================================================
   RETOS EXPAND — página "Tu Perfil / Retos"
   Separado del HTML inline para carga via wp_enqueue_style()
   ============================================================ */

:root {
  --g: #adf3e7;
  --g2: #adf3e7;
  --bg: #ffffff;
  --glass: rgba(0,0,0,.50);
  --stroke: rgba(255,255,255,.08);
}

/* ====== EXPAND LAYOUT ====== */
.h3-section {
  position: relative;
  height: 88vh;
  min-height: 520px;
}
.img-pane {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.h3-section.expanded .img-pane { width: 42%; }

@media (max-width: 767px) {
  .h3-section { height: auto; min-height: unset; }
  .h3-section .img-pane { position: relative; height: 70vh; min-height: 520px; width: 100%; }
  .h3-section.expanded .img-pane { width: 100%; }
}

.panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 58%;
  transform: translateX(100%);
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  background: rgba(255,255,255,.96);
  border-left: 1px solid rgba(173,243,231,.85);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.h3-section.expanded .panel { transform: translateX(0); }

@media (max-width: 767px) {
  .panel { width: 100%; }
  .h3-section.expanded .panel {
    position: fixed;
    inset: 0;
    z-index: 50;
    transform: translateX(0);
    background: rgba(255,255,255,.98);
    color: #0b0b0b;
  }
}

/* top/bottom fades */
.fade-top, .fade-bot {
  position: absolute; left: 0; right: 0;
  height: 72px; pointer-events: none; z-index: 20;
}
.fade-top { top: 0; background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent); }
.fade-bot { bottom: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent); }

/* ====== WIDGETS ====== */
.w2 {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 10px 9px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.w2 .w2-row { display: flex; align-items: center; gap: 6px; }
.w2 .w2-label { font-size: 8px; letter-spacing: .05em; font-weight: 700; color: rgba(255,255,255,.6); }
.w2 .w2-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; }

.w2-fat { width: 142px; }
.w2-fat .w2-val { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.w2-fat .w2-num { font-size: 12px; font-weight: 800; color: #4ade80; }
.w2-fat .w2-sub { font-size: 8px; color: rgba(74,222,128,.55); }

.w2-nutrition { width: 134px; }
.w2-nutrition .w2-emoji { font-size: 14px; line-height: 1; display: inline-block; transform: translateZ(0); }
.w2-nutrition .bar { height: 6px; background: rgba(255,255,255,.10); border-radius: 999px; overflow: hidden; flex: 1; }
.w2-nutrition .bar > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .6s ease-out; }
@keyframes emojiPop {
  0%   { transform: scale(.7) rotate(-12deg); }
  70%  { transform: scale(1.08) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.w2-nutrition .w2-emoji.pop { animation: emojiPop .55s cubic-bezier(.2,.9,.2,1); }

.w2-smoke { width: 140px; }
.w2-smoke .days { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; margin: 2px 0 5px; }
.w2-smoke .days span { font-size: 6px; color: rgba(255,255,255,.25); text-align: center; }
.w2-smoke .grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.w2-smoke .cell { height: 13px; border-radius: 3px; background: rgba(255,255,255,.05); display: grid; place-items: center; }
.w2-smoke .cell.ok  { background: rgba(34,197,94,.18); }
.w2-smoke .cell.bad { background: rgba(239,68,68,.18); }
.w2-smoke .cell b { font-size: 8px; transform: scale(0); transition: transform .25s cubic-bezier(.2,.9,.2,1); }
.w2-smoke .cell.show b { transform: scale(1); }

.w2-stress { width: 142px; }
.w2-stress .w2-val { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.w2-stress .w2-num { font-size: 11px; font-weight: 800; color: #a78bfa; }
.w2-stress .w2-sub { font-size: 8px; color: rgba(167,139,250,.55); }
.w2-stress-path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: stressDraw 4.8s ease-in-out infinite;
}
@keyframes stressDraw {
  0%   { stroke-dashoffset: 240; }
  30%  { stroke-dashoffset: 0; }
  70%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 240; }
}

.w2-sleep { width: 142px; display: flex; align-items: center; gap: 10px; }
.w2-sleep .ring {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(from -90deg,#312e81 0% 0%,#818cf8 0% 0%,rgba(255,255,255,.05) 0% 100%);
}
.w2-sleep .ring > span { width: 28px; height: 28px; border-radius: 999px; background: #07070a; display: grid; place-items: center; }
.w2-sleep .dot { width: 5px; height: 5px; border-radius: 999px; }
.w2-sleep .txt { font-size: 8px; color: rgba(255,255,255,.5); }

.w2-focus { width: 132px; height: 55px; position: relative; overflow: hidden; }
.w2-focus .p { position: absolute; border-radius: 999px; will-change: transform,opacity; }
.w2-focus .w2-num { font-size: 8px; font-weight: 700; color: rgba(255,255,255,.6); letter-spacing: .05em; }

/* floating animation */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.floaty { animation: floaty 3.6s ease-in-out infinite; }
.widget-wrap { position: absolute; z-index: 10; pointer-events: none; }
.pos-tl { top: 18px; left: 18px; }
.pos-tr { top: 18px; right: 18px; }
.pos-bl { bottom: 18px; left: 18px; }
.pos-br { bottom: 18px; right: 18px; }

.content-z { position: relative; z-index: 15; }

/* ECG overlay */
.ecg-overlay { position: absolute; inset: 0; z-index: 8; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.h3-section.is-ecg .ecg-overlay { opacity: 1; }
.ecg-path { fill: none; stroke: rgba(34,197,94,.9); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ecg-glow { filter: drop-shadow(0 0 10px rgba(34,197,94,.30)); }
.ecg-dash { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s linear infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* CTA button */
.cta {
  background-color: rgb(var(--color-verdeZ-900));
  color: #fff;
  border: none;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
}

.boton_cta:hover{
  color: #fff !important;
}

#como h3{
  color: #fff !important;
}

#como p{
  color: rgba(255,255,255,.85) !important;
}

/* ====== HARDEN LIGHT BACKGROUND ====== */
.h3vel-page {
  background: var(--bg) !important;
  color: #0b0b0b;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}
.h3vel-page * { max-width: 100%; }
.h3-section { background: var(--bg); }
.h3vel-page, .h3vel-page main, .h3vel-page section, .h3vel-page header { overflow-x: hidden; }

/* ====== WIDGETS MÁS VISIBLES EN DESKTOP ====== */
@media (min-width: 768px) {
  .widget-wrap .w2 { transform: scale(1.22); }
  .widget-wrap.pos-tr .w2, .widget-wrap.pos-br .w2 { transform-origin: top right; }
  .widget-wrap.pos-tl .w2, .widget-wrap.pos-bl .w2 { transform-origin: top left; }
  .pos-tl { top: 22px; left: 22px; }
  .pos-tr { top: 22px; right: 22px; }
  .pos-bl { bottom: 22px; left: 22px; }
  .pos-br { bottom: 22px; right: 22px; }
}

/* ====== MOBILE: panel sin scroll lateral + X accesible ====== */
@media (max-width: 767px) {
  .panel { overflow-x: hidden; width: 100vw; max-width: 100vw; }
  .panel > div { overflow-x: hidden; }
  .close-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 70;
  }
  .panel .relative.h-full { padding-top: 56px; }
}

/* ====== THEME OVERRIDES (Tailwind greens -> H3VEL mint) ====== */
.h3vel-page .bg-green-500 { background: #adf3e7 !important; }
.h3vel-page [class*="bg-green-500/"] { background-color: rgb(var(--color-verdeZ-900)) !important; }
.h3vel-page [class*="border-green-500"] { border-color:rgb(var(--color-verdeZ-900)) !important; }
.h3vel-page [class*="text-green-"] { color: #000 !important; }
.h3vel-page [class*="from-green-"],
.h3vel-page [class*="to-emerald-"],
.h3vel-page [class*="to-green-"] {
  --tw-gradient-from: #0b3b2f !important;
  --tw-gradient-to: #0f766e !important;
}

.h3vel-page .text-gray-300,
.h3vel-page .text-gray-300\/80,
.h3vel-page .text-gray-300\/85,
.h3vel-page .text-gray-300\/90,
.h3vel-page .text-gray-200,
.h3vel-page .text-gray-500 {
  color: rgba(15,23,42,.75) !important;
}

/* ====== RETOS (7 secciones) en negro ====== */
.h3vel-page #retos {
  background: #000 !important;
  color: #fff;
}
.h3vel-page #retos .h3-section {
  background: #000 !important;
  border-top-color: rgba(255,255,255,.06) !important;
}
.h3vel-page #retos .img-pane {
  background: #000 !important;
}

.h3vel-page #retos .img-pane .text-gray-300,
.h3vel-page #retos .img-pane .text-gray-300\/80,
.h3vel-page #retos .img-pane .text-gray-300\/85,
.h3vel-page #retos .img-pane .text-gray-300\/90,
.h3vel-page #retos .img-pane .text-gray-200 {
  color: rgba(255,255,255,.82) !important;
}
.h3vel-page #retos .img-pane .text-gray-500 {
  color: rgba(255,255,255,.60) !important;
}
.h3vel-page #retos .img-pane [class*="text-green-"] {
  color: rgba(173,243,231,.92) !important;
}
.h3vel-page #retos .img-pane [class*="bg-green-500/"] {
  background-color: rgba(173,243,231,.16) !important;
}
.h3vel-page #retos .img-pane [class*="border-green-500"] {
  border-color: rgba(173,243,231,.30) !important;
}

.h3vel-page #retos .panel {
  color: #0b0b0b;
}

/* Panel (blanco): contraste de textos */
.panel .text-gray-300,
.panel .text-gray-300\/80,
.panel .text-gray-300\/85,
.panel .text-gray-300\/90,
.panel .text-gray-200 {
  color: rgba(15,23,42,.78) !important;
}
.panel .text-gray-500 {
  color: rgba(15,23,42,.55) !important;
}
