/* ══════════════════════════════════════════════════════════════════
   STORE STYLES — layered on top of the shared theme.css
   (product grid, cart drawer, quantity steppers, price tags)
   ══════════════════════════════════════════════════════════════════ */

/* ─── STOREFRONT HEADER ─── */
.shop-head {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 40px 8px;
}

.shop-lead {
  font-size: 14px;
  color: #8B9CB0;
  line-height: 1.9;
  letter-spacing: 0.3px;
  max-width: 620px;
  margin-top: 10px;
}

/* ─── PRODUCT GRID ─── */
.shop-wrap {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  padding: 24px 40px 90px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  background: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
}

.p-card {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background 0.18s;
}

.p-card:hover { background: var(--surface); }

.p-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(6,182,212,0.06), rgba(124,58,237,0.05)),
    var(--bg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.p-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholder glyph when a product has no image */
.p-img.empty::after {
  content: '◈';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  color: var(--text-dim);
  opacity: 0.5;
}

.p-tag {
  position: absolute;
  top: 10px; left: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 9px;
  background: rgba(7,11,20,0.8);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.p-tag.out { color: var(--accent-2); border-color: rgba(124,58,237,0.5); }

.p-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.p-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}

.p-desc {
  font-size: 12.5px;
  color: #8B9CB0;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.p-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.5px;
}

.p-add {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
  transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
  white-space: nowrap;
}

.p-add:hover { background: #05a0ba; box-shadow: 0 0 22px rgba(6,182,212,0.3); }
.p-add:active { transform: scale(0.97); }
.p-add:disabled {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* keeps clock + cart together on the right of the top bar, and unlike the
   theme's .tb-status this stays visible on mobile so the cart is always reachable */
.tb-right { display: flex; align-items: center; gap: 16px; }
@media (max-width: 700px) { .tb-clock { display: none !important; } }

/* ─── CART BUTTON (top bar) ─── */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(6,182,212,0.35);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-btn:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(6,182,212,0.18); }

.cart-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-count.zero { display: none; }

/* favourites button in the top bar (mirrors the cart button) */
.fav-btn svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.fav-btn.active { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.5); }
.fav-btn.active svg path { fill: currentColor; stroke: none; }
.cart-count.rose { background: #ff4d6d; }

/* ─── CART DRAWER ─── */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(4,7,14,0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(420px, 100vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 1450;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}

.cart-drawer.open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
}

.cart-x {
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.cart-x:hover { color: var(--accent); border-color: var(--border); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px;
}

.cart-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-align: center;
  padding: 48px 0;
}

.cart-line {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line-img {
  width: 58px; height: 58px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}

.cart-line-mid { flex: 1; min-width: 0; }

.cart-line-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.cart-line-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.cart-line-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.cart-line-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--green);
  white-space: nowrap;
}

/* qty stepper */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
}

.qty button {
  width: 26px; height: 26px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.qty button:hover { color: var(--accent); background: var(--surface); }

.qty span {
  min-width: 30px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
}

.cart-foot {
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px;
  flex-shrink: 0;
}

.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cart-total-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.cart-total-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 0.5px;
}

.checkout-btn {
  width: 100%;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 15px;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
  transition: background 0.18s, box-shadow 0.18s;
}

.checkout-btn:hover { background: #05a0ba; box-shadow: 0 0 30px rgba(6,182,212,0.35); }
.checkout-btn:disabled { opacity: 0.55; cursor: wait; }

.cart-secure {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.7;
}

.cart-secure b { color: var(--green); font-weight: 400; }

.cart-msg {
  min-height: 16px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-align: center;
  color: var(--accent-2);
}

/* ─── LOADING / EMPTY CATALOGUE ─── */
.shop-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 48px 0;
  text-align: center;
}

