/* ==========================================================================
   461152 — CSS net-new GLOBAL (no encaja en pages.css ni servicio.css)
   ==========================================================================
   Origen: Hook 461152 (UCN Core Styles — pages + servicio) — wp_head priority 2000
   Fecha: 2026-04-29

   El hook agrupaba bajo el nombre "pages + servicio" varios bloques que en
   realidad son fixes GLOBALES (header, WooCommerce, side cart, dark-mode).
   Este archivo agrupa todo el CSS net-new que NO pertenece a pages.css ni
   a servicio.css.

   Recomendacion de migracion: ver 461152-report.md, seccion "Plan de enqueue".
   Probable destino: NUEVO archivo `assets/css/dark-mode-defense.css` enqueued
   global (ya hay precedente con woocommerce.css, header.css, footer-astra.css).
   Algunos sub-bloques (search-pill dedupe, top-bar legacy) pueden moverse
   a header.css en lugar de un archivo nuevo.
   ========================================================================== */


/* ==========================================================================
   1. UCN SEARCH PILL DEDUPE — 2026-04-17
   ==========================================================================
   El Customizer (wp-custom-css, hook 461154) tiene reglas legacy que
   tratan .ucn-search-pill como una pildora visible. El DOM actual envuelve
   .ucn-search-pill__field dentro de .ucn-search-pill, asi que las reglas
   del Customizer renderizan una pildora fantasma exterior. Aqui se neutralizan.

   DESTINO RECOMENDADO: header.css (donde vive el componente search-pill)
   o eliminar las reglas conflictivas en 461154 (raiz del problema).
   ========================================================================== */
