/* Nuvorelix V10.30 — Universal design system
   Loaded last. Unifies text, surfaces, inputs, borders and accents across public + admin. */

:root,
html[data-theme="light"]{
  --nx-bg:#f6f2e9;
  --nx-bg-2:#fbf8f1;
  --nx-surface:#fffdf9;
  --nx-surface-2:#f2ebde;
  --nx-surface-3:#e9dfcf;
  --nx-text:#17130f;
  --nx-text-2:#4e473f;
  --nx-muted:#746c62;
  --nx-soft:#968b7c;
  --nx-line:#dfd2bd;
  --nx-line-strong:#cdb98f;
  --nx-gold:#c89218;
  --nx-gold-2:#e0b64a;
  --nx-gold-soft:rgba(200,146,24,.11);
  --nx-success:#2f9b69;
  --nx-danger:#b94f45;
  --nx-shadow:0 16px 44px rgba(49,38,18,.08);
  --nx-shadow-lg:0 28px 80px rgba(49,38,18,.11);

  --c-bg:var(--nx-bg)!important;
  --c-bg-2:var(--nx-bg-2)!important;
  --c-card:var(--nx-surface)!important;
  --c-card-2:var(--nx-surface-2)!important;
  --c-line:var(--nx-line)!important;
  --c-line-strong:var(--nx-line-strong)!important;
  --c-text:var(--nx-text)!important;
  --c-muted:var(--nx-muted)!important;
  --c-soft:var(--nx-soft)!important;
  --c-primary:var(--nx-gold)!important;
  --c-primary-2:var(--nx-gold-2)!important;
}

html[data-theme="dark"]{
  --nx-bg:#090806;
  --nx-bg-2:#0d0c09;
  --nx-surface:#11100d;
  --nx-surface-2:#17140f;
  --nx-surface-3:#1f1a12;
  --nx-text:#f5efe3;
  --nx-text-2:#d0c6b5;
  --nx-muted:#aaa091;
  --nx-soft:#81786c;
  --nx-line:#332a19;
  --nx-line-strong:#4a3a1d;
  --nx-gold:#d2a52d;
  --nx-gold-2:#eccf75;
  --nx-gold-soft:rgba(210,165,45,.12);
  --nx-success:#58b988;
  --nx-danger:#d46e63;
  --nx-shadow:0 18px 56px rgba(0,0,0,.24);
  --nx-shadow-lg:0 32px 90px rgba(0,0,0,.34);

  --c-bg:var(--nx-bg)!important;
  --c-bg-2:var(--nx-bg-2)!important;
  --c-card:var(--nx-surface)!important;
  --c-card-2:var(--nx-surface-2)!important;
  --c-line:var(--nx-line)!important;
  --c-line-strong:var(--nx-line-strong)!important;
  --c-text:var(--nx-text)!important;
  --c-muted:var(--nx-muted)!important;
  --c-soft:var(--nx-soft)!important;
  --c-primary:var(--nx-gold)!important;
  --c-primary-2:var(--nx-gold-2)!important;
}

/* universal page + typography */
html[data-theme] body:not(.admin-body){background:var(--nx-bg)!important;color:var(--nx-text)!important}
html[data-theme] body:not(.admin-body) :where(h1,h2,h3,h4,h5,h6,.title,.heading,.card-title,.section-title){color:var(--nx-text)!important}
html[data-theme] body:not(.admin-body) :where(p,.subtitle,.description,.muted,.help-text,.hint,.caption){color:var(--nx-muted)!important}
html[data-theme] body:not(.admin-body) :where(label,legend,.form-label,.field-label){color:var(--nx-text-2)!important}
html[data-theme] body:not(.admin-body) :where(small,.small,.meta,.eyebrow){color:var(--nx-soft)!important}
html[data-theme] body:not(.admin-body) a{color:inherit}
html[data-theme] body:not(.admin-body) a:hover{color:var(--nx-gold)!important}

/* common surfaces: one family everywhere */
html[data-theme] body:not(.admin-body) :where(
  .cm-product-card,.cm-purchase-card,.cm-account-card,.cm-account-panel,.cm-panel,.cm-card,
  .library-card,.review-card,.account-card,.account-panel,.profile-card,.summary-card,.info-card,
  .cart-card,.checkout-card,.support-card,.filter-card,.search-card,.settings-card,
  .modal-content,.dialog-content,.dropdown-menu,.popover,.cm-account-popover,.cm-drawer-panel,
  .nx-recovery-shell,.nx-reset-shell
){
  background:var(--nx-surface)!important;
  border-color:var(--nx-line)!important;
  color:var(--nx-text)!important;
  box-shadow:var(--nx-shadow)!important;
}

