/* =========================================================
   NESTLY FURNITURE — DESIGN SYSTEM
   Palette: warm ivory + charcoal + terracotta + sage + gold
   ========================================================= */

:root {
  --nestly-bg: #FAF6F0;
  --nestly-surface: #FFFFFF;
  --nestly-text: #2B2621;
  --nestly-muted: #7A7168;
  --nestly-primary: #B5652F;
  --nestly-primary-dark: #8F4E23;
  --nestly-accent: #8A9A82;
  --nestly-gold: #C9A66B;
  --nestly-border: #E7DFD3;
  --nestly-radius: 14px;
  --nestly-font-heading: 'Fraunces', serif;
  --nestly-font-body: 'Inter', sans-serif;
  --nestly-shadow: 0 4px 24px rgba(43,38,33,0.06);
  --nestly-shadow-lg: 0 12px 40px rgba(43,38,33,0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--nestly-bg);
  color: var(--nestly-text);
  font-family: var(--nestly-font-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .font-heading {
  font-family: var(--nestly-font-heading);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.section-head h2 { font-size: clamp(26px, 3vw, 38px); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--nestly-primary); font-weight: 600; }
.muted { color: var(--nestly-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--nestly-radius);
  font-weight: 600; font-size: 15px; border: 1px solid transparent;
  cursor: pointer; transition: all .2s ease;
}
.btn-primary { background: var(--nestly-primary); color: #fff; }
.btn-primary:hover { background: var(--nestly-primary-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--nestly-text); color: var(--nestly-text); }
.btn-outline:hover { background: var(--nestly-text); color: #fff; }
.btn-ghost { background: var(--nestly-surface); border-color: var(--nestly-border); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,246,240,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nestly-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; max-width: 1280px; margin: 0 auto; gap: 24px; }
.site-logo img { max-height: 42px; }
.site-logo { font-family: var(--nestly-font-heading); font-size: 24px; font-weight: 600; }
.main-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-nav a { font-weight: 500; font-size: 15px; }
.main-nav a:hover { color: var(--nestly-primary); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-icon-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--nestly-text); }
.cart-count {
  position: absolute; top: -8px; right: -10px; background: var(--nestly-primary); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 50%; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 640px; display: flex; align-items: center;
  background: linear-gradient(180deg, rgba(43,38,33,.15), rgba(43,38,33,.55)), var(--nestly-bg);
  background-size: cover; background-position: center;
  color: #fff; border-radius: 0 0 32px 32px; overflow: hidden;
}
.hero-content { max-width: 620px; padding: 0 24px; margin-left: 6vw; }
.hero-content h1 { font-size: clamp(36px, 5.5vw, 64px); color: #fff; }
.hero-content p { font-size: 18px; color: rgba(255,255,255,.9); margin-bottom: 28px; }

/* ---------- Category Grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.category-card {
  position: relative; border-radius: var(--nestly-radius); overflow: hidden; aspect-ratio: 3/4;
  background: var(--nestly-surface); box-shadow: var(--nestly-shadow); transition: transform .25s ease;
}
.category-card:hover { transform: translateY(-4px); }
.category-card img { width: 100%; height: 100%; object-fit: cover; }
.category-card .cat-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px;
  background: linear-gradient(0deg, rgba(0,0,0,.55), transparent);
  color: #fff; font-family: var(--nestly-font-heading); font-size: 20px;
}

/* ---------- Product Grid & Cards ---------- */
.products, ul.products {
  display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 28px 24px;
  list-style: none; margin: 0; padding: 0;
}
.product-card, ul.products li.product {
  background: var(--nestly-surface); border-radius: var(--nestly-radius); overflow: hidden;
  border: 1px solid var(--nestly-border); transition: box-shadow .2s ease, transform .2s ease;
  position: relative;
}
.product-card:hover, ul.products li.product:hover { box-shadow: var(--nestly-shadow-lg); transform: translateY(-3px); }
.product-thumb { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #f2ece2; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
.product-thumb img.img-alt { position: absolute; inset: 0; opacity: 0; }
.product-card:hover .img-alt { opacity: 1; }
.product-card:hover .img-main { opacity: 0; }
.quick-add-btn {
  position: absolute; right: 12px; bottom: 12px; background: #fff; border: 1px solid var(--nestly-border);
  border-radius: 50px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  opacity: 0; transform: translateY(6px); transition: all .2s ease; box-shadow: var(--nestly-shadow);
}
.product-card:hover .quick-add-btn { opacity: 1; transform: translateY(0); }
.product-info { padding: 16px; }
.product-info .price { font-weight: 700; color: var(--nestly-primary); margin-top: 4px; }
.product-info .price del { color: var(--nestly-muted); font-weight: 400; margin-right: 6px; }
.star-rating { color: var(--nestly-gold); font-size: 13px; }
.color-swatches { display: flex; gap: 6px; margin-top: 8px; }
.color-swatches span { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--nestly-border); display: inline-block; cursor: pointer; }

/* ---------- Shop / Filters ---------- */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; }
.filter-bar { background: var(--nestly-surface); border: 1px solid var(--nestly-border); border-radius: var(--nestly-radius); padding: 24px; align-self: start; position: sticky; top: 100px; }
.filter-group { margin-bottom: 24px; }
.filter-group h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.filter-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; color: var(--nestly-muted); cursor: pointer; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.shop-toolbar select { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--nestly-border); background: var(--nestly-surface); }
.mobile-filter-toggle { display: none; }

/* ---------- Product Detail Page ---------- */
.pdp-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.pdp-gallery-main { border-radius: var(--nestly-radius); overflow: hidden; aspect-ratio: 1/1; background: #f2ece2; cursor: zoom-in; }
.pdp-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pdp-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.pdp-thumbs img.active { border-color: var(--nestly-primary); }
.pdp-info { position: sticky; top: 100px; }
.pdp-info h1 { font-size: 32px; }
.pdp-price { font-size: 26px; font-weight: 700; color: var(--nestly-primary); margin: 8px 0 16px; }
.stock-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 50px; background: #EBF3E8; color: #4C7A3E; margin-bottom: 16px; }
.swatch-group { margin-bottom: 20px; }
.swatch-group h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; color: var(--nestly-muted); }
.finish-swatches { display: flex; gap: 10px; }
.finish-swatches .swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--nestly-border); }
.finish-swatches .swatch.selected { border-color: var(--nestly-primary); }
.qty-add-row { display: flex; gap: 12px; margin: 24px 0; }
.qty-selector { display: flex; align-items: center; border: 1px solid var(--nestly-border); border-radius: var(--nestly-radius); overflow: hidden; }
.qty-selector button { background: none; border: none; width: 40px; height: 48px; cursor: pointer; font-size: 18px; }
.qty-selector input { width: 46px; border: none; text-align: center; font-weight: 600; }
.sticky-add-bar {
  position: sticky; bottom: 0; background: var(--nestly-surface); border-top: 1px solid var(--nestly-border);
  padding: 14px 24px; display: none; align-items: center; justify-content: space-between; z-index: 50;
}
.accordion-item { border-bottom: 1px solid var(--nestly-border); }
.accordion-trigger { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 18px 0; background: none; border: none; font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height .25s ease; color: var(--nestly-muted); font-size: 14px; }
.accordion-item.open .accordion-panel { max-height: 400px; padding-bottom: 18px; }
.accordion-trigger .icon { transition: transform .2s ease; }
.accordion-item.open .accordion-trigger .icon { transform: rotate(45deg); }