.ucn-search-pill:has(.ucn-search-pill__field) {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.ucn-search-pill:has(.ucn-search-pill__field):focus-within {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
/* Hijos directos legacy (icon / input / mic / clear) que ya no se usan */
.ucn-search-pill > svg.ucn-sp-icon,
.ucn-search-pill > .ucn-sp-icon,
.ucn-search-pill > input[type="search"]:not(.ucn-search-pill__input),
.ucn-search-pill > .ucn-sp-mic,
.ucn-search-pill > .ucn-sp-clear {
    display: none !important;
}


/* ==========================================================================
   2. LEGACY TOP-BAR HIDE  -- REVISAR INTENCIONALIDAD
   ==========================================================================
   El hook oculta cuatro selectores con display:none. De los cuatro:
     - .ucn-top-bar     -> NO existe en el child theme (selector muerto)
     - .ucn-envio-bar   -> NO existe en el child theme (selector muerto)
     - body > .ucn-top-notice -> NO existe en el child theme (selector muerto)
     - .ucn-topbar      -> SI EXISTE en header.css como barra superior activa
                           (envio 24/48h, --ucn-topbar-h: 32px). OCULTARLA
                           contradice a header.css.

   Si la intencion es "matar la topbar definitivamente" -> eliminar la
   topbar de header.php / header.css y NO arrastrar este patch.
   Si la intencion era solo eliminar legacys obsoletos -> quitar `.ucn-topbar`
   de la lista (mantener solo los tres muertos para barrer DOM huerfano).

   DESTINO RECOMENDADO: header.css con la version corregida.
   ========================================================================== */
.ucn-top-bar,
.ucn-envio-bar,
body > .ucn-top-notice {
    display: none !important;
}
/* REVISAR: .ucn-topbar fue eliminado de la lista por colision con header.css.
   Reactivar SOLO si producto confirma que la topbar debe desaparecer. */


/* ==========================================================================
   3. HIDE MOBILE-ONLY SEARCH TRIGGER ON DESKTOP
   ==========================================================================
   DESTINO RECOMENDADO: header.css (componente .ucn-search__mobile-trigger
   ya pertenece al header).
   ========================================================================== */
@media (min-width: 1100px) {
    #ucn-header .ucn-search__mobile-trigger,
    .ucn-search__mobile-trigger {
        display: none !important;
    }
}


/* ==========================================================================
   4. FORCE LIGHT COLOR SCHEME GLOBALLY
   ==========================================================================
   Algunos navegadores (Chrome Auto Dark Mode, Edge Dark Mode, Dark Reader)
   auto-invierten paginas que no declaran color-scheme. Esto rompe modales
   con fondos blancos / transparentes. El sitio es light-only.

   DESTINO RECOMENDADO: nuevo archivo `dark-mode-defense.css` enqueued global,
   o anadir al inicio de pages.css (consistente con que pages.css ya carga
   en todas las paginas migradas) — preferimos archivo dedicado por claridad.
   ========================================================================== */
:root,
html,
body {
    color-scheme: light !important;
    forced-color-adjust: none;
}
/* Modales / overlays / drawers que deben permanecer blancos */
.xoo-wsc-container,
.xoo-wsc-modal,
.xoo-el-modal,
.xoo-el-modal-ele,
.ucn-search-overlay,
.ucn-search-results,
.ups-dropdown,
.astra-pro-modal,
.astra-popup,
dialog {
    color-scheme: light !important;
    background-color: #ffffff;
}
/* Search backdrop debe seguir transparente (catcher fullscreen) */
.ups-backdrop,
.ups-backdrop.is-open {
    background: transparent !important;
    background-color: transparent !important;
}

/* Astra side cart drawer: panel blanco solido + backdrop solido */
.xoo-wsc-container.xoo-wsc-active .xoo-wsc-modal {
    background: #ffffff !important;
}
.xoo-wsc-container.xoo-wsc-active::before {
    background: rgba(0, 0, 0, 0.55) !important;
}


/* ==========================================================================
   5. DARK MODE DEFENSE — UNIFICADO (V1 + V2 fusionados)
   ==========================================================================
   En el hook conviven UCN-DARK-MODE-DEFENSE-V1 (l. 1015-1082) y V2
   (l. 1196-1267). V2 amplia V1 con mas contenedores generales y override
   de Dark Reader. V1 + V2 atacan los mismos selectores de WooCommerce
   (ul.products li.product, .astra-shop-thumbnail-wrap, etc.) -> hay
   solapamiento. Aqui se fusionan en un unico bloque sin duplicaciones.

   DESTINO RECOMENDADO: archivo nuevo `dark-mode-defense.css` o anexo
   al final de woocommerce.css (afecta principalmente a productos).
   ========================================================================== */

/* Surfaces de producto */
ul.products li.product,
ul.products li.product.ast-separate-posts,
ul.products .product,
.products .product,
.related.products .product,
.up-sells .product,
.cross-sells .product,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.uc-product-card,
.uc-card,
article.product,
.product-card,
li.product .woocommerce-loop-product__link,
.products .product .woocommerce-LoopProduct-link {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}
ul.products li.product *,
.products .product * { color: inherit; }

/* Titulos y precios de producto */
ul.products li.product .woocommerce-loop-product__title,
.products .product h2,
.products .product h3,
.uc-product-title,
.uc-product-card h2,
.uc-product-card h3,
.uc-product-card .uc-title,
li.product .price,
li.product .price .amount,
li.product .price bdi {
    color: #0f172a !important;
}
li.product .price del,
li.product .price del .amount { color: #64748b !important; }
li.product .price ins,
li.product .price ins .amount { color: #C8102E !important; }

/* Stock / badges con sus colores semanticos */
.uc-stock--ok,
.uc-badge--en-stock,
.woocommerce-loop-product__link .in-stock { color: #0a7d3a !important; }

/* Home v3 surfaces */
.uc-h3,
.uc-h3 section,
.uc-h3 article,
.uc-h3 .uc-h3__card,
.uc-h3 .uc-h3-card {
    color-scheme: light !important;
}
.uc-h3 { background: #fafaf7 !important; }

/* Mi cuenta / cart surfaces */
.woocommerce-account .woocommerce,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-cart .cart_totals,
.woocommerce-checkout form.checkout {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Product card inner <a> + thumbnail wrap (Chrome Auto Dark inv.) */
a.woocommerce-LoopProduct-link,
a.woocommerce-loop-product__link,
ul.products li.product > a.woocommerce-LoopProduct-link,
ul.products li.product > a.woocommerce-loop-product__link,
.products .product a.woocommerce-LoopProduct-link,
.products .product a.woocommerce-loop-product__link,
.related.products a.woocommerce-LoopProduct-link,
.up-sells a.woocommerce-LoopProduct-link,
.cross-sells a.woocommerce-LoopProduct-link,
li.product .astra-shop-thumbnail-wrap,
li.product .astra-shop-thumbnail-wrap a,
ul.products li.product .astra-shop-thumbnail-wrap,
ul.products li.product a.woocommerce-LoopProduct-link,
ul.products li.product a.woocommerce-loop-product__link {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}
li.product .astra-shop-thumbnail-wrap,
body.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap,
body.post-type-archive-product ul.products li.product .astra-shop-thumbnail-wrap {
    background: #fafafa !important;
    background-color: #fafafa !important;
}
li.product .astra-shop-thumbnail-wrap img,
li.product a.woocommerce-LoopProduct-link img,
li.product a.woocommerce-loop-product__link img {
    background: transparent !important;
    background-color: transparent !important;
}
@media (prefers-color-scheme: dark) {
    a.woocommerce-LoopProduct-link,
    a.woocommerce-loop-product__link,
    li.product .astra-shop-thumbnail-wrap,
    li.product .astra-shop-thumbnail-wrap a {
        background-color: #ffffff !important;
    }
    li.product .astra-shop-thumbnail-wrap {
        background-color: #fafafa !important;
    }
}

/* Contenedores globales (V2): asegurar light en todo el chasis */
:root { color-scheme: light !important; }
html, body {
    color-scheme: light !important;
    background: #ffffff !important;
    forced-color-adjust: none !important;
}
#ucn-header, #ucn-main, #ucn-footer,
.site, .site-content, #content, #page, #main,
ul.products,
.woocommerce, .woocommerce-page,
.single-product, .woocommerce-cart, .woocommerce-checkout,
.wc-block-components-notice, .woocommerce-info, .woocommerce-message {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
    background-color: initial;
}

/* Imagenes nunca invertidas */
img, picture, video, svg, canvas, iframe,
.wp-post-image, .attachment-woocommerce_thumbnail, .attachment-woocommerce_single,
.astra-shop-thumbnail-wrap img, .woocommerce-product-gallery__image img,
.product-gallery img {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

/* Sidecart drawer */
#xoo-wsc-container, #xoo-wsc-container *,
.xoo-wsc-modal, .xoo-wsc-modal *,
.xoo-wsc-container, .xoo-wsc-container *,
.xoo-wsc-bki, .xoo-wsc-bki *,
.xoo-wsc-body, .xoo-wsc-footer, .xoo-wsc-header {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}
#xoo-wsc-container, .xoo-wsc-bki, .xoo-wsc-modal { background: #ffffff !important; }

/* Predictive search */
.ups-wrap, .ups-wrap *, .ups-suggestions, .ups-suggestions *,
.ups-overlay, .ups-backdrop, .ucn-search-overlay, .ucn-search-overlay * {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}

/* Checkout */
body.woocommerce-checkout, body.woocommerce-checkout *,
form.checkout, form.checkout *,
#order_review, #order_review * {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}

/* Override Dark Reader */
html[data-darkreader-mode] { color-scheme: light only !important; }


/* ==========================================================================
   6. UCN-PLACEHOLDER-FIX
   ==========================================================================
   Reemplaza el placeholder PNG de WooCommerce por un SVG inline que
   Chrome Auto Dark Mode no puede invertir (color-scheme:light + fill explicitos).

   DESTINO RECOMENDADO: woocommerce.css (afecta exclusivamente a productos).
   ========================================================================== */
ul.products li.product img.woocommerce-placeholder,
.products .product img.woocommerce-placeholder,
li.product img[src*="woocommerce-placeholder"] {
    opacity: 0 !important;
    visibility: hidden !important;
}
ul.products li.product .astra-shop-thumbnail-wrap:has(> a > img.woocommerce-placeholder),
ul.products li.product .astra-shop-thumbnail-wrap:has(img[src*="woocommerce-placeholder"]),
.products .product .astra-shop-thumbnail-wrap:has(img[src*="woocommerce-placeholder"]) {
    position: relative !important;
    background-color: #fafafa !important;
}
ul.products li.product .astra-shop-thumbnail-wrap:has(img[src*="woocommerce-placeholder"])::before,
.products .product .astra-shop-thumbnail-wrap:has(img[src*="woocommerce-placeholder"])::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background-color: #fafafa !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' width='120' height='120'><rect width='120' height='120' fill='%23fafafa' rx='8'/><g fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M30 42l30-15 30 15v36l-30 15-30-15z'/><path d='M30 42l30 15 30-15'/><path d='M60 57v36'/><path d='M45 34.5l30 15'/></g><text x='60' y='108' text-anchor='middle' fill='%2394a3b8' font-family='system-ui,sans-serif' font-size='8' font-weight='500'>Sin imagen</text></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 55% auto !important;
    color-scheme: light only !important;
    forced-color-adjust: none !important;
    pointer-events: none !important;
    z-index: 1 !important;
    border-radius: inherit !important;
}
/* Fallback para navegadores sin :has() */
ul.products li.product:has(img.woocommerce-placeholder) .astra-shop-thumbnail-wrap {
    background-color: #fafafa !important;
    position: relative !important;
}
/* Single product: imagen principal */
body.single-product .woocommerce-product-gallery__image img.wp-post-image.woocommerce-placeholder,
body.single-product img[src*="woocommerce-placeholder"] {
    opacity: 0 !important;
}
body.single-product .woocommerce-product-gallery__image:has(img[src*="woocommerce-placeholder"])::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background-color: #fafafa !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' width='120' height='120'><rect width='120' height='120' fill='%23fafafa' rx='8'/><g fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M30 42l30-15 30 15v36l-30 15-30-15z'/><path d='M30 42l30 15 30-15'/><path d='M60 57v36'/><path d='M45 34.5l30 15'/></g><text x='60' y='108' text-anchor='middle' fill='%2394a3b8' font-family='system-ui,sans-serif' font-size='8' font-weight='500'>Sin imagen</text></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 40% auto !important;
    color-scheme: light only !important;
    forced-color-adjust: none !important;
    z-index: 1 !important;
}

/* === ucn-topbar hide (preserva comportamiento del hook original) ===
   La topbar (.ucn-topbar) está definida y mostrada por header.css + hook ucn-header-polish.
   Este hook (461152) la ocultaba globalmente en producción.
   Mantenemos la regla aquí para preservar la UX actual.
*/
.ucn-topbar,
.ucn-envio-bar,
body > .ucn-top-notice {
    display: none !important;
}

/* === BEGIN APPEND-FROM-461024 === */

/* ------------------------------------------------------------
 * APPENDED 2026-04-29 (agent E3) — desde hook 461024
 * Bloque: ucn-force-light (1936 bytes)
 * ------------------------------------------------------------ */

/* UCN-FORCE-LIGHT-V1 */
/* Opt out of browser auto-dark / force-dark inversion */
:root, html, body {
  color-scheme: light only !important;
  forced-color-adjust: none !important;
}
/* Safety: neutralize any stray prefers-color-scheme:dark rules by re-asserting light on key surfaces */
@media (prefers-color-scheme: dark) {
  html, body, .site, #content, .site-content,
  #primary, #secondary, #main,
  .woocommerce, .woocommerce-page,
  ul.products, ul.products li.product,
  .woocommerce-cart-form, .woocommerce-checkout,
  .woocommerce-mini-cart, .mini_cart_content,
  .xoo-el-modal, .xoo-el-form,
  .ucn-footer, .ucn-topbar, #ucn-header,
  .ast-woocommerce-container, .ast-container {
    background: #ffffff !important;
    color: #0f172a !important;
  }
  /* Keep explicit dark surfaces dark */
  .ucn-footer, .ucn-topbar, #ucn-header .ucn-topbar {
    background: #0f172a !important;
    color: #ffffff !important;
  }
  /* Product cards light */
  ul.products li.product {
    background: #ffffff !important;
    border-color: #ececec !important;
  }
  ul.products li.product img { filter: none !important; }
  ul.products h2.woocommerce-loop-product__title,
  ul.products .woocommerce-loop-product__title {
    color: #0f172a !important;
  }
  ul.products .price,
  ul.products .price .woocommerce-Price-amount,
  ul.products .price bdi {
    color: #0f172a !important;
  }
  /* Cart drawer and modal panels */
  .woocommerce-mini-cart,
  .mini_cart_content,
  [class*="cart-drawer"], [class*="cart-panel"],
  .woocommerce-mini-cart-item,
  .xoo-wsc-container, .xoo-wsc-basket, .xoo-wsc-modal,
  .woocommerce-cart-form__contents, .cart_totals {
    background: #ffffff !important;
    color: #0f172a !important;
  }
  /* Inputs */
  input, select, textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #e5e7eb !important;
  }
  /* Links keep red accent */
  /* fase-fix-1 + fix-narrow-scope 2026-04-29: solo links inline en texto editorial */
   #content .entry-content p a:not(.button):not(.wp-block-button__link),
   #content .entry-content li a:not(.button):not(.wp-block-button__link),
   .ucn-content p a:not(.button):not(.wp-block-button__link),
   .ucn-content li a:not(.button):not(.wp-block-button__link) { color: #C8102E; }
}

/* === END APPEND-FROM-461024 === */
