/* ==========================================================================
   Nitrox Jeans — marca sobre Astra + Elementor + WooCommerce
   Mismos tokens que el Cotizador de Bordados (cotizador.nitroxjeans.com).
   Tema oscuro fijo: no depende de prefers-color-scheme.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Azul industrial Nitrox + índigo tecnológico sobre slate-950. */
  --brand-900: #0339a6;
  --brand-700: #0468bf;
  --brand-600: #0477bf;
  --brand-200: #1e3a5f;
  --brand-100: #172a46;
  --brand-50: #0f1d33;
  --brand-tint: #0c1a30;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-300: #a5b4fc;
  --accent: #7cc4f5;
  --grad-brand: linear-gradient(135deg, #0477bf 0%, #4f46e5 100%);
  --grad-text: linear-gradient(100deg, #7cc4f5 0%, #a5b4fc 55%, #818cf8 100%);
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --placeholder: #64748b;
  --line: #1e293b;
  --line-strong: #334155;
  --line-hover: #475569;
  --canvas: #020617;
  --surface: #0b1222;
  --surface-soft: #0f172a;
  --surface-muted: #162036;
  --surface-hover: #131d33;
  /* Vidrio: solo en superficies que flotan sobre otra cosa. */
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-bg-strong: rgba(15, 23, 42, 0.82);
  --glass-border: rgba(148, 163, 184, 0.14);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-blur: blur(18px) saturate(150%);
  --header-glass: rgba(2, 6, 23, 0.72);
  --surface-glass: rgba(11, 18, 34, 0.9);
  --danger: #e11d48;
  --danger-text: #fda4af;
  --success: #34d399;
  --ring: #7cc4f5;
  --ring-soft: rgba(124, 196, 245, 0.25);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 4px 12px rgba(0, 0, 0, 0.35), 0 24px 56px -12px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 10px 30px -8px rgba(79, 70, 229, 0.55);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Plus Jakarta Sans Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-card: 1rem;
  --radius-btn: 10px;

  /* Elementor: sus colores y fuentes globales pasan a ser los de la marca. */
  --e-global-color-primary: var(--brand-600);
  --e-global-color-secondary: var(--accent);
  --e-global-color-text: var(--ink-soft);
  --e-global-color-accent: var(--brand-600);
  --e-global-typography-primary-font-family: var(--font);
  --e-global-typography-secondary-font-family: var(--font);
  --e-global-typography-text-font-family: var(--font);
  --e-global-typography-accent-font-family: var(--font);

  /* Astra: paleta global. */
  --ast-global-color-0: var(--brand-600);
  --ast-global-color-1: var(--brand-700);
  --ast-global-color-2: var(--ink);
  --ast-global-color-3: var(--ink-soft);
  --ast-global-color-4: var(--surface);
  --ast-global-color-5: var(--canvas);
  --ast-global-color-6: var(--line);
  --ast-global-color-7: var(--surface-soft);
  --ast-global-color-8: var(--muted);

  color-scheme: dark;
}

/* --- Base --------------------------------------------------------------- */

html { -webkit-tap-highlight-color: transparent; }

body.nx,
body.nx .site,
body.nx .site-content,
body.nx .ast-separate-container,
body.nx.ast-separate-container .ast-article-single,
body.nx.ast-separate-container .ast-woocommerce-container {
  background: var(--canvas);
  color: var(--ink-soft);
  font-family: var(--font);
}

body.nx { font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

body.nx h1, body.nx h2, body.nx h3, body.nx h4, body.nx h5, body.nx h6,
body.nx .entry-title,
body.nx .elementor-heading-title,
body.nx .product_title {
  font-family: var(--font) !important; /* Elementor fija la fuente por widget en línea. */
  font-style: normal !important;        /* Hoy los títulos van en cursiva (Playfair). */
  color: var(--ink);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
body.nx h1, body.nx .product_title { font-weight: 800; }
body.nx h2, body.nx h3 { font-weight: 700; }

body.nx a { color: var(--accent); transition: color 200ms ease; }
body.nx ::selection { background: var(--brand-600); color: #fff; }

body.nx :focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.nx-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Cifras alineadas en precios y totales. */
body.nx .price, body.nx .amount, body.nx .woocommerce-Price-amount,
body.nx .quantity .qty, body.nx .nx-ship-bar { font-variant-numeric: tabular-nums; }

/* --- Franja superior ---------------------------------------------------- */

.nx-topbar { background: var(--grad-brand); color: #dbeafe; font-size: 12.5px; font-weight: 600; }
.nx-topbar__inner {
  max-width: 1280px; margin: 0 auto; padding: 8px 16px;
  display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.nx-topbar a { color: #fff !important; text-decoration: none; }
.nx-dot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--success); vertical-align: middle; }
@media (max-width: 640px) { .nx-hide-sm { display: none; } .nx-topbar__inner { gap: 12px; } }

/* --- Encabezado: vidrio solo aquí (superficie flotante) ----------------- */

body.nx .site-header,
body.nx .ast-primary-header-bar,
body.nx .ast-mobile-header-wrap .ast-primary-header-bar {
  background: var(--header-glass) !important;
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line) !important;
}
body.nx .site-header { position: sticky; top: 0; z-index: 99; }
body.nx.admin-bar .site-header { top: 32px; }

/* El logo es azul: siempre sobre recuadro blanco. Y más pequeño en móvil (hoy ocupa media pantalla). */
body.nx .site-logo-img .custom-logo-link,
body.nx .ast-site-identity .custom-logo-link {
  display: inline-flex; padding: 6px 8px; border-radius: 12px; background: #fff;
}
body.nx .custom-logo { max-height: 52px; width: auto !important; }
@media (max-width: 921px) { body.nx .custom-logo { max-height: 40px; } }

body.nx .main-header-menu .menu-link,
body.nx .ast-header-break-point .main-header-menu .menu-link {
  color: var(--ink-soft) !important;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  transition: color 200ms ease;
}
body.nx .main-header-menu .current-menu-item > .menu-link { color: var(--accent) !important; }

/* "KIDS" apunta a una categoría de la plantilla sin productos: oculto hasta que exista la línea infantil.
   Lo correcto es quitarlo en Apariencia → Menús; esto evita el enlace roto mientras tanto. */
body.nx .menu-item:has(> a[href*="/categoria-producto/accessories"]) { display: none; }

body.nx .ast-header-break-point .main-header-bar-navigation,
body.nx .ast-mobile-popup-drawer .ast-mobile-popup-inner { background: var(--surface) !important; }

body.nx .ast-site-header-cart .count,
body.nx .ast-cart-menu-wrap .count { background: var(--brand-600); color: #fff; }

/* --- Botones ------------------------------------------------------------ */

body.nx .button,
body.nx button.button,
body.nx .ast-button,
body.nx .elementor-button,
body.nx input[type="submit"],
body.nx .single_add_to_cart_button,
body.nx .checkout-button,
body.nx #place_order,
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px;
  border: 1px solid transparent; border-radius: var(--radius-btn) !important;
  background: var(--grad-brand) !important; color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: 0.01em; text-transform: none;
  text-decoration: none; cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease, opacity 200ms ease, transform 160ms var(--ease-out);
}
body.nx .button:active, body.nx .elementor-button:active, body.nx .single_add_to_cart_button:active,
body.nx #place_order:active, .nx-btn:active { transform: scale(0.97); }

body.nx .button:disabled, body.nx .button.disabled, body.nx .single_add_to_cart_button.disabled {
  opacity: 0.5 !important; cursor: not-allowed;
}

.nx-btn--ghost {
  background: var(--glass-bg) !important; color: var(--ink) !important; border-color: var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* Estados de carga y éxito: el botón responde en el mismo instante del clic. */
body.nx .is-loading, .nx-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
body.nx .is-loading::after, .nx-btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: nx-spin 600ms linear infinite;
}
body.nx .button.is-added, body.nx .single_add_to_cart_button.is-added, .nx-btn.is-added { background: linear-gradient(135deg, #059669, #10b981) !important; }
@keyframes nx-spin { to { transform: rotate(360deg); } }

.nx-ico { width: 1.25em; height: 1.25em; flex: none; }

/* Superficie de vidrio reutilizable. */
.nx-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

.nx-grad-text {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  body.nx .button:hover, body.nx .elementor-button:hover, body.nx .single_add_to_cart_button:hover,
  body.nx #place_order:hover, .nx-btn--primary:hover { filter: brightness(1.1); box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  .nx-btn--ghost:hover { background: rgba(148, 163, 184, 0.12) !important; border-color: var(--line-hover); }
}

/* --- Campos ------------------------------------------------------------- */

body.nx input[type="text"], body.nx input[type="email"], body.nx input[type="tel"],
body.nx input[type="number"], body.nx input[type="password"], body.nx input[type="search"],
body.nx textarea, body.nx select,
body.nx .select2-container .select2-selection {
  min-height: 46px;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 12px !important;
  font-family: var(--font);
  font-size: 16px; /* 16px evita que iOS haga zoom al enfocar. */
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
body.nx input:focus, body.nx textarea:focus, body.nx select:focus {
  border-color: var(--ring) !important; box-shadow: 0 0 0 3px var(--ring-soft) !important; outline: none;
}
body.nx ::placeholder { color: var(--placeholder); }
body.nx label, body.nx .woocommerce form .form-row label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }

/* --- Tarjetas de producto ----------------------------------------------- */

body.nx ul.products li.product,
body.nx .elementor-widget-woocommerce-products ul.products li.product,
body.nx .eael-product-grid .product {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 0 0 16px !important;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
body.nx ul.products li.product .astra-shop-thumbnail-wrap,
body.nx ul.products li.product a img { border-radius: 0; margin: 0 0 14px; }

body.nx ul.products li.product .astra-shop-thumbnail-wrap { overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-soft); }
body.nx ul.products li.product .astra-shop-thumbnail-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms var(--ease-out);
}

body.nx ul.products li.product .woocommerce-loop-product__title { color: var(--ink); font-size: 15px; font-weight: 700; font-style: normal; padding: 0 16px; }
body.nx ul.products li.product .ast-woo-product-category { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0 16px; }
body.nx ul.products li.product .price { padding: 0 16px; color: var(--accent) !important; font-weight: 800; font-size: 16px; }
body.nx ul.products li.product .price del { color: var(--muted) !important; font-weight: 500; opacity: 1; }
body.nx ul.products li.product .price ins { text-decoration: none; }

/* El botón "Seleccionar opciones" aparece al pasar el cursor; en táctil queda siempre visible. */
body.nx ul.products li.product .button { margin: 12px 16px 0; width: calc(100% - 32px); }
@media (hover: hover) and (pointer: fine) {
  body.nx ul.products li.product:hover { border-color: var(--line-hover); box-shadow: var(--shadow-card); }
  body.nx ul.products li.product:hover .astra-shop-thumbnail-wrap img { transform: scale(1.04); }
}

/* Las muestras de variación dentro de la tarjeta saturan la grilla (hoy salen 8 colores × 5 tallas). */
body.nx ul.products li.product .cfvsw-swatches-container,
body.nx ul.products li.product .variations_form,
body.nx ul.products li.product .reset_variations { display: none !important; }

body.nx .onsale, .nx-badge {
  top: 12px !important; left: 12px !important; right: auto !important;
  min-width: 0 !important; min-height: 0 !important; padding: 4px 10px !important; line-height: 1.4 !important;
  border-radius: 999px !important; background: var(--brand-600) !important; color: #fff !important;
  font-size: 11px !important; font-weight: 800 !important; letter-spacing: 0.04em;
}

/* --- Ficha de producto -------------------------------------------------- */

body.nx.single-product div.product {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start;
}
body.nx.single-product div.product > .woocommerce-product-gallery,
body.nx.single-product div.product > .summary { width: 100% !important; float: none !important; margin: 0 !important; }
body.nx.single-product div.product > .woocommerce-tabs,
body.nx.single-product div.product > .related,
body.nx.single-product div.product > .up-sells { grid-column: 1 / -1; }
@media (max-width: 921px) { body.nx.single-product div.product { grid-template-columns: 1fr; gap: 24px; } }

body.nx .woocommerce-product-gallery { position: sticky; top: 96px; }
body.nx .woocommerce-product-gallery__wrapper,
body.nx .woocommerce-product-gallery .flex-viewport {
  border-radius: var(--radius-card); overflow: hidden; background: var(--surface-soft); border: 1px solid var(--line);
}
body.nx .flex-control-thumbs { display: flex; gap: 10px; margin-top: 12px !important; }
body.nx .flex-control-thumbs li { width: 72px !important; }
body.nx .flex-control-thumbs img { border-radius: 10px; border: 1px solid var(--line); opacity: 0.6; transition: opacity 200ms ease, border-color 200ms ease; }
body.nx .flex-control-thumbs img.flex-active { opacity: 1; border-color: var(--accent); }

body.nx.single-product .product_title { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin-bottom: 8px; }
body.nx.single-product .summary .price { font-size: 26px; font-weight: 800; color: var(--ink) !important; margin: 8px 0 20px; }
body.nx.single-product .summary .price del { font-size: 17px; color: var(--muted) !important; font-weight: 500; }
body.nx.single-product .summary .price ins { text-decoration: none; color: var(--accent); }
body.nx .woocommerce-breadcrumb, body.nx .ast-woocommerce-breadcrumb { color: var(--muted); font-size: 12.5px; }
body.nx .product_meta { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }

/* Selector de variaciones: tallas como píldoras y colores como círculos con anillo. */
body.nx .variations { margin-bottom: 8px; }
body.nx .variations th.label label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
body.nx .cfvsw-swatches-container { gap: 8px; }
body.nx .cfvsw-swatches-option {
  min-width: 46px; min-height: 40px;
  border: 1px solid var(--line-strong) !important; border-radius: 10px !important;
  background: var(--surface-soft) !important; color: var(--ink) !important;
  font-weight: 700; box-shadow: none !important;
  transition: border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
body.nx .cfvsw-swatches-option:active { transform: scale(0.95); }
body.nx .cfvsw-swatches-option.cfvsw-selected-swatch { border-color: var(--accent) !important; background: var(--brand-tint) !important; box-shadow: 0 0 0 3px var(--ring-soft) !important; }
body.nx .cfvsw-swatches-option.cfvsw-swatches-disabled { opacity: 0.35; text-decoration: line-through; }
body.nx .cfvsw-swatches-option[data-slug] .cfvsw-swatch-inner { border-radius: inherit; }

body.nx .single_variation_wrap .woocommerce-variation-price .price { margin: 0 0 12px; }
body.nx form.cart { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
body.nx form.cart .variations, body.nx form.cart .single_variation_wrap, body.nx form.cart .nx-size-guide { flex-basis: 100%; }
body.nx .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 10px; }
body.nx .quantity .qty { width: 72px; text-align: center; }
body.nx .single_add_to_cart_button { flex: 1 1 200px; }
body.nx .nx-buy-now { flex: 1 1 100%; }

.nx-size-guide { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nx-size-guide summary { cursor: pointer; padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--accent); list-style: none; }
.nx-size-guide summary::-webkit-details-marker { display: none; }
.nx-size-guide summary::after { content: "+"; float: right; color: var(--muted); }
.nx-size-guide[open] summary::after { content: "−"; }
.nx-size-guide table { margin: 0; width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.nx-size-guide th, .nx-size-guide td { padding: 8px 16px; border-top: 1px solid var(--line); text-align: left; color: var(--ink-soft); }
.nx-size-guide th { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.nx-size-guide p { margin: 0; padding: 10px 16px 14px; font-size: 12px; color: var(--muted); }

.nx-perks { list-style: none; margin: 20px 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); display: grid; gap: 12px; }
.nx-perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); }
.nx-perks strong { color: var(--ink); }
.nx-perks__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-tint); border: 1px solid var(--brand-200); color: var(--accent); }
.nx-perks__icon svg { width: 18px; height: 18px; }

.nx-wholesale {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #dbeafe !important; text-decoration: none !important; font-size: 13px;
  transition: box-shadow 200ms ease, transform 160ms var(--ease-out);
}
.nx-wholesale strong { color: #fff; font-size: 15px; }
.nx-wholesale:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .nx-wholesale:hover { box-shadow: 0 10px 28px rgba(3, 57, 166, 0.45); } }

/* Pestañas de descripción / ficha técnica. */
body.nx .woocommerce-tabs { margin-top: 48px; padding-top: 0; border-top: 0; }
body.nx .woocommerce-tabs ul.tabs {
  display: inline-flex; gap: 4px; padding: 4px !important; margin-bottom: 24px !important;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
}
body.nx .woocommerce-tabs ul.tabs::before { display: none; }
body.nx .woocommerce-tabs ul.tabs li { margin: 0 !important; border: 0 !important; background: none !important; }
body.nx .woocommerce-tabs ul.tabs li a { padding: 8px 16px !important; border-radius: 9px; color: var(--muted) !important; font-size: 13px; font-weight: 700; }
body.nx .woocommerce-tabs ul.tabs li.active a { background: var(--brand-900); color: #fff !important; }
body.nx .woocommerce-Tabs-panel { max-width: 72ch; color: var(--ink-soft); }
body.nx table.shop_attributes { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; border-collapse: separate; }
body.nx table.shop_attributes th, body.nx table.shop_attributes td { border-color: var(--line) !important; background: transparent !important; color: var(--ink-soft); padding: 12px 16px !important; font-style: normal; }
body.nx table.shop_attributes th { color: var(--muted); font-weight: 600; width: 30%; }

/* Barra fija de compra en móvil. */
.nx-sticky-buy {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-float);
  transform: translateY(0); opacity: 1;
  transition: transform 220ms var(--ease-out), opacity 220ms ease;
}
.nx-sticky-buy[hidden] { display: flex !important; transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.nx-sticky-buy p { margin: 0; line-height: 1.3; }
.nx-sticky-buy__name { color: var(--ink); font-weight: 700; font-size: 13px; }
.nx-sticky-buy__price { color: var(--accent); font-weight: 800; font-size: 14px; }
.nx-sticky-buy__price del { display: none; }
.nx-sticky-buy .nx-btn { min-height: 42px; padding: 10px 16px; }
@media (min-width: 922px) { .nx-sticky-buy { display: none !important; } }

/* --- Carrito lateral (Astra "Slide-in") y barra de envío gratis ---------- */

body.nx #astra-mobile-cart-drawer,
body.nx .astra-cart-drawer {
  background: var(--surface-glass) !important;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  color: var(--ink-soft);
}
body.nx .astra-cart-drawer .astra-cart-drawer-header { border-bottom: 1px solid var(--line); }
body.nx .astra-cart-drawer .astra-cart-drawer-title { color: var(--ink); font-weight: 800; }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item { border-bottom: 1px solid var(--line); }
body.nx .astra-cart-drawer .woocommerce-mini-cart__total { border-top: 1px solid var(--line); color: var(--ink); }
body.nx .astra-cart-drawer .woocommerce-mini-cart__buttons .button:not(.checkout) { background: var(--surface-muted) !important; border: 1px solid var(--line-strong); }
body.nx .astra-mobile-cart-overlay { background: rgba(3, 25, 70, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body.nx .astra-cart-drawer { transition: transform 280ms var(--ease-out) !important; }

.nx-ship-bar { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--brand-tint); border: 1px solid var(--brand-200); font-size: 13px; color: var(--ink-soft); }
.nx-ship-bar p { margin: 0 0 8px; }
.nx-ship-bar strong { color: var(--ink); }
.nx-ship-bar__track { display: block; height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.nx-ship-bar__track span { display: block; height: 100%; width: var(--nx-pct, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--brand-600), var(--accent)); transition: width 500ms var(--ease-out); }

/* --- Carrito y checkout ------------------------------------------------- */

body.nx.woocommerce-cart .site-main,
body.nx.woocommerce-checkout .site-main { max-width: 1120px; margin: 0 auto; }

body.nx table.shop_table,
body.nx .woocommerce-checkout-review-order,
body.nx .cart_totals,
body.nx #customer_details,
body.nx #payment {
  background: var(--surface) !important; border: 1px solid var(--line) !important;
  border-radius: var(--radius-card) !important; color: var(--ink-soft);
}
body.nx table.shop_table th, body.nx table.shop_table td { border-color: var(--line) !important; }
body.nx #customer_details { padding: 24px; }
body.nx #payment { padding: 8px; }
body.nx #payment ul.payment_methods { border-color: var(--line) !important; }
body.nx #payment div.payment_box { background: var(--surface-soft) !important; color: var(--ink-soft); border-radius: 10px; }
body.nx #payment div.payment_box::before { border-bottom-color: var(--surface-soft) !important; }
body.nx .woocommerce-checkout h3 { font-size: 16px; font-weight: 700; color: var(--ink); }

/* Checkout en dos columnas: datos a la izquierda, resumen fijo a la derecha. */
@media (min-width: 922px) {
  body.nx.woocommerce-checkout form.checkout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  body.nx.woocommerce-checkout form.checkout > * { grid-column: 1; }
  body.nx.woocommerce-checkout #order_review_heading,
  body.nx.woocommerce-checkout #order_review { grid-column: 2; }
  body.nx.woocommerce-checkout #order_review_heading { grid-row: 1; margin: 0; }
  body.nx.woocommerce-checkout #order_review { grid-row: 2 / span 4; position: sticky; top: 96px; }
  body.nx.woocommerce-checkout #customer_details { grid-row: 1 / span 5; }
  body.nx #customer_details .col-1, body.nx #customer_details .col-2 { width: 100%; float: none; }
}
body.nx #place_order { width: 100%; min-height: 52px; font-size: 16px; }

body.nx .woocommerce-message, body.nx .woocommerce-info, body.nx .woocommerce-error {
  background: var(--brand-tint) !important; color: var(--ink) !important;
  border: 1px solid var(--brand-200) !important; border-radius: 12px;
}
body.nx .woocommerce-error { background: rgba(127, 18, 50, 0.35) !important; border-color: var(--danger) !important; color: var(--danger-text) !important; }

.nx-thanks { margin: 0 0 32px; padding: 28px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); }
.nx-thanks h2 { margin: 0 0 8px; font-size: 26px; }
.nx-thanks p { color: var(--ink-soft); }

/* --- Elementor: secciones que hoy van en blanco o gris claro ------------ */

/* Los fondos de cada sección se cambian en Elementor (ver informe); aquí solo texto e iconos. */
body.nx .elementor-widget-text-editor, body.nx .elementor-icon-box-description { color: var(--ink-soft); }
body.nx .elementor-icon-box-title, body.nx .elementor-icon-box-title a { color: var(--ink); font-style: normal; }
body.nx .elementor-icon i, body.nx .elementor-icon svg { color: var(--accent); fill: var(--accent); }

/* --- Pie corporativo ---------------------------------------------------- */

.nx-footer { background: var(--surface); border-top: 1px solid var(--line); }
.nx-footer__inner {
  max-width: 1280px; margin: 0 auto; padding: 56px 16px 40px;
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px;
}
@media (max-width: 921px) { .nx-footer__inner { grid-template-columns: 1fr 1fr; } .nx-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .nx-footer__inner { grid-template-columns: 1fr; } }
.nx-footer__brand { display: flex; gap: 16px; align-items: flex-start; }
.nx-logo-tile { flex: none; display: inline-grid; place-items: center; width: 56px; height: 64px; border-radius: 12px; background: #fff; }
.nx-logo-tile img { width: 36px; height: auto; }
.nx-footer__name { margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.nx-footer__tagline { margin: 2px 0 8px; color: var(--accent); font-size: 13px; font-weight: 600; }
.nx-footer__legal { margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nx-footer__col { display: flex; flex-direction: column; gap: 10px; }
.nx-footer__col a { color: var(--ink-soft) !important; text-decoration: none; font-size: 14px; }
@media (hover: hover) and (pointer: fine) { .nx-footer__col a:hover { color: var(--accent) !important; } }

body.nx .site-footer, body.nx .site-below-footer-wrap, body.nx .ast-builder-grid-row-container {
  background: var(--canvas) !important; color: var(--muted); border-top: 1px solid var(--line);
}
body.nx .ast-footer-copyright { font-size: 12px; color: var(--muted); }

/* --- Movimiento al hacer scroll ----------------------------------------- *
   Reemplaza las animaciones de entrada de Elementor (hoy ocultan 13 bloques
   hasta que cargan sus scripts). El contenido es visible sin JS: la clase
   .nx-js la pone nitrox.js antes de ocultar nada.                          */

.nx-js [data-nx-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--nx-i, 0) * 70ms);
}
.nx-js [data-nx-reveal].is-in { opacity: 1; transform: none; }

/* --- Movimiento reducido ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
  .nx-js [data-nx-reveal] { transform: none; }
  body.nx ul.products li.product:hover .astra-shop-thumbnail-wrap img { transform: none; }
}

/* ==========================================================================
   v2 — Catálogo con filtros, ficha, carrito y WPForms
   ========================================================================== */

/* --- Catálogo: filtros laterales ---------------------------------------- */

.nx-shop { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.nx-shop__main { min-width: 0; }
.nx-shop__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.nx-shop__bar .woocommerce-result-count, .nx-shop__bar .woocommerce-ordering { float: none; margin: 0; color: var(--muted); font-size: 13px; }

.nx-filters { position: sticky; top: 96px; }
.nx-filters__toggle { display: none; }
.nx-filters__panel {
  display: grid; gap: 22px; padding: 20px; border-radius: 20px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.nx-filters__title { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nx-filters__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nx-filters__list li { margin: 0; }
.nx-filters__list--colors { display: grid; gap: 4px; }

.nx-chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-soft);
  color: var(--ink-soft) !important; font-size: 13px; font-weight: 700; text-decoration: none !important;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.nx-chip--size { min-width: 44px; padding-inline: 10px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.nx-chip:active { transform: scale(0.95); }
.nx-chip.is-active { background: var(--grad-brand); border-color: transparent; color: #fff !important; }

.nx-swatch {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px;
  color: var(--ink-soft) !important; font-size: 13.5px; text-decoration: none !important;
  transition: background-color 200ms ease;
}
.nx-swatch span { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); transition: box-shadow 200ms ease; }
.nx-swatch.is-active { background: rgba(99, 102, 241, 0.14); color: var(--ink) !important; font-weight: 700; }
.nx-swatch.is-active span { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--indigo-300); }

.nx-filters__clear { justify-self: start; font-size: 13px; font-weight: 700; color: var(--accent) !important; }
.nx-filters__b2b {
  display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--grad-brand);
  color: #e0e7ff !important; font-size: 12.5px; text-decoration: none !important;
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}
.nx-filters__b2b strong { color: #fff; font-size: 14px; }
.nx-filters__b2b:active { transform: scale(0.98); }

@media (hover: hover) and (pointer: fine) {
  .nx-chip:not(.is-active):hover { border-color: var(--line-hover); color: var(--ink) !important; }
  .nx-swatch:not(.is-active):hover { background: rgba(148, 163, 184, 0.08); }
  .nx-filters__b2b:hover { box-shadow: var(--shadow-glow); }
}

@media (max-width: 921px) {
  .nx-shop { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .nx-filters { position: static; }
  .nx-filters__toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
    border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-soft);
    color: var(--ink); font: 700 14px/1 var(--font); cursor: pointer;
  }
  .nx-filters__panel { display: none; margin-top: 10px; }
  .nx-filters.is-open .nx-filters__panel { display: grid; animation: nx-drop 220ms var(--ease-out); }
}
@keyframes nx-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Tarjetas del catálogo: elevación suave al pasar el cursor. */
body.nx ul.products li.product { transition: transform 260ms var(--ease-out), border-color 200ms ease, box-shadow 260ms var(--ease-out); }
body.nx ul.products li.product .astra-shop-thumbnail-wrap { background: radial-gradient(80% 70% at 50% 40%, #f8fafc, #e2e8f0); }
body.nx ul.products li.product .astra-shop-thumbnail-wrap img { object-fit: contain; mix-blend-mode: multiply; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  body.nx ul.products li.product:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); }
  body.nx ul.products li.product:hover .astra-shop-thumbnail-wrap img { transform: scale(1.05); }
}

/* Botones AJAX del catálogo: WooCommerce añade .loading y .added. */
body.nx .button.loading { position: relative; color: transparent !important; pointer-events: none; }
body.nx .button.loading::after {
  content: "" !important; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; top: 0 !important; right: 0 !important;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: nx-spin 600ms linear infinite; font-family: inherit !important;
}
body.nx .added_to_cart { display: inline-block; margin: 8px 16px 0; font-size: 13px; font-weight: 700; color: var(--accent) !important; }

/* --- Ficha ----------------------------------------------------------------- */

/* Zoom de WooCommerce: el cursor indica que la foto se puede ampliar. */
body.nx .woocommerce-product-gallery__image { background: radial-gradient(80% 70% at 50% 40%, #f8fafc, #e2e8f0); cursor: zoom-in; }
body.nx .woocommerce-product-gallery__image img { mix-blend-mode: multiply; }
body.nx .woocommerce-product-gallery__trigger {
  top: 14px !important; right: 14px !important; width: 40px !important; height: 40px !important; border-radius: 12px !important;
  background: var(--glass-bg-strong) !important; border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
body.nx .pswp__bg { background: var(--canvas); }

.nx-cart-msg { flex-basis: 100%; margin: 4px 0 0; padding: 10px 14px; border-radius: 10px; background: rgba(127, 18, 50, 0.35); border: 1px solid var(--danger); color: var(--danger-text); font-size: 13px; }

.nx-spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.nx-spec-grid > div { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.nx-spec-grid h3 { margin: 0 0 6px; font-size: 15px; }
.nx-spec-grid p { margin: 0; font-size: 14px; }
@media (max-width: 760px) { .nx-spec-grid { grid-template-columns: minmax(0, 1fr); } }

body.nx .woocommerce-tabs ul.tabs li.active a { background: var(--grad-brand); }
body.nx .woocommerce-tabs ul.tabs li a { transition: color 200ms ease, background-color 200ms ease; }

/* --- Carrito lateral: vidrio, aparición de los productos ----------------- */

body.nx .astra-cart-drawer { background: var(--glass-bg-strong) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-left: 1px solid var(--glass-border); }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item { padding-block: 14px !important; }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item img { border-radius: 12px; background: #f1f5f9; }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item a:not(.remove) { color: var(--ink) !important; font-weight: 700; }
body.nx .astra-cart-drawer .remove { color: var(--muted) !important; border: 1px solid var(--line-strong); border-radius: 50%; transition: color 200ms ease, border-color 200ms ease; }
body.nx .astra-cart-drawer .woocommerce-mini-cart__buttons { display: grid; gap: 8px; }
body.nx .astra-cart-drawer .woocommerce-mini-cart__buttons .button { width: 100%; margin: 0 !important; }
body.nx .astra-cart-drawer.active .woocommerce-mini-cart-item { animation: nx-rise-in 300ms var(--ease-out) both; }
body.nx .astra-cart-drawer.active .woocommerce-mini-cart-item:nth-child(2) { animation-delay: 40ms; }
body.nx .astra-cart-drawer.active .woocommerce-mini-cart-item:nth-child(3) { animation-delay: 80ms; }
body.nx .astra-cart-drawer .woocommerce-mini-cart__empty-message { color: var(--muted); text-align: center; padding: 40px 0; }
@keyframes nx-rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) { body.nx .astra-cart-drawer .remove:hover { color: var(--danger-text) !important; border-color: var(--danger); background: transparent !important; } }

/* Checkout: el bloqueo de WooCommerce mientras procesa, en oscuro y con spinner. */
body.nx .blockUI.blockOverlay { background: rgba(2, 6, 23, 0.6) !important; opacity: 1 !important; }
body.nx .blockUI.blockOverlay::before { border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }
body.nx #payment ul.payment_methods li { padding: 14px 12px; border-radius: 12px; transition: background-color 200ms ease; }
body.nx #payment ul.payment_methods li:has(input:checked) { background: rgba(99, 102, 241, 0.1); }

/* --- WPForms: formularios corporativos en vidrio oscuro ------------------ */

body.nx .wpforms-container { margin: 0 !important; }
body.nx .wpforms-container .wpforms-field { padding: 0 0 16px !important; }
body.nx .wpforms-container .wpforms-field-label {
  margin-bottom: 6px !important; color: var(--ink-soft) !important; font-size: 12.5px !important; font-weight: 600 !important;
}
body.nx .wpforms-container .wpforms-required-label { color: var(--indigo-300) !important; }
body.nx .wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.nx .wpforms-container select,
body.nx .wpforms-container textarea {
  width: 100% !important; max-width: 100% !important; min-height: 48px;
  padding: 12px 14px !important; border-radius: 12px !important;
  background: rgba(2, 6, 23, 0.55) !important; color: var(--ink) !important;
  border: 1px solid var(--line-strong) !important; box-shadow: none !important;
  font: 400 16px/1.4 var(--font) !important;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
body.nx .wpforms-container textarea { min-height: 110px; resize: vertical; }
body.nx .wpforms-container input:focus, body.nx .wpforms-container select:focus, body.nx .wpforms-container textarea:focus {
  border-color: var(--indigo-300) !important; box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.22) !important; background: rgba(2, 6, 23, 0.8) !important;
}
body.nx .wpforms-container select option { background: var(--surface-soft); color: var(--ink); }
/* Nombre + correo en dos columnas en escritorio. */
@media (min-width: 640px) {
  body.nx .nx-wpf .wpforms-field-container { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  body.nx .nx-wpf .wpforms-field-select, body.nx .nx-wpf .wpforms-field-textarea { grid-column: 1 / -1; }
}
body.nx .wpforms-container .wpforms-submit-container { padding-top: 4px !important; }
body.nx .wpforms-container button[type="submit"].wpforms-submit {
  width: 100%; min-height: 52px; padding: 14px 22px !important; border: 0 !important; border-radius: 12px !important;
  background: var(--grad-brand) !important; color: #fff !important; font: 700 15px/1 var(--font) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important; cursor: pointer;
  transition: filter 200ms ease, box-shadow 200ms ease, transform 160ms var(--ease-out);
}
body.nx .wpforms-container button[type="submit"].wpforms-submit:active { transform: scale(0.97); }
/* Mientras envía: WPForms deshabilita el botón y muestra su texto "Enviando…". */
body.nx .wpforms-container button[type="submit"].wpforms-submit:disabled { opacity: 0.75; cursor: progress; }
body.nx .wpforms-container .wpforms-submit-spinner { filter: brightness(3); }
@media (hover: hover) and (pointer: fine) {
  body.nx .wpforms-container button[type="submit"].wpforms-submit:hover { filter: brightness(1.1); box-shadow: var(--shadow-glow) !important; }
}
body.nx .wpforms-container label.wpforms-error, body.nx .wpforms-container em.wpforms-error { color: var(--danger-text) !important; font-size: 12.5px !important; margin-top: 6px; }
body.nx .wpforms-container .wpforms-error:is(input, select, textarea) { border-color: var(--danger) !important; }
body.nx .wpforms-confirmation-container-full {
  padding: 20px !important; border-radius: 14px !important; color: #d1fae5 !important;
  background: rgba(16, 185, 129, 0.12) !important; border: 1px solid rgba(16, 185, 129, 0.45) !important;
  animation: nx-rise-in 300ms var(--ease-out) both;
}
body.nx .wpforms-confirmation-container-full p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  body.nx ul.products li.product:hover, .nx-chip:active { transform: none; }
  body.nx .astra-cart-drawer.active .woocommerce-mini-cart-item { animation: none; }
}
body.nx .wpforms-container button[type="submit"].wpforms-submit { text-transform: none !important; letter-spacing: 0.01em !important; }
body.nx .ast-footer-copyright { text-align: center; }
/* La etiqueta de oferta flota sobre la foto (en la cuadrícula de la ficha no debe ocupar celda). */
body.nx.single-product div.product { position: relative; }
body.nx.single-product div.product > .onsale { position: absolute !important; z-index: 9; top: 16px !important; left: 16px !important; margin: 0 !important; }
body.nx .single_add_to_cart_button, body.nx .button, body.nx .elementor-button { text-transform: none !important; letter-spacing: 0.01em !important; }
/* En la ficha el precio tachado ya comunica la oferta: la etiqueta suelta sobra. */
body.nx.single-product div.product > .onsale { display: none !important; }

/* ==========================================================================
   v3 — Auditoría TASTE, modo claro/oscuro y componentes de compra
   ========================================================================== */

/* --- TASTE: color plano de marca. Un solo acento, sin degradados en botones,
       chips ni títulos, y sin resplandores de color en las sombras. ---------- */
:root {
  --grad-brand: #0477bf;
  --shadow-glow: 0 6px 16px -8px rgba(4, 119, 191, 0.55);
  --field-bg: rgba(2, 6, 23, 0.55);
  --overlay: rgba(2, 6, 23, 0.6);
  --ok-ink: #a7f3d0;
  --wa-ink: #a7f3c4;
}
.nx-grad-text { background: none; -webkit-text-fill-color: currentColor; color: var(--accent); }
body.nx .button:hover, body.nx .single_add_to_cart_button:hover, body.nx #place_order:hover,
.nx-btn--primary:hover, body.nx .wpforms-container button[type="submit"].wpforms-submit:hover { filter: none !important; }
@media (hover: hover) and (pointer: fine) {
  body.nx .button:not(.nx-btn--ghost):hover, body.nx .single_add_to_cart_button:hover, body.nx #place_order:hover,
  .nx-btn--primary:hover, body.nx .wpforms-container button[type="submit"].wpforms-submit:hover { background: var(--brand-700) !important; }
}
body.nx .nx-topbar { background: var(--brand-900); }

/* --- Modo claro: mismos componentes, otra paleta de tokens -------------- */
html[data-theme="light"] {
  /* Tokens del tema claro del Cotizador de Bordados (misma marca, mismos valores). */
  --brand-200: #c7dcf2; --brand-100: #dbeafe; --brand-50: #eff6ff; --brand-tint: #e8f2fd;
  --accent: #0468bf; --indigo-300: #0468bf;
  --ink: #17365f; --ink-soft: #31527f; --muted: #58718d; --placeholder: #6b7f96;
  --line: #dce7f4; --line-strong: #bfd0e4; --line-hover: #93aecd;
  --canvas: #f2f6fc; --surface: #ffffff; --surface-soft: #f8fbff; --surface-muted: #edf4fb; --surface-hover: #f6f9fd;
  --glass-bg: rgba(255, 255, 255, 0.72); --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(23, 54, 95, 0.08); --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --header-glass: rgba(255, 255, 255, 0.78); --surface-glass: rgba(255, 255, 255, 0.94);
  --shadow-card: 0 1px 2px rgba(20, 58, 99, 0.05), 0 8px 24px rgba(20, 58, 99, 0.05);
  --shadow-float: 0 4px 12px rgba(3, 25, 70, 0.1), 0 20px 48px rgba(3, 25, 70, 0.18);
  --shadow-glow: 0 6px 16px -8px rgba(4, 104, 191, 0.4);
  --ring: #0477bf; --ring-soft: rgba(4, 119, 191, 0.18);
  --danger: #be123c; --danger-text: #be123c; --field-bg: #ffffff; --overlay: rgba(242, 246, 252, 0.7);
  --ok-ink: #047857; --wa-ink: #047857;
  color-scheme: light;
}
html[data-theme="light"] body.nx .woocommerce-error { background: #fff1f2 !important; }
html[data-theme="light"] body.nx .nx-cart-msg { background: #fff1f2; }
html[data-theme="light"] .nxh-hero__outline { -webkit-text-stroke-color: rgba(4, 57, 166, 0.16); }
html[data-theme="light"] .nxh-band__outline { -webkit-text-stroke-color: rgba(4, 57, 166, 0.1); }
html[data-theme="light"] .nxh-hero__model, html[data-theme="light"] .nxh-cat img { filter: drop-shadow(0 24px 30px rgba(15, 23, 42, 0.22)); }
html[data-theme="light"] .nxh-cat--hombre img { filter: none; }
html[data-theme="light"] .nxh-wa { background: #ecfdf5; border-color: #a7f3d0; }

/* Superficies que siempre son oscuras (tarjetas de color, franja, banners de marca):
   redeclaran sus tokens para que el texto se lea igual en ambos modos. */
.nxh-promo, .nxh-cat--empresa, .nx-topbar, .nx-wholesale, .nx-filters__b2b {
  --ink: #f1f5f9; --ink-soft: #cbd5e1; --muted: #94a3b8; --accent: #7cc4f5; --indigo-300: #a5b4fc;
}

/* Cambio de modo: todo cambia a la vez (sin transiciones durante un frame), como en el Cotizador. */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }

/* Botón de modo en el menú. */
.nx-mode-item { display: flex; align-items: center; }
.nx-mode {
  display: inline-grid; grid-auto-flow: column; align-items: center; gap: 8px;
  width: 40px; height: 40px; padding: 0; justify-content: center; margin-left: 8px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.nx-mode:active { transform: scale(0.94); }
.nx-mode .nx-ico { width: 18px; height: 18px; }
.nx-mode__moon, html[data-theme="light"] .nx-mode__sun { display: none; }
html[data-theme="light"] .nx-mode__moon { display: block; }
.nx-mode__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .nx-mode:hover { border-color: var(--line-hover); background: var(--surface-soft); } }
/* En el menú móvil se muestra con texto, a lo ancho. */
.ast-mobile-popup-drawer .nx-mode, .ast-header-break-point .main-header-bar-navigation .nx-mode {
  width: auto; height: 44px; padding: 0 14px; margin: 12px 20px; justify-content: start;
}
.ast-mobile-popup-drawer .nx-mode__text, .ast-header-break-point .main-header-bar-navigation .nx-mode__text { position: static; width: auto; height: auto; clip: auto; font: 600 14px/1 var(--font); }

/* --- Duplicados de marca: un solo logo por encabezado ------------------- */
body.nx .site-logo-img .custom-logo-link + .custom-logo-link,
body.nx .ast-site-identity .custom-logo-link + .custom-logo-link { display: none !important; }
html[data-theme="light"] body.nx .site-logo-img .custom-logo-link { box-shadow: inset 0 0 0 1px var(--line); }
.nx-logo-tile { box-shadow: inset 0 0 0 1px var(--line); }

/* --- Páginas de Elementor (Nosotros, Contacto…): sin fondos blancos sueltos
       ni textos grises sobre blanco; todo hereda la paleta del modo activo. -- */
body.nx .elementor .elementor-section, body.nx .elementor .e-con, body.nx .elementor .elementor-column > .elementor-widget-wrap { background-color: transparent !important; }
body.nx .elementor-widget-text-editor, body.nx .elementor-widget-text-editor p, body.nx .popularis-text-block, body.nx .popularis-text-block p { color: var(--ink-soft) !important; }
body.nx .elementor-heading-title, body.nx .popularis-extra-heading-title { color: var(--ink) !important; letter-spacing: -0.03em; }
body.nx .elementor-widget-heading h1.elementor-heading-title, body.nx h1.popularis-extra-heading-title { font-size: clamp(32px, 4.4vw, 52px) !important; font-weight: 800 !important; line-height: 1.05 !important; }
body.nx .elementor-widget-image img { border-radius: 20px; }

/* SureForms en todo el sitio (Nosotros, Contacto). */
body.nx .srfm-form-container, body.nx .srfm-form { background: transparent !important; box-shadow: none !important; border: 0 !important; }
body.nx .srfm-block-label, body.nx .srfm-form label { color: var(--ink-soft) !important; font-weight: 600 !important; font-size: 13px !important; }
body.nx .srfm-description, body.nx .srfm-help { color: var(--muted) !important; }
body.nx .srfm-input-common, body.nx .srfm-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), body.nx .srfm-form textarea, body.nx .srfm-form select {
  background: var(--field-bg) !important; color: var(--ink) !important;
  border: 1px solid var(--line-strong) !important; border-radius: 12px !important; box-shadow: none !important; min-height: 48px;
}
body.nx .srfm-submit-button, body.nx .srfm-form button[type="submit"] {
  min-height: 52px; border: 0 !important; border-radius: 12px !important; background: var(--brand-600) !important; color: #fff !important;
  font: 700 15px/1 var(--font) !important; text-transform: none !important; letter-spacing: 0.01em !important;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
body.nx .srfm-submit-button:active { transform: scale(0.97); }
body.nx .srfm-error-message { color: var(--danger-text) !important; }

/* Campos y capas que tenían color fijo. */
body.nx .wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.nx .wpforms-container select, body.nx .wpforms-container textarea { background: var(--field-bg) !important; }
body.nx .wpforms-container input:focus, body.nx .wpforms-container select:focus, body.nx .wpforms-container textarea:focus { background: var(--field-bg) !important; }
body.nx .wpforms-confirmation-container-full { color: var(--ok-ink) !important; }
body.nx .blockUI.blockOverlay { background: var(--overlay) !important; }
.nxh-wa { color: var(--wa-ink) !important; }
.nxh-dots span { box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(127, 127, 127, 0.25); }
.nxh-promo .nxh-dots span { box-shadow: 0 0 0 2px rgba(2, 6, 23, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }

/* --- Selectores de variación ------------------------------------------- */

/* Colores: círculos con el tono exacto y anillo al seleccionar. */
body.nx [swatches-attr="attribute_pa_color"] { gap: 10px; }
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option {
  width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important;
  padding: 3px !important; border-radius: 50% !important; border: 1px solid var(--line-strong) !important;
  background: transparent !important; box-shadow: none !important;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 160ms var(--ease-out);
}
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatch-inner { width: 100%; height: 100%; border-radius: 50% !important; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.3); }
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option.cfvsw-selected-swatch {
  border-color: transparent !important; background: transparent !important;
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--ink) !important;
}
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option:active { transform: scale(0.92); }
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option.cfvsw-swatches-disabled,
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option.cfvsw-swatches-out-of-stock { opacity: 0.35; text-decoration: none; position: relative; }
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-disabled::after,
body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-out-of-stock::after {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 1.5px; background: var(--ink); transform: rotate(45deg); border-radius: 1px;
}
@media (hover: hover) and (pointer: fine) {
  body.nx [swatches-attr="attribute_pa_color"] .cfvsw-swatches-option:not(.cfvsw-selected-swatch):hover { border-color: var(--line-hover) !important; }
}

/* Tallas: píldoras de igual ancho; sin stock = tachada y sin clic. */
body.nx [swatches-attr="attribute_pa_talla"] { gap: 8px; }
body.nx [swatches-attr="attribute_pa_talla"] .cfvsw-swatches-option {
  min-width: 52px !important; min-height: 44px !important; border-radius: 12px !important;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
body.nx [swatches-attr="attribute_pa_talla"] .cfvsw-swatches-option.cfvsw-selected-swatch {
  background: var(--ink) !important; color: var(--canvas) !important; border-color: var(--ink) !important; box-shadow: none !important;
}
body.nx [swatches-attr="attribute_pa_talla"] .cfvsw-swatches-option.cfvsw-swatches-out-of-stock,
body.nx [swatches-attr="attribute_pa_talla"] .cfvsw-swatches-option.cfvsw-swatches-disabled { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }

/* Enlace "Guía de tallas" y modal. */
.nx-size-link {
  display: inline-flex; align-items: center; gap: 6px; flex-basis: 100%; justify-content: flex-start;
  padding: 0; margin: -2px 0 6px; border: 0; background: none; color: var(--ink-soft);
  font: 600 13px/1.4 var(--font); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
  cursor: pointer; transition: color 200ms ease, text-decoration-color 200ms ease;
}
.nx-size-link .nx-ico { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .nx-size-link:hover { color: var(--ink); text-decoration-color: currentColor; } }

.nx-modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0;
  border: 1px solid var(--glass-border); border-radius: 20px;
  background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow-float);
}
.nx-modal[open] { animation: nx-modal-in 220ms var(--ease-out); }
.nx-modal.is-closing { animation: nx-modal-out 180ms ease-in forwards; }
.nx-modal::backdrop { background: rgba(2, 6, 23, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.nx-modal[open]::backdrop { animation: nx-fade-in 220ms ease; }
.nx-modal.is-closing::backdrop { animation: nx-fade-out 180ms ease forwards; }
.nx-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.nx-modal__head h2 { margin: 0; font-size: 20px; }
.nx-modal__close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 200ms ease; }
.nx-modal__close .nx-ico { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .nx-modal__close:hover { background: var(--surface-soft); } }
.nx-size-table { width: calc(100% - 40px); margin: 8px 20px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.nx-size-table th, .nx-size-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink-soft); }
.nx-size-table th { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nx-size-table td:first-child { color: var(--ink); font-weight: 700; }
.nx-modal__note { margin: 4px 20px 20px; font-size: 13px; color: var(--muted); }
@keyframes nx-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes nx-modal-out { to { opacity: 0; transform: translateY(4px) scale(0.98); } }
@keyframes nx-fade-in { from { opacity: 0; } }
@keyframes nx-fade-out { to { opacity: 0; } }
/* La guía antigua (desplegable) ya no se usa. */
.nx-size-guide { display: none !important; }

/* --- Carrito lateral: cantidad con − / + -------------------------------- */
.nx-mini-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.nx-mini-qty__price { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.nx-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; transition: opacity 200ms ease; }
.nx-stepper button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms ease, transform 120ms var(--ease-out); }
.nx-stepper button:active { transform: scale(0.88); }
.nx-stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.nx-stepper button .nx-ico { width: 14px; height: 14px; }
.nx-stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.nx-stepper.is-busy { opacity: 0.6; }
.nx-stepper.is-error { border-color: var(--danger); }
@media (hover: hover) and (pointer: fine) { .nx-stepper button:not(:disabled):hover { background: var(--surface-soft); } }
body.nx .woocommerce-mini-cart-item.is-removing { opacity: 0.4; transition: opacity 200ms ease; }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item .quantity { display: block; }
body.nx .astra-cart-drawer .woocommerce-mini-cart__buttons .checkout { min-height: 52px; font-size: 15px; }

/* --- Checkout: validación en vivo ---------------------------------------- */
body.nx .woocommerce-checkout .form-row.nx-invalid :is(input, select, textarea),
body.nx .woocommerce-checkout .form-row.woocommerce-invalid :is(input, select, textarea),
body.nx .woocommerce-checkout .form-row.nx-invalid .select2-selection { border-color: var(--danger) !important; }
body.nx .woocommerce-checkout .form-row.nx-valid :is(input, select, textarea) { border-color: rgba(16, 185, 129, 0.6) !important; }
.nx-field-msg { margin: 6px 0 0; font-size: 12.5px; color: var(--danger-text); animation: nx-fade-in 200ms ease; }
body.nx .woocommerce-checkout .form-row { margin-bottom: 14px; }
body.nx .woocommerce-checkout .col2-set h3, body.nx #order_review_heading { font-size: 15px; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .nx-modal[open], .nx-modal.is-closing, .nx-modal::backdrop { animation: none !important; }
}

/* --- Ajustes tras la revisión en vivo ------------------------------------ */
/* Etiqueta de oferta de Astra en la ficha: el precio tachado ya lo comunica. */
body.nx.single-product .ast-onsale-card { display: none !important; }
.nx-size-link { text-transform: none !important; letter-spacing: 0 !important; }
/* "Ver carrito" (botón secundario) legible en ambos modos. */
body.nx .woocommerce-mini-cart__buttons .button:not(.checkout) {
  background: transparent !important; color: var(--ink) !important; border: 1px solid var(--line-strong) !important; box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) { body.nx .woocommerce-mini-cart__buttons .button:not(.checkout):hover { background: var(--surface-soft) !important; } }
body.nx .astra-cart-drawer .woocommerce-mini-cart-item { padding-right: 36px !important; }
body.nx .nx-size-table th, body.nx .nx-size-table td { padding: 10px 12px !important; border-width: 0 0 1px !important; border-color: var(--line) !important; background: transparent !important; }
body.nx .nx-size-table { border: 0 !important; }
/* Título de la tienda. */
.nx-shop__head { margin: 0 0 24px; }
.nx-shop__head h1 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.035em; }
/* Checkout: Astra fija anchos en % (55/40) que se aplican dentro de la cuadrícula y la encogen. */
@media (min-width: 922px) {
  body.nx.woocommerce-checkout form.checkout { grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); gap: 40px; }
  body.nx.woocommerce-checkout form.checkout #customer_details,
  body.nx.woocommerce-checkout form.checkout #order_review,
  body.nx.woocommerce-checkout form.checkout #order_review_heading { width: 100% !important; float: none !important; margin: 0 !important; padding-left: 0; padding-right: 0; }
  body.nx.woocommerce-checkout #customer_details { padding: 28px !important; }
  body.nx.woocommerce-checkout #order_review { padding: 20px !important; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
}
body.nx.woocommerce-checkout #order_review table.shop_table { border: 0 !important; background: transparent !important; }
body.nx.woocommerce-checkout #order_review .order-total .amount { font-size: 20px; font-weight: 800; color: var(--ink); }
body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row { width: auto !important; float: none !important; grid-column: 1 / -1; }
body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first { grid-column: 1; }
body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last { grid-column: 2; }
@media (max-width: 560px) { body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first, body.nx.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last { grid-column: 1 / -1; } }
@media (min-width: 922px) {
  body.nx.woocommerce-checkout form.checkout { grid-template-rows: auto 1fr; }
  body.nx.woocommerce-checkout form.checkout #customer_details { grid-row: 1 / span 2 !important; }
  body.nx.woocommerce-checkout form.checkout #order_review_heading { grid-row: 1 !important; align-self: end; margin-bottom: 12px !important; }
  body.nx.woocommerce-checkout form.checkout #order_review { grid-row: 2 !important; align-self: start; }
}
