:root {
  --logo-white: #faf9f6;
  --logo-text: #595959;

  --tone-900: #2f2f2f;
  --tone-800: #3f3f3f;
  --tone-700: #4d4d4d;
  --tone-600: #595959;
  --tone-500: #707070;
  --tone-300: #c6c2bc;
  --tone-200: #ddd9d3;
  --tone-100: #efece6;

  --bg: var(--logo-white);
  --surface: var(--logo-white);
  --surface-muted: #f6f4f0;
  --ink: var(--tone-800);
  --ink-soft: var(--tone-600);
  --line: var(--tone-200);
  --brand: var(--tone-800);
  --brand-strong: var(--tone-900);
  --brand-contrast: var(--logo-white);
  --radius: 14px;
  --shadow: 0 16px 36px rgba(10, 10, 10, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, #fffdfa 0%, transparent 35%),
    radial-gradient(circle at 95% 10%, var(--tone-100) 0%, transparent 30%),
    var(--bg);
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: Sora, "Segoe UI", sans-serif;
  line-height: 1.15;
  margin-top: 0;
}

p,
li {
  color: var(--ink-soft);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.section {
  padding: 2.4rem 0;
}

.eyebrow {
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--tone-700);
}

.frame {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.frame-soft {
  border: 1px dashed var(--line);
  background: var(--surface-muted);
  border-radius: calc(var(--radius) - 4px);
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: Sora, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 224px;
  height: 112px;
  object-fit: contain;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}

nav a {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
}

nav a[aria-current="page"] {
  color: var(--brand-strong);
}

.grid-two {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.8rem;
  align-items: stretch;
}

.hero-copy {
  padding: 1.2rem 0;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.hero-image {
  overflow: hidden;
  min-height: 380px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn {
  border: 1px solid var(--brand-strong);
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--brand-strong);
  color: var(--brand-contrast);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand-strong);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-wide {
  width: 100%;
}

.light-surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent);
}

.split-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.split-panel article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.cta {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1rem;
}

.cta .btn {
  margin-top: 0.75rem;
}

.page-head {
  margin-bottom: 1.4rem;
}

.quote-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.quote-form,
.quote-summary {
  padding: 1rem;
}

.quote-form {
  display: grid;
  gap: 0.75rem;
  position: relative; /* for drop zone overlay */
}

/* Drag & Drop Zone Overlay */
.drop-zone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(239, 236, 230, 0.9);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius);
  border: 3px dashed var(--tone-500);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.quote-form.drag-over .drop-zone-overlay {
  opacity: 1;
  pointer-events: auto;
}

.overlay-content {
  text-align: center;
  color: var(--brand-strong);
  font-weight: 700;
}

.upload-icon {
  margin-bottom: 0.5rem;
  stroke: var(--brand-strong);
}

/* 3D Preview */
.preview-wrap {
  width: 100%;
  background: var(--surface-muted);
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  overflow: hidden;
}

.preview-container {
  width: 100%;
  height: 320px;
  position: relative;
  outline: none;
  cursor: grab;
}

.preview-container:active {
  cursor: grabbing;
}

.preview-overlay-text {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tone-600);
  background: rgba(250, 249, 246, 0.85);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.file-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  gap: 1rem;
}

#upload-name {
  color: var(--ink-soft);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  border: 1px solid var(--tone-300);
  border-radius: 8px;
  padding: 0.62rem;
  font: inherit;
  background: var(--surface);
}

.upload-preview {
  padding: 0.8rem;
  text-align: center;
}

.upload-preview img {
  margin: 0 auto 0.5rem;
  width: 120px;
}

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

.quote-summary h2 {
  margin-bottom: 0.4rem;
}

.price {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--brand-strong);
  margin: 0;
}

.delivery {
  font-weight: 700;
  margin-top: 0.2rem;
}

.estimate-breakdown {
  margin: 1rem 0;
}

.estimate-breakdown dl {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.estimate-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.35rem;
}

.estimate-breakdown dt {
  color: var(--tone-700);
}

.estimate-breakdown dd {
  margin: 0;
  font-weight: 700;
}

.shop-toolbar {
  margin-bottom: 1rem;
}

