/* ============================================
   SR CLOTHING — Shared Stylesheet
   Aesthetic: Refined editorial luxury
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Instrument+Sans:wght@300;400;500;600&display=swap');

:root {
  --black: #0d0d0d;
  --white: #f5f3f0;
  --off-white: #ede9e3;
  --mid: #8a8680;
  --light: #c8c4be;
  --accent: #b84a2a;   /* ember — echoes the Detective Coat */
  --border: #2a2824;
  --border-light: #dedad4;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Instrument Sans', sans-serif;
  --nav-h: 68px;
  --max-w: 1440px;
  --gutter: clamp(20px, 4vw, 60px);
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
ul { list-style: none; }

/* ── ANNOUNCEMENT BAR ── */
.announcement {
  background: var(--black);
  color: var(--white);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px var(--gutter);
  font-family: var(--font-body);
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,0.06); }

.nav-left { display: flex; gap: 28px; align-items: center; }
.nav-left a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  opacity: 0.7;
  transition: opacity var(--transition);
  position: relative;
}
.nav-left a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--black);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-left a:hover { opacity: 1; }
.nav-left a:hover::after { transform: scaleX(1); }
.nav-left a.active { opacity: 1; }
.nav-left a.active::after { transform: scaleX(1); }

.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.nav-logo img {
  width: 36px;
  height: auto;
  object-fit: contain;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
.nav-right button, .nav-right a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-right button:hover, .nav-right a:hover { opacity: 1; }

.cart-btn { position: relative; }
.cart-count {
  position: absolute;
  top: -8px; right: -10px;
  background: var(--black);
  color: var(--white);
  font-size: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  opacity: 1 !important;
}
.cart-count.hidden { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; width: 22px; }
.hamburger span { display: block; height: 1px; background: var(--black); transition: var(--transition); }

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white);
  z-index: 200;
  flex-direction: column;
  padding: 80px var(--gutter) 40px;
  gap: 8px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 300;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  transition: color var(--transition);
}
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav-close {
  position: absolute;
  top: 24px; right: var(--gutter);
  font-size: 24px;
  color: var(--black);
  opacity: 0.5;
}

/* ── PAGE WRAPPER ── */
.page { min-height: calc(100vh - var(--nav-h)); }

/* ── FOOTER ── */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 60px var(--gutter) 32px;
  margin-top: 80px;
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.footer-brand img {
  width: 40px;
  height: auto;
  object-fit: contain;
  margin-bottom: 16px;
  filter: invert(1);
}
.footer-brand p {
  font-size: 13px;
  opacity: 0.5;
  line-height: 1.8;
  max-width: 260px;
}
.footer-col h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 20px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  opacity: 0.65;
  margin-bottom: 10px;
  transition: opacity var(--transition);
}
.footer-col a:hover { opacity: 1; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 28px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.35;
  letter-spacing: 0.08em;
}

/* ── CART DRAWER ── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--white);
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border-light);
}
.cart-drawer-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.cart-close {
  font-size: 22px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.cart-close:hover { opacity: 1; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px 28px; }
.cart-empty {
  text-align: center;
  padding: 60px 0;
  font-size: 13px;
  opacity: 0.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.cart-item-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--off-white);
}
.cart-item-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.cart-item-meta { font-size: 11px; opacity: 0.5; letter-spacing: 0.06em; margin-bottom: 10px; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.cart-item-qty button {
  width: 24px; height: 24px;
  border: 1px solid var(--border-light);
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.cart-item-qty button:hover { background: var(--black); color: var(--white); }
.cart-item-price { font-size: 13px; font-weight: 500; white-space: nowrap; }
.cart-item-remove {
  font-size: 18px;
  opacity: 0.3;
  transition: opacity var(--transition);
  padding: 0 4px;
}
.cart-item-remove:hover { opacity: 0.8; }

.cart-footer {
  padding: 20px 28px 28px;
  border-top: 1px solid var(--border-light);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 20px;
}
.cart-subtotal span:last-child { font-weight: 600; }

.btn-checkout {
  width: 100%;
  background: var(--black);
  color: var(--white);
  padding: 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-body);
  transition: background var(--transition);
  font-weight: 500;
}
.btn-checkout:hover { background: #2a2824; }
.btn-checkout:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--black);
  color: var(--white);
  padding: 14px 28px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 500;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 14px 36px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border: 1px solid var(--black);
}
.btn-primary:hover { background: transparent; color: var(--black); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--black);
  padding: 13px 36px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 500;
  border: 1px solid var(--black);
  transition: background var(--transition), color var(--transition);
}
.btn-outline:hover { background: var(--black); color: var(--white); }

/* ── SECTION TITLES ── */
.section-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* ── PRODUCT CARD ── */
.product-card { display: block; cursor: pointer; }
.product-card-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--off-white);
  position: relative;
  margin-bottom: 14px;
}
.product-card-img img {
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-quick {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 13px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateY(100%);
  transition: transform var(--transition);
}
.product-card:hover .product-card-quick { transform: translateY(0); }
.product-card-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; letter-spacing: 0.04em; }
.product-card-sub { font-size: 12px; opacity: 0.45; margin-bottom: 6px; }
.product-card-price { font-size: 14px; font-weight: 500; }

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 28px;
}

/* ── STOCK BADGES ── */
.stock-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 500;
}
.stock-badge.out { background: var(--black); color: var(--white); }
.stock-badge.last { background: #b84a2a; color: #fff; }
.stock-badge.low { background: #8a6a1a; color: #fff; }
@media (max-width: 900px) {
  .nav-left { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}
