/* Motion override — JS enables transitions after load */
[data-reveal],[data-reveal-stagger]>*,[data-reveal-media]{opacity:1!important;visibility:visible!important;transform:none!important;}
[hidden]{display:none!important;}
button{cursor:pointer;}

/* ── Design tokens ──────────────────────────────────────────────── */
:root {
  --ms-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ms-shadow-sm:   0 2px 10px rgba(10,10,9,0.07), 0 1px 2px rgba(10,10,9,0.04);
  --ms-shadow-md:   0 8px 32px rgba(10,10,9,0.10), 0 2px 8px rgba(10,10,9,0.06);
  --ms-shadow-lg:   0 24px 64px rgba(10,10,9,0.18), 0 8px 20px rgba(10,10,9,0.08);
  --ms-shadow-modal:0 32px 80px rgba(10,10,9,0.24), 0 8px 24px rgba(10,10,9,0.10);
}

/* ── Announcement bar ───────────────────────────────────────────── */
#ms-announce-bar { user-select: none; }
#ms-ann-text { transition: opacity 0.22s ease; }

/* ── Header scroll elevation ────────────────────────────────────── */
.ms-header-scrolled { box-shadow: var(--ms-shadow-sm) !important; border-bottom-color: var(--color-line) !important; }

/* ── Selected/active state ──────────────────────────────────────── */
.ms-selected {
  background: var(--color-ink) !important;
  color: var(--color-ivory) !important;
  border-color: var(--color-ink) !important;
}

/* ── Toast notification ─────────────────────────────────────────── */
.ms-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 13px 24px 13px 20px;
  background: var(--color-ink);
  color: var(--color-ivory);
  box-shadow: var(--ms-shadow-lg);
  max-width: min(380px, 92vw);
  font-size: 13px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  border-left: 2px solid var(--color-gold);
  animation: ms-toast-in 0.45s var(--ms-ease) both;
}
@keyframes ms-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Modal base ─────────────────────────────────────────────────── */
.ms-modal {
  border: 0;
  padding: 0;
  width: min(580px, calc(100% - 20px));
  max-height: 92dvh;
  background: var(--color-ivory);
  color: var(--color-ink);
  box-shadow: var(--ms-shadow-modal);
}
.ms-modal::backdrop {
  background: rgba(10,10,9,0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.ms-modal-inner {
  padding: 32px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 92dvh;
}
@media (max-width: 480px) { .ms-modal-inner { padding: 24px 18px; } }

.ms-modal h2 {
  font-family: var(--font-serif), Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 4px;
}
.ms-modal-meta {
  font-size: 12px;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
}
.ms-divider {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 20px 0;
}
.ms-close {
  float: right;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--color-muted);
  transition: color 0.2s;
  margin: -4px -2px 0 0;
}
.ms-close:hover { color: var(--color-ink); }
.ms-modal .input-ms  { width: 100%; margin: 6px 0; }
.ms-modal .btn-primary { margin-top: 20px; }

/* ── Bag — item ─────────────────────────────────────────────────── */
.ms-item {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-line);
}
.ms-item:last-of-type { border-bottom: 0; }
.ms-item img {
  width: 76px;
  height: 96px;
  object-fit: cover;
  flex-shrink: 0;
  background: #ece8e1;
  display: block;
}
.ms-item-info { flex: 1; min-width: 0; }
.ms-item-info h3 {
  font-family: var(--font-serif), Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-item-info p {
  font-size: 12px;
  color: var(--color-muted);
  margin: 5px 0;
  letter-spacing: 0.03em;
}
.ms-item-price {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  margin-top: 2px;
}

/* ── Quantity control ───────────────────────────────────────────── */
.ms-qty {
  display: inline-flex;
  border: 1px solid var(--color-line);
  margin-top: 10px;
  align-items: center;
  background: #fff;
}
.ms-qty button {
  padding: 5px 12px;
  font-size: 16px;
  line-height: 1;
  color: var(--color-charcoal);
  transition: background 0.15s, color 0.15s;
}
.ms-qty button:hover { background: var(--color-line); color: var(--color-ink); }
.ms-qty span {
  padding: 0 4px;
  font-size: 13px;
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ms-remove {
  float: right;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  border-bottom: 1px solid rgba(107,101,96,0.35);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.ms-remove:hover { color: var(--color-ink); border-bottom-color: var(--color-ink); }

/* ── Bag — totals ───────────────────────────────────────────────── */
.ms-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-line);
  gap: 12px;
}
.ms-total-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
}
.ms-total-price {
  font-family: var(--font-serif), Georgia, serif;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

/* ── Product options (size / colour selector) ───────────────────── */
.ms-options { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.ms-options button {
  border: 1px solid var(--color-line);
  padding: 9px 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  background: #fff;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ms-options button:hover { border-color: var(--color-charcoal); }

/* ── Empty state ────────────────────────────────────────────────── */
.ms-empty {
  padding: 44px 0 28px;
  color: var(--color-muted);
  font-size: 13.5px;
  line-height: 1.65;
  text-align: center;
  letter-spacing: 0.01em;
}

/* ── Status text ────────────────────────────────────────────────── */
.ms-status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--color-muted);
  letter-spacing: 0.01em;
}
.ms-status-success { color: #2d6a3f; }
.ms-status-error   { color: var(--color-red-700, #bf000f); }

/* ── Wishlist grid ──────────────────────────────────────────────── */
.ms-wishlist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 40px;
}
.ms-wishlist-grid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.ms-wishlist-grid-info { margin-top: 14px; }
.ms-wishlist-grid h3 {
  font-family: var(--font-serif), Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ms-wishlist-grid p { margin: 6px 0; font-size: 12.5px; color: var(--color-muted); }
.ms-wishlist-grid button { margin-right: 10px; margin-top: 12px; }


/* ── Product card — colour swatches ─────────────────────────────── */
.ms-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--color-line);
  flex-shrink: 0;
  transition: transform 0.2s var(--ms-ease);
}
.ms-swatch:hover { transform: scale(1.25); }

/* ── Product card — new badge ───────────────────────────────────── */
.ms-badge-new {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  pointer-events: none;
  padding: 4px 8px;
  background: var(--color-ink);
  color: var(--color-ivory);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ── Product card — wishlist button ─────────────────────────────── */
.ms-wishlist-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 20;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246,243,238,0.92);
  color: var(--color-ink);
  transition: background 0.2s, color 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ms-wishlist-btn:hover { background: var(--color-ivory); }
.ms-wishlist-btn.ms-saved { color: var(--color-gold); }

/* ── Card image overlay (on hover) ──────────────────────────────── */
.ms-card-img-wrap { position: relative; }
.ms-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,9,0.14) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.45s var(--ms-ease);
  pointer-events: none;
  z-index: 1;
}
.group:hover .ms-card-overlay { opacity: 1; }

/* ── Card info section ──────────────────────────────────────────── */
.ms-card-info {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-card-category {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--color-muted);
}
.ms-card-name {
  font-family: var(--font-serif), Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--color-ink);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}
.ms-card-name:hover { color: var(--color-brown); }
@media (max-width: 639px) { .ms-card-name { font-size: 15px; } }
.ms-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.ms-card-price {
  font-size: 13px;
  color: var(--color-charcoal);
  font-weight: 500;
  letter-spacing: 0.01em;
}
@media (max-width: 639px) { .ms-card-price { font-size: 12px; } }
.ms-card-swatches { display: flex; gap: 5px; align-items: center; }

/* ── Filter sidebar mobile ──────────────────────────────────────── */
@media (max-width: 1023px) {
  aside.ms-filter-open { display: block !important; }
  .ms-wishlist-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
