/* Ofertas a Medida.cl: shared palette (olive), dark mode, the wordmark and the theme switch.
   Loaded by every page after the kit's system.css. */
:root {
  color-scheme: light;
  --p-bg: #f5f5f1; --p-surface: #e9eae3; --p-ink: #11130d; --p-muted: #5a5d53;
  --p-accent: #5c6a06; --p-accent-ink: #ffffff; --p-action: #5c6a06; --p-action-ink: #ffffff;
  --p-inv-bg: #11130d; --p-inv-surface: #1a1c16; --p-inv-ink: #f3f4ee; --p-inv-muted: #a3a698;
  --p-inv-accent: #a9bb45; --p-inv-accent-ink: #11130d; --p-inv-action: #a9bb45; --p-inv-action-ink: #11130d;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-text: "Manrope", system-ui, sans-serif;
  --display-weight: 500; --display-tracking: -0.035em; --display-tracking-xl: -0.045em;
  /* the app's own pieces and the soft fields */
  --app-bg: #ffffff; --app-sub: #f6f6f2; --app-line: #e5e6df; --app-muted: #5a5d53; --app-ink: #11130d;
  --field: #e2e6c6; --tint: #ebeed6; --accent-deep: #3a4304; --line-2: #d2d4ca; --hover: #f1f2ec;
  --logo-tag: #687707; --logo-text: #11130d;
  --good: #2f7a32; --good-bg: #e2f0dc; --wait: #b23a2a; --wait-bg: #f7e1dc; --new: #2a62a3; --new-bg: #dfe9f6;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --p-bg: #121410; --p-surface: #1b1e18; --p-ink: #eef0e8; --p-muted: #a6aa9b;
  --p-accent: #a9bb45; --p-accent-ink: #11130d; --p-action: #a9bb45; --p-action-ink: #11130d;
  --p-inv-bg: #0a0b08; --p-inv-surface: #151711; --p-inv-ink: #eef0e8; --p-inv-muted: #a6aa9b;
  --p-inv-accent: #a9bb45; --p-inv-accent-ink: #11130d; --p-inv-action: #a9bb45; --p-inv-action-ink: #11130d;
  --app-bg: #1e211b; --app-sub: #262a22; --app-line: #343a2d; --app-muted: #a6aa9b; --app-ink: #eef0e8;
  --field: #2b3219; --tint: #2f361c; --accent-deep: #d3df95; --line-2: #3d4335; --hover: #262a22;
  --logo-tag: #9fb03a; --logo-text: #eef0e8;
  --good: #9ad48f; --good-bg: #213320; --wait: #f2a196; --wait-bg: #3a2420; --new: #9cc4f0; --new-bg: #1f2c3d;
}
html { background: var(--p-bg); }
html, body { transition: background-color 200ms ease, color 200ms ease; }
::selection { background: var(--field); color: var(--p-ink); }

/* the logo: the full "Ofertas a Medida.cl" mark, drawn from img/logo.svg; its text follows the theme */
.brand { display: inline-flex; align-items: center; color: var(--p-ink); text-decoration: none; flex: none; }
.brand .brand__logo, .nav__logo svg.brand__logo { display: block; height: 60px; width: auto; aspect-ratio: 3296 / 1206; }
.footer .brand .brand__logo { height: 72px; }
@media (max-width: 639px) { .brand .brand__logo, .nav__logo svg.brand__logo { height: 48px; } }
.brand__s { height: auto; aspect-ratio: 1090 / 1172; color: var(--logo-tag); flex: none; }
.app .brand__s { width: 22px; }
.msg__from .brand__s { width: 26px; }

