/* =========================================================
   Concordia Store — Design System
   Matches the Concordia brand guide: Twilight Indigo / Warm Mist /
   Coral / Starlight Gold / Periwinkle / Plum-Slate, Fraunces + Nunito,
   constellation "C" motif, "Many Stars, One Sky" tagline.
   ========================================================= */

:root {
  /* Brand colors — exact values from the Concordia brand guide */
  --indigo: #4A4670;       /* Twilight Indigo */
  --mist: #F6F1EA;         /* Warm Mist */
  --white: #FFFFFF;
  --coral: #E88A6C;        /* Coral */
  --coral-deep: #89616E;   /* Coral, darkened for AA-safe text use on light bg */
  --gold: #D4AF6A;         /* Starlight Gold */
  --periwinkle: #8B96C9;
  --plum: #6B6478;         /* Plum-Slate */
  --muted-on-dark: #C2BEC5;
  --border-tint: #CCC7C8;

  /* Semantic aliases */
  --color-bg: var(--mist);
  --color-surface: var(--white);
  --color-text: var(--indigo);
  --color-text-muted: var(--plum);
  --color-border: var(--border-tint);

  --color-accent: var(--coral);          /* fills: buttons, icons, decorative stars */
  --color-accent-text: var(--coral-deep); /* AA-safe coral for text on light bg (price, links) */
  --color-on-accent: var(--indigo);      /* text placed on a coral fill */

  --color-dark: var(--indigo);           /* header / footer bands */
  --color-on-dark: var(--mist);
  --color-on-dark-muted: var(--muted-on-dark);

  --color-focus: #2F6FDA; /* high-contrast focus ring, distinct from brand hues */

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 10px rgba(74, 70, 112, 0.10);
  --shadow-card-hover: 0 6px 18px rgba(74, 70, 112, 0.16);

  --max-width: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-text); }
ul, ol { padding-left: 1.25em; }
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -6rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.75em 1.25em;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.15s ease;
  text-decoration: none;
  font-weight: 800;
}
.skip-link:focus {
  top: 1rem;
}

/* Visible focus states everywhere — do not remove */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
section { padding: 3rem 0; }

/* ---------- Header / nav (dark indigo band) ---------- */
.site-header {
  background: var(--color-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-on-dark);
}
.brand:hover { color: var(--color-on-dark); }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--color-on-dark);
}
.brand-name .sub {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--color-on-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4em 0.1em;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
}
/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.75em 1.6em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.btn-primary:hover { background: var(--gold); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.btn-secondary:hover {
  background: var(--color-text);
  color: var(--color-on-dark);
}
.btn[aria-disabled="true"] {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  pointer-events: none;
}
.btn-block { width: 100%; }
.nav-cta { padding: 0.5em 1.4em; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}
.hero-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.85;
}
.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.hero .tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}
.hero p.lede {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
}
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.product-card a.product-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card-media {
  aspect-ratio: 1 / 1;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body {
  padding: 1.1rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}
.product-card-body h3 { margin-bottom: 0; font-size: 1.1rem; }
.product-card-price {
  font-weight: 800;
  color: var(--color-accent-text);
  font-size: 1.05rem;
}
.product-card-desc {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.product-detail-media {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.product-detail-media img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-accent-text);
  margin: 0.25rem 0 0.5rem;
}
.field-group { margin-bottom: 1.5rem; }
.field-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4em;
}
select, input[type="number"] {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.6em 0.8em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 180px;
}
.ship-line {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0 0 1rem;
}
.ship-line a { color: var(--color-text-muted); text-decoration: underline; }
.ship-line a:hover { color: var(--indigo); }

/* ---------- Cards / generic sections ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.section-heading p { color: var(--color-text-muted); }

.three-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.three-up .card { text-align: left; }
.three-up .card h3 { display: flex; align-items: center; gap: 0.5em; }
.icon-star { width: 22px; height: 22px; color: var(--coral-deep); flex-shrink: 0; }

/* ---------- FAQ ---------- */
.faq-group-heading {
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.2rem;
}
.faq-group-heading:first-of-type { margin-top: 0; }
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.1rem;
  padding: 1.1rem 0.25rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--coral-deep);
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer {
  padding: 0 0.25rem 1.25rem;
  color: var(--color-text-muted);
}

/* ---------- Confirmation ---------- */
.confirmation {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.confirmation .icon-large {
  width: 64px;
  height: 64px;
  color: var(--coral-deep);
  margin: 0 auto 1.5rem;
}

/* ---------- Cart ---------- */
.cart-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 1.1rem;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.cart-item-media {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
  flex-shrink: 0;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info h3 { font-size: 1.05rem; margin-bottom: 0.15em; }
.cart-item-info .cart-item-variant {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin: 0 0 0.5em;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cart-item-controls label {
  font-size: 0.85rem;
  font-weight: 700;
}
.cart-item-controls input[type="number"] {
  width: 4.5em;
  min-width: 0;
  padding: 0.4em 0.5em;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  text-decoration: underline;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.3em 0;
}
.cart-item-remove:hover { color: var(--coral-deep); }
.cart-item-price {
  text-align: right;
  font-weight: 800;
  color: var(--color-accent-text);
  white-space: nowrap;
}
.cart-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cart-summary .cart-total {
  font-size: 1.3rem;
  font-weight: 800;
}
.cart-status {
  margin-top: 1rem;
  font-weight: 700;
}
.cart-status[data-tone="error"] { color: var(--coral-deep); }
.cart-empty {
  text-align: center;
  padding: 2rem 0;
}

/* ---------- Footer (dark indigo band) ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-on-dark-muted);
  margin-top: 4rem;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}
.site-footer strong { color: var(--color-on-dark); }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--color-on-dark);
  text-decoration: none;
  font-weight: 700;
}
.footer-nav a:hover { color: var(--coral); text-decoration: underline; }
.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: 0.5rem;
  color: var(--color-on-dark-muted);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 2.5rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .product-detail { grid-template-columns: 1fr; gap: 2rem; }
  .main-nav ul { gap: 1.1rem; }
}

@media (max-width: 600px) {
  .site-header .container { flex-wrap: wrap; }
  .main-nav ul { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  section { padding: 2.25rem 0; }
  .cart-item {
    grid-template-columns: 64px 1fr;
    grid-template-areas: "media info" "price price";
  }
  .cart-item-media { width: 64px; height: 64px; grid-area: media; }
  .cart-item-info { grid-area: info; }
  .cart-item-price { grid-area: price; text-align: left; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
