/* =========================================
   VARIABLES & THEMES
   ========================================= */
:root {
  --bg: #1f160d;
  --bg2: #151008;
  --card: #2b1f12;
  --ink: #fff9f0;
  --muted: #f2e4c7;
  --gold: #daba52;
  --gold2: #bf952c;
  --radius: 16px;
  --gap: 7px;
  --bar-font: clamp(.98rem, .9rem + .35vw, 1.15rem);
  --bar-pad-y: 14px;
  --bar-pad-x: 18px;
  --bar-gap: 12px;
  --bar-icon: 28px;
  --bar-close: 32px;
  --bar-btn-py: 8px;
  --bar-btn-px: 16px;
  --outline: 0 0 0 2px rgba(212, 175, 55, .35), 0 0 0 4px rgba(212, 175, 55, .2);
  --accent-ink: #2b1f10;
}

html[data-theme=navy] {
  --bg: #0c1a2b;
  --bg2: #0a1523;
  --card: #121e32;
  --ink: #eef3fb;
  --muted: #b9c7dc;
  --gold: #E9C46A;
  --gold2: #D4AF37;
  --accent-ink: #0b1220;
}

html[data-theme=light] {
  --bg: #f0ede5;
  --bg2: #ebe6dd;
  --card: #ffffff;
  --ink: #0e1420;
  --muted: #5f6773;
  --gold: #D4AF37;
  --gold2: #BB9729;
  --accent-ink: #0e1420;
}

html[data-theme=christmas] {
  --bg: #0e1a12;
  --bg2: #0b130d;
  --card: #13211a;
  --ink: #f8fff6;
  --muted: #d8e8d3;
  --gold: #f6d974;
  --gold2: #d43a46;
  --accent-ink: #0e1a12;
}

/* =========================================
   BASE STYLES & BODY
   ========================================= */
* {
  box-sizing: border-box;
}

body,
html {
  max-width: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 110% -10%, color-mix(in oklab, var(--gold) 22%, transparent), transparent 60%),
    radial-gradient(800px 520px at -10% -10%, color-mix(in oklab, var(--gold2) 20%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg) 0, var(--bg2) 100%);
  font-family: "Noto Naskh Arabic", "Segoe UI", system-ui, -apple-system, Arial;
  min-height: 100vh;
}

/* Christmas Theme Background Special Logic */
html[data-theme=christmas] body {
  --s: 75px;
  --_c: #0000, #fff 1deg 79deg, #0000 81deg;
  --g0: conic-gradient(from 140deg at 50% 87.5%, var(--_c));
  --g1: conic-gradient(from 140deg at 50% 81.25%, var(--_c));
  --g2: conic-gradient(from 140deg at 50% 75%, var(--_c));
  --g3: conic-gradient(at 10% 20%, #0000 75%, #fff 0);
  background:
    var(--g0) 0 calc(var(--s)/ -4),
    var(--g0) var(--s) calc(3 * var(--s)/ 4),
    var(--g1),
    var(--g1) var(--s) var(--s),
    var(--g2) 0 calc(var(--s)/ 4),
    var(--g2) var(--s) calc(5 * var(--s)/ 4),
    var(--g3) calc(var(--s)/ -10) var(--s),
    var(--g3) calc(9 * var(--s)/ 10) calc(2 * var(--s)),
    repeating-conic-gradient(from 45deg, #a31e39 0 25%, #31570e 0 50%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 75%, transparent), color-mix(in oklab, var(--bg2) 85%, transparent));
  background-size: calc(2 * var(--s)) calc(2 * var(--s));
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--card) 92%, var(--bg));
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 18%, transparent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
  height: 60px;
  transition: box-shadow .3s ease;
}

header .bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.header-row {
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, .12);
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .2px;
  white-space: nowrap;
}

.mini-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 6px;

  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--gold) 18%, transparent);
}

.mini-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: .2s ease;
}

.mini-nav a.current {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  box-shadow: 0 6px 14px color-mix(in oklab, var(--gold) 25%, transparent);
}

.mini-nav a:focus {
  outline: 0;
  box-shadow: var(--outline);
}

.hdr-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.78rem, 1.8vw, .95rem);
  line-height: 1.6;
}

.hdr-utilities {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.hdr-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-menu {
  position: relative;
}

.icon-toggle {
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  background: var(--card);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
  color: var(--ink);
}

.icon-toggle .icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: color .2s ease;
}