/* ---------- Social Proof ---------- */
.reviews-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.review-card { background: var(--nestly-surface); border: 1px solid var(--nestly-border); border-radius: var(--nestly-radius); padding: 24px; }
.press-logos { display: flex; gap: 40px; align-items: center; opacity: .6; flex-wrap: wrap; }
.insta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.insta-grid img { aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; }

/* ---------- Slide-out Cart ---------- */
.cart-drawer-overlay { position: fixed; inset: 0; background: rgba(43,38,33,.4); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 200; }
.cart-drawer-overlay.active { opacity: 1; pointer-events: all; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw; background: var(--nestly-surface);
  z-index: 201; transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.cart-drawer.active { transform: translateX(0); }
.cart-drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--nestly-border); display: flex; justify-content: space-between; align-items: center; }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-drawer-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--nestly-border); }
.cart-drawer-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.cart-drawer-footer { padding: 20px 24px; border-top: 1px solid var(--nestly-border); background: var(--nestly-bg); }
.cart-drawer-subtotal { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 14px; font-size: 17px; }

/* ---------- Checkout ---------- */
.checkout-steps { display: flex; gap: 12px; margin-bottom: 32px; }
.checkout-step { flex: 1; text-align: center; padding: 12px; border-radius: var(--nestly-radius); background: var(--nestly-surface); border: 1px solid var(--nestly-border); font-weight: 600; font-size: 14px; color: var(--nestly-muted); }
.checkout-step.active { border-color: var(--nestly-primary); color: var(--nestly-primary); background: #FBF0E7; }
.login-required-box {
  background: #FBF0E7; border: 1px solid var(--nestly-gold); border-radius: var(--nestly-radius);
  padding: 24px; margin-bottom: 28px; display: flex; gap: 16px; align-items: flex-start;
}
.trust-badges { text-align: center; font-size: 13px; color: var(--nestly-muted); margin-top: 24px; }
.payment-method-logos { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.payment-method-logos span { padding: 4px 10px; border: 1px solid var(--nestly-border); border-radius: 6px; font-size: 12px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--nestly-text); color: #F1ECE3; padding: 64px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer a { color: #C9C2B6; font-size: 14px; line-height: 2; }
.site-footer a:hover { color: var(--nestly-gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; justify-content: space-between; font-size: 13px; color: #9C9384; flex-wrap: wrap; gap: 10px; }
.social-icons { display: flex; gap: 14px; }

/* ---------- Auth / My Account ---------- */
.auth-wrap { max-width: 440px; margin: 60px auto; background: var(--nestly-surface); border: 1px solid var(--nestly-border); border-radius: var(--nestly-radius); padding: 40px; }
.auth-wrap h2 { text-align: center; }
.auth-wrap label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
.auth-wrap input[type="text"], .auth-wrap input[type="password"], .auth-wrap input[type="email"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--nestly-border); border-radius: 10px; font-size: 15px;
}
.woocommerce-form-row, form.woocommerce-checkout .form-row { margin-bottom: 16px; }
input, select, textarea { font-family: var(--nestly-font-body); }
.woocommerce input.input-text, .woocommerce select, .woocommerce textarea {
  padding: 12px 14px; border: 1px solid var(--nestly-border); border-radius: 10px; width: 100%; background: var(--nestly-surface);
}
.woocommerce #payment ul.payment_methods li { border-radius: var(--nestly-radius); border: 1px solid var(--nestly-border); padding: 14px; margin-bottom: 10px; list-style: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .products, ul.products { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .pdp-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav, .filter-bar { display: none; }
  .mobile-menu-toggle { display: block; }
  .products, ul.products { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .shop-layout { grid-template-columns: 1fr; }
  .sticky-add-bar { display: flex; }
  .reviews-strip { grid-template-columns: 1fr; }
  .insta-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { min-height: 480px; border-radius: 0 0 20px 20px; }
  .hero-content { margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