/* keep intentional black premium split-panels dark */
html[data-theme] body :where(.nx-recovery-guide,.nx-reset-guide){background:linear-gradient(145deg,#12110e,#080806)!important}
html[data-theme] body :where(.nx-recovery-guide,.nx-reset-guide) :where(h1,h2,h3,strong){color:#f7f1e7!important}
html[data-theme] body :where(.nx-recovery-guide,.nx-reset-guide) :where(p,small,span){color:#aaa193}

/* forms */
html[data-theme] body:not(.admin-body) :where(input,textarea,select){
  background:var(--nx-surface-2)!important;
  color:var(--nx-text)!important;
  border-color:var(--nx-line)!important;
  caret-color:var(--nx-gold)!important;
}
html[data-theme] body:not(.admin-body) :where(input,textarea,select)::placeholder{color:var(--nx-soft)!important;opacity:1!important}
html[data-theme] body:not(.admin-body) :where(input,textarea,select):focus{
  border-color:var(--nx-gold)!important;
  box-shadow:0 0 0 4px var(--nx-gold-soft)!important;
  outline:none!important;
}

/* buttons */
html[data-theme] body:not(.admin-body) :where(.btn,.button,button[type="submit"],.cm-primary-action,.cm-purchase-button,.cm-card-cta,.nx-recovery-submit,.nx-reset-primary){
  border-radius:14px!important;
  font-weight:800!important;
}
html[data-theme] body:not(.admin-body) :where(.btn-primary,.primary,button[type="submit"],.cm-primary-action,.cm-purchase-button,.cm-card-cta,.nx-recovery-submit,.nx-reset-primary){
  background:linear-gradient(135deg,var(--nx-gold-2),var(--nx-gold))!important;
  color:#171108!important;
  border-color:rgba(151,102,5,.32)!important;
  box-shadow:0 12px 28px rgba(165,112,12,.15)!important;
}
html[data-theme] body:not(.admin-body) :where(.btn-secondary,.secondary,.ghost,.alt){
  background:var(--nx-surface)!important;
  color:var(--nx-text)!important;
  border-color:var(--nx-line)!important;
}

/* chips, badges, dividers */
html[data-theme] body:not(.admin-body) :where(.badge,.chip,.tag,.pill){
  background:var(--nx-gold-soft)!important;
  color:var(--nx-gold)!important;
  border-color:color-mix(in srgb,var(--nx-gold) 30%,transparent)!important;
}
html[data-theme] body:not(.admin-body) :where(hr,.divider,.separator){border-color:var(--nx-line)!important}

/* navbar/footer consistency */
html[data-theme] body:not(.admin-body) :where(.nx-header,.cm-topbar,.nova-navbar,.site-header){
  background:color-mix(in srgb,var(--nx-surface) 92%,transparent)!important;
  border-color:var(--nx-line)!important;
  color:var(--nx-text)!important;
}
html[data-theme] body:not(.admin-body) :where(.nx-footer,.site-footer,.cm-footer){
  background:var(--nx-surface)!important;
  border-color:var(--nx-line)!important;
  color:var(--nx-text)!important;
}

/* clean brand assets — no filters, opacity tricks or blending */
html[data-theme] img[src*="nuvorelix"],
html[data-theme] .nx-brand-logo,
html[data-theme] .admin-brand img{
  filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
  image-rendering:auto!important;
}

/* mobile storefront: clearer light mode, less muddy */
html[data-theme="light"] body:not(.admin-body) :where(.cm-product-card,.mobile-product-card,.cm-mobile-buybar,.bottom-nav,.mobile-bottom-nav){
  background:#fffdf9!important;
  border-color:#d8c8aa!important;
  color:#17130f!important;
}
html[data-theme="light"] body:not(.admin-body) :where(.cm-product-card,.mobile-product-card) :where(p,small,.meta){color:#71685d!important}

/* ADMIN: same tokens, no random blue/purple leftovers */
html[data-theme] body.admin-body{
  --a-bg:var(--nx-bg)!important;
  --a-surface:var(--nx-surface)!important;
  --a-surface-2:var(--nx-surface-2)!important;
  --a-text:var(--nx-text)!important;
  --a-muted:var(--nx-muted)!important;
  --a-line:var(--nx-line)!important;
  --a-gold:var(--nx-gold)!important;
  background:var(--nx-bg)!important;
  color:var(--nx-text)!important;
}
html[data-theme] body.admin-body :where(.admin-panel,.admin-card,.metric-card,.table-wrap,.admin-table-card,.admin-form-card,.modal-content){
  background:var(--nx-surface)!important;
  color:var(--nx-text)!important;
  border-color:var(--nx-line)!important;
}
html[data-theme] body.admin-body :where(h1,h2,h3,h4,h5,strong,label,th){color:var(--nx-text)!important}
html[data-theme] body.admin-body :where(p,small,.muted,td,.admin-help){color:var(--nx-muted)!important}
html[data-theme] body.admin-body :where(input,textarea,select){background:var(--nx-surface-2)!important;color:var(--nx-text)!important;border-color:var(--nx-line)!important}
html[data-theme] body.admin-body :where(input,textarea,select)::placeholder{color:var(--nx-soft)!important}
html[data-theme] body.admin-body :where(.btn:not(.alt),.editor-save,.admin-create-primary){background:linear-gradient(135deg,var(--nx-gold-2),var(--nx-gold))!important;color:#171108!important;border-color:rgba(151,102,5,.32)!important}
html[data-theme] body.admin-body :where(.btn.alt,.admin-theme-toggle){background:var(--nx-surface)!important;color:var(--nx-text)!important;border-color:var(--nx-line)!important}
html[data-theme] body.admin-body :where(.admin-nav a.active,.admin-nav a:hover){background:var(--nx-gold-soft)!important;color:var(--nx-text)!important}

@media(max-width:760px){
  html[data-theme] body:not(.admin-body) :where(.cm-product-card,.mobile-product-card,.library-card,.account-card){box-shadow:0 10px 28px rgba(32,24,12,.07)!important}
  html[data-theme="light"] body:not(.admin-body){background:#f8f4ec!important}
}


/* ==========================================================
   NUVORELIX V10.46 · CAMBIOS SEGUROS DE UX
   Solo CSS/JS. Sin PHP, SQL, .env, pagos ni configuración.
   ========================================================== */

/* CALY: usar el isotipo limpio/proporcionado en ambos temas.
   La versión dark antigua tenía un lienzo horizontal que generaba
   la línea visual que se veía fuera de lugar. */
body.cm-caly-page .caly-symbol-dark{
  display:none!important;
}
body.cm-caly-page .caly-symbol-light{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  object-fit:contain!important;
}
html[data-theme="dark"] body.cm-caly-page .caly-symbol-light{
  filter:brightness(0) invert(1);
  opacity:.94;
}

/* Producto: el bloque "¿Cómo quieres recibirlo?" tiene scroll propio
   en escritorio y conserva el comportamiento natural en móvil/tablet. */
@media (min-width:1025px){
  body.cm-product-reboot .cm-purchase-card{
    max-height:calc(100vh - 116px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
  body.cm-product-reboot .cm-purchase-card::-webkit-scrollbar{
    width:8px;
  }
  body.cm-product-reboot .cm-purchase-card::-webkit-scrollbar-thumb{
    background:color-mix(in srgb,var(--nx-gold) 48%,transparent);
    border-radius:999px;
  }
  body.cm-product-reboot .cm-purchase-card::-webkit-scrollbar-track{
    background:transparent;
  }
}
@media (max-width:1024px){
  body.cm-product-reboot .cm-purchase-card{
    max-height:none!important;
    overflow:visible!important;
  }
}

/* Toast de carrito sin abandonar la ficha */
.nx-cart-toast{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:9999;
  width:min(390px,calc(100vw - 32px));
  padding:16px;
  border:1px solid var(--nx-line);
  border-radius:18px;
  background:color-mix(in srgb,var(--nx-surface) 96%,transparent);
  color:var(--nx-text);
  box-shadow:0 22px 65px rgba(0,0,0,.22);
  backdrop-filter:blur(18px);
  display:grid;
  gap:12px;
  transform:translateY(18px);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
.nx-cart-toast.is-visible{
  transform:translateY(0);
  opacity:1;
  pointer-events:auto;
}
.nx-cart-toast-head{
  display:flex;
  align-items:flex-start;
  gap:11px;
}
.nx-cart-toast-icon{
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:var(--nx-gold-soft);
  color:var(--nx-gold);
  font-weight:900;
}
.nx-cart-toast-copy{
  min-width:0;
  display:grid;
  gap:3px;
}
.nx-cart-toast-copy strong{
  color:var(--nx-text)!important;
  font-size:14px;
}
.nx-cart-toast-copy span{
  color:var(--nx-muted)!important;
  font-size:12px;
  line-height:1.45;
}
.nx-cart-toast-close{
  margin-left:auto;
  width:28px;
  height:28px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--nx-muted);
  cursor:pointer;
  font-size:18px;
}
.nx-cart-toast-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}
.nx-cart-toast-actions button,
.nx-cart-toast-actions a{
  min-height:40px;
  border-radius:11px;
  border:1px solid var(--nx-line);
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.nx-cart-toast-actions button{
  background:var(--nx-surface-2);
  color:var(--nx-text);
}
.nx-cart-toast-actions a{
  background:linear-gradient(135deg,var(--nx-gold-2),var(--nx-gold));
  color:#171108!important;
  border-color:transparent;
}
.cm-purchase-button.is-loading{
  opacity:.7;
  cursor:wait;
  pointer-events:none;
}
@media(max-width:600px){
  .nx-cart-toast{
    right:16px;
    bottom:82px;
  }
  .nx-cart-toast-actions{
    grid-template-columns:1fr;
  }
}


/* ==========================================================
   NUVORELIX V10.47 · CALY CARD POLISH
   Reequilibra logo, marca y mantra en la tarjeta CALY.
   ========================================================== */

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-card-top{
  align-items:center!important;
  gap:24px!important;
  padding-bottom:22px!important;
  border-bottom:1px solid rgba(70,196,239,.12)!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand{
  gap:18px!important;
  align-items:center!important;
  min-width:0!important;
}

/* Isotipo limpio dentro de una placa real, no flotando sobre el fondo */
body.cm-caly-page .alliance-v70-card-caly .alliance-v70-logo-wrap{
  width:96px!important;
  height:96px!important;
  padding:10px!important;
  box-sizing:border-box!important;
  border-radius:24px!important;
  overflow:hidden!important;
  background:linear-gradient(145deg,#ffffff 0%,#f5f9fc 100%)!important;
  border:1px solid rgba(99,205,245,.24)!important;
  box-shadow:
    0 14px 34px rgba(0,0,0,.24),
    0 0 0 1px rgba(255,255,255,.04)!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-logo-wrap .caly-symbol-light{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  object-fit:contain!important;
  filter:none!important;
  opacity:1!important;
  transform:none!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-logo-wrap .caly-symbol-dark{
  display:none!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand>div{
  gap:7px!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand small{
  color:#56cffa!important;
  font-size:.64rem!important;
  line-height:1.2!important;
  font-weight:850!important;
  letter-spacing:.20em!important;
}

body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand strong{
  color:#f7f8fa!important;
  font-size:2.18rem!important;
  line-height:.95!important;
  font-weight:850!important;
  letter-spacing:.07em!important;
}

/* La frase deja de verse "flotando" y pasa a ser un acento editorial */
body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
  align-self:stretch!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  min-width:150px!important;
  margin-left:auto!important;
  padding:4px 0 4px 22px!important;
  border-left:1px solid rgba(70,196,239,.22)!important;
  color:#53cffb!important;
  font-size:.67rem!important;
  line-height:1.55!important;
  font-weight:850!important;
  letter-spacing:.18em!important;
}

body.cm-caly-page .alliance-v70-card-caly .caly-mantra::after{
  width:58px!important;
  margin-top:11px!important;
  opacity:.55!important;
}

/* Light mode: misma composición, solo cambia el contraste */
html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .alliance-v70-card-top{
  border-bottom-color:rgba(15,143,199,.13)!important;
}

html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .alliance-v70-logo-wrap{
  background:linear-gradient(145deg,#ffffff 0%,#f7fbfe 100%)!important;
  border-color:rgba(15,143,199,.16)!important;
  box-shadow:0 12px 28px rgba(20,54,72,.08)!important;
}

html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand strong{
  color:#17191d!important;
}

html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand small,
html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
  color:#0f8fc7!important;
}

html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
  border-left-color:rgba(15,143,199,.18)!important;
}

@media(max-width:720px){
  body.cm-caly-page .alliance-v70-card-caly .alliance-v70-card-top{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:16px!important;
    padding-bottom:18px!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .alliance-v70-logo-wrap{
    width:78px!important;
    height:78px!important;
    border-radius:20px!important;
    padding:8px!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand{
    gap:14px!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .alliance-v70-brand strong{
    font-size:1.7rem!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
    width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    padding:12px 0 0!important;
    border-left:0!important;
    border-top:1px solid rgba(70,196,239,.18)!important;
    display:block!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .caly-mantra br{
    display:none!important;
  }

  body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
    word-spacing:.15em!important;
  }

  html[data-theme="light"] body.cm-caly-page .alliance-v70-card-caly .caly-mantra{
    border-top-color:rgba(15,143,199,.16)!important;
  }
}
