:root {
  --bg: #fcf8f3;
  --surface: #ffffff;
  --surface-2: #f5ede4;
  --text: #241b16;
  --muted: #7b6d65;
  --line: #e6d8ca;
  --accent: #1e1a18;
  --accent-soft: #c9a77d;
  --danger: #bc5a5a;
  --success: #235d3a;
  --shadow: 0 18px 45px rgba(36, 27, 22, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}
.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.hidden { display: none !important; }
.section { padding: 72px 0; }
.section-kicker, .eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .74rem;
  color: var(--muted);
  margin: 0 0 10px;
}
h1, h2, h3, .brand {
  font-family: 'Cormorant Garamond', serif;
}
h1 { font-size: clamp(2.7rem, 6vw, 5rem); line-height: .95; margin: 0 0 16px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
h3 { font-size: 1.45rem; margin: 0 0 10px; }
p { line-height: 1.65; }
.primary-btn, .secondary-btn, .icon-btn, .cart-link {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: .25s ease;
}
.primary-btn {
  background: var(--accent);
  color: white;
  padding: 14px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary-btn:hover { transform: translateY(-1px); }
.secondary-btn {
  background: transparent;
  border: 1px solid var(--line);
  padding: 13px 22px;
}
.secondary-btn:hover, .cart-link:hover { background: var(--surface-2); }
.small-btn { padding: 10px 14px; }
.full-btn { width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(252, 248, 243, 0.8);
  border-bottom: 1px solid rgba(230, 216, 202, 0.7);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 80px;
}
.brand {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.main-nav {
  display: flex;
  gap: 26px;
}
.main-nav a { color: var(--muted); }
.main-nav a:hover { color: var(--text); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cart-link {
  border: 1px solid var(--line);
  padding: 10px 16px;
  background: var(--surface);
}
#cartCountBadge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: .82rem;
  margin-left: 8px;
}

.hero {
  padding: 0 0 32px;
}
.hero-slider {
  position: relative;
  min-height: 74vh;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero-slide.active { opacity: 1; }
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 21, 18, .65), rgba(26, 21, 18, .2));
}
.hero-content {
  position: relative;
  z-index: 1;
  color: white;
  padding-top: 18vh;
  max-width: 650px;
}
.hero-content p { color: rgba(255,255,255,.88); }
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: -56px;
  position: relative;
  z-index: 2;
}
.slider-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.55);
}
.slider-dots button.active { background: white; }

.search-panel input,
.checkout-form input,
.checkout-form select,
.checkout-form textarea,
.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-copy { max-width: 520px; color: var(--muted); }
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-strip article,
.about-box,
.checkout-panel,
.order-summary,
.cart-item,
.product-card,
.modal-card,
.success-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feature-strip article { padding: 28px; }
.about-box {
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.shop-head { align-items: center; }
.filters select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 12px 16px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.product-card {
  overflow: hidden;
}
.product-image-wrap {
  position: relative;
  aspect-ratio: 4 / 4.6;
  background: var(--surface-2);
}
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.promo-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(188, 90, 90, .95);
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .78rem;
}
.product-info {
  padding: 20px;
}
.product-title-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}
.product-title-row h3 { margin-bottom: 0; }
.product-meta {
  color: var(--muted);
  margin: 8px 0 14px;
  min-height: 46px;
}
.price-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.current-price { font-weight: 700; font-size: 1.05rem; }
.old-price {
  color: var(--muted);
  text-decoration: line-through;
}
.promo-price {
  color: var(--danger);
  font-weight: 700;
}
.card-actions {
  display: flex;
  gap: 10px;
}
.color-preview-row, .color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.color-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.color-chip.active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 18, .6);
}
.modal-card {
  position: relative;
  width: min(1080px, calc(100% - 24px));
  margin: 6vh auto;
  padding: 26px;
}
.modal-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  font-size: 1.6rem;
}
.modal-main-image {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: 20px;
  background: var(--surface-2);
}
.thumbnail-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.thumbnail-row img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
}
.thumbnail-row img.active { border-color: var(--accent); }
.modal-description { color: var(--muted); }
.option-group { margin-top: 18px; }
.quantity-box {
  margin-top: 10px;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.quantity-box button,
.quantity-box input {
  border: 0;
  background: transparent;
  text-align: center;
  width: 50px;
  height: 46px;
}
.quantity-box input { width: 56px; }
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr .88fr;
  gap: 28px;
  align-items: start;
}
.cart-items {
  display: grid;
  gap: 18px;
}
.cart-item {
  padding: 16px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
}
.cart-item img {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: 18px;
}
.cart-item h3 { margin: 0 0 8px; }
.cart-item p { margin: 0 0 8px; }
.item-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0;
  cursor: pointer;
}
.checkout-panel {
  padding: 24px;
  position: sticky;
  top: 100px;
}
.order-summary {
  padding: 20px;
  margin-bottom: 18px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 16px;
}
.checkout-form {
  display: grid;
  gap: 14px;
}
.checkout-form h3 { margin: 0 0 6px; }
.helper-note { color: var(--muted); font-size: .92rem; }
.success-box {
  padding: 18px;
  color: var(--success);
  margin-top: 18px;
}

