/* Trojan Storage — "Choose Your Space" modal
   Recreated from the design handoff (design_handoff_choose_your_space_modal).
   One component, two layout variants: .is-two-up (Good/Better) and
   .is-three-tier (Good/Better/Best). All values map to the Trojan design tokens
   (assets/css/tokens.css in the theme); every var() has a literal fallback so the
   component still renders correctly if the theme tokens are not present (e.g. the
   standalone demo, or an embed). */

/* ---------- Scrim / overlay ---------- */
.tcs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5, 1.5rem);
  background: rgba(13, 15, 19, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              visibility var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1));
  overflow-y: auto;
}
.tcs-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Modal card ---------- */
.tcs-dialog {
  position: relative;
  width: 100%;
  max-width: 700px; /* two-up default */
  background: var(--white, #fff);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-xl, 0 24px 56px rgba(20, 22, 27, 0.16));
  padding: 26px;
  margin: auto;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur-slow, 280ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              opacity var(--dur-slow, 280ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.tcs-overlay.is-open .tcs-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.tcs-overlay.is-three-tier .tcs-dialog {
  max-width: 860px;
}

/* ---------- Header ---------- */
.tcs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  margin-bottom: 18px;
}
.tcs-title {
  margin: 0 0 4px;
  font-family: var(--font-display, 'Barlow Semi Condensed', 'Arial Narrow', sans-serif);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  color: var(--text-strong, #0d0f13);
}
.tcs-subtitle {
  margin: 0;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-size: 14px;
  color: var(--text-muted, #6b7383);
}
.tcs-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -6px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--slate-400, #99a1af);
  cursor: pointer;
  transition: color var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              background var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.tcs-close:hover { color: var(--slate-600, #4b525f); background: var(--slate-100, #edeff3); }
.tcs-close svg { width: 22px; height: 22px; }

/* ---------- Tier grid ---------- */
.tcs-cols {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr; /* two-up */
}
.tcs-overlay.is-three-tier .tcs-cols {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ---------- Tier card ---------- */
.tcs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white, #fff);
  border: 2px solid var(--slate-200, #dce0e7);
  border-radius: var(--radius-md, 10px);
  padding: 22px;
}
/* Tier color-coding (border) */
.tcs-card.is-good   { border-color: var(--green-500, #1e8a5b); }
.tcs-card.is-better { border-color: var(--brand, #d32d08); }
.tcs-card.is-best   { border-color: var(--amber-500, #e2a100); }

/* Recommended (three-tier "Better") elevation + ribbon */
.tcs-card.is-recommended { box-shadow: var(--shadow-md, 0 4px 10px rgba(20, 22, 27, 0.08), 0 2px 4px rgba(20, 22, 27, 0.06)); }
.tcs-ribbon {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white, #fff);
  background: var(--brand, #d32d08);
  padding: 5px 12px;
  border-radius: var(--radius-pill, 999px);
}

/* Tier badge */
.tcs-badge {
  align-self: flex-start;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: var(--radius-pill, 999px);
}
.is-good   .tcs-badge { color: var(--green-600, #14704a); background: var(--green-50, #e8f6ef); }
.is-better .tcs-badge { color: var(--brand, #d32d08);    background: var(--red-50, #fef3f0); }
.is-best   .tcs-badge { color: var(--amber-600, #b47f00); background: var(--amber-50, #fdf4e1); }

/* Layout name / dimensions */
.tcs-layout-name {
  margin: 14px 0 2px;
  font-family: var(--font-display, 'Barlow Semi Condensed', sans-serif);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.15;
  color: var(--text-strong, #0d0f13);
}
.tcs-dims {
  margin: 0;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-size: 13px;
  color: var(--text-muted, #6b7383);
}

/* ---------- two-up: feature tags (pills) ---------- */
.tcs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tcs-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--slate-700, #353a44);
  background: var(--slate-100, #edeff3);
  padding: 7px 12px;
  border-radius: var(--radius-pill, 999px);
}
.tcs-tag svg { width: 14px; height: 14px; color: var(--brand, #d32d08); flex: none; }
.tcs-rule {
  height: 1px;
  margin: 16px 0;
  background: var(--border-subtle, #dce0e7);
  border: 0;
}

/* ---------- three-tier: aligned feature rows ---------- */
.tcs-features {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  min-height: 96px; /* keep the three columns aligned */
}
.tcs-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-size: 13.5px;
  color: var(--text-body, #353a44);
  padding: 4.5px 0;
}
.tcs-feature svg { width: 16px; height: 16px; flex: none; }
.tcs-feature.is-included svg { color: var(--green-600, #14704a); }
.tcs-feature.is-excluded { color: var(--text-faint, #99a1af); }
.tcs-feature.is-excluded svg { color: var(--slate-300, #c0c6d1); }

/* ---------- Price ---------- */
.tcs-price {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-display, 'Barlow Semi Condensed', sans-serif);
  font-weight: 800;
  color: var(--text-strong, #0d0f13);
}
.tcs-price .tcs-per { font-weight: 600; color: var(--text-muted, #6b7383); }
.is-two-up .tcs-price { text-align: center; font-size: 34px; line-height: 1; }
.is-two-up .tcs-price .tcs-per { font-size: 13px; }
.is-three-tier .tcs-price { text-align: left; font-size: 26px; line-height: 1; }
.is-three-tier .tcs-price .tcs-per { font-size: 12px; }
.tcs-price-strike {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint, #99a1af);
  text-decoration: line-through;
}

/* Scarcity ("2 left") + sold-out */
.tcs-scarcity {
  margin-top: 6px;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 700;
  font-size: 12px;
  color: var(--brand, #d32d08);
}
.is-two-up .tcs-scarcity { text-align: center; }
.tcs-card.is-soldout { opacity: 0.72; }
.tcs-soldout {
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted, #6b7383);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- CTAs ---------- */
.tcs-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.tcs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font-family: var(--font-sans, 'Barlow', system-ui, sans-serif);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              border-color var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              box-shadow var(--dur-base, 180ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.is-three-tier .tcs-btn { height: 38px; font-size: 14px; }

.tcs-btn-rent {
  color: var(--on-brand, #fff);
  background: var(--brand, #d32d08);
}
.tcs-btn-rent:hover { background: var(--brand-hover, #b82506); box-shadow: var(--shadow-brand, 0 8px 20px rgba(211, 45, 8, 0.28)); }
.tcs-btn-rent:active { background: var(--brand-active, #951d06); }
/* Recommended card's rent button keeps the brand lift at rest */
.is-recommended .tcs-btn-rent { box-shadow: var(--shadow-brand, 0 8px 20px rgba(211, 45, 8, 0.28)); }

.tcs-btn-reserve {
  color: var(--brand, #d32d08);
  background: var(--white, #fff);
  border-color: var(--red-200, #f8bdad);
}
.tcs-btn-reserve:hover { background: var(--red-50, #fef3f0); border-color: var(--brand, #d32d08); }

/* ---------- Focus visibility (a11y) ---------- */
.tcs-close:focus-visible,
.tcs-btn:focus-visible {
  outline: 3px solid var(--focus-ring, rgba(211, 45, 8, 0.45));
  outline-offset: 2px;
}

/* ---------- Responsive: stack to single column ---------- */
@media (max-width: 640px) {
  .tcs-overlay { padding: 0; align-items: stretch; }
  .tcs-dialog,
  .tcs-overlay.is-three-tier .tcs-dialog {
    max-width: none;
    min-height: 100%;
    border-radius: 0;
    padding: 20px;
  }
  .tcs-cols,
  .tcs-overlay.is-three-tier .tcs-cols {
    grid-template-columns: 1fr;
  }
  .tcs-features { min-height: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tcs-overlay,
  .tcs-dialog { transition-duration: 1ms; }
  .tcs-dialog { transform: none; }
}
