:root {
  --bg-outer: #050507;
  --bg-app: #08080b;
  --bg-card: #121218;
  --bg-elev: #1a1a22;
  --border: rgba(255, 255, 255, 0.11);
  --red: #e50914;
  --red-bright: #ff2432;
  --red-glow: rgba(229, 9, 20, 0.45);
  --text: #f5f5f7;
  --muted: #9ca3af;
  --max-w: 440px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-outer);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(600px 420px at 50% 0%, rgba(229, 9, 20, 0.14), transparent 70%),
    linear-gradient(180deg, #07070a 0%, #030305 100%);
}

.app-shell {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-app);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
}

.view {
  display: none;
  padding-bottom: 72px;
}

.view.active {
  display: block;
  animation: fadeIn 0.22s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Seamless Slice Containers */
.slice {
  position: relative;
  width: 100%;
  line-height: 0;
  user-select: none;
}

.slice img {
  display: block;
  width: 100%;
  height: auto;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #070709;
}

.fixed-bottom {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  z-index: 35;
  background: #0a0a0d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Interactive Hotspots */
.hotspot {
  position: absolute;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 5;
  border-radius: 10px;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.hotspot:active {
  background-color: rgba(255, 255, 255, 0.12);
}

.hotspot-pulse {
  border-radius: 999px;
  animation: ctaGlow 2.2s infinite ease-in-out;
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 36, 50, 0.55); }
  50% { box-shadow: 0 0 18px 4px rgba(255, 36, 50, 0.35); }
}

/* Live Search Input Overlaid Cleanly on y001_02 */
.search-overlay {
  position: absolute;
  left: 13%;
  right: 6%;
  top: 16%;
  bottom: 16%;
  display: flex;
  align-items: center;
}

.search-overlay input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 0 28px 0 4px;
}

.search-overlay input::placeholder {
  color: transparent;
}

.search-overlay input.has-value {
  background: rgba(28, 30, 38, 0.92);
  border-radius: 999px;
  padding-left: 10px;
}

.search-clear {
  position: absolute;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  display: none;
}

.search-clear.show {
  display: block;
}

.model-card-slice {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.model-card-slice.hidden-by-search {
  display: none;
}

.search-empty {
  display: none;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.search-empty.show {
  display: block;
}

/* Dynamic Model Switcher Banner on Detail View (shown when 500RR / 820X chosen) */
.detail-model-banner {
  display: none;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.18), rgba(20, 20, 28, 0.95));
  border-top: 1px solid rgba(229, 9, 20, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-model-banner.show {
  display: flex;
}

.detail-model-banner .dm-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.detail-model-banner .dm-sub {
  font-size: 12px;
  color: #fca5a5;
  margin-top: 2px;
}

.detail-model-banner .dm-price {
  font-size: 18px;
  font-weight: 800;
  color: #ff3b47;
  white-space: nowrap;
}

/* Specs Accordion Card on Detail View */
.specs-card {
  margin: 10px 12px 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.specs-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.specs-card h3::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--red);
}

.specs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.specs-list li {
  font-size: 12.5px;
  line-height: 1.45;
  color: #d1d5db;
  padding-left: 14px;
  position: relative;
}

.specs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
}

/* Compliance Footer */
.compliance-footer {
  padding: 18px 16px 26px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #060608;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.footer-links button {
  background: none;
  border: 0;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.footer-links button:hover {
  color: #fff;
}

.footer-meta {
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
}

/* Image Popup Modals (y002 & y004) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.img-modal-box {
  position: relative;
  width: 100%;
  max-width: 390px;
  animation: popIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.img-modal-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  background: rgba(15, 15, 20, 0.75);
  color: #fff;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
}

.img-modal-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.14);
  line-height: 0;
}

.img-modal-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Native Booking Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop.open {
  display: flex;
}

.sheet-panel {
  width: 100%;
  max-width: var(--max-w);
  max-height: 90vh;
  overflow-y: auto;
  background: #111117;
  border-top: 1px solid rgba(229, 9, 20, 0.45);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  animation: slideUp 0.24s cubic-bezier(0.2, 0.85, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #ff4550;
  margin: 0 0 4px;
}

.sheet-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.model-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.model-pill {
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #181822;
  color: #d1d5db;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.model-pill strong {
  display: block;
  font-size: 14px;
  color: #fff;
}

.model-pill.selected {
  border-color: var(--red-bright);
  background: rgba(229, 9, 20, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 36, 50, 0.35);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #181822;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--red-bright);
}

.perks-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.perk-tag {
  font-size: 11px;
  font-weight: 600;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 4px 9px;
  border-radius: 999px;
}

.btn-primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c80812 0%, #ff2532 55%, #d60a15 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
}

.btn-primary:active {
  transform: scale(0.99);
}

.form-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #9ca3af;
}

/* Info / Legal Modal Body */
.info-body {
  font-size: 13px;
  line-height: 1.65;
  color: #d1d5db;
}

.info-body h4 {
  margin: 14px 0 6px;
  font-size: 14px;
  color: #fff;
}

.info-body p,
.info-body ul {
  margin: 0 0 10px;
}

.info-body ul {
  padding-left: 18px;
}

/* Toast */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 120;
  background: rgba(20, 20, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