@media (max-width: 960px) {
  .product-grid,
  .feature-strip,
  .checkout-grid,
  .modal-layout {
    grid-template-columns: 1fr 1fr;
  }
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-panel { position: static; }
  .modal-card { margin-top: 3vh; }
  .modal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 56px 0; }
  .header-row {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 16px;
    font-size: .95rem;
  }
  .feature-strip,
  .product-grid,
  .thumbnail-row,
  .product-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }
  .section-head,
  .about-box,
  .card-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-slider { min-height: 66vh; }
  .hero-content { padding-top: 16vh; }
  .cart-item { grid-template-columns: 1fr; }
}

.site-header .logo {
  display: block;
  width: 180px;
  height: 70px;
  flex-shrink: 0;
  background: url('../img/logo.png') center/contain no-repeat;
}

.follow-text {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.social-icons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.social-icons img {
  width: 28px;
  filter: grayscale(100%);
}

.social-icons img:hover {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  position: relative;
  width: min(1080px, calc(100% - 24px));
  margin: 3vh auto;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
}

@media (max-width: 720px) {
  .product-modal {
    padding: 8px;
    align-items: flex-start;
  }

  .modal-card {
    width: 100%;
    margin: 0;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: 18px;
    border-radius: 18px;
  }

  .modal-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .modal-main-image {
    aspect-ratio: 1 / 1.05;
  }

  .thumbnail-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-top: 12px;
  }
  .modal-actions .secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #241b16;
  color: white;
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-size: 0.95rem;
  text-align: center;
  max-width: calc(100% - 24px);
}

.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .cart-toast {
    bottom: 16px;
    font-size: 0.92rem;
    padding: 12px 16px;
    width: calc(100% - 24px);
    border-radius: 18px;
  }
}

.firebase-badge{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid rgba(17,17,17,.08);border-radius:999px;background:#fff7f2;color:#7a4d2a;font-size:.92rem;font-weight:600}
.firebase-badge strong{color:#111}
.hero-note{margin-top:18px;display:flex;flex-wrap:wrap;gap:12px}
.helper-stack{display:grid;gap:8px;margin-top:14px}
.admin-status-box,.store-status-box{margin-top:12px;padding:14px 16px;border-radius:18px;background:#fff7f2;border:1px solid rgba(17,17,17,.08);font-size:.95rem}
.store-status-box.hidden,.admin-status-box.hidden{display:none}
.inline-note{font-size:.92rem;color:#6f6a66;margin-top:8px}
.preview-grid .img-chip{position:relative}
.preview-grid .remove-preview{position:absolute;top:8px;right:8px;border:none;background:rgba(17,17,17,.7);color:#fff;width:28px;height:28px;border-radius:50%;cursor:pointer}
.upload-meta{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:8px;font-size:.9rem;color:#6f6a66}
.product-card img,.modal-main-image,.cart-item img,.admin-product-item img{object-fit:cover}



.stock-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(30, 26, 24, .92);
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .78rem;
}

.product-card.out-of-stock {
  opacity: .68;
}

.product-card.out-of-stock .product-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
}

.stock-disabled-note {
  justify-content: center;
}

.muted-stock-text {
  width: 100%;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 12px 14px;
}

.disabled-btn {
  opacity: .6;
  pointer-events: none;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #241b16;
  color: white;
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-size: 0.95rem;
  text-align: center;
  max-width: calc(100% - 24px);
}
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.product-modal {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .cart-toast {
    bottom: 16px;
    width: calc(100% - 24px);
    border-radius: 18px;
  }

  .modal-actions .secondary-btn,
  .modal-actions .primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .product-modal {
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    margin: 0;
    max-height: calc(100vh - 16px);
    padding: 18px;
  }
}

.empty-cart-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.empty-cart-inner {
  max-width: 420px;
}

.empty-cart-inner h3 {
  margin: 0 0 10px;
}

.empty-cart-text {
  margin: 0 0 18px;
  color: var(--muted);
}

.empty-cart-btn {
  min-width: 170px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .empty-cart-state {
    padding: 22px;
  }

  .empty-cart-btn {
    width: auto;
    min-width: 150px;
  }
}

/* ===== Product card image slider + per-color stock ===== */
.product-image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  transition: .2s ease;
}

.product-image-arrow:hover {
  background: white;
  transform: translateY(-50%) scale(1.06);
}

.image-prev { left: 12px; }
.image-next { right: 12px; }

.color-chip.variant-unavailable {
  opacity: .48;
  filter: grayscale(100%);
  text-decoration: line-through;
}

.color-chip.variant-unavailable.active {
  opacity: .7;
  border-style: dashed;
  background: #f3f0ec;
}

.compact-stock-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
}

.product-card.out-of-stock .product-image-wrap img {
  filter: grayscale(70%);
}

@media (max-width: 720px) {
  .product-image-arrow {
    width: 34px;
    height: 34px;
    font-size: 1.45rem;
  }

  .image-prev { left: 8px; }
  .image-next { right: 8px; }

  .compact-stock-text {
    width: 100%;
  }
}
