/* 示范衣坊 / Demo Boutique — AIM Growth Solutions demo store */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2724;
  --muted: #6f6760;
  --line: #e7e0d6;
  --accent: #b5653f;
  --accent-dark: #9a5232;
  --wa: #1f8a4c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body.sd-lock { overflow: hidden; }

img { max-width: 100%; display: block; }

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.sd-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Banner + header */
.sd-banner {
  background: var(--ink);
  color: #f5efe7;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
}

.sd-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.sd-header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}

.sd-logo {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.sd-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sd-lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.sd-lang-btn {
  min-width: 44px;
  min-height: 40px;
  border: 0;
  background: transparent;
  font-size: 14px;
}

.sd-lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

.sd-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
}

.sd-cart-btn svg { width: 18px; height: 18px; }

.sd-cart-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

/* Hero */
.sd-hero { padding: 48px 0 36px; }

.sd-hero-in {
  display: grid;
  gap: 32px;
  align-items: center;
}

.sd-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sd-hero h1 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.2;
}

.sd-hero-collage {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.sd-hero-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.sd-hero-collage img:first-child { grid-row: span 2; }

/* Buttons */
.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.sd-btn-dark { background: var(--ink); color: #fff; }
.sd-btn-accent { background: var(--accent); color: #fff; }
.sd-btn-accent:hover { background: var(--accent-dark); }
.sd-btn-wa { background: var(--wa); color: #fff; }
.sd-btn-block { width: 100%; }

.sd-btn:disabled {
  background: #c9c1b7;
  cursor: not-allowed;
}

/* Shop */
.sd-shop { padding: 12px 0 56px; }

.sd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.sd-filter {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
}

.sd-filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sd-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.sd-card:hover {
  box-shadow: 0 10px 28px rgba(43, 39, 36, 0.1);
  transform: translateY(-2px);
}

.sd-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #efe8de;
}

.sd-card.is-soldout img { opacity: 0.55; }

.sd-card[hidden] { display: none; }

.sd-card-body,
.sd-card-name,
.sd-card-price { display: block; }

.sd-card-body { padding: 12px 14px 14px; }

.sd-card-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}

.sd-card-price {
  margin: 0;
  font-weight: 700;
}

.sd-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.sd-tag-low { background: #c0841a; }
.sd-tag-out { background: #6f6760; }

/* Footer */
.sd-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.sd-footer p { margin: 0 0 4px; }

.sd-footer-name {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  color: var(--ink);
  font-size: 18px;
}

/* Modals */
.sd-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 39, 36, 0.55);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}

.sd-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.sd-modal-box {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
}

.sd-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 18px;
}

.sd-product-box {
  max-width: 860px;
  display: grid;
}

.sd-product-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 42vh;
  object-fit: cover;
  background: #efe8de;
}

.sd-product-info { padding: 18px 20px 22px; }

.sd-product-info h2 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
}

.sd-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f3e4da;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.sd-badge[hidden] { display: none; }

.sd-price {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.sd-desc {
  margin: 0 0 14px;
  color: var(--muted);
}

.sd-field { margin-bottom: 14px; }

.sd-field[hidden] { display: none; }

.sd-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.sd-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sd-size {
  min-width: 46px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.sd-size.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.sd-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.sd-qty button {
  width: 42px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 18px;
}

.sd-qty span {
  min-width: 32px;
  text-align: center;
}

/* Drawer */
.sd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(43, 39, 36, 0.45);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s, visibility 0.25s;
}

.sd-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.sd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(43, 39, 36, 0.12);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s;
}

.sd-drawer.is-open {
  transform: none;
  visibility: visible;
}

.sd-drawer-head {
  position: relative;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.sd-drawer-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 44px;
}

.sd-drawer-head .sd-x { top: 16px; right: 12px; }

.sd-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 16px;
}

.sd-drawer-foot {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.sd-empty { color: var(--muted); }
.sd-empty[hidden] { display: none; }

.sd-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sd-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.sd-line img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.sd-line-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.sd-line-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.sd-line .sd-qty button { width: 34px; height: 32px; font-size: 16px; }

.sd-line-right { text-align: right; }

.sd-line-total {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 14px;
}

.sd-remove {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
}

.sd-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  font-size: 16px;
}

.sd-form label,
.sd-form fieldset {
  display: block;
  margin: 0 0 12px;
}

.sd-form label > span,
.sd-form legend {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

.sd-form input[type="text"],
.sd-form input[type="tel"],
.sd-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.sd-form textarea { resize: vertical; }

.sd-form fieldset {
  border: 0;
  padding: 0;
}

.sd-form .sd-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 0 0;
  min-height: 36px;
}

.sd-form .sd-radio span {
  display: inline;
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.sd-error {
  margin: 0;
  color: #b3261e;
  font-size: 14px;
}

.sd-error[hidden] { display: none; }

/* Order preview */
.sd-preview-box {
  max-width: 440px;
  padding: 22px 20px 20px;
}

.sd-preview-box h2 {
  margin: 0 48px 14px 0;
  font-size: 18px;
  line-height: 1.35;
}

.sd-chat {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d9d2c7;
}

.sd-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #075e54;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.sd-chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f3e4da;
  color: var(--accent-dark);
  font-size: 14px;
  line-height: 30px;
  text-align: center;
}

.sd-chat-body {
  padding: 14px;
  background: #ece5dd;
}

.sd-bubble {
  max-width: 92%;
  margin-left: auto;
  padding: 10px 12px;
  border-radius: 10px 0 10px 10px;
  background: #dcf8c6;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.sd-preview-note {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Toast — sits above content, below the drawer, bottom-left so it never covers the cart */
.sd-toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.sd-toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Responsive */
@media (min-width: 640px) {
  .sd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

@media (min-width: 768px) {
  .sd-hero { padding: 64px 0 48px; }
  .sd-hero-in { grid-template-columns: 1fr 1.1fr; gap: 48px; }
  .sd-product-box { grid-template-columns: 1fr 1fr; }
  .sd-product-media img { height: 100%; max-height: none; }
  .sd-product-info { padding: 32px 28px 28px; }
}

@media (min-width: 1024px) {
  .sd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
}

@media (max-width: 480px) {
  .sd-banner { font-size: 12px; }
  .sd-logo { font-size: 19px; }
  .sd-cart-btn [data-t="cart"] { display: none; }
  .sd-hero { padding: 28px 0 24px; }
  .sd-card-body { padding: 10px 12px 12px; }
  .sd-card-name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
