@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --brand-logo-height: clamp(104px, 14vw, 168px);
  --brand-logo-max-width: min(880px, 90vw);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.top-strip {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 12px;
  padding: 8px 0;
}

.top-strip .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.brand-logo__image {
  height: var(--brand-logo-height);
  width: auto;
  max-width: var(--brand-logo-max-width);
  object-fit: contain;
  display: block;
  image-rendering: auto;
}

.search-form {
  flex: 1 1 320px;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.search-form input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.search-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}

.search-form button:hover { background: var(--primary-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.hero {
  padding: 72px 0;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #1e40af 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1617814076367-b759c7d7e738?q=80&w=1400') center/cover;
  opacity: 0.12;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.hero-search {
  display: flex;
  gap: 0;
  max-width: 560px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-size: 15px;
}

.hero-search button {
  border: none;
  background: var(--success);
  color: #fff;
  font-weight: 800;
  padding: 0 22px;
  cursor: pointer;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 32px 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.section-title {
  margin: 48px 0 20px;
}

.section-title h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.page-head {
  padding: 28px 0 8px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.page-head .meta {
  color: var(--muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  gap: 16px;
  padding: 16px 0 48px;
}

.product-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.product-card .media {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 180px;
}

.product-card h2 {
  margin: 0;
  font-size: 18px;
}

.product-card .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
}

.chip strong { color: var(--text); }

.price-block {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.price-main {
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
}

.price-sub {
  font-size: 13px;
  color: var(--muted);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--success);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover { filter: brightness(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 0 48px;
}

.detail-gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-main-image {
  width: 100%;
  min-height: 280px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 12px;
}

.thumb-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.thumb-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.detail-panel h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

.detail-desc {
  margin-top: 20px;
  color: #334155;
  white-space: pre-wrap;
}

.empty-state, .loading-state, .error-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  margin: 24px 0 48px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 32px 0;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover { color: var(--primary); }

.checkout-page {
  padding: 32px 0 48px;
}

.checkout-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.checkout-card h1 {
  margin: 0 0 24px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.checkout-form {
  display: grid;
  gap: 16px;
}

.checkout-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkout-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.checkout-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.checkout-input:disabled {
  background: #f8fafc;
  color: var(--muted);
}

.checkout-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.checkout-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.checkout-price-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
}

.checkout-price-box p {
  margin: 0 0 8px;
}

.checkout-price-box p:last-child {
  margin-bottom: 0;
}

.checkout-total {
  font-weight: 800;
  color: var(--success);
}

.checkout-submit {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.checkout-submit:hover {
  background: var(--primary-dark);
}

.checkout-back {
  display: block;
  margin-top: 20px;
  text-align: center;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.checkout-back:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Auth modal — component-style, no inline display overrides */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 16px;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal__panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: min(420px, calc(100% - 32px));
  box-shadow: var(--shadow);
}

.auth-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.auth-modal__header h2 {
  margin: 0;
  font-size: 20px;
}

.auth-modal__close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.auth-modal__form {
  display: grid;
  gap: 12px;
}

.auth-modal__input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.auth-modal__submit {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auth-modal__register {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* ── Account dashboard (Phase 2) ── */
.account-page {
  padding: 24px 0 48px;
}

.account-hero {
  margin-bottom: 24px;
}

.account-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.account-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.account-section {
  margin-bottom: 24px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-card__header {
  padding: 20px 20px 0;
}

.account-card__header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.account-card__header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-card__body {
  padding: 16px 20px 20px;
}

.account-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.account-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.account-form--inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-value {
  font-weight: 600;
  font-size: 15px;
}

.profile-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.entity-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.entity-card + .entity-card {
  margin-top: 12px;
}

.entity-card__title {
  margin: 0 0 4px;
  font-size: 16px;
}

.entity-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.entity-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.account-badge--success {
  background: #dcfce7;
  color: #166534;
}

.account-badge--info {
  background: #e0e7ff;
  color: #3730a3;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-danger:hover {
  filter: brightness(0.95);
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.order-card + .order-card {
  margin-top: 16px;
}

.order-card__header {
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.order-card__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}

.order-card__id {
  font-weight: 800;
  font-size: 15px;
}

.order-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.order-card__total {
  color: var(--success);
}

.order-card__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-card__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.order-card__item:last-child {
  border-bottom: none;
}

.order-card__item-name {
  font-weight: 600;
  font-size: 14px;
}

.order-card__item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.order-card__item-price {
  font-weight: 700;
  white-space: nowrap;
}

.state-block {
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
}

.state-block strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.state-block p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.state-block--loading {
  background: #f8fafc;
  border: 1px dashed var(--border);
}

.state-block--empty {
  background: #f8fafc;
  border: 1px dashed var(--border);
}

.state-block--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.state-block--error p {
  color: #b91c1c;
}

@media (min-width: 900px) {
  .account-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .order-card__stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .entity-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 860px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .account-form--inline {
    grid-template-columns: 1fr;
  }
}

/* ── Legal / trust pages (Phase 2) ── */
.legal-page {
  padding: 24px 0 48px;
}

.legal-page__head {
  margin-bottom: 20px;
}

.legal-page__head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.legal-page__head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.legal-notice {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #92400e;
}

.legal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.legal-content section + section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.legal-content h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.legal-content h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}

.legal-content p,
.legal-content li {
  color: #334155;
  font-size: 15px;
  line-height: 1.65;
}

.legal-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.legal-content dl {
  margin: 0;
}

.legal-content dt {
  font-weight: 700;
  margin-top: 12px;
  font-size: 14px;
}

.legal-content dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.contact-layout {
  display: grid;
  gap: 20px;
}

.contact-info-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.contact-form-card {
  display: grid;
  gap: 12px;
}

.contact-form-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.footer-copy {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}

@media (max-width: 860px) {
  :root {
    --brand-logo-height: clamp(88px, 24vw, 112px);
    --brand-logo-max-width: min(560px, 92vw);
  }

  .features { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .checkout-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root {
    --brand-logo-height: clamp(80px, 28vw, 100px);
    --brand-logo-max-width: min(480px, 94vw);
  }
}