/* ─── TOAST (added to cart) ─── */
.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid rgba(6,182,212,0.4);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 12px 20px;
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 0 30px rgba(6,182,212,0.15);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .shop-head { padding: 32px 20px 4px; }
  .shop-wrap { padding: 20px 20px 70px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .p-name { font-size: 17px; }
  .p-add { padding: 8px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════════════
   CARD ACTIONS (favourite / view / share) + PRODUCT DETAIL + FAV FILTER
   ══════════════════════════════════════════════════════════════════ */

/* product name and image are clickable -> open the product detail */
.p-name {
  background: none; border: none; padding: 0; width: 100%;
  text-align: left; cursor: pointer; transition: color 0.18s;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px; font-weight: 800; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text); line-height: 1.1;
}
.p-name:hover, .p-name:focus-visible { color: var(--accent); outline: none; }
.p-img { cursor: pointer; }

/* TOUCH-FIRST: the actions live as a visible row inside the card body, BELOW
   the image, so they never cover it. On hover-capable desktops (mouse) they are
   lifted out into an overlay on the image that reveals on hover. */
.p-actions {
  display: flex; gap: 8px; z-index: 3;
  margin-top: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .p-actions {
    position: absolute; top: 10px; right: 10px; margin-top: 0;
    flex-direction: column;
    opacity: 0; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  /* reveal on hover; keep visible when the item is favourited */
  .p-card:hover .p-actions,
  .p-card.faved .p-actions { opacity: 1; transform: none; }
}

.p-action-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.1s;
}
.p-action-btn:hover, .p-action-btn:focus-visible {
  color: var(--accent); border-color: rgba(6, 182, 212, 0.5); outline: none;
}
.p-action-btn:active { transform: scale(0.92); }
.p-action-btn svg {
  width: 17px; height: 17px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
/* favourite: outline heart normally, filled rose when active */
.p-action-btn.fav.active { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.55); }
.p-action-btn.fav.active svg path { fill: currentColor; stroke: none; }

/* ─── favourites filter chip (catalogue header) ─── */
.fav-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); background: transparent;
  border: 1px solid var(--border); padding: 6px 12px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.fav-chip:hover { color: var(--text); border-color: rgba(6, 182, 212, 0.4); }
.fav-chip.active { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.55); }
.fav-chip svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.fav-chip.active svg path { fill: currentColor; stroke: none; }
.fav-chip .n { opacity: 0.8; }

/* ─── PRODUCT DETAIL (inside-the-product) MODAL ─── */
.pd-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1500; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.pd-overlay.open { opacity: 1; pointer-events: auto; }

.pd {
  position: fixed; z-index: 1550; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(900px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border);
  display: grid; grid-template-columns: 1.05fr 1fr;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.12), 0 24px 60px rgba(0, 0, 0, 0.6);
}
.pd.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

/* top scan line, matching the site's modal language */
.pd::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6; z-index: 2;
}

.pd-media {
  background:
    linear-gradient(135deg, rgba(6,182,212,0.06), rgba(124,58,237,0.05)), var(--bg);
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  min-height: 340px; position: relative;
}
.pd-media img { width: 100%; height: 100%; max-height: 90vh; object-fit: contain; display: block; }
.pd-media.empty::after { content: '◈'; font-size: 54px; color: var(--text-dim); opacity: 0.5; }

.pd-info { padding: 34px 32px 30px; display: flex; flex-direction: column; gap: 14px; }
.pd-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--accent-2); letter-spacing: 3px; text-transform: uppercase;
}
.pd-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: clamp(28px, 5vw, 38px);
  font-weight: 900; line-height: 1.03; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text);
}
.pd-price { font-family: 'JetBrains Mono', monospace; font-size: 21px; color: var(--green); }
.pd-stock {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; width: fit-content;
  padding: 4px 10px; border: 1px solid;
}
.pd-stock.in  { color: var(--green);    border-color: rgba(0, 229, 255, 0.35); }
.pd-stock.out { color: var(--accent-2); border-color: rgba(124, 58, 237, 0.5); }
.pd-desc { font-size: 13.5px; color: #8B9CB0; line-height: 1.9; white-space: pre-wrap; }

.pd-actions { margin-top: auto; padding-top: 12px; display: flex; gap: 10px; align-items: center; }
.pd-add {
  flex: 1;
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 800;
  letter-spacing: 3px; text-transform: uppercase; padding: 13px;
  cursor: pointer; background: var(--accent); border: 1px solid var(--accent); color: #000;
  transition: background 0.18s, box-shadow 0.18s;
}
.pd-add:hover { background: #05a0ba; box-shadow: 0 0 26px rgba(6, 182, 212, 0.32); }
.pd-add:disabled { background: transparent; border-color: var(--border); color: var(--text-dim); cursor: not-allowed; box-shadow: none; }
.pd-actions .p-action-btn { width: 46px; height: 46px; }
.pd-actions .p-action-btn svg { width: 20px; height: 20px; }

.pd-close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 36px; height: 36px; background: rgba(7, 11, 20, 0.7);
  border: 1px solid var(--border); color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace; font-size: 15px; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.pd-close:hover { color: var(--accent); border-color: rgba(6, 182, 212, 0.4); }

@media (max-width: 720px) {
  .pd { grid-template-columns: 1fr; }
  .pd-media { border-right: none; border-bottom: 1px solid var(--border); min-height: 0; max-height: 42vh; }
  .pd-media img { max-height: 42vh; }
  .pd-info { padding: 24px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .cart-overlay, .toast,
  .pd, .pd-overlay, .p-actions { transition: none; }
}
