/* ============================================================
   Travelio — demo Style Switcher (APP_DEMO only)
   Shared by the website and the admin panel. Sized in px on
   purpose: the panel must not grow or shrink with the font-size
   setting it controls.
   ============================================================ */
.tv-switcher {
  --sw-bg: #ffffff;
  --sw-text: #1e293b;
  --sw-muted: #64748b;
  --sw-border: #e2e8f0;
  --sw-soft: #f1f5f9;
  --sw-accent: var(--tv-primary, #4da6ff);
  --sw-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sw-text);
}

html[data-theme="dark"] .tv-switcher,
body.dark-mode .tv-switcher {
  --sw-bg: #0f172a;
  --sw-text: #e2e8f0;
  --sw-muted: #94a3b8;
  --sw-border: #1e293b;
  --sw-soft: #1e293b;
  --sw-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.tv-switcher__toggle {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 1051;
  margin-top: -23px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px 0 0 12px;
  background: var(--sw-accent);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--sw-shadow);
  transition: right 0.25s ease;
}

.tv-switcher__toggle i {
  animation: tv-switcher-spin 6s linear infinite;
}

.tv-switcher.is-open .tv-switcher__toggle {
  right: 320px;
}

.tv-switcher.is-open .tv-switcher__toggle i {
  animation: none;
}

.tv-switcher__toggle:focus-visible,
.tv-switcher button:focus-visible,
.tv-switcher select:focus-visible,
.tv-switcher input:focus-visible {
  outline: 2px solid var(--sw-accent);
  outline-offset: 2px;
}

.tv-switcher__panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1050;
  width: 320px;
  max-width: calc(100vw - 46px);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sw-bg);
  border-left: 1px solid var(--sw-border);
  box-shadow: var(--sw-shadow);
}

.tv-switcher__panel[hidden] {
  display: none;
}

.tv-switcher__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 4px;
}

.tv-switcher__head h2 {
  margin: 0;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--sw-text);
}

.tv-switcher__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--sw-soft);
  color: var(--sw-text);
  font-size: 16px;
  cursor: pointer;
}

.tv-switcher__note {
  margin: 0;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--sw-border);
  font-size: 12.5px;
  color: var(--sw-muted);
}

.tv-switcher__body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 20px 16px;
}

.tv-switcher__group {
  padding: 14px 0;
  border-bottom: 1px solid var(--sw-border);
}

.tv-switcher__group:last-child {
  border-bottom: 0;
}

.tv-switcher__group h3,
.tv-switcher__label {
  display: block;
  margin: 0 0 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sw-muted);
}

.tv-switcher__label + .tv-switcher__select + .tv-switcher__label,
.tv-switcher__select + .tv-switcher__label {
  margin-top: 14px;
}

.tv-switcher__swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.tv-switcher__swatch {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--swatch, var(--sw-soft));
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--sw-bg);
}

.tv-switcher__swatch[aria-pressed="true"] {
  border-color: var(--sw-text);
}

.tv-switcher__swatch--custom {
  display: grid;
  place-items: center;
  background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444);
  color: #ffffff;
  font-size: 14px;
  overflow: hidden;
}

.tv-switcher__swatch--custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.tv-switcher__swatch--custom i {
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tv-switcher__templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tv-switcher__template {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 2px solid var(--sw-border);
  border-radius: 10px;
  background: var(--sw-bg);
  color: var(--sw-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.tv-switcher__template[aria-pressed="true"] {
  border-color: var(--sw-accent);
}

.tv-switcher__template-shot {
  display: block;
  height: 44px;
  border-radius: 6px;
  background:
    linear-gradient(var(--t-b), var(--t-b)) 0 0 / 100% 7px no-repeat,
    linear-gradient(120deg, var(--t-b), var(--t-a)) 0 11px / 100% 18px no-repeat,
    var(--t-c);
}

.tv-switcher__segment {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--sw-soft);
}

.tv-switcher__segment button {
  flex: 1;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sw-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tv-switcher__segment button[aria-pressed="true"] {
  background: var(--sw-bg);
  color: var(--sw-accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.tv-switcher__segment--sizes button {
  padding: 0;
}

.tv-switcher__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sw-muted);
}

.tv-switcher__select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  background: var(--sw-bg);
  color: var(--sw-text);
  font-family: inherit;
  font-size: 14px;
}

.tv-switcher__foot {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--sw-border);
}

.tv-switcher__reset {
  width: 100%;
  height: 42px;
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  background: transparent;
  color: var(--sw-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tv-switcher__reset:hover {
  border-color: var(--sw-accent);
  color: var(--sw-accent);
}

/* Right-to-left pages: the switcher sits on the left edge. */
[dir="rtl"] .tv-switcher__toggle {
  right: auto;
  left: 0;
  border-radius: 0 12px 12px 0;
  transition: left 0.25s ease;
}

[dir="rtl"] .tv-switcher.is-open .tv-switcher__toggle {
  right: auto;
  left: 320px;
}

[dir="rtl"] .tv-switcher__panel {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--sw-border);
}

@media (max-width: 400px) {
  .tv-switcher.is-open .tv-switcher__toggle {
    right: calc(100vw - 46px);
  }

  [dir="rtl"] .tv-switcher.is-open .tv-switcher__toggle {
    left: calc(100vw - 46px);
  }
}

@keyframes tv-switcher-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tv-switcher__toggle,
  .tv-switcher__toggle i {
    animation: none;
    transition: none;
  }
}

@media print {
  .tv-switcher {
    display: none;
  }
}
