:root {
  --bg: #ffffff;
  --surface: #f5f5f4;
  --surface-alt: #fafaf9;
  --ink: #0d0d0d;
  --ink-muted: #525252;
  --border: #e5e5e5;
  --border-strong: #171717;
  --accent: #8b2e1e;
  --accent-ink: #ffffff;
  --danger: #991b1b;
  --success: #166534;
  --focus-ring: #0d0d0d;
  --header-h: 64px;
  --font-display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Base-layer pointer affordance (R-39) */
a[href],
button:not(:disabled),
summary,
select:not(:disabled),
label[for],
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
[role="tab"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Accessible focus indicator (R-32) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  padding: 4px 0;
}

.brand-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  color: var(--accent);
}

.nav-btn.is-active {
  border-bottom-color: var(--ink);
  font-weight: 700;
}

.nav-btn--owner {
  color: var(--accent);
}

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

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface);
}

.icon-btn:active {
  background: var(--border);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
}

.role-pill--owner {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.mobile-only-btn {
  display: none;
}

/* Main container */
.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.page-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.page-section--flush {
  max-width: 100%;
  padding: 0 0 48px;
}

/* Lookbook Hero Carousel (SUVS-inspired) */
.lookbook-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
}

.lookbook-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lookbook-slide {
  flex: 0 0 50%;
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 78dvh;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--bg);
}

.lookbook-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.lookbook-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  color: var(--ink);
}

.lookbook-placeholder-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.lookbook-placeholder-sub {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.carousel-arrow:hover {
  background: var(--ink);
  color: var(--bg);
}

.carousel-arrow--prev {
  left: 16px;
}

.carousel-arrow--next {
  right: 16px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: transparent;
  position: relative;
}

/* Ensure 44px touch target around small dot via pseudo-element */
.carousel-dot::after {
  content: "";
  position: absolute;
  inset: -17px;
}

.carousel-dot.is-active {
  background: var(--ink);
}

.hero-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1440px;
  margin: 24px auto 0;
  padding: 0 180px 0 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #262626;
}

.btn:active {
  background: #404040;
}

.btn--secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--surface);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--accent:hover {
  background: #702316;
}

.btn--danger {
  background: var(--bg);
  border-color: var(--danger);
  color: var(--danger);
}

.btn--danger:hover {
  background: var(--danger);
  color: var(--bg);
}

.btn--sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.8125rem;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* Filter chips */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-chip {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-chip:hover {
  border-color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Product Grid (3-state responsive: 1 col -> 2 col -> 3/4 col) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--bg);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.product-media-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.product-name-btn {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
}

.product-name-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.detail-media {
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.size-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.size-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
}

.size-btn:hover {
  background: var(--surface);
}

.size-btn.is-active {
  background: var(--ink);
  color: var(--bg);
}

.size-chart-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

/* Full Product Detail Page (Multi-POV Gallery + Size + Qty + Size Chart) */
.pdp-back-btn {
  margin-bottom: 20px;
}

.pdp-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: start;
}

.pdp-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pdp-main-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pdp-main-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.pdp-pov-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdp-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pdp-thumb-btn {
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pdp-thumb-btn.is-active {
  border: 2px solid var(--ink);
}

.pdp-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-thumb-caption {
  position: absolute;
  inset-x: 0;
  bottom: 0;
  background: rgba(13, 13, 13, 0.78);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 4px;
  text-align: center;
  width: 100%;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  margin: 8px 0 18px;
}

.qty-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
}

.qty-btn:hover {
  background: var(--surface);
}

.qty-val {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .pdp-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.product-tee-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  gap: 12px;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.product-collection {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0;
}

.product-price {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.product-desc {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0;
  flex: 1;
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.product-actions .btn {
  flex: 1;
}

/* States: Empty / Loading / Error (R-27) */
.state-box {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.state-box--error {
  border-color: var(--danger);
  color: var(--danger);
}

.state-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.state-desc {
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 0;
  font-size: 0.9375rem;
}

/* Owner Workspace */
.owner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.panel-card {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 24px;
}

.panel-card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--surface-alt);
}

.inline-price-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-price-input {
  width: 130px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.thumb-sm {
  width: 48px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: 0;
}

.status-msg {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
}

.status-msg--error {
  border-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

.status-msg--success {
  border-color: var(--success);
  color: var(--success);
  background: #f0fdf4;
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(13, 13, 13, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 24px;
}

.modal-card--wide {
  max-width: 640px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tab-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(13, 13, 13, 0.5);
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer-panel {
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.mobile-menu-panel {
  width: 100%;
  max-width: 320px;
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-right: auto;
}

/* Footer + Floating Currency Switcher (non-overlapping) */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 24px 24px 80px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.currency-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.currency-select {
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Responsive Breakpoints (3 states: Mobile < 640px, Tablet 640-1024px, Desktop > 1024px) */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .mobile-only-btn {
    display: inline-flex;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 12px;
  }

  .page-section {
    padding: 20px 16px 64px;
  }

  .lookbook-slide {
    flex: 0 0 100%;
    border-right: 0;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .form-row-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hide-on-mobile {
    display: none;
  }

  .header-actions .role-pill {
    display: none;
  }

  .hero-cta-bar {
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
