/* ---- Unicentre Technology shop — same brand tokens as the ERP's pos.css ---- */
:root {
  --bg:            #f6f6f7;
  --surface:       #ffffff;
  --ink:           #0a0a0a;
  --ink-soft:      #3f3f46;
  --muted:         #71717a;
  --line:          #e4e4e7;
  --accent:        #c61f27;
  --accent-hover:  #a5171d;
  --accent-warm:   #f2a824;
  --on-accent:     #ffffff;
  --stock-in:      #1a7f37;
  --stock-low:     #b45309;
  --stock-out:     #b3261e;
  --radius:        12px;
  --shadow:        0 1px 2px rgba(0,0,0,.06), 0 10px 28px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Josefin Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

a { color: inherit; }

.shop-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: .9rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  position: sticky; top: 0; z-index: 20;
}
.shop-topbar img { height: 40px; width: auto; }
.shop-topbar .shop-name { font-weight: 700; font-size: 1.05rem; }
.shop-topbar .shop-tagline { color: var(--muted); font-size: .8rem; }

.shop-cart-link {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; white-space: nowrap;
}
.shop-cart-link:hover { border-color: var(--accent); color: var(--accent); }
.shop-cart-badge {
  background: var(--accent); color: var(--on-accent); border-radius: 999px;
  font-size: .72rem; font-weight: 700; min-width: 1.2rem; height: 1.2rem; line-height: 1.2rem;
  text-align: center; padding: 0 .3rem;
}

.shop-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.shop-hero { text-align: center; padding: 1.5rem 0 2rem; }
.shop-hero h1 { margin: 0 0 .4rem; font-size: 1.6rem; }
.shop-hero p { color: var(--muted); margin: 0; }

.shop-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.25rem 0; }
.shop-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; text-decoration: none;
}
.shop-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem;
}

