/*
 * IESYS SELECT — Aurora V2.6 Theme Parity
 * Light/Dark parity for /ofertas and all category pages.
 * Loaded AFTER /assets/css/select.css.
 */

/* ===============================================================
   THEME TOKENS
   =============================================================== */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg2: #eef3f8;
  --paper: #0d1728;
  --text: #0d1728;
  --muted: #5d697a;
  --line: rgba(19, 37, 61, .13);
  --blue: #1677ff;
  --gold: #b88722;
  --violet: #7357db;
  --select-surface: rgba(255,255,255,.91);
  --select-surface-strong: #ffffff;
  --select-topbar: rgba(247,249,252,.88);
  --select-shadow: 0 24px 70px rgba(27, 48, 80, .09);
  --select-electric-core: #1677ff;
  --select-electric-hot: #55c2ff;
  --select-electric-glow: rgba(22,119,255,.24);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080c;
  --bg2: #0d1018;
  --paper: #f5f1e8;
  --text: #f4f3ef;
  --muted: #adb7c7;
  --line: rgba(224,232,255,.14);
  --blue: #82b5ff;
  --gold: #d8b867;
  --violet: #9677ff;
  --select-surface: rgba(255,255,255,.025);
  --select-surface-strong: rgba(255,255,255,.05);
  --select-topbar: rgba(7,8,12,.76);
  --select-shadow: 0 28px 80px rgba(0,0,0,.28);
  --select-electric-core: #3797ff;
  --select-electric-hot: #83dcff;
  --select-electric-glow: rgba(55,151,255,.36);
}

/* ===============================================================
   PAGE / BACKDROP
   =============================================================== */

html[data-theme] body {
  color: var(--text) !important;
  transition: background-color 220ms ease, color 220ms ease;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 86% 3%, rgba(22,119,255,.08), transparent 32rem),
    radial-gradient(circle at 10% 88%, rgba(115,87,219,.045), transparent 27rem),
    var(--bg) !important;
}

html[data-theme="light"] body::before {
  opacity: .55 !important;
  background-image:
    linear-gradient(rgba(22,61,110,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,61,110,.035) 1px, transparent 1px) !important;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 86% 3%, rgba(130,181,255,.14), transparent 32rem),
    radial-gradient(circle at 10% 88%, rgba(150,119,255,.1), transparent 27rem),
    var(--bg) !important;
}

/* ===============================================================
   TOPBAR / NAV
   =============================================================== */

html[data-theme] .topbar {
  border-bottom-color: var(--line) !important;
  background: var(--select-topbar) !important;
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

html[data-theme="light"] .topbar {
  box-shadow: 0 10px 34px rgba(29,51,84,.045);
}

html[data-theme="light"] .brand {
  color: #111b2b !important;
}

html[data-theme="light"] .brand-mark {
  color: #8b6515 !important;
  border-color: rgba(184,135,34,.40) !important;
  background:
    linear-gradient(145deg, rgba(184,135,34,.12), rgba(22,119,255,.055)) !important;
}

html[data-theme="light"] .brand-sub {
  color: #6c7889 !important;
}

html[data-theme="light"] .nav {
  color: #5a6678 !important;
}

html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .nav a[aria-current="page"] {
  color: #0d1728 !important;
}

html[data-theme="light"] .nav-action {
  color: #795914 !important;
  border-color: rgba(184,135,34,.26) !important;
  background: rgba(184,135,34,.075) !important;
}

html[data-theme="light"] .menu-button {
  color: #172236 !important;
  border-color: var(--line) !important;
  background: rgba(255,255,255,.78) !important;
}

html[data-theme="light"] .mobile-menu {
  border-top-color: var(--line) !important;
}

html[data-theme="light"] .mobile-menu a {
  color: #536075 !important;
}

/* Theme toggle shares the same persistence key used by the main site. */
.iesys-theme-toggle {
  appearance: none;
  position: relative;
  width: 46px;
  height: 29px;
  flex: 0 0 46px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--select-surface-strong);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(28,48,82,.06);
}

.iesys-theme-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 16px rgba(22,119,255,.22);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

html[data-theme="dark"] .iesys-theme-toggle::after {
  transform: translateX(17px);
}

.iesys-theme-icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  pointer-events: none;
  font-size: 11px;
}

html[data-theme="light"] .iesys-theme-icons span:first-child,
html[data-theme="dark"] .iesys-theme-icons span:last-child {
  color: #fff;
}

