/* ============ SWAG MITRA ============ */
:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #141414;
  --muted: #6b6a66;
  --line: #e4e2db;
  --accent: #e2553c;
  --accent-ink: #ffffff;
  --ok: #1f8a4c;
  --warn: #c77700;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.page-title { font-size: 1.5rem; margin: 20px 0 12px; }

/* ---------- Header ---------- */
#site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 246, 242, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.demo-bar { background: #fff3cd; color: #6b4e00; font-size: .78rem; text-align: center; padding: 4px 8px; }
.hdr { display: flex; align-items: center; gap: 12px; height: 60px; position: relative; }
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: -.5px; text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.cart-btn { position: relative; display: inline-flex; padding: 8px; text-decoration: none; }
.badge { position: absolute; top: 0; right: -2px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.icon-btn { background: none; border: 0; padding: 8px; cursor: pointer; display: inline-flex; line-height: 1; }
.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: inline-flex; margin-left: -8px; }
  .logo { margin-right: auto; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: var(--card);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .nav a.active { border-bottom-color: var(--line); color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  padding: 13px 20px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-sm { padding: 9px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- Catalog ---------- */
.strip { background: var(--ink); color: #fff; text-align: center; font-size: .85rem; padding: 8px 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: .9rem; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-bottom: 32px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.card-img { position: relative; aspect-ratio: 4 / 5; background: #ecebe6; display: block; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body .btn { margin-top: auto; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; font-size: .85em; margin-left: 4px; }
.price .off { color: var(--ok); font-size: .85em; margin-left: 6px; }

.skeleton { background: linear-gradient(90deg, #ecebe6 25%, #f4f3ef 50%, #ecebe6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); aspect-ratio: 4 / 6; }
@keyframes shimmer { to { background-position: -200% 0; } }

.state { text-align: center; padding: 48px 16px; color: var(--muted); }
.state .btn { margin-top: 14px; }

/* ---------- Product page ---------- */
.pdp { display: grid; gap: 24px; padding: 16px 0 40px; }
@media (min-width: 860px) { .pdp { grid-template-columns: 1.1fr 1fr; gap: 40px; padding-top: 28px; } }
.gallery-main { aspect-ratio: 4 / 5; background: #ecebe6; border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb { flex: none; width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #ecebe6; }
.thumb.on { border-color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: 1.5rem; margin: 0 0 6px; line-height: 1.25; }
.pdp .price { font-size: 1.35rem; }
.cat-label { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.size { min-width: 52px; padding: 10px 12px; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; cursor: pointer; font-weight: 600; }
.size.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.size-msg { color: var(--danger); font-size: .88rem; min-height: 1.3em; margin: 4px 0; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.pdp-actions { display: grid; gap: 10px; margin: 14px 0; }
@media (min-width: 480px) { .pdp-actions { grid-template-columns: 1fr 1fr; } }
.desc { white-space: pre-line; color: #333; }
.trust { display: grid; gap: 6px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: .9rem; margin-top: 16px; }

/* ---------- Bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, 0); z-index: 100; display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-wrap.open { background: rgba(0, 0, 0, .45); }
.sheet { background: var(--card); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; transform: translateY(100%); transition: transform .2s; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet .btn { margin-top: 14px; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; } }

/* ---------- Cart ---------- */
.layout-2 { display: grid; gap: 20px; padding-bottom: 40px; }
@media (min-width: 860px) { .layout-2 { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.line { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line img, .line .noimg { width: 76px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: #ecebe6; }
.line-name { font-weight: 600; text-decoration: none; display: block; line-height: 1.3; }
.line-meta { font-size: .85rem; color: var(--muted); }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: var(--card); cursor: pointer; font-size: 1.1rem; }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 30px; text-align: center; font-weight: 600; }
.rm { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; padding: 4px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-total { font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.panel .btn { margin-top: 14px; }
.sticky-sum { position: sticky; top: 76px; }

/* ---------- Checkout ---------- */
.form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 5px; }
.field label { font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; outline: none;
  font-size: 16px; /* iOS zoom roko */
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--danger); }
.field .err-msg { color: var(--danger); font-size: .8rem; display: none; }
.field.err .err-msg { display: block; }
.pay-opts { display: grid; gap: 10px; }
.pay-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.pay-opt:has(input:checked) { border-color: var(--ink); }
.pay-opt input { margin-top: 3px; accent-color: var(--ink); width: 18px; height: 18px; }
.pay-opt small { display: block; color: var(--muted); }
.mini-line { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: .9rem; }
.mini-line img, .mini-line .noimg { width: 44px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: #ecebe6; flex: none; }
.mini-line .grow { flex: 1; min-width: 0; }
.mini-line .grow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secure { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* ---------- Success ---------- */
.success { max-width: 520px; margin: 40px auto; text-align: center; }
.tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 16px; }
.success .panel { text-align: left; margin: 20px 0; }
.success .btn { margin: 6px; }

/* ---------- Policies ---------- */
.policy { max-width: 780px; padding-bottom: 40px; }
.policy section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; scroll-margin-top: 80px; }
.policy h2 { margin-top: 0; font-size: 1.2rem; }

/* ---------- Footer ---------- */
#site-footer { background: var(--ink); color: #ddd; margin-top: 24px; }
.foot { padding: 28px 16px 90px; display: grid; gap: 18px; }
.foot .muted { color: #9a9a9a; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.foot-links a { text-decoration: none; color: #ddd; font-size: .9rem; }
.foot-links a:hover { color: #fff; }

/* ---------- WhatsApp + toast ---------- */
.wa-float { position: fixed; right: 16px; bottom: 16px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); z-index: 60; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Admin ---------- */
.admin-wrap { padding: 20px 16px 40px; }
.login-box { max-width: 380px; margin: 40px auto; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.admin-grid { display: grid; gap: 20px; }
@media (min-width: 980px) { .admin-grid { grid-template-columns: 420px 1fr; align-items: start; } }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-list label { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .9rem; background: #fff; }
.check-list label:has(input:checked) { border-color: var(--ink); }
.img-list { display: flex; flex-wrap: wrap; gap: 8px; }
.img-item { position: relative; width: 72px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: #ecebe6; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: .75rem; line-height: 1; }
.img-item .first { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .62rem; text-align: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ok); }
.a-item { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.a-item:last-child { border-bottom: 0; }
.a-item img, .a-item .noimg { width: 60px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: #ecebe6; }
.a-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.a-actions .btn { padding: 6px 10px; font-size: .8rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eee; vertical-align: middle; }
.pill.ok { background: #dff3e6; color: var(--ok); }
.pill.warn { background: #fdf0d9; color: var(--warn); }
.pill.off { background: #f3dcd9; color: var(--danger); }
.order { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; font-size: .92rem; }
.order:last-child { border-bottom: 0; }
.order-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.order select { padding: 7px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; }
.order-items { color: #333; }
.order-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
