/* =========================================================
   LOOMCRAFT (ASP.NET) — design tokens
   Palette:
     --putty     #E8E2D6  background
     --forest    #2F4538  primary / header
     --sienna    #BC6C3D  accent
     --charcoal  #2B2825  text
     --gold      #D4AF6A  highlight
     --paper     #FAF7F1  card surface
   Type:
     Display — Fraunces (headings only)
     Body    — Inter
     Label   — Space Mono (prices, tags, meta)
   ========================================================= */

:root {
  --putty: #e8e2d6;
  --forest: #2f4538;
  --forest-dark: #233329;
  --sienna: #bc6c3d;
  --charcoal: #2b2825;
  --gold: #d4af6a;
  --paper: #faf7f1;
  --line: rgba(43, 40, 37, 0.14);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-label: "Space Mono", monospace;

  --radius: 4px;
  --shadow-card: 0 1px 2px rgba(43, 40, 37, 0.08), 0 8px 24px rgba(43, 40, 37, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--putty);
  color: var(--charcoal);
  font-family: var(--font-body);
  line-height: 1.5;
}

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

a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--sienna);
  outline-offset: 2px;
}

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--forest);
  color: var(--paper);
  border-bottom: 1px solid var(--forest-dark);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--paper);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.logo span {
  color: var(--gold);
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  font-weight: 400;
}

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

.main-nav a {
  text-decoration: none;
  color: var(--paper);
  font-size: 0.95rem;
  opacity: 0.9;
}

.main-nav a:hover { opacity: 1; }

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(250, 247, 241, 0.35);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--paper);
}

.cart-link:hover { border-color: var(--gold); }

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--gold);
  color: var(--forest-dark);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: var(--forest);
  color: var(--paper);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}

.hero-eyebrow {
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 18px;
}

.hero h1 em { font-style: italic; color: var(--gold); }

.hero p {
  font-size: 1.02rem;
  max-width: 38ch;
  color: rgba(250, 247, 241, 0.82);
  margin: 0;
}

.swatch-stack {
  position: relative;
  height: 300px;
}

.swatch-tag {
  position: absolute;
  width: 170px;
  height: 210px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px;
  color: var(--charcoal);
  display: flex;
  flex-direction: column;
}

.swatch-tag .swatch-fill {
  flex: 1;
  border-radius: 2px;
  position: relative;
}

.swatch-tag .swatch-fill::after {
  content: "";
  position: absolute;
  top: 10px; left: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

.swatch-tag .swatch-label {
  font-family: var(--font-label);
  font-size: 0.68rem;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}

.swatch-1 { transform: rotate(-9deg) translate(-70px, 10px); z-index: 1; left: 50%; }
.swatch-2 { transform: rotate(4deg) translate(50px, -20px); z-index: 2; left: 50%; }
.swatch-3 { transform: rotate(-2deg) translate(-10px, 50px); z-index: 3; left: 50%; }

/* =========================================================
   SHOP SECTION
   ========================================================= */
.shop { padding: 56px 0 72px; }

.shop-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.shop-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
}

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-label);
  font-size: 0.75rem;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  color: var(--charcoal);
  text-decoration: none;
}

.filter-pill:hover { border-color: var(--sienna); }

.filter-pill.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-swatch {
  height: 150px;
  position: relative;
  border-bottom: 1px dashed var(--line);
}

.product-swatch::after {
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

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

.product-category {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sienna);
  margin: 0;
}

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

.product-fabric {
  font-size: 0.82rem;
  color: rgba(43, 40, 37, 0.65);
  margin: 0;
}

.product-price {
  font-family: var(--font-label);
  font-size: 1rem;
  margin: 4px 0;
}

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

.product-options select {
  flex: 1;
  font-family: var(--font-label);
  font-size: 0.78rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--putty);
  color: var(--charcoal);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--sienna); color: var(--paper); width: 100%; margin-top: 10px; }
.btn-primary:hover { background: #a85e34; }

.btn-ghost {
  background: transparent;
  border-color: rgba(250, 247, 241, 0.35);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-outline {
  background: transparent;
  border-color: var(--charcoal);
  color: var(--charcoal);
}
.btn-outline:hover { border-color: var(--sienna); color: var(--sienna); }

/* =========================================================
   CART PAGE
   ========================================================= */
.cart-page { padding: 48px 0 72px; }

.cart-page h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 24px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.cart-table th {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  background: var(--forest);
  color: var(--paper);
}

.cart-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}

.cart-table tr:last-child td { border-bottom: none; }

.cart-swatch {
  width: 48px;
  height: 48px;
  border-radius: 2px;
}

.cart-table .item-name { font-weight: 600; }

.cart-table .item-meta {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: rgba(43, 40, 37, 0.6);
}

.qty-input {
  width: 56px;
  font-family: var(--font-label);
  font-size: 0.9rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  color: var(--sienna);
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.update-btn {
  background: none;
  border: none;
  color: var(--forest);
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

.cart-summary {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.cart-summary-box {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-label);
  font-size: 1.1rem;
}

.cart-empty, .checkout-message {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--font-label);
  font-size: 0.9rem;
}

.cart-empty { color: rgba(43, 40, 37, 0.55); }

.checkout-message {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--forest);
  margin-bottom: 20px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--forest-dark);
  color: rgba(250, 247, 241, 0.7);
  padding: 32px 0;
  margin-top: 40px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

.site-footer strong {
  color: var(--paper);
  font-family: var(--font-display);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .hero .container {
    grid-template-columns: 1fr;
    padding-top: 36px;
    padding-bottom: 36px;
  }
  .swatch-stack { height: 220px; margin-top: 16px; }
  .swatch-tag { width: 140px; height: 175px; }
  .swatch-1, .swatch-2, .swatch-3 { left: 20%; }
}

@media (max-width: 540px) {
  .main-nav a:not(.cart-link) { display: none; }
  .hero h1 { font-size: 2rem; }
  .cart-table { font-size: 0.85rem; }
  .cart-table th, .cart-table td { padding: 10px 8px; }
  .cart-summary-box { width: 100%; }
}

/* ===== Admin Login Button (header) ===== */
.admin-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 106, 0.4);
  color: var(--gold) !important;
  background: rgba(212, 175, 106, 0.08);
  text-decoration: none;
  transition: all 0.15s ease;
  opacity: 1 !important;
}

.admin-login-btn:hover {
  background: rgba(212, 175, 106, 0.18);
  border-color: var(--gold);
}