.shop-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .15s ease;
}
.shop-card:hover { transform: translateY(-2px); }
.shop-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex: 1; }
.shop-card .thumb {
  aspect-ratio: 1 / 1; background: #f0f0f1; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.shop-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-card .thumb .no-photo { color: var(--muted); font-size: .8rem; }
.shop-card .body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.shop-card .brand { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.shop-card .model { font-weight: 600; line-height: 1.25; }
.shop-card .price { margin-top: auto; font-weight: 700; color: var(--accent); }
.shop-card .avail { font-size: .75rem; color: var(--muted); }

.stock-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.stock-badge::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.stock-badge.is-in-stock { color: var(--stock-in); }
.stock-badge.is-low-stock { color: var(--stock-low); }
.stock-badge.is-out-of-stock { color: var(--stock-out); }

.shop-empty { text-align: center; color: var(--muted); padding: 3rem 0; }

.shop-pagination { display: flex; justify-content: center; margin-top: 2rem; }
.shop-pagination nav { display: flex; gap: .35rem; }

/* ---- Product detail ---- */
.shop-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
@media (max-width: 760px) { .shop-detail { grid-template-columns: 1fr; } }

.shop-gallery-main {
  aspect-ratio: 1 / 1; background: #f0f0f1; border-radius: var(--radius); overflow: hidden;
  position: relative; border: 1px solid var(--line);
}
.shop-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.shop-gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.shop-gallery-thumbs button {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid transparent;
  padding: 0; cursor: pointer; background: #f0f0f1;
}
.shop-gallery-thumbs button.is-active { border-color: var(--accent); }
.shop-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* cursor-following zoom lens, same mechanism as the ERP's Stock View */
.shop-zoom { position: relative; cursor: zoom-in; }
.shop-zoom__lens {
  position: absolute; inset: 0; background-repeat: no-repeat; background-size: 200%;
  opacity: 0; transition: opacity .12s ease; pointer-events: none;
}
.shop-zoom.is-zooming .shop-zoom__lens { opacity: 1; }

.shop-spec-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 .25rem; }
.shop-spec-brand { color: var(--muted); text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; margin-bottom: .75rem; }
.shop-spec-price { font-size: 1.5rem; font-weight: 800; color: var(--accent); margin: .5rem 0 1rem; }
.shop-spec-table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
.shop-spec-table td { padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.shop-spec-table td:first-child { color: var(--muted); width: 40%; }

.shop-whatsapp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #25D366; color: #fff; border: none; cursor: pointer;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  box-shadow: var(--shadow); font-family: inherit; font-size: 1rem;
}
.shop-whatsapp-btn:hover { background: #1ebe57; }
.shop-whatsapp-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Add to cart / quantity stepper ---- */
.shop-qty-stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden;
}
.shop-qty-stepper button {
  background: var(--surface); border: none; width: 2.1rem; height: 2.1rem; font-size: 1.1rem;
  cursor: pointer; color: var(--ink-soft);
}
.shop-qty-stepper button:hover { background: var(--bg); }
.shop-qty-stepper input {
  width: 2.6rem; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; font-family: inherit; font-size: .95rem; height: 2.1rem;
  -moz-appearance: textfield;
}
.shop-qty-stepper input::-webkit-outer-spin-button,
.shop-qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.shop-add-row { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; }
.shop-addcart-btn {
  background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px;
  padding: .8rem 1.4rem; font-weight: 700; font-family: inherit; font-size: 1rem; cursor: pointer;
}
.shop-addcart-btn:hover { background: var(--accent-hover); }
.shop-addcart-btn:disabled { opacity: .7; cursor: default; }
.shop-addcart-btn--card {
  margin: 0 .9rem .9rem; padding: .55rem .9rem; font-size: .85rem;
}
.shop-addcart-btn--sm { padding: .55rem .9rem; font-size: .85rem; }

/* ---- Wishlist heart toggle ---- */
.shop-wish-btn {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  width: 2rem; height: 2rem; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  box-shadow: var(--shadow); line-height: 1;
}
.shop-wish-btn:hover { color: var(--accent); }
.shop-wish-btn.is-active { color: var(--accent); }
.shop-wish-btn--inline {
  position: static; width: auto; height: auto; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  padding: .75rem 1.2rem; font-family: inherit; font-size: .95rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: .4rem; box-shadow: none;
}
.shop-wish-btn--inline:hover { border-color: var(--accent); color: var(--accent); }
.shop-wish-btn--inline.is-active { border-color: var(--accent); color: var(--accent); background: #fdf1f1; }

.shop-price-note { color: var(--muted); font-size: .8rem; margin: .5rem 0 1rem; }

.shop-back { display: inline-block; margin-bottom: 1rem; color: var(--muted); text-decoration: none; font-size: .88rem; }
.shop-back:hover { color: var(--ink); }

.shop-related { margin-top: 3rem; }
.shop-related h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.shop-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem 3rem; }

/* ---- Cart page ---- */
.shop-cart-items { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.shop-cart-row {
  display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem;
}
.shop-cart-row__thumb {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f0f0f1;
  display: flex; align-items: center; justify-content: center;
}
.shop-cart-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-cart-row__thumb .no-photo { color: var(--muted); font-size: .65rem; text-align: center; }
.shop-cart-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.shop-cart-row__name a { font-weight: 600; text-decoration: none; }
.shop-cart-row__name a:hover { color: var(--accent); }
.shop-cart-row__price { font-size: .82rem; color: var(--muted); }
.shop-cart-row__right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.shop-cart-row__linetotal { font-weight: 700; color: var(--accent); }
.shop-cart-row__remove {
  background: none; border: none; color: var(--muted); font-size: .78rem; cursor: pointer; text-decoration: underline;
  padding: 0;
}
.shop-cart-row__remove:hover { color: var(--accent); }

.shop-cart-summary {
  display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem;
  font-weight: 700; padding-top: .75rem; border-top: 2px solid var(--line);
}
.shop-cart-total { color: var(--accent); font-size: 1.4rem; }

.shop-checkout {
  max-width: 480px; margin: 2rem auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.shop-checkout h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.shop-field { display: block; margin-bottom: 1rem; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.shop-field input, .shop-field textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .75rem; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: .95rem; color: var(--ink); background: var(--bg);
}
.shop-field input:focus, .shop-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.shop-clear-btn {
  display: block; width: 100%; text-align: center; background: none; border: none; color: var(--muted);
  font-size: .82rem; text-decoration: underline; cursor: pointer; margin-top: 1rem; padding: .5rem;
}
.shop-clear-btn:hover { color: var(--accent); }

@media (max-width: 520px) {
  .shop-cart-row { flex-wrap: wrap; }
  .shop-cart-row__right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; margin-left: 80px; }
}

/* ---- Wishlist page ---- */
.shop-wishlist-items { display: flex; flex-direction: column; gap: .75rem; }
.shop-wishlist-row {
  display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem;
}
.shop-wishlist-row__thumb {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f0f0f1;
  display: flex; align-items: center; justify-content: center;
}
.shop-wishlist-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-wishlist-row__thumb .no-photo { color: var(--muted); font-size: .65rem; text-align: center; }
.shop-wishlist-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.shop-wishlist-row__name a { font-weight: 600; text-decoration: none; }
.shop-wishlist-row__name a:hover { color: var(--accent); }
.shop-wishlist-row__price { font-size: .9rem; font-weight: 700; color: var(--accent); }
.shop-wishlist-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex-shrink: 0; }

@media (max-width: 520px) {
  .shop-wishlist-row { flex-wrap: wrap; }
  .shop-wishlist-row__right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; margin-left: 80px; }
}