/* the light / dark switch */
.theme-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--p-ink); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background 160ms, transform 120ms; }
.theme-btn:hover { background: var(--hover); }
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* the search box (hero, nav and the search page) */
.search { box-sizing: border-box; min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 8px; background: var(--app-bg); border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 6px 6px 18px; width: 100%; }
.search:focus-within { border-color: var(--p-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--p-accent) 25%, transparent); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--app-muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1 1 0; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--app-ink); font: 400 17px/1.3 var(--font-text); height: 44px; outline: none; }
.search input::placeholder { color: var(--app-muted); }
.search button { height: 44px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--p-action); color: var(--p-action-ink); font: 600 16px/1 var(--font-text); cursor: pointer; flex: none; }
.search button:hover { filter: brightness(1.08); }
.nav-search { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--p-ink); flex: none; }
.nav-search:hover { background: var(--hover); }
.nav-search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* form controls follow the theme */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--app-bg); color: var(--app-ink); border-color: var(--line-2); }
html[data-theme="dark"] select option, html[data-theme="dark"] select optgroup { background: var(--app-bg); color: var(--app-ink); }
/* the search bar at the top of every page (desktop); phones use the icon or the search on the page */
.search--top { width: clamp(200px, 24vw, 340px); padding: 3px 4px 3px 14px; }
.search--top input { height: 38px; font-size: 15px; }
.search--top svg { width: 18px; height: 18px; }
.top__r .nav-search { display: none; }
@media (max-width: 899px) { .search--top { display: none; } .top__r .nav-search { display: inline-grid; } }
.nav .search--top { width: clamp(180px, 16vw, 250px); }
@media (max-width: 1279px) { .nav .search--top { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the price thermometer: where today's price sits in its 90-day range */
.thermo { margin-top: 10px; }
.thermo__track { position: relative; height: 10px; border-radius: 99px; background: var(--app-sub); box-shadow: inset 0 0 0 1px var(--app-line); }
.thermo__zone { position: absolute; top: 0; bottom: 0; }
.thermo__zone--good { left: 0; background: var(--good-bg); border-radius: 99px 0 0 99px; }
.thermo__zone--wait { background: var(--wait-bg); border-radius: 0 99px 99px 0; }
.thermo__ref { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--app-muted); border-radius: 2px; }
.thermo__now { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--p-accent); box-shadow: 0 0 0 3px var(--app-bg); }
.thermo__ends { position: relative; display: flex; justify-content: space-between; margin-top: 6px; font: 500 12px/1.2 var(--font-text); color: var(--app-muted); font-variant-numeric: tabular-nums; }
.thermo--big .thermo__track { height: 16px; }
.thermo--big .thermo__now { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.thermo--big .thermo__ends { margin-top: 10px; font-size: 13px; min-height: 2.6em; }
.thermo__reft { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font-weight: 600; color: var(--app-ink); }
.verdict { display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1.2 var(--font-text); }
.verdict::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.v-good { color: var(--good); } .v-wait { color: var(--wait); } .v-new { color: var(--new); } .v-normal { color: var(--app-muted); }
.flag { display: inline-flex; width: fit-content; padding: 3px 10px; border-radius: 99px; background: var(--wait-bg); color: var(--wait); font: 700 12px/1.3 var(--font-text); }
.readbtn { border: 0; background: none; padding: 6px 0; font: 600 13px/1.3 var(--font-text); color: var(--app-ink); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; cursor: pointer; }

/* "Cómo leer el termómetro" */
.reader { border: 0; border-radius: 24px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--app-bg); color: var(--app-ink); box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
.reader::backdrop { background: rgb(10 12 8 / .6); }
.reader__in { padding: clamp(22px, 4vw, 36px); display: grid; gap: 16px; }
.reader h2 { font: 700 26px/1.15 var(--font-display); letter-spacing: -0.025em; }
.reader__demo { padding: 18px 18px 6px; border-radius: 18px; background: var(--app-sub); }
.reader__zones { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.reader__zones li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.reader__zones .verdict { font-size: 14px; }
.reader p { margin: 0; }
.reader__small { font-size: var(--t-small); color: var(--app-muted); }
.reader .btn { justify-self: start; }
@media (max-width: 520px) { .reader__zones li { grid-template-columns: 1fr; gap: 2px; } }

/* the logo's personality: every few seconds the tag swings on its string, as if someone brushed past it */
.brand__logo .lg-tag { transform-box: view-box; transform-origin: var(--px) var(--py); animation: oam-tilt 9s cubic-bezier(.36,.07,.19,.97) 4s infinite; }
.brand:hover .lg-tag, .brand:focus-visible .lg-tag { animation: oam-tilt-now 1.1s cubic-bezier(.36,.07,.19,.97) 1; }
.brand__s .lg-tag { animation: none; }
@keyframes oam-tilt {
  0%, 84%, 100% { transform: rotate(0deg); }
  87% { transform: rotate(-11deg); }
  90.5% { transform: rotate(7deg); }
  93.5% { transform: rotate(-4deg); }
  96.5% { transform: rotate(1.5deg); }
}
@keyframes oam-tilt-now {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-11deg); }
  45% { transform: rotate(7deg); }
  68% { transform: rotate(-3.5deg); }
  86% { transform: rotate(1.2deg); }
}

/* the opening: the tag drops onto its hook and swings, the tape unrolls and the name rises, then the curtain lifts */
html.oam-intro body { overflow: hidden; }
html.oam-intro::after { content: ""; position: fixed; inset: 0; z-index: 9998; background: var(--p-bg); }
.intro { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--p-bg); cursor: pointer; }
.intro .brand__logo { width: min(560px, 82vw); height: auto; overflow: visible; }
.intro .lg-tag { animation: oam-drop 1.25s cubic-bezier(.3,1.35,.5,1) both, oam-swing 1.4s cubic-bezier(.36,.07,.19,.97) 1.05s both; }
.intro .lg-tape { clip-path: inset(0 100% 0 0); animation: oam-unroll .7s cubic-bezier(.65,0,.35,1) .55s forwards; }
.intro .lg-text { clip-path: inset(100% 0 0 0); transform: translateY(40px); animation: oam-rise .75s cubic-bezier(.2,.8,.2,1) .85s forwards; }
.intro__line { position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%); font: 600 15px/1.3 var(--font-text); color: var(--p-muted); opacity: 0; animation: oam-fade .6s ease 1.5s forwards; white-space: nowrap; }
.intro.is-out { animation: oam-curtain .55s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes oam-drop { 0% { transform: translateY(-140%) rotate(-28deg); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(0) rotate(0deg); } }
@keyframes oam-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 55% { transform: rotate(4deg); } 80% { transform: rotate(-1.5deg); } }
@keyframes oam-unroll { to { clip-path: inset(0 0 0 0); } }
@keyframes oam-rise { to { clip-path: inset(0 0 0 0); transform: translateY(0); } }
@keyframes oam-fade { to { opacity: 1; } }
@keyframes oam-curtain { to { transform: translateY(-100%); } }
.intro .lg-tag { transform-box: view-box; transform-origin: var(--px) var(--py); }
@media (prefers-reduced-motion: reduce) {
  .brand__logo .lg-tag, .brand:hover .lg-tag { animation: none; }
  html.oam-intro::after { display: none; }
}
