/* ── NARA Hardware store ─────────────────────────────────── */
.hw-page { padding-top: 8rem; min-height: 70vh; }
.hw-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hw-head .section-sub { color: var(--muted); max-width: 620px; margin-top: .8rem; }

.hw-filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hw-chip {
  padding: .45rem 1.1rem; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .82rem; font-weight: 500; transition: all .2s;
}
.hw-chip:hover { color: var(--accent); border-color: var(--accent); }
.hw-chip.active { color: #070B14; background: var(--accent); border-color: var(--accent); }

.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.hw-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .2s, border-color .2s;
}
.hw-card:hover { transform: translateY(-3px); border-color: rgba(0,194,255,.45); }
.hw-card-img { display: block; aspect-ratio: 4/3; background: var(--card2); overflow: hidden; }
.hw-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.hw-card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.hw-cat { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hw-card h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.hw-card h3 a { color: var(--white); text-decoration: none; }
.hw-card p { color: var(--muted); font-size: .85rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hw-card-foot { margin-top: auto; padding-top: .75rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.hw-price { font-weight: 700; font-size: 1.1rem; color: var(--white); font-variant-numeric: tabular-nums; }
.hw-price.req { font-size: .85rem; font-weight: 500; color: var(--muted); }

.hw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--accent); color: #070B14; border: none; border-radius: 8px;
  padding: .6rem 1rem; font: 600 .82rem var(--font-display); cursor: pointer; text-decoration: none;
  transition: background .2s, transform .15s;
}
.hw-btn:hover { background: #33CFFF; }
.hw-btn:active { transform: scale(.97); }
.hw-btn.ghost { background: transparent; color: var(--white); border: 1px solid var(--border); }
.hw-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.hw-btn.added { background: var(--green); }
.hw-btn.lg { padding: .9rem 1.6rem; font-size: .95rem; }
.hw-btn svg { width: 16px; height: 16px; }

.hw-empty { border: 1px dashed var(--border); border-radius: 14px; padding: 4rem 2rem; text-align: center; color: var(--muted); }

/* detail */
.hw-crumb { font-size: .82rem; color: var(--muted); margin-bottom: 2rem; }
.hw-crumb a { color: var(--muted); text-decoration: none; }
.hw-crumb a:hover { color: var(--accent); }
.hw-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: start; }
.hw-detail-img { background: var(--card); border: 1px solid var(--border); border-radius: 16px; aspect-ratio: 1; overflow: hidden; }
.hw-detail-img img { width: 100%; height: 100%; object-fit: contain; padding: 2rem; }
.hw-detail h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; margin: .6rem 0 1rem; }
.hw-detail .hw-price { font-size: 1.8rem; display: block; margin-bottom: 1.5rem; }
.hw-desc { color: var(--muted); line-height: 1.8; white-space: pre-line; margin-bottom: 2rem; }
.hw-buy { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.hw-qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.hw-qty button { background: transparent; border: none; color: var(--white); width: 36px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.hw-qty button:hover { color: var(--accent); }
.hw-qty input { width: 48px; height: 40px; text-align: center; background: transparent; border: none; color: var(--white);
  font: 600 .95rem var(--font-body); -moz-appearance: textfield; }
.hw-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.hw-related { margin-top: 5rem; }
.hw-related h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }

/* cart */
.hw-cart { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.hw-cart-list { display: flex; flex-direction: column; gap: 1rem; }
.hw-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .8rem; }
.hw-line img { width: 84px; height: 84px; object-fit: contain; background: var(--card2); border-radius: 8px; padding: .4rem; }
.hw-line h4 { font-size: .95rem; font-weight: 600; }
.hw-line h4 a { color: var(--white); text-decoration: none; }
.hw-line-meta { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.hw-line-right { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.hw-remove { background: none; border: none; color: var(--muted); font-size: .78rem; cursor: pointer; text-decoration: underline; }
.hw-remove:hover { color: #ff6b6b; }
.hw-summary { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; position: sticky; top: 7rem; }
.hw-summary h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.hw-total { display: flex; justify-content: space-between; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; font-weight: 600; }
.hw-total small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.hw-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.hw-form .full { grid-column: 1 / -1; }
.hw-form label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.hw-form input, .hw-form textarea, .hw-form select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--white); padding: .65rem .8rem; font: .88rem var(--font-body);
}
.hw-form input:focus, .hw-form textarea:focus, .hw-form select:focus { outline: none; border-color: var(--accent); }
.hw-form textarea { min-height: 90px; resize: vertical; }
.hw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hw-msg { margin-top: 1rem; padding: .8rem 1rem; border-radius: 8px; font-size: .88rem; display: none; }
.hw-msg.ok { display: block; color: var(--green); border: 1px solid rgba(0,255,178,.4); background: rgba(0,255,178,.06); }
.hw-msg.err { display: block; color: #ff8080; border: 1px solid rgba(255,107,107,.4); background: rgba(255,107,107,.06); }

/* toast */
.hw-toast { position: fixed; bottom: 6.5rem; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--card); color: var(--white); border: 1px solid var(--accent); border-radius: 10px;
  padding: .75rem 1.2rem; font-size: .88rem; z-index: 300; transition: all .25s; display: flex; gap: 1rem; align-items: center; }
.hw-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hw-toast a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* RTL */
body.rtl .hw-line-right { align-items: flex-start; }
body.rtl .hw-crumb, body.rtl .hw-detail { direction: rtl; }
body.rtl .hw-head .section-label { justify-content: flex-end; }

/* light */
body.light-mode .hw-btn, body.light-mode .hw-chip.active { color: #fff; }
body.light-mode .hw-btn.ghost { color: var(--white); }
body.light-mode .hw-form input, body.light-mode .hw-form textarea, body.light-mode .hw-form select { background: #fff; }

@media (max-width: 1024px) {
  .hw-detail, .hw-cart { grid-template-columns: 1fr; gap: 2rem; }
  .hw-summary { position: static; }
}
@media (max-width: 640px) {
  .hw-page { padding: 7rem 1rem 4rem; }
  .hw-form { grid-template-columns: 1fr; }
  .hw-line { grid-template-columns: 64px 1fr; }
  .hw-line img { width: 64px; height: 64px; }
  .hw-line-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* model no. + spec table */
.hw-card-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.hw-sku { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.hw-model { color: var(--muted); font-size: .85rem; margin: -.4rem 0 1rem; }
.hw-model span { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; margin-inline-end: .35rem; }
.hw-specs { margin-top: 4rem; max-width: 900px; }
.hw-specs h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }
.hw-specs table { width: 100%; border-collapse: collapse; font-size: .9rem; direction: ltr; text-align: left; }
.hw-specs tr { border-bottom: 1px solid var(--border); }
.hw-specs tr:nth-child(odd) { background: var(--card); }
.hw-specs th { width: 36%; padding: .7rem 1rem; color: var(--muted); font-weight: 500; vertical-align: top; }
.hw-specs td { padding: .7rem 1rem; color: var(--white); }
@media (max-width: 640px) { .hw-specs th, .hw-specs td { display: block; width: auto; padding: .35rem .8rem; } .hw-specs td { padding-bottom: .7rem; } }
/* product photos have white backgrounds: frame them in white so they blend */
.hw-card-img, .hw-detail-img { background: #fff; }
.hw-line img { background: #fff; }
