/*!
 * EaseAway Experience Foundation — R1.1
 * Shared tokens + shell/layout primitives for a single product feel.
 * Load after easeaway-polish.css. Does not invent a second theme system.
 */
:root {
  /* Map polish tokens onto design-system names for cross-page consistency */
  --xp-color-forest: var(--ea-forest, #1b2e1f);
  --xp-color-forest-soft: var(--ea-forest-soft, #2d4a33);
  --xp-color-terracotta: var(--ea-terracotta, #e8734a);
  --xp-color-cream: var(--ea-cream, #f9f7f2);
  --xp-color-sand: var(--ea-sand, #e8dcc5);
  --xp-color-mint: var(--ea-mint-ok, #22543d);
  --xp-color-warn: var(--ea-amber-warn, #c05621);
  --xp-color-danger: var(--ea-coral-alert, #c53030);

  --xp-font-display: 'Fraunces', Georgia, serif;
  --xp-font-body: 'DM Sans', 'Inter', system-ui, sans-serif;

  --xp-text-xs: 0.75rem;
  --xp-text-sm: 0.875rem;
  --xp-text-md: 1rem;
  --xp-text-lg: 1.125rem;
  --xp-text-xl: 1.375rem;
  --xp-text-2xl: clamp(1.5rem, 3vw, 2rem);
  --xp-text-3xl: clamp(1.85rem, 4vw, 2.5rem);

  --xp-space-1: 4px;
  --xp-space-2: 8px;
  --xp-space-3: 12px;
  --xp-space-4: 16px;
  --xp-space-5: 24px;
  --xp-space-6: 32px;
  --xp-space-7: 48px;

  --xp-radius-sm: var(--ea-radius-sm, 10px);
  --xp-radius-md: var(--ea-radius-md, 18px);
  --xp-radius-lg: var(--ea-radius-lg, 24px);
  --xp-radius-pill: var(--ea-radius-pill, 999px);

  --xp-shadow-sm: var(--ea-shadow-soft, 0 10px 30px -10px rgba(27, 46, 31, 0.12));
  --xp-shadow-md: var(--ea-shadow-lift, 0 18px 40px -14px rgba(27, 46, 31, 0.22));
  --xp-focus-ring: var(--ea-shadow-focus, 0 0 0 3px rgba(232, 115, 74, 0.25));

  --xp-bp-phone: 480px;
  --xp-bp-tablet: 768px;
  --xp-bp-desktop: 1024px;

  --xp-shell-header-h: 56px;
  --xp-shell-nav-h: 64px;
  --xp-page-max: 1120px;
}

/* Shell layout — prevent bottom-nav collision */
body.ea-shell-applied {
  padding-bottom: calc(var(--xp-shell-nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  max-width: 100vw;
}

body.ea-shell-applied .ea-page-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--xp-shell-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--xp-space-3);
  padding: var(--xp-space-2) var(--xp-space-4);
  background: rgba(249, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--xp-color-sand);
}

body.ea-shell-applied .ea-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 2px;
  min-height: var(--xp-shell-nav-h);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 254, 251, 0.96);
  border-top: 1px solid var(--xp-color-sand);
  box-shadow: 0 -6px 24px rgba(27, 46, 31, 0.06);
}

body.ea-shell-applied .ea-bottom-nav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 2px;
  text-decoration: none;
  color: var(--xp-color-forest-soft);
  font-family: var(--xp-font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--xp-radius-sm);
}

body.ea-shell-applied .ea-bottom-nav__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body.ea-shell-applied .ea-bottom-nav__item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  flex-shrink: 0;
}

body.ea-shell-applied .ea-bottom-nav__item.is-active,
body.ea-shell-applied .ea-bottom-nav__item[aria-current='page'] {
  color: var(--xp-color-terracotta);
}

body.ea-shell-applied .ea-bottom-nav__item:focus-visible,
body.ea-shell-applied .ea-page-header a:focus-visible,
body.ea-shell-applied .ea-page-header button:focus-visible,
.xp-btn:focus-visible,
.xp-input:focus-visible,
.xp-select:focus-visible {
  outline: none;
  box-shadow: var(--xp-focus-ring);
}

/* Page primitives */
.xp-page {
  max-width: var(--xp-page-max);
  margin: 0 auto;
  padding: var(--xp-space-5) var(--xp-space-4);
}

.xp-page-title {
  font-family: var(--xp-font-display);
  font-size: var(--xp-text-2xl);
  font-weight: 800;
  color: var(--xp-color-forest);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 var(--xp-space-2);
}

.xp-page-lede {
  font-family: var(--xp-font-body);
  font-size: var(--xp-text-md);
  color: var(--xp-color-forest-soft);
  line-height: 1.55;
  margin: 0 0 var(--xp-space-5);
  max-width: 42rem;
}

.xp-section {
  margin-bottom: var(--xp-space-6);
}

.xp-section-title {
  font-family: var(--xp-font-display);
  font-size: var(--xp-text-xl);
  font-weight: 700;
  color: var(--xp-color-forest);
  margin: 0 0 var(--xp-space-3);
}

.xp-card {
  background: var(--bg-card, #fffefb);
  border: 1px solid var(--xp-color-sand);
  border-radius: var(--xp-radius-md);
  box-shadow: var(--xp-shadow-sm);
  padding: var(--xp-space-4);
}

.xp-card + .xp-card {
  margin-top: var(--xp-space-3);
}

.xp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--xp-space-2);
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--xp-radius-sm);
  border: 1px solid transparent;
  font-family: var(--xp-font-body);
  font-size: var(--xp-text-sm);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.xp-btn:active {
  transform: translateY(1px);
}

.xp-btn--primary {
  background: linear-gradient(135deg, var(--xp-color-terracotta), #ed8936);
  color: #fff;
}

.xp-btn--secondary {
  background: var(--xp-color-forest);
  color: #fff;
}

.xp-btn--ghost {
  background: transparent;
  border-color: var(--xp-color-sand);
  color: var(--xp-color-forest);
}

.xp-btn--block {
  width: 100%;
}

.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--xp-radius-pill);
  font-size: var(--xp-text-xs);
  font-weight: 600;
  background: var(--ea-mint-bg, #e3ede4);
  color: var(--xp-color-mint);
  border: 1px solid var(--ea-mint-border, #b8d4bc);
}

.xp-badge--warn {
  background: var(--ea-amber-bg, #fff8eb);
  color: var(--xp-color-warn);
  border-color: var(--ea-amber-border, #e8c878);
}

.xp-badge--blocked {
  background: #fff5f5;
  color: var(--xp-color-danger);
  border-color: #feb2b2;
}

.xp-alert {
  padding: var(--xp-space-3) var(--xp-space-4);
  border-radius: var(--xp-radius-sm);
  border: 1px solid var(--xp-color-sand);
  background: var(--xp-color-cream);
  color: var(--xp-color-forest-soft);
  font-size: var(--xp-text-sm);
  line-height: 1.5;
}

.xp-alert--info {
  border-color: #bee3f8;
  background: #ebf8ff;
  color: #2b6cb0;
}

.xp-alert--blocked {
  border-color: #feb2b2;
  background: #fff5f5;
  color: #9b2c2c;
}

.xp-empty {
  text-align: center;
  padding: var(--xp-space-6) var(--xp-space-4);
  color: var(--xp-color-forest-soft);
}

.xp-empty h3 {
  font-family: var(--xp-font-display);
  color: var(--xp-color-forest);
  margin: 0 0 var(--xp-space-2);
}

.xp-form-row {
  display: grid;
  gap: var(--xp-space-3);
  margin-bottom: var(--xp-space-4);
}

@media (min-width: 768px) {
  .xp-form-row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.xp-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xp-color-forest-soft);
  margin-bottom: 6px;
}

.xp-input,
.xp-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--xp-color-sand);
  border-radius: var(--xp-radius-sm);
  background: #fff;
  font-family: var(--xp-font-body);
  font-size: var(--xp-text-sm);
  color: var(--xp-color-forest);
}

/* Mobile safety */
@media (max-width: 768px) {
  .hotel-search-intents { grid-template-columns: 1fr !important; }
  .xp-btn, .loc-btn, .search-btn { max-width: 100%; }
  body.ea-shell-applied .ea-bottom-nav__item {
    font-size: 9px;
  }

  .xp-page {
    padding: var(--xp-space-4) var(--xp-space-3);
  }

  /* Kill common overflow sources on shelled pages */
  body.ea-shell-applied img,
  body.ea-shell-applied video,
  body.ea-shell-applied iframe,
  body.ea-shell-applied table {
    max-width: 100%;
  }
}

/* Desktop: bottom nav still works; allow slightly larger labels */
@media (min-width: 1024px) {
  body.ea-shell-applied .ea-bottom-nav__item {
    font-size: 11px;
  }
}

/* Intent chips (Planner) */
.xp-intent-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xp-space-2);
  margin: var(--xp-space-3) 0;
}

.xp-intent-chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--xp-radius-pill);
  border: 1px solid var(--xp-color-sand);
  background: #fff;
  font-size: var(--xp-text-sm);
  font-weight: 600;
  color: var(--xp-color-forest);
  cursor: pointer;
}

.xp-intent-chip.is-active {
  border-color: var(--xp-color-terracotta);
  background: rgba(232, 115, 74, 0.08);
  color: var(--xp-color-terracotta);
}

.xp-intent-chip:disabled,
.xp-intent-chip[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