.icon-toggle .icon-language,
.icon-toggle .icon-theme {
  -webkit-mask-image: url("../language.svg");
  mask-image: url("../language.svg");
}

.icon-toggle .icon-theme {
  -webkit-mask-image: url("../theme.svg");
  mask-image: url("../theme.svg");
}

.icon-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--outline);
}

.icon-toggle:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.info-toggle {
  font-weight: 700;
  font-size: 14px;
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--gold) 18%, transparent);
  color: var(--ink);
}

.info-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 0;
}

.info-panel__inner {
  
  border: 1px solid color-mix(in oklab, var(--gold) 16%, transparent);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

[hidden].info-panel {
  display: none;
}

/* =========================================
   MENUS & DROPDOWNS
   ========================================= */
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 160px;
  background: color-mix(in oklab, var(--card) 96%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  z-index: 20;
  display: grid;
  gap: 4px;
}

.menu-panel button {
  border: 0;
  background: 0 0;
  color: var(--ink);
  text-align: start;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-panel button .check {
  opacity: 0;
  transition: .2s ease;
}

.menu-panel button.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
}

.menu-panel button.active .check {
  opacity: 1;
}

.menu-panel button:focus-visible {
  outline: 0;
  box-shadow: var(--outline);
}

[hidden].menu-panel {
  display: none;
}

/* =========================================
   LAYOUT & GRID
   ========================================= */
main {
  max-width: 980px;
  margin: 20px auto;
  padding: 0 16px 40px;
}

.grid {
  display: grid;
  gap: var(--gap);
}

@media(min-width:900px) {
  .grid-2 {
    grid-template-columns: 1.2fr .8fr;
  }
}

.card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 96%, transparent) 0, var(--card) 100%);
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}

/* =========================================
   TYPOGRAPHY & FORMS
   ========================================= */
h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 6px;
}

input {
  width: 100%;
  background: color-mix(in oklab, var(--bg) 80%, #0000);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 40%, transparent);
  padding: 12px;
  border-radius: 12px;
  outline: 0;
  caret-color: var(--ink);
  box-shadow: 0 0 0 transparent;
  transition: all .2s ease;
}

input:focus {
  box-shadow: var(--outline);
  border-color: var(--gold);
}

input::placeholder {
  color: color-mix(in oklab, var(--gold) 55%, #fff0);
  font-style: italic;
}

input:hover {
  border-color: var(--gold2);
}

.num {
  direction: ltr;
  text-align: left;
}

/* =========================================
   UI COMPONENTS (Buttons, Switches, Badges)
   ========================================= */
.spot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.priceField {
  flex: 1 1 180px;
  min-width: 170px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  box-shadow: 0 10px 22px color-mix(in oklab, var(--gold) 35%, transparent);
}

.btn:focus {
  outline: 0;
  box-shadow: var(--outline);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold) 25%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  transition: .25s;
}

.slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  transition: .25s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}

.switch input:checked+.slider {
  background: color-mix(in oklab, var(--gold2) 70%, #0000);
}

.switch input:checked+.slider::after {
  transform: translate(18px, -50%);
}

.switch .txt {
  font-size: 12px;
  color: var(--muted);
}

.spot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  color: var(--muted);
  font-size: 12px;
}

.spacer {
  flex: 1 1 auto;
}

.error {
  background: #3a120c;
  border: 1px solid rgba(255, 150, 120, .6);
  color: #ffe1db;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px;
  display: none;
}

html[data-theme=light] .error {
  background: #ffe9e6;
  color: #8a1d12;
  border-color: #ffb2a0;
}

.prices {
  display: grid;
  gap: 10px;
}

.prices>div {
  padding: 4px 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--gold) 18%, transparent);
}

.prices .label {
  color: var(--muted);
  font-size: 13px;
}

.prices .value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .3px;
}

.bar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bar-head h2 {
  margin: 0;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-mini {
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.btn-mini:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--gold) 18%, transparent);
}

.btn-mini:active {
  transform: translateY(0) scale(.99);
}

.btn-mini.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border: 0;
}

.btn-mini.gold:hover {
  filter: brightness(1.05);
}

.btn-mini.gold:active {
  filter: brightness(.98);
}

.btn-mini:focus {
  outline: 0;
  box-shadow: var(--outline);
}

.btn-mini:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* =========================================
   CONFIGURATION PANEL
   ========================================= */
