/* ---------------------------------------------------------------------------
 * components.css — shared shell components: header, footer, flash, service card,
 * and the site-wide FORM SYSTEM (inputs, selects, checkboxes, radio cards,
 * field-level errors).
 *
 * The form system lives here, not in a page sheet, because checkout, contact,
 * sign-in, sign-up, password reset and the account pages must all look and
 * behave identically. Add to it here; never restyle a control in a page sheet.
 *
 * Loads AFTER tokens/*.css and base.css. Token references only — no literals.
 * ------------------------------------------------------------------------- */

/* ===========================================================================
   HEADER
   Dark glass bar, sticky. Mobile menu is a CSS-only checkbox toggle so the
   navigation still works with JavaScript unavailable or still loading.
   =========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 15, .9);
  -webkit-backdrop-filter: blur(var(--blur-header));
  backdrop-filter: blur(var(--blur-header));
  border-bottom: 1px solid var(--border-hairline);
}

.site-header__inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-8));
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

/* ---- wordmark ---- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.wordmark:hover { color: inherit; }

.wordmark__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--gradient-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

/* ---- primary nav ---- */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}
.site-nav__link {
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.site-nav__link:hover,
.site-nav__link.is-active { color: var(--text-primary); }
.site-nav__link.is-active { position: relative; }
.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
}

/* ---- right-hand actions ---- */
.site-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.site-actions__link {
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.site-actions__link:hover { color: var(--text-primary); }

/* ---- currency switcher ---- */
.currency-switch { display: inline-flex; align-items: center; }
.currency-switch__select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5) var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.currency-switch__select:hover { border-color: var(--border-hairline-hover); color: var(--text-primary); }
.currency-switch__select option { background: var(--surface-2); color: var(--text-primary); }

/* ---- cart ---- */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
}
.cart-link:hover { color: var(--text-primary); }
.cart-link__badge {
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- hamburger (CSS-only toggle) ---- */
.nav-toggle__cb { display: none; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--border-hairline-hover); }
.nav-toggle__open  { display: block; }
.nav-toggle__close { display: none; }
.nav-toggle__cb:checked ~ .site-header .nav-toggle__open  { display: none; }
.nav-toggle__cb:checked ~ .site-header .nav-toggle__close { display: block; }

/* ---- mobile panel ---- */
.mobile-panel {
  display: none;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-hairline);
  padding: var(--space-6) clamp(var(--space-5), 4vw, var(--space-8)) var(--space-7);
  flex-direction: column;
  gap: var(--space-5);
}
.nav-toggle__cb:checked ~ .mobile-panel { display: flex; }

.mobile-panel__link {
  font-family: var(--font-display);
  font-size: var(--body-size);
  font-weight: 600;
  color: var(--text-secondary);
}
.mobile-panel__link:hover,
.mobile-panel__link.is-active { color: var(--text-primary); }

.mobile-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-5);
  margin-top: var(--space-1);
}

/* Breakpoint matches the design's 1180px mobile switch. */
@media (max-width: 1180px) {
  .site-nav,
  .site-actions { display: none; }
  .nav-toggle   { display: flex; }
}

/* ===========================================================================
   FLASH MESSAGES — semantic tokens, one block per type.
   =========================================================================== */
.flash-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-5);
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--body-sm-size);
  line-height: var(--body-sm-lh);
}
.flash__dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 7px;
  background: currentColor;
}
.flash--success { background: var(--success-tint); border-color: var(--success-border); color: var(--success); }
.flash--error   { background: var(--error-tint);   border-color: var(--error-border);   color: var(--error); }
.flash--warning { background: var(--warning-tint); border-color: var(--warning-border); color: var(--warning); }
.flash--info    { background: var(--info-tint);    border-color: var(--info-border);    color: var(--info); }
.flash__text { color: var(--text-primary); }

/* ===========================================================================
   SERVICE CARD
   =========================================================================== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--elev-1), var(--elev-1-highlight);
  height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.service-card:hover {
  border-color: rgba(56, 189, 248, .35);
  box-shadow: var(--elev-2), var(--elev-2-highlight);
}
/* Tighter padding for dense grids (the partial's `compact` local). */
.service-card--compact { padding: var(--space-5); }

.service-card__media {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.service-card__media img { width: 100%; height: 100%; object-fit: cover; }

.service-card__badges {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  display: flex;
  gap: var(--space-2);
}
.badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-hairline);
  background: var(--surface-3);
  color: var(--text-secondary);
}
.badge--featured {
  background: var(--gradient-accent);
  color: #fff;
  border-color: transparent;
}

.service-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.service-card__title a { color: inherit; }
.service-card__title a:hover { color: var(--accent-purple); }

.service-card__desc {
  font-size: var(--body-sm-size);
  line-height: 1.55;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0;
}

.service-card__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: auto;
}
.service-card__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-primary);
}
.service-card__unit {
  font-size: 13px;
  color: var(--text-muted);
}

.service-card__cta {
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
  color: var(--accent-purple);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* ===========================================================================
   FOOTER
   =========================================================================== */
.site-footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border-hairline);
  padding: clamp(var(--space-8), 6vw, var(--space-9)) 0 var(--space-7);
  margin-top: auto;
}

/* Four columns: brand, site links, legal links, contact — per the approved
   footer layout. The brand column is wider because it carries the blurb. */
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.15fr 1.25fr;
  gap: var(--space-8);
  margin-bottom: var(--space-9);
}

.site-footer__brand {
  min-width: 0;
  max-width: 360px;
}
.site-footer__blurb {
  font-size: var(--body-sm-size);
  line-height: 1.6;
  font-weight: 300;
  color: var(--text-secondary);
  margin: var(--space-4) 0 var(--space-5);
}

.site-footer__socials { display: flex; gap: var(--space-3); }
.site-footer__social {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}
.site-footer__social:hover { color: var(--text-primary); background: var(--surface-3); }

.site-footer__col-title {
  font-family: var(--font-display);
  color: var(--text-muted);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.site-footer__links a,
.site-footer__links span {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: var(--body-sm-size);
}
.site-footer__links a:hover { color: var(--text-primary); }

.site-footer__legal {
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
}
.site-footer__legal small {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  display: block;
}
.site-footer__identity { max-width: 70ch; }

@media (max-width: 960px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-7); }
  .site-footer__brand { grid-column: span 2; max-width: none; }
}

@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__brand { grid-column: span 1; }
  .site-footer__legal { flex-direction: column; }
}
