/* ===== Threadly — clothing store ===== */
:root {
  --ink: #1c1a18;
  --ink-soft: #5b5650;
  --ink-faint: #8a837a;
  --paper: #faf7f2;
  --paper-2: #f3ede3;
  --card: #ffffff;
  --line: #e7e0d5;
  --brand: #b4552d;
  --brand-dark: #8f3f1f;
  --brand-soft: #f6e7df;
  --green: #2f7d5b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 24, .06), 0 4px 14px rgba(28, 26, 24, .05);
  --shadow-md: 0 10px 30px rgba(28, 26, 24, .12);
  --shadow-lg: 0 24px 60px rgba(28, 26, 24, .22);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.container { width: min(1200px, 92vw); margin-inline: auto; }
.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; }

/* ---- Announcement ---- */
.announce {
  background: var(--ink);
  color: #f5efe6;
  text-align: center;
  font-size: .82rem;
  letter-spacing: .01em;
  padding: .55rem 1rem;
}
.announce p { margin: 0; }
.announce strong { color: #fff; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 242, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.01em; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.logo-text { font-family: var(--serif); font-size: 1.28rem; }

.main-nav { display: flex; gap: 1.35rem; margin-left: 1rem; flex: 1; }
.main-nav a { font-size: .9rem; color: var(--ink-soft); font-weight: 500; position: relative; padding: .25rem 0; }
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--brand); transition: right .25s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
  transition: background .2s ease, transform .2s ease;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn:active { transform: scale(.94); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: 3px; right: 3px;
  min-width: 19px; height: 19px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: .68rem; font-weight: 700;
  border-radius: 999px; border: 2px solid var(--paper);
  transform: scale(0); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.cart-count.show { transform: scale(1); }

/* ---- Hero ---- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, #f2ddd0 0%, transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 5rem;
}
.eyebrow {
  display: inline-block;
  font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft);
  padding: .4rem .8rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero p { max-width: 46ch; color: var(--ink-soft); font-size: 1.05rem; margin: 1.25rem 0 2rem; }
.hero-cta { display: flex; gap: .85rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(180, 85, 45, .28); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 10px 26px rgba(180, 85, 45, .35); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-block { width: 100%; }

.hero-stats { display: flex; gap: 2.25rem; list-style: none; padding: 0; margin: 2.75rem 0 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--serif); font-size: 1.4rem; }
.hero-stats span { font-size: .8rem; color: var(--ink-faint); }

.hero-art { position: relative; height: 420px; }
.hero-card {
  position: absolute; border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex; align-items: flex-end; padding: 1rem;
  color: #fff; font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase;
}
.hero-card span { position: relative; z-index: 1; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.4)); }
.hero-card--a { width: 58%; height: 62%; top: 2%; left: 0; background: linear-gradient(150deg, #d98f6b, #b4552d); animation: float 7s ease-in-out infinite; }
.hero-card--b { width: 48%; height: 52%; top: 0; right: 0; background: linear-gradient(150deg, #6d7f6a, #38493a); animation: float 8s ease-in-out .5s infinite; }
.hero-card--c { width: 62%; height: 46%; bottom: 0; right: 6%; background: linear-gradient(150deg, #7d92ad, #40536b); animation: float 6.5s ease-in-out 1s infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---- Shop ---- */
.shop { padding: 4rem 0 5rem; }
.shop-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.shop-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.shop-sub { margin: .4rem 0 0; color: var(--ink-faint); font-size: .9rem; }
.shop-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.search-field {
  display: flex; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem .9rem; color: var(--ink-faint);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); color: var(--brand); }
.search-field input { border: 0; outline: 0; background: transparent; font-size: .9rem; width: 190px; color: var(--ink); }

.select-field select {
  appearance: none;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235b5650' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .85rem center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .62rem 2.3rem .62rem 1rem; font-size: .88rem; color: var(--ink); outline: 0;
}
.select-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.filter-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: .5rem 1.05rem; border-radius: 999px; font-size: .86rem; font-weight: 500;
  transition: all .18s ease;
}
.filter-chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Product grid ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: cardIn .4s ease backwards;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }

.product-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-media img { transform: scale(1.06); }
.badge {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  background: var(--ink); color: #fff; font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: .3rem .6rem; border-radius: 6px;
}
.badge.sale { background: var(--brand); }
.badge.out { background: var(--ink-faint); }