#cfgPanel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

#cfgPanel.open {
  display: block;
}

#cfgPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

#cfgPanel .cfg-sheet {
  position: relative;
  margin: 6vh auto 0;
  width: min(520px, 92vw);
  max-height: 86vh;
  overflow: auto;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

#cfgPanel .cfg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-end: 40px;
}

#cfgPanel .cfg-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

#cfgPanel .cfg-close:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border-color: transparent;
}

#cfgPanel .cfg-close:focus {
  outline: 0;
  box-shadow: var(--outline);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-note {
  font-size: 12px;
  color: var(--muted);
}

/* =========================================
   MISC & UTILITIES
   ========================================= */
.mini {
  font-size: 12px;
  color: var(--muted);
}

.ad-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-contact__mail {
  font-weight: 600;
  color: var(--ink);
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: #25d366;
  color: #03230d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.whatsapp-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4);
}

.whatsapp-button:focus {
  outline: 0;
  box-shadow: var(--outline);
}

.whatsapp-button svg {
  width: 14px;
  height: 14px;
}

html[data-theme=light] .whatsapp-button {
  color: #011b08;
}

.ad-card video {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

.out {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  line-height: 1.6;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  padding: 12px;
  border-radius: 12px;
  white-space: pre-line;
}

/* =========================================
   TOASTS & BANNERS
   ========================================= */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 120%);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .35);
  transition: transform .35s ease, opacity .35s ease;
  opacity: 0;
  z-index: 2000;
  max-width: min(92vw, 420px);
  text-align: center;
  font-size: 13px;
}

#toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

#a2hsBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transform: translateY(-110%);
  transition: transform .45s ease;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  color: var(--ink);
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-size: var(--bar-font);
}

#a2hsBanner.show {
  transform: translateY(0);
}

#a2hsBanner .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--bar-pad-y) var(--bar-pad-x);
  display: flex;
  align-items: center;
  gap: var(--bar-gap);
}

#a2hsBanner img.icon {
  width: var(--bar-icon);
  height: var(--bar-icon);
  border-radius: 6px;
  flex: 0 0 var(--bar-icon);
}

#a2hsBanner .txt {
  flex: 1;
  line-height: 1.35;
}

#a2hsBanner .cta {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: var(--bar-btn-py) var(--bar-btn-px);
  font-weight: 800;
  cursor: pointer;
  font-size: 1em;
}

#a2hsBanner .close {
  background: 0 0;
  color: var(--ink);
  border: 0;
  width: var(--bar-close);
  height: var(--bar-close);
  font-size: calc(var(--bar-close) * .56);
  line-height: var(--bar-close);
  cursor: pointer;
  flex: 0 0 var(--bar-close);
}

/* =========================================
   INSTALL MODAL (A2HS)
   ========================================= */
#a2hsModal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

#a2hsModal.open {
  display: flex;
}

#a2hsModal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
}

#a2hsModal .sheet {
  position: relative;
  width: min(680px, 92vw);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .65);
}

#a2hsModal .sheet h3 {
  margin: 0 0 8px;
}

#a2hsModal .sheet img.main {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  background: #0b0b0b;
}

#a2hsModal .steps {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
}

#a2hsModal .steps .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

#a2hsModal .steps img.icon {
  width: 22px;
  height: 22px;
}

#a2hsModal .x {
  position: absolute;
  top: 8px;
  left: 10px;
  background: 0 0;
  border: 0;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

/* =========================================
   FOOTER & HELPERS
   ========================================= */
footer {
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding-top: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.no-scroll {
  height: 100vh;
  overflow: hidden;
}

body.has-topbar {
  padding-top: 68px;
}

/* =========================================
   MEDIA QUERIES
   ========================================= */
@media(max-width:900px) {
  .brand-title {
    font-size: 13px;
  }

  .mini-nav {
    gap: 6px;
    padding: 4px;
  }

  .mini-nav a {
    padding: 5px 12px;
    font-size: 11px;
  }
}

@media(max-width:720px) {
  .brand-title {
    display: none;
  }

  .mini-nav {
    margin-inline: 0;
    flex: 1 1 auto;
  }
}

@media(max-width:540px) {
  header {
    height: auto;
  }

  header .bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 12px;
  }

  .mini-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .hdr-utilities {
    order: 2;
  }

  .header-brand {
    order: 1;
  }

  .info-panel {
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
