/* ===== Tomorrow Hardware: ขาว / ครีม / ดำ ===== */
:root {
  --white: #ffffff;
  --cream: #f6f1e7;
  --cream-2: #ece3d2;
  --black: #141414;
  --ink: #1d1b18;
  --muted: #6f685c;
  --line: #e4dbca;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 20, 20, 0.08);
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .logo { font-family: "Prompt", sans-serif; line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--black);
  font-weight: 600; cursor: pointer; transition: transform .15s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--black); color: var(--cream); }
.btn-dark:hover { background: #2b2926; }
.btn-light { background: var(--cream); color: var(--black); border-color: var(--cream); }
.btn-light:hover { background: var(--white); }
.btn-ghost { background: transparent; color: var(--black); }
.btn-ghost:hover { background: var(--black); color: var(--cream); }
.btn-ghost-light { background: transparent; color: var(--cream); border-color: rgba(246,241,231,.6); }
.btn-ghost-light:hover { background: var(--cream); color: var(--black); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; letter-spacing: .02em; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--black); color: var(--cream);
  display: grid; place-items: center; font-weight: 700;
}
.logo b { font-weight: 700; }
.logo span { font-weight: 400; color: var(--muted); }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 16px; border-radius: 999px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.nav a:hover { color: var(--black); background: var(--cream); }
.nav a.active { color: var(--cream); background: var(--black); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
  display: grid; place-items: center; transition: background .2s;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--black); color: var(--cream);
  font-size: .72rem; font-weight: 700; display: grid; place-items: center;
}
.cart-count[data-empty="true"] { display: none; }
.menu-btn { display: none; }

/* ===== Hero slider ===== */
.hero { position: relative; background: var(--black); color: var(--cream); overflow: hidden; }
.slides { position: relative; height: clamp(480px, 72vh, 640px); }
.slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .8s ease, visibility .8s;
}
.slide.active { opacity: 1; visibility: visible; }
.slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.06); transition: transform 7s ease; }
.slide.active .slide-bg { transform: scale(1); }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20,20,20,.95) 0%, rgba(20,20,20,.75) 42%, rgba(20,20,20,.1) 100%);
}
.slide-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; }
.slide-text { max-width: 560px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cream-2); border: 1px solid rgba(236,227,210,.35); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.slide h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; color: var(--white); margin-bottom: 16px; }
.slide h1 em { font-style: normal; color: var(--cream-2); font-weight: 300; }
.slide p { color: rgba(246,241,231,.8); font-size: 1.05rem; margin: 0 0 28px; }
.slide-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.price-tag {
  position: absolute; right: 6%; bottom: 14%; z-index: 3;
  background: var(--cream); color: var(--black); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); min-width: 190px;
}
.price-tag small { display: block; color: var(--muted); font-size: .78rem; }
.price-tag strong { font-family: "Prompt"; font-size: 1.35rem; }
.hero-controls {
  position: absolute; left: 0; right: 0; bottom: 28px; z-index: 4;
}
.hero-controls .wrap { display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 8px; }
.dot { width: 28px; height: 4px; border-radius: 4px; border: 0; padding: 0; background: rgba(246,241,231,.3); cursor: pointer; transition: background .3s, width .3s; }
.dot.active { background: var(--cream); width: 48px; }
.arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(246,241,231,.35);
  background: transparent; color: var(--cream); cursor: pointer; display: grid; place-items: center;
}
.arrow:hover { background: rgba(246,241,231,.12); }