.shop-toolbar label {
  width: min(280px, 100%);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.product-card {
  overflow: hidden;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-body {
  padding: 0.8rem;
}

.chip {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--tone-300);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.product-price {
  font-size: 1.2rem;
  color: var(--brand-strong);
  font-weight: 800;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 2.6rem;
}

.footer-wrap {
  min-height: 64px;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 980px) {
  .grid-two,
  .quote-layout,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .hero-image {
    min-height: 300px;
  }

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

@media (max-width: 640px) {
  .section {
    padding: 1.8rem 0;
  }

  .nav-wrap {
    min-height: 66px;
    gap: 0.5rem;
  }

  .brand span {
    font-size: 0.95rem;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  nav ul {
    gap: 0.55rem;
  }

  nav a {
    font-size: 0.72rem;
  }

  .form-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Nav Cart Badge */
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tone-500);
  color: var(--brand-contrast);
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  font-weight: 800;
  margin-left: 0.2rem;
  vertical-align: middle;
  transition: background 0.3s, transform 0.3s;
}
.cart-badge.has-items {
  background: #d32f2f;
  transform: scale(1.1);
}

/* Account Dropdown in Navigation */
.user-menu-item {
  position: relative;
  cursor: pointer;
}
.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
}
.dropdown-icon {
  transition: transform 0.3s;
}
.user-menu-item:hover .dropdown-icon {
  transform: rotate(180deg);
}
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 100;
}
.user-menu-item:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown li {
  padding: 0;
  margin: 0;
}
.user-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s;
}
.user-dropdown a:hover {
  background: var(--surface-muted);
  color: var(--brand-strong);
}

/* Cart & Checkout Layout */
.cart-layout {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 1.25rem;
  align-items: start;
}
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cart-item-card {
  display: flex;
  gap: 1rem;
  padding: 0.85rem;
  align-items: center;
}
.cart-item-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}
.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cart-item-details h3 {
  margin: 0;
  font-size: 1rem;
}
.cart-item-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.35;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.qty-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.qty-btn {
  border: 1px solid var(--tone-300);
  background: var(--surface);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.qty-btn:hover {
  background: var(--surface-muted);
}
.qty-val {
  font-weight: 700;
  font-size: 0.88rem;
  width: 22px;
  text-align: center;
}
.remove-btn {
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.remove-btn:hover {
  background: rgba(198, 40, 40, 0.06);
}

/* Auth Pages */
.auth-container {
  max-width: 440px;
  margin: 2rem auto;
  padding: 1.5rem;
}
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  margin-bottom: 1.25rem;
}
.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.auth-tab-btn.active {
  color: var(--brand-strong);
  border-bottom: 2px solid var(--brand-strong);
  margin-bottom: -2px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.auth-error {
  color: #c62828;
  background: rgba(198, 40, 40, 0.05);
  border: 1px solid rgba(198, 40, 40, 0.2);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
}

/* Admin Panel layout */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-tab-nav {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.admin-tab-nav.active {
  background: var(--brand-strong);
  color: var(--brand-contrast);
}
.admin-tab-nav:not(.active):hover {
  background: var(--surface-muted);
  color: var(--brand-strong);
}
.admin-content {
  padding: 1.5rem;
}
.admin-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}
.admin-orders-table, .admin-products-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.admin-orders-table th, .admin-orders-table td,
.admin-products-table th, .admin-products-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-size: 0.82rem;
}
.admin-orders-table th, .admin-products-table th {
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--surface-muted);
}
.admin-order-items-list {
  padding-left: 1.2rem;
  margin: 0.2rem 0;
  font-size: 0.78rem;
}

/* Order status pills */
.status-pill {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 99px;
  padding: 0.18rem 0.45rem;
  letter-spacing: 0.04em;
}
.status-pending { background: #fff9c4; color: #f57f17; border: 1px solid #ffe082; }
.status-inprogress { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-shipped { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.status-completed { background: #f3e5f5; color: #6a1b9a; border: 1px solid #d1c4e9; }
.status-cancelled { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* Grid / table responsive overrides */
@media (max-width: 980px) {
  .cart-layout, .admin-layout {
    grid-template-columns: 1fr;
  }
}