/* ================================================================
   WORNSUM — Design System
   ================================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --navy:        #0D1F3C;
  --navy-light:  #1a3356;
  --white:       #FFFFFF;
  --red:         #C8102E;
  --cream:       #E8DFCF;
  --cream-dark:  #D5C9B4;
  --bg:          #F5F1EB;       /* warm parchment — like unbleached canvas */
  --text:        #1A1A1A;
  --muted:       #6B7280;
  --border:      #DDD6C8;       /* warm border to match cream palette */
  --shadow-sm:   0 2px 8px rgba(13,31,60,.06);
  --shadow:      0 4px 20px rgba(13,31,60,.10);
  --shadow-lg:   0 8px 40px rgba(13,31,60,.18);
  --radius:      8px;
  --radius-sm:   4px;
  --ease:        0.22s ease;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --nav-h:       70px;

  /* Zigzag stitch SVG — used as repeating-x background */
  --stitch-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpolyline points='0,5 5,0 10,5 15,0 20,5' stroke='%23C8102E' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img   { display: block; max-width: 100%; }
a     { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
ul    { list-style: none; }

/* ── Typography ──────────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);  font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 0.9375rem; font-weight: 600; }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 0 0 rgba(200,16,46,.12);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* Logo */
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: 0.1em;
  color: var(--navy); text-transform: uppercase; flex-shrink: 0;
}
.logo-badge { flex-shrink: 0; }

/* Nav links */
.nav-links {
  display: flex; align-items: center; gap: 2px;
}
.nav-links a {
  display: block; padding: 7px 14px;
  font-size: 0.875rem; font-weight: 500;
  color: var(--muted); border-radius: var(--radius-sm);
  transition: color var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); }
.nav-links a.active::after {
  content: '';
  position: absolute; bottom: 0; left: 14px; right: 14px;
  height: 2px; background: var(--red); border-radius: 1px;
}

/* Cart button */
.nav-right { display: flex; align-items: center; gap: 8px; }
.cart-link {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: var(--navy); transition: background var(--ease);
}
.cart-link:hover { background: var(--bg); }
.cart-icon-wrap { position: relative; }
.cart-icon-wrap svg { display: block; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 100px; background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}

/* Hamburger */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; padding: 6px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--navy);
  border-radius: 2px; transition: transform var(--ease), opacity var(--ease);
  transform-origin: center;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================
   LAYOUT
   ================================================================ */
.page { min-height: 100vh; padding-top: var(--nav-h); }

.section { padding: 80px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header {
  margin-bottom: 40px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.section-tag {
  display: inline-block; margin-bottom: 6px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--red); text-transform: uppercase;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.02em;
  border: 2px solid transparent;
  /* Specific properties — never transition: all */
  transition: background 0.18s ease-out, border-color 0.18s ease-out,
              transform 0.16s ease-out, box-shadow 0.18s ease-out;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--red); border-color: var(--red);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.btn-primary:active { transform: scale(0.97); box-shadow: none; }
.btn-primary.added { background: #16a34a; border-color: #16a34a; }

/* Red CTA — used on hero "Shop the Collection" */
.btn-red {
  background: #C8102E !important;
  color: #FFFFFF !important;
  border-color: #C8102E !important;
}
.btn-red:hover {
  background: #a50d25 !important;
  border-color: #a50d25 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200,16,46,.40);
}
.btn-red:active { transform: scale(0.97); box-shadow: none; }

.btn-outline {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,.4);
}
.btn-outline:hover {
  border-color: rgba(255,255,255,.9); background: rgba(255,255,255,.08);
}
.btn-ghost {
  background: transparent; color: var(--navy); border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--navy); background: var(--bg); }

.btn-sm { padding: 8px 16px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  background: var(--navy);
  /* Warm cream stripe texture — low opacity to keep text readable */
  background-image: repeating-linear-gradient(
    180deg,
    transparent       0px, transparent       42px,
    rgba(232,223,207,.06) 42px, rgba(232,223,207,.06) 84px
  );
  padding: 108px 24px 100px;
  text-align: center;
  position: relative; overflow: hidden;
}
/* Red overlock zigzag stitch — inline element between h1 and p */
.hero-stitch {
  width: 100%;
  height: 10px;
  margin: 20px 0;
  background: var(--stitch-svg) repeat-x center;
  opacity: .65;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-tag {
  display: inline-block; margin-bottom: 22px;
  padding: 5px 16px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  color: rgba(255,255,255,.65); text-transform: uppercase;
}
.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero > .hero-content > p { color: rgba(255,255,255,.6); font-size: 1.1rem; margin-bottom: 40px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================================================================
   PRODUCT GRID
   ================================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.no-results {
  color: var(--muted); text-align: center;
  padding: 60px 0; grid-column: 1 / -1; font-size: 0.9375rem;
}

/* ── Product card ────────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.card-image {
  aspect-ratio: 1; overflow: hidden; background: var(--cream);
}
.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.product-card:hover .card-image img { transform: scale(1.05); }

.card-body { padding: 16px 18px 18px; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.card-category {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--red);
}
.card-size {
  font-size: 0.68rem; font-weight: 600; color: var(--muted);
  background: var(--cream); padding: 2px 9px; border-radius: 100px;
}
.card-name {
  color: var(--text); line-height: 1.35; margin-bottom: 14px;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-price { font-size: 1.0625rem; font-weight: 800; color: var(--navy); }

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-btn {
  padding: 8px 20px; border-radius: 100px;
  font-size: 0.8125rem; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--muted);
  background: var(--white); transition: all var(--ease);
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ================================================================
   ABOUT STRIP (home page)
   ================================================================ */
.about-strip {
  background: var(--navy);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 50px,
    rgba(255,255,255,.015) 50px, rgba(255,255,255,.015) 100px
  );
  padding: 72px 24px; text-align: center;
}
.stitch-line {
  width: 200px; height: 10px; margin: 0 auto 32px;
  background: var(--stitch-svg) repeat-x center;
}
.about-strip h2 { color: var(--white); margin-bottom: 14px; }
.about-strip > p { color: rgba(255,255,255,.6); max-width: 480px; margin: 0 auto 32px; }

/* ================================================================
   SHOP PAGE HEADER
   ================================================================ */
.shop-hero {
  background: var(--white);
  padding: 56px 24px 48px;
  border-bottom: 1px solid var(--border);
}
.shop-hero-inner { max-width: 1200px; margin: 0 auto; }
.shop-hero h1 { color: var(--navy); }
.shop-hero p  { margin-top: 8px; color: var(--muted); }

/* ================================================================
   CONTACT PAGE
   ================================================================ */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; align-items: start;
}
.contact-info h2   { color: var(--navy); margin-bottom: 12px; }
.contact-info > p  { margin-bottom: 32px; }

.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--text);
  font-size: 0.875rem; font-weight: 500;
  transition: border-color var(--ease), background var(--ease);
}
.contact-link:hover { border-color: var(--navy); background: var(--bg); }
.contact-link svg { color: var(--red); flex-shrink: 0; }

.form-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
  box-shadow: var(--shadow-sm);
}
.form-card h2 { color: var(--navy); margin-bottom: 28px; font-size: 1.25rem; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9375rem; color: var(--text);
  background: var(--white); outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(13,31,60,.08);
}
.form-group textarea { resize: vertical; min-height: 128px; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.contact-success {
  display: none; align-items: center; gap: 10px;
  margin-top: 16px; padding: 14px 18px; border-radius: var(--radius);
  background: #DCFCE7; border: 1px solid #86EFAC;
  font-size: 0.9rem; font-weight: 600; color: #166534;
}

/* ================================================================
   CART PAGE
   ================================================================ */
.cart-page-header {
  background: var(--white); padding: 48px 24px 40px;
  border-bottom: 1px solid var(--border);
}
.cart-page-header-inner { max-width: 1200px; margin: 0 auto; }
.cart-page-header h1 { color: var(--navy); }

.cart-layout {
  display: grid; grid-template-columns: 1fr 380px;
  gap: 32px; align-items: start;
}

/* Cart items */
.cart-row {
  position: relative;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: grid;
  grid-template-columns: 76px 1fr auto auto auto;
  gap: 16px; align-items: center;
  margin-bottom: 12px;
}
.cart-item-img {
  width: 76px; height: 76px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--cream); flex-shrink: 0;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-name {
  font-weight: 600; color: var(--text); font-size: 0.9375rem;
  margin-bottom: 4px; line-height: 1.3;
}
.cart-item-meta { font-size: 0.8125rem; color: var(--muted); }

.cart-item-qty { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--border); color: var(--text); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); transition: all var(--ease);
}
.qty-btn:hover { border-color: var(--navy); background: var(--navy); color: var(--white); }
.qty-num { font-weight: 700; min-width: 22px; text-align: center; font-size: 0.9375rem; }

.cart-item-price { font-weight: 800; color: var(--navy); font-size: 1rem; white-space: nowrap; }

.cart-remove {
  width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all var(--ease);
}
.cart-remove:hover { background: #FEE2E2; color: var(--red); }

/* Checkout sidebar */
.checkout-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  position: sticky; top: calc(var(--nav-h) + 24px);
  box-shadow: var(--shadow-sm);
}
.checkout-card h2 { font-size: 1.125rem; color: var(--navy); margin-bottom: 24px; }

.checkout-divider {
  height: 1px; background: var(--border); margin: 20px 0;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.cart-total-label { font-size: 0.875rem; color: var(--muted); font-weight: 600; }
.cart-total-amount { font-size: 1.25rem; font-weight: 800; color: var(--navy); }

/* Formspree note */
.formspree-note {
  font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 12px;
}

/* Empty cart */
.cart-empty-state {
  display: none; flex-direction: column; align-items: center;
  padding: 100px 24px; text-align: center; gap: 16px;
}
.cart-empty-state svg { color: var(--border); margin-bottom: 8px; }
.cart-empty-state h2 { color: var(--navy); }
.cart-empty-state p  { max-width: 260px; }

/* Order success */
.order-success {
  display: none; flex-direction: column; align-items: center;
  padding: 100px 24px; text-align: center; gap: 16px;
}
.order-success svg { color: #16a34a; margin-bottom: 8px; }
.order-success h2  { color: var(--navy); }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: var(--navy);
  padding: 52px 24px 28px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.footer-brand {}
.footer-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.footer-logo-text {
  font-weight: 800; font-size: 1rem; letter-spacing: 0.1em;
  color: var(--white); text-transform: uppercase;
}
.footer-tagline { font-size: 0.8125rem; color: rgba(255,255,255,.45); }

.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  color: rgba(255,255,255,.35); text-transform: uppercase; margin-bottom: 4px;
}
.footer-nav a {
  font-size: 0.875rem; color: rgba(255,255,255,.6);
  transition: color var(--ease);
}
.footer-nav a:hover { color: var(--white); }

.footer-bottom {
  max-width: 1200px; margin: 28px auto 0;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.75rem; color: rgba(255,255,255,.3); text-align: center;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes cartBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30%       { transform: translateY(-8px) scale(1.1); }
  55%       { transform: translateY(-3px) scale(1.05); }
  75%       { transform: translateY(-5px) scale(1.07); }
}
.cart-icon-wrap.bounce { animation: cartBounce .45s ease; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .product-grid   { grid-template-columns: repeat(2, 1fr); }
  .cart-layout    { grid-template-columns: 1fr; }
  .checkout-card  { position: static; }
  .contact-grid   { gap: 40px; }
}

@media (max-width: 768px) {
  /* Mobile nav */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--white); padding: 12px 16px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open  { display: flex; }
  .nav-links a     { padding: 10px 12px; border-radius: var(--radius-sm); }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--bg); }

  /* Sections */
  .section { padding: 60px 20px; }
  .section-header { flex-direction: column; align-items: flex-start; }

  /* Hero */
  .hero { padding: 80px 20px; }
  .hero-ctas { flex-direction: column; align-items: center; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }

  /* Cart row mobile layout */
  .cart-row {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px 14px;
  }
  .cart-item-img  { grid-row: 1 / 4; align-self: start; }
  .cart-item-info { grid-column: 2; grid-row: 1; }
  .cart-item-qty  { grid-column: 2; grid-row: 2; }
  .cart-item-price{ grid-column: 2; grid-row: 3; }
  .cart-remove    { position: absolute; top: 12px; right: 12px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 28px; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .form-card    { padding: 24px 20px; }
}