.quick-add {
  position: absolute; left: .75rem; right: .75rem; bottom: .75rem; z-index: 2;
  transform: translateY(calc(100% + .75rem)); opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.product-card:hover .quick-add, .product-card:focus-within .quick-add { transform: translateY(0); opacity: 1; }
.quick-add .btn { width: 100%; box-shadow: var(--shadow-md); }
.wish-btn {
  position: absolute; top: .7rem; right: .7rem; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: var(--ink-soft);
  display: grid; place-items: center; backdrop-filter: blur(4px);
  transition: color .2s ease, transform .2s ease;
}
.wish-btn:hover { transform: scale(1.1); }
.wish-btn.active { color: var(--brand); }
.wish-btn.active svg { fill: currentColor; }

.product-info { padding: 1rem 1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-cat { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.product-name { font-size: 1.02rem; font-weight: 600; font-family: var(--sans); }
.product-rating { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--ink-faint); }
.stars { color: #e0a32e; letter-spacing: 1px; }
.product-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; }
.price { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.price .was { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); text-decoration: line-through; margin-left: .4rem; font-weight: 400; }
.swatches { display: flex; gap: .28rem; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--ink-soft); font-size: 1rem; }
.empty-emoji { display: block; font-size: 2.5rem; margin-bottom: .75rem; }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #e8e0d5; padding: 3.5rem 0 1.5rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1.8fr; gap: 3rem; }
.footer-brand { display: flex; gap: .9rem; align-items: flex-start; }
.footer-brand .logo-mark { flex-shrink: 0; }
.footer-brand strong { font-family: var(--serif); font-size: 1.2rem; color: #fff; }
.footer-brand p { margin: .35rem 0 0; color: #b3a99a; font-size: .88rem; max-width: 30ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-cols h3 { font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: .9rem; }
.footer-cols a { display: block; color: #b3a99a; font-size: .88rem; padding: .22rem 0; transition: color .2s ease; }
.footer-cols a:hover { color: #fff; }
.copyright { text-align: center; margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.1); color: #8a8175; font-size: .8rem; }

/* ---- Cart drawer ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(28,26,24,.42);
  backdrop-filter: blur(2px); z-index: 50;
  opacity: 0; transition: opacity .3s ease;
}
.overlay.show { opacity: 1; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(430px, 100vw); background: var(--paper);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .34s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; }
.cart-head-count {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
  padding: .18rem .55rem; border-radius: 999px;
}
.cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.cart-empty { text-align: center; padding: 3.5rem 1rem; color: var(--ink-soft); }
.cart-empty span { display: block; font-size: 2.5rem; margin-bottom: .75rem; }

.cart-item { display: grid; grid-template-columns: 74px 1fr; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 74px; height: 92px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-info { display: flex; flex-direction: column; gap: .2rem; }
.cart-item-name { font-weight: 600; font-size: .92rem; }
.cart-item-meta { font-size: .76rem; color: var(--ink-faint); text-transform: capitalize; }
.cart-item-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: transparent; color: var(--ink); font-size: 1.05rem; line-height: 1; }
.qty button:hover { background: var(--paper-2); }
.qty button:disabled { color: var(--ink-faint); cursor: not-allowed; }
.qty span { min-width: 26px; text-align: center; font-size: .88rem; font-weight: 600; }
.cart-item-price { font-weight: 600; font-family: var(--serif); }
.remove-btn { border: 0; background: transparent; color: var(--ink-faint); font-size: .78rem; padding: 0; text-decoration: underline; align-self: flex-start; }
.remove-btn:hover { color: var(--brand); }

.cart-foot { border-top: 1px solid var(--line); padding: 1.1rem 1.25rem 1.35rem; background: var(--card); }
.ship-progress { margin-bottom: 1rem; }
.ship-progress p { margin: 0 0 .45rem; font-size: .82rem; color: var(--ink-soft); }
.ship-progress p.done { color: var(--green); font-weight: 600; }
.ship-bar { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.ship-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--green)); border-radius: 999px; transition: width .4s ease; }
.cart-totals { margin: 0 0 1rem; }
.cart-totals > div { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-soft); padding: .18rem 0; }
.cart-totals dd { margin: 0; font-weight: 500; color: var(--ink); }
.cart-totals .grand { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .6rem; font-size: 1.05rem; }
.cart-totals .grand dt { font-weight: 600; color: var(--ink); }
.cart-totals .grand dd { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.link-btn { width: 100%; margin-top: .6rem; border: 0; background: transparent; color: var(--ink-faint); font-size: .82rem; text-decoration: underline; }
.link-btn:hover { color: var(--brand); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 1.25rem;
  background: rgba(28,26,24,.5); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.modal.show { opacity: 1; }
.modal-card {
  position: relative; width: min(460px, 100%);
  background: var(--paper); border-radius: 20px; padding: 2rem;
  box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto;
  transform: translateY(12px) scale(.98); transition: transform .3s cubic-bezier(.34,1.3,.64,1);
}
.modal.show .modal-card { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: .75rem; right: .75rem; }
.modal-card h2 { font-size: 1.6rem; }
.modal-sub { color: var(--ink-faint); font-size: .86rem; margin: .3rem 0 1.4rem; }
.checkout-form { display: flex; flex-direction: column; gap: .85rem; }
.checkout-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.checkout-form input {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem;
  font-size: .92rem; font-family: inherit; background: var(--card); color: var(--ink); outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.checkout-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: .85rem; }
.checkout-total { margin: .4rem 0 .2rem; font-size: .95rem; color: var(--ink-soft); }
.checkout-total strong { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }

.success { text-align: center; padding: 1rem 0; }
.success-badge {
  width: 64px; height: 64px; margin: 0 auto 1.1rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; color: #fff;
  background: linear-gradient(140deg, var(--green), #1f5c41);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from { transform: scale(0); } }
.success p { color: var(--ink-soft); }
.success .order-id { font-family: var(--sans); font-size: .85rem; color: var(--ink-faint); background: var(--paper-2); display: inline-block; padding: .4rem .8rem; border-radius: 999px; }
.success .btn { margin-top: 1.25rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 120%);
  background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: 999px;
  font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-md); z-index: 90;
  transition: transform .35s cubic-bezier(.34,1.4,.64,1); max-width: 92vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 0 3.5rem; }
  .hero-art { height: 300px; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 620px) {
  .shop-tools { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .select-field { flex: 1; }
  .select-field select { width: 100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .quick-add { transform: none; opacity: 1; }
  .modal-card { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