/* ===== Perks bar ===== */
.perks { background: var(--cream); border-bottom: 1px solid var(--line); }
.perks .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.perk { display: flex; align-items: center; gap: 12px; }
.perk-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--black); color: var(--cream); display: grid; place-items: center; }
.perk-icon svg { width: 20px; height: 20px; }
.perk b { display: block; font-size: .95rem; }
.perk small { color: var(--muted); font-size: .8rem; }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-cream { background: var(--cream); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.link-arrow { font-weight: 600; border-bottom: 1.5px solid var(--black); padding-bottom: 2px; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10;
  background: var(--black); color: var(--cream);
}
.cat img { width: 100%; height: 100%; object-fit: cover; opacity: .75; transition: transform .5s, opacity .3s; }
.cat:hover img { transform: scale(1.05); opacity: .6; }
.cat-label {
  position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; align-items: end;
}
.cat-label h3 { font-size: 1.25rem; color: var(--white); }
.cat-label small { color: var(--cream-2); }
.cat-go { width: 38px; height: 38px; border-radius: 50%; background: var(--cream); color: var(--black); display: grid; place-items: center; transition: transform .3s; }
.cat:hover .cat-go { transform: rotate(-45deg); }

/* ===== Product cards ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--cream); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.badge {
  position: absolute; top: 12px; left: 12px; background: var(--black); color: var(--cream);
  font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { font-size: .78rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.card h3 { font-size: 1.08rem; font-weight: 600; }
.card-desc { color: var(--muted); font-size: .9rem; margin: 0; }
.specs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.specs li { font-size: .75rem; background: var(--cream); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: auto; padding-top: 6px; }
.price { font-family: "Prompt"; font-size: 1.4rem; font-weight: 600; }
.price-old { color: var(--muted); font-size: .9rem; text-decoration: line-through; }
.buy-row { display: flex; gap: 10px; }
.buy-row .btn { flex: 1; padding: 10px 14px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--white); }
.qty button { width: 36px; height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; }
.qty button:hover { background: var(--cream); }
.qty input {
  width: 36px; height: 40px; border: 0; text-align: center; font-weight: 600; background: transparent;
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm button, .qty-sm input { height: 32px; width: 30px; }

/* ===== Promo band ===== */
.promo { background: var(--black); color: var(--cream); border-radius: 24px; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; }
.promo-text { padding: 56px; }
.promo-text h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--white); margin: 14px 0; }
.promo-text p { color: rgba(246,241,231,.75); margin: 0 0 28px; }
.promo-img { min-height: 320px; background-size: cover; background-position: center; }

/* ===== Page head ===== */
.page-head { background: var(--cream); border-bottom: 1px solid var(--line); padding: 56px 0 40px; }
.page-head .crumbs { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-head p { color: var(--muted); margin: 10px 0 0; max-width: 620px; }

/* Filters */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-weight: 500; transition: all .2s; }
.chip:hover { border-color: var(--black); }
.chip.active { background: var(--black); border-color: var(--black); color: var(--cream); }
.result-count { color: var(--muted); font-size: .9rem; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; }
.info-list { display: grid; gap: 14px; }
.info-card { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.info-card .perk-icon { width: 46px; height: 46px; }
.info-card h3 { font-size: 1rem; margin-bottom: 4px; }
.info-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.info-card a:hover { color: var(--black); text-decoration: underline; }
.form-card { background: var(--cream); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.form-card h2 { font-size: 1.5rem; margin-bottom: 6px; }
.form-card > p { color: var(--muted); margin: 0 0 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--black); }
.field textarea { resize: vertical; min-height: 130px; }
.form-success { display: none; margin-top: 16px; padding: 14px 16px; background: var(--black); color: var(--cream); border-radius: 12px; }
.form-success.show { display: block; }
.map { margin-top: 48px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); height: 380px; background: var(--cream); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(1.05); }

/* ===== Footer ===== */
.site-footer { background: var(--black); color: rgba(246,241,231,.7); padding: 64px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .logo b { color: var(--white); }
.site-footer .logo span { color: var(--cream-2); }
.site-footer .logo-mark { background: var(--cream); color: var(--black); }
.site-footer h4 { color: var(--white); font-family: "Prompt"; margin: 0 0 14px; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(246,241,231,.12); margin-top: 48px; padding-top: 22px; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ===== Cart drawer ===== */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.45); opacity: 0; visibility: hidden; transition: .3s; z-index: 90; }
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--white);
  z-index: 100; transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.25rem; }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--cream); }
.cart-item h4 { margin: 0 0 4px; font-size: .92rem; font-weight: 600; }
.cart-item .unit { color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.cart-item .line-total { font-weight: 600; text-align: right; }
.remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 4px 0; text-decoration: underline; }
.remove:hover { color: var(--black); }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 10px; }
.cart-empty svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: .5; }
.drawer-foot { padding: 20px 22px; border-top: 1px solid var(--line); background: var(--cream); }
.sum-row { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); }
.sum-row.total { color: var(--ink); font-size: 1.15rem; font-weight: 700; margin: 10px 0 16px; }
.drawer-foot .btn { width: 100%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--black); color: var(--cream); padding: 12px 20px; border-radius: 14px; text-align: center;
  z-index: 120; transition: .3s; pointer-events: none; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Shared: ปุ่มเล็ก, ช่องอัปโหลดรูป ===== */