html[data-theme="light"] .iesys-theme-icons span:last-child,
html[data-theme="dark"] .iesys-theme-icons span:first-child {
  color: var(--muted);
}

.iesys-theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent);
  outline-offset: 3px;
}

/* ===============================================================
   TYPOGRAPHY
   =============================================================== */

html[data-theme="light"] .eyebrow {
  color: #4f5f74 !important;
}

html[data-theme="light"] .hero h1,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .category-hero h1,
html[data-theme="light"] .empty-state h2,
html[data-theme="light"] .principle h3,
html[data-theme="light"] .site-cta h2 {
  color: #0d1728 !important;
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .section-heading p,
html[data-theme="light"] .category-hero p,
html[data-theme="light"] .empty-state p,
html[data-theme="light"] .principle p,
html[data-theme="light"] .site-cta p {
  color: #5b6779 !important;
}

html[data-theme="light"] .hero h1 span {
  background:
    linear-gradient(100deg, #1677ff, #6554cc 64%, #b88722) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

/* ===============================================================
   BUTTONS
   =============================================================== */

html[data-theme="light"] .button.secondary {
  color: #263449 !important;
  border-color: rgba(21,43,70,.15) !important;
  background: rgba(255,255,255,.80) !important;
}

html[data-theme="light"] .button.secondary:hover {
  background: #ffffff !important;
  border-color: rgba(22,119,255,.24) !important;
}

html[data-theme="light"] .button.primary {
  color: #17130a !important;
  background: linear-gradient(135deg, #f1d98e, #c99a31) !important;
  box-shadow: 0 14px 35px rgba(184,135,34,.13) !important;
}

/* ===============================================================
   HOME SELECT PANEL
   =============================================================== */

html[data-theme="light"] .select-panel {
  color: #162137 !important;
  border-color: rgba(22,119,255,.17) !important;
  background:
    radial-gradient(circle at 78% 10%, rgba(22,119,255,.09), transparent 13rem),
    radial-gradient(circle at 12% 92%, rgba(184,135,34,.055), transparent 11rem),
    linear-gradient(145deg, #ffffff, #f2f6fb) !important;
  box-shadow: var(--select-shadow);
}

html[data-theme="light"] .panel-label {
  color: #667387 !important;
}

html[data-theme="light"] .panel-label b {
  color: #866315 !important;
}

html[data-theme="light"] .select-word {
  color: #111b2b !important;
  text-shadow: 0 18px 45px rgba(32,60,98,.07);
}

html[data-theme="light"] .panel-status div {
  border-top-color: rgba(24,49,78,.12) !important;
}

html[data-theme="light"] .panel-status span {
  color: #778397 !important;
}

html[data-theme="light"] .panel-status strong {
  color: #1a273a !important;
}

/* ===============================================================
   CATEGORY CARDS
   =============================================================== */

html[data-theme="light"] .category-grid {
  border-top-color: var(--line) !important;
  border-left-color: var(--line) !important;
  box-shadow: 0 18px 54px rgba(28,49,80,.045);
}

html[data-theme="light"] .category-card {
  color: #1c293c !important;
  border-right-color: var(--line) !important;
  border-bottom-color: var(--line) !important;
  background: rgba(255,255,255,.72);
}

html[data-theme="light"] .category-card:hover {
  color: #0b1626 !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(237,245,255,.96)) !important;
}

html[data-theme="light"] .category-card span {
  color: #8b6618 !important;
}

/* ===============================================================
   PRINCIPLES / DISCLOSURE
   =============================================================== */

html[data-theme="light"] .principle {
  border-color: var(--line) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,249,253,.94)) !important;
  box-shadow: 0 18px 54px rgba(28,49,80,.055);
}

html[data-theme="light"] .principle b {
  color: #866315 !important;
}

html[data-theme="light"] .disclosure {
  color: #586679 !important;
  border-left-color: #b88722 !important;
  background: rgba(184,135,34,.055) !important;
}

/* ===============================================================
   CATEGORY PAGES / EMPTY STATE
   =============================================================== */

html[data-theme="light"] .category-hero .breadcrumbs {
  color: #718095 !important;
}

html[data-theme="light"] .category-hero .breadcrumbs a:hover {
  color: #0d1728 !important;
}

html[data-theme="light"] .notice {
  color: #35516f !important;
  border-color: rgba(22,119,255,.18) !important;
  background: rgba(22,119,255,.05) !important;
}

html[data-theme="light"] .empty-state {
  border-color: var(--line) !important;
  background:
    radial-gradient(circle at 82% 12%, rgba(22,119,255,.06), transparent 17rem),
    linear-gradient(145deg, #ffffff, #f4f7fb) !important;
  box-shadow: var(--select-shadow);
}

html[data-theme="light"] .empty-index {
  color: #866315 !important;
}

html[data-theme="light"] .integrity-list li {
  color: #425167 !important;
}

html[data-theme="light"] .integrity-list li::before {
  color: #866315 !important;
  border-color: rgba(184,135,34,.36) !important;
}

/* ===============================================================
   MARKETFLOW CTA — intentional premium dark island in light mode
   =============================================================== */

html[data-theme="light"] .site-cta {
  color: #f7f9fc !important;
  border-color: rgba(123,156,203,.18) !important;
  background:
    radial-gradient(circle at 86% 20%, rgba(115,87,219,.17), transparent 17rem),
    radial-gradient(circle at 8% 90%, rgba(22,119,255,.11), transparent 18rem),
    linear-gradient(145deg, #111725, #080d15) !important;
  box-shadow: 0 28px 82px rgba(24,42,67,.15);
}

html[data-theme="light"] .site-cta .eyebrow {
  color: #b8c9dc !important;
}

html[data-theme="light"] .site-cta h2 {
  color: #f7f9fc !important;
}

html[data-theme="light"] .site-cta p {
  color: #b7c2d0 !important;
}

/* ===============================================================
   FOOTER
   =============================================================== */

html[data-theme="light"] .footer {
  color: #6c798c !important;
  border-top-color: var(--line) !important;
}

html[data-theme="light"] .footer a:hover {
  color: #0d1728 !important;
}

/* ===============================================================
   ELECTRIC SELECT SIGNATURE
   =============================================================== */

.iesys-select-electric {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.iesys-select-electric::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.10em;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      var(--select-electric-core) 8%,
      var(--select-electric-hot) 76%,
      #e9f9ff 95%,
      transparent 100%
    );
  box-shadow:
    0 0 5px var(--select-electric-hot),
    0 0 14px var(--select-electric-glow);
  transition:
    transform 760ms cubic-bezier(.16,.84,.22,1),
    opacity 220ms ease;
}

.iesys-select-electric::before {
  content: "";
  position: absolute;
  right: -7px;
  bottom: calc(-.10em - 5px);
  width: 13px;
  height: 10px;
  opacity: 0;
  background:
    linear-gradient(132deg,
      transparent 0 31%,
      var(--select-electric-hot) 33% 40%,
      transparent 42% 57%,
      #edfaff 59% 65%,
      transparent 67%);
  filter:
    drop-shadow(0 0 3px var(--select-electric-hot))
    drop-shadow(0 0 8px var(--select-electric-glow));
}

.iesys-select-electric.is-visible::after {
  transform: scaleX(1);
  opacity: .92;
}

.iesys-select-electric.is-visible::before {
  animation: iesysSelectSpark 4.2s ease-in-out 650ms infinite;
}

.hero h1 .iesys-select-electric,
.hero h1 span.iesys-select-electric {
  display: inline-block;
}

@keyframes iesysSelectSpark {
  0%, 74%, 100% { opacity: 0; transform: scale(.7); }
  78% { opacity: .20; }
  80% { opacity: .90; transform: translate3d(2px,-1px,0) scale(1); }
  82% { opacity: .18; }
  85% { opacity: .65; transform: translate3d(-1px,0,0) scale(.9); }
  89% { opacity: 0; }
}

/* ===============================================================
   RESPONSIVE
   =============================================================== */

@media (max-width: 940px) {
  .iesys-theme-toggle {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .iesys-theme-toggle {
    width: 43px;
    height: 27px;
    flex-basis: 43px;
  }

  .iesys-theme-toggle::after {
    width: 19px;
    height: 19px;
  }

  html[data-theme="dark"] .iesys-theme-toggle::after {
    transform: translateX(16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .iesys-select-electric::after {
    transition: none !important;
  }

  .iesys-select-electric.is-visible::before {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Aurora 2.8B — electric rail must not intersect intelligence descenders */
.hero h1 .iesys-select-electric{line-height:1.04;padding-bottom:.18em;margin-bottom:-.08em;overflow:visible}
.hero h1 .iesys-select-electric::after{bottom:-.20em}
.hero h1 .iesys-select-electric::before{bottom:calc(-.20em - 5px)}
