/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.brand-dot { color: var(--clay); }

.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .main-nav { display: flex; }
  .mobile-only { display: none !important; }
}

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--secondary); color: var(--foreground); }
.nav-link.active { background: var(--secondary); color: var(--foreground); box-shadow: var(--shadow-soft); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn:hover:not(:disabled) { opacity: 0.92; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-clay { background: var(--clay); color: var(--clay-foreground); box-shadow: var(--shadow-soft); }
.btn-ocean { background: var(--ocean); color: var(--ocean-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-outline { background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-soft); }
.btn-outline:hover:not(:disabled) { background: var(--secondary); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--secondary); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }

.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.78rem 1.4rem; font-size: 0.95rem; }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-highlight { background: var(--highlight); color: var(--highlight-foreground); }
.badge-clay { background: var(--clay); color: var(--clay-foreground); }
.badge-ocean { background: var(--ocean); color: var(--ocean-foreground); }
.badge-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.badge-success { background: var(--success); color: var(--success-foreground); }
.badge-glass { background: color-mix(in oklab, var(--card) 90%, transparent); color: var(--foreground); backdrop-filter: blur(8px); }

/* Cards */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
}

.card-pad { padding: 1.25rem; }
.card-pad-lg { padding: 1.75rem; }

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.product-card:hover .product-media img { transform: scale(1.05); }

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Hero */
.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--primary);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.14));
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-block: 6rem 3.5rem;
  color: #f8fafc;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.hero-title {
  margin: 0.6rem 0 0;
  max-width: 42rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 800;
  line-height: 0.94;
  text-transform: uppercase;
}

.hero-sub {
  margin-top: 1rem;
  max-width: 32rem;
  color: #e2e8f0;
  font-size: 1.05rem;
}

/* Shopping location header (borderless, no background card) */
.shop-location-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .shop-location-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

/* Tabs */
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tab-btn {
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.tab-btn:hover { background: var(--secondary); color: var(--foreground); }
.tab-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: var(--shadow-soft);
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.label { font-size: 0.82rem; font-weight: 600; color: var(--foreground); }

.input, .select, .textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.9rem;
}

.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--ocean);
  outline-offset: 1px;
}

.textarea { min-height: 5.5rem; resize: vertical; }

/* Dropdowns */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 14rem;
  padding: 0.35rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-elevated);
  z-index: 60;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-label {
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dropdown-sep { height: 1px; background: var(--border); margin: 0.3rem 0; }
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--secondary); }

/* Slide-out Drawer & Modals */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 16, 28, 0.52);
  backdrop-filter: blur(2px);
  z-index: 70;
  display: none;
}
.backdrop.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100vw, 27rem);
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  z-index: 80;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.drawer-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open { display: flex; }
.modal-panel {
  position: relative;
  z-index: 92;
  width: min(100%, 34rem);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-float);
  padding: 1.5rem;
}

/* Option chips & swatches */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.chip.selected {
  border-color: var(--ocean);
  background: color-mix(in oklab, var(--ocean) 14%, var(--card));
  color: var(--foreground);
  font-weight: 600;
}
.swatch-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
}

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); }
.table tr.highlight-row { background: color-mix(in oklab, var(--ocean) 14%, transparent); font-weight: 600; }

/* Alerts & Toasts */
.flash-stack { padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}
.alert-success { background: color-mix(in oklab, var(--success) 12%, var(--card)); border-color: var(--success); }
.alert-error { background: color-mix(in oklab, var(--destructive) 12%, var(--card)); border-color: var(--destructive); color: var(--destructive); }
.alert-warning { background: color-mix(in oklab, var(--highlight) 22%, var(--card)); border-color: var(--highlight); }
.alert-info { background: var(--surface); }

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
}
.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-elevated);
  font-size: 0.85rem;
  animation: fadeUp 0.2s ease both;
}
.toast.toast-warning { background: var(--highlight); color: var(--highlight-foreground); }
.toast.toast-error { background: var(--destructive); color: var(--destructive-foreground); }

/* Tooltip */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-box {
  position: absolute;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 16rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
}
.tooltip-wrap:hover .tooltip-box, .tooltip-wrap:focus-within .tooltip-box { opacity: 1; }

/* Cart item card */
.bag-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
}
.bag-item.unavailable {
  border-color: var(--destructive);
  background: color-mix(in oklab, var(--destructive) 6%, var(--card));
}
.bag-item-img {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
}
.qty-stepper button {
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  background: transparent;
  border-radius: 0.35rem;
  cursor: pointer;
}
.qty-stepper button:hover { background: var(--secondary); }

/* Admin order product preview card */
.order-item-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--background);
}
.order-item-card img {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}