[hidden] { display: none !important; }
.btn:disabled { opacity: .6; cursor: wait; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-sm { padding: 8px 16px; font-size: .88rem; }
.dropzone {
  display: flex; align-items: center; gap: 16px; padding: 16px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 14px; background: var(--cream);
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--black); background: var(--white); }
.dropzone img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--white); flex: none; }
.dropzone-text { font-size: .92rem; color: var(--muted); }
.dropzone-text b { color: var(--ink); }
.dropzone-text small { display: block; margin-top: 2px; font-size: .8rem; }

/* ===== Checkout / Order ===== */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.checkout-grid .form-card { scroll-margin-top: 96px; }
.checkout-grid .form-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.checkout-grid .form-card > div > p, .checkout-grid [data-panel] > p { color: var(--muted); margin: 0 0 20px; }
.hint { color: var(--muted); font-size: .82rem; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 28px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; font-size: .92rem; }
.steps li + li::before { content: ""; width: 28px; height: 1.5px; background: var(--line); margin-right: 4px; }
.steps span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); background: var(--white); font-weight: 700; font-size: .85rem; }
.steps li.active { color: var(--ink); }
.steps li.active span, .steps li.done span { background: var(--black); border-color: var(--black); color: var(--cream); }
.pay-options { display: grid; gap: 12px; margin-bottom: 18px; }
.pay-option {
  display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); transition: border-color .2s, box-shadow .2s;
}
.pay-option:hover { border-color: var(--muted); }
.pay-option:has(input:checked) { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.pay-option input { width: 18px; height: 18px; accent-color: var(--black); flex: none; }
.pay-option b { display: block; }
.pay-option small { color: var(--muted); }
.ship-to { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 16px 0; font-size: .92rem; }
.ship-to p { margin: 4px 0 0; color: var(--muted); }
.link-btn { position: absolute; top: 12px; right: 14px; border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; }
.step-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.summary-card { position: sticky; top: 96px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.summary-card h3 { font-size: 1.2rem; margin-bottom: 12px; }
.summary-card .sum-row.total { margin: 10px 0 0; }
.summary-items { list-style: none; padding: 0; margin: 0 0 16px; }
.summary-items li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.summary-items img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--cream); }
.summary-items b { display: block; font-weight: 600; }
.summary-items small { color: var(--muted); }
.summary-items span { font-weight: 600; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 40px 16px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }
.order-meta { margin: 0 0 8px; display: grid; gap: 4px; font-size: .9rem; }
.order-meta div { display: flex; justify-content: space-between; gap: 12px; }
.order-meta dt { color: var(--muted); }
.order-meta dd { margin: 0; font-weight: 600; }
.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.qr-label { font-weight: 700; letter-spacing: .06em; background: var(--black); color: var(--cream); padding: 6px 16px; border-radius: 999px; font-size: .85rem; }
.qr-img { width: min(300px, 100%); border-radius: 16px; border: 1px solid var(--line); background: var(--white); }
.qr-to { color: var(--muted); margin: 0; font-size: .9rem; }
.pay-steps { margin: 24px 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.pay-steps b { color: var(--ink); }
.slip-form { display: grid; gap: 12px; }
.status-card { text-align: center; }
.status-card p { color: var(--muted); margin: 8px 0 20px; }
.status-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--black); color: var(--cream); display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .perks .wrap { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .promo { grid-template-columns: 1fr; }
  .promo-text { padding: 40px 28px; }
  .contact-grid { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .price-tag { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .menu-btn { display: grid; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: var(--white);
    border-bottom: 1px solid var(--line); padding: 12px 16px; display: none;
  }
  .nav.open { display: flex; }
  .logo span { display: none; }
  .slide::after { background: linear-gradient(180deg, rgba(20,20,20,.55) 0%, rgba(20,20,20,.92) 70%); }
  .slide-content { align-items: flex-end; padding-bottom: 80px; }
  .section { padding: 56px 0; }
  .cat-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 24px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
}

.load-error { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }
