/* =========================================================
   Shiba Tech Repair — shop, cart and checkout
   Extends assets/css/styles.css (load that first)
   ========================================================= */

/* ---------- Cart button in nav ---------- */
.cart-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); color: var(--text);
  display: grid; place-items: center; transition: .2s;
}
.cart-btn:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.cart-btn__count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--grad-accent); color: #fff;
  font-size: .72rem; font-weight: 700; font-family: var(--ff-head);
  display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: .2s;
}
.cart-btn__count.on { opacity: 1; transform: scale(1); }

/* ---------- Category filter chips ---------- */
.shop-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
.chip {
  padding: 10px 20px; border-radius: 999px; font-family: var(--ff-head); font-weight: 600; font-size: .92rem;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-strong); color: var(--muted); transition: .2s;
}
.chip:hover { color: var(--text); background: rgba(255,255,255,.09); }
.chip--on { background: var(--grad-accent); border-color: transparent; color: #fff; box-shadow: var(--shadow-glow); }
.shop-count { text-align: center; margin-bottom: 34px; }

/* ---------- Product card ---------- */
.product { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.product__media {
  position: relative; display: block; aspect-ratio: 4/3; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--line);
}
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.product:hover .product__media img { transform: scale(1.06); }
.product__badge {
  position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700;
  font-family: var(--ff-head); letter-spacing: .03em;
}
.product__cat {
  display: inline-block; margin: 20px 24px 0; font-size: .74rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--orange);
}
.product h3 { font-size: 1.12rem; margin: 8px 24px 6px; }
.product h3 a:hover { color: var(--orange); }
.product > p { color: var(--muted); font-size: .92rem; margin: 0 24px; flex: 1; }
.product__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 20px 24px 24px;
}
.product__price { font-family: var(--ff-head); font-weight: 700; font-size: 1.5rem; }
.product__foot .btn { padding: 11px 18px; font-size: .89rem; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: start; }
.product-detail__media {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-strong);
  background: #fff; box-shadow: var(--shadow);
}
.product-detail__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product-detail__price {
  font-family: var(--ff-head); font-weight: 700; font-size: 2.6rem;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 18px;
}
.spec-list { display: grid; gap: 11px; margin-bottom: 28px; }
.spec-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .96rem; }
.spec-list svg { color: var(--orange); flex: none; margin-top: 4px; }
.product-detail__buy { display: flex; gap: 14px; margin-bottom: 18px; }

/* ---------- Quantity stepper ---------- */
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--navy-900); overflow: hidden;
}
.qty__btn {
  width: 44px; height: 52px; background: none; border: 0; color: var(--text);
  font-size: 1.3rem; font-weight: 600; transition: .2s;
}
.qty__btn:hover { background: rgba(255,255,255,.08); color: var(--orange); }
.qty__input {
  width: 52px; height: 52px; text-align: center; background: none; border: 0;
  color: var(--text); font-family: var(--ff-head); font-weight: 700; font-size: 1.05rem;
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm { margin-top: 8px; }
.qty--sm .qty__btn { width: 30px; height: 30px; font-size: 1rem; }
.qty--sm .qty__val {
  min-width: 30px; text-align: center; font-family: var(--ff-head);
  font-weight: 700; font-size: .9rem;
}

.stock-note { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .93rem; margin-bottom: 24px; }
.dot-ok, .dot-low { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-ok  { background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,.18); }
.dot-low { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,183,3,.18); }

.assurances { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.assurance { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .89rem; }
.assurance svg { color: var(--orange); flex: none; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(5,9,18,.72); backdrop-filter: blur(3px); z-index: 200;
  animation: cart-fade .25s ease;
}
@keyframes cart-fade { from { opacity: 0; } to { opacity: 1; } }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 201;
  background: var(--navy-850); border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1); box-shadow: -20px 0 60px -20px rgba(0,0,0,.8);
}
.cart-drawer.open { transform: none; }
.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
}
.cart-drawer__head h3 { font-size: 1.2rem; }
.cart-drawer__close { background: none; border: 0; color: var(--muted); display: grid; place-items: center; transition: .2s; }
.cart-drawer__close:hover { color: var(--text); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 18px 24px; }
.cart-drawer__foot { padding: 22px 24px; border-top: 1px solid var(--line); background: var(--navy-900); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cart-total span { color: var(--muted); }
.cart-total strong { font-family: var(--ff-head); font-size: 1.6rem; }
.cart-ship { color: var(--orange); font-size: .85rem; margin-bottom: 16px; min-height: 18px; }

.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #fff; flex: none; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__info strong { display: block; font-size: .96rem; margin-bottom: 3px; }
.cart-item__price { color: var(--orange); font-weight: 600; font-size: .92rem; }
.cart-item__x { background: none; border: 0; color: var(--muted-2); align-self: flex-start; padding: 4px; transition: .2s; }
.cart-item__x:hover { color: var(--red); }

.cart-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.cart-empty svg { color: var(--muted-2); margin-bottom: 16px; }
.cart-empty p { margin-bottom: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  padding: 14px 24px; border-radius: 999px; font-weight: 600; font-size: .93rem;
  box-shadow: var(--shadow); z-index: 300; opacity: 0; pointer-events: none; transition: .3s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Order confirmation ---------- */
.order-done { max-width: 620px; margin-inline: auto; text-align: center; }
.order-done__icon {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 26px;
}
.order-done__icon.ok { background: rgba(46,204,113,.14); border: 1px solid rgba(46,204,113,.4); color: #2ecc71; }
.order-done__icon.warn { background: rgba(255,183,3,.14); border: 1px solid rgba(255,183,3,.4); color: var(--amber); }
.order-done h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 14px; }
.order-summary {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin: 32px 0 16px;
}
.order-line { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; color: var(--muted); }
.order-line strong { color: var(--text); }
.order-line--total {
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px;
  font-family: var(--ff-head); font-size: 1.15rem;
}
.order-line--total span, .order-line--total strong { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .product-detail { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  .cart-btn { width: 40px; height: 40px; }
  .product-detail__buy { flex-direction: column; }
  .product-detail__buy .qty { align-self: flex-start; }
  .product__foot { flex-direction: column; align-items: stretch; }
  .product__foot .btn { width: 100%; }
}
