/* ============================================================
   Nails Era — Shop Admin & Display Styles  v2
   ============================================================ */

/* ── Wizard Steps ─────────────────────────────────────────── */
.shop-wizard-steps {
  display: flex; gap: 0; margin-bottom: .75rem;
  border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--admin-border, #e6ebe8);
  background: var(--admin-bg, #f4f6f5);
}
.shop-step-item {
  flex: 1; padding: .42rem .4rem; text-align: center;
  font-size: .74rem; font-weight: 600; color: var(--admin-muted, #6b7c74);
  border-right: 1.5px solid var(--admin-border, #e6ebe8);
  cursor: pointer; transition: background .15s, color .15s;
  position: relative;
}
.shop-step-item:last-child { border-right: none; }
.shop-step-item .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--admin-border, #e6ebe8); color: #888;
  font-size: .65rem; font-weight: 700; margin-right: .25rem;
  transition: background .15s, color .15s;
}
.shop-step-item.active {
  background: var(--admin-primary, #154b34); color: #fff;
}
.shop-step-item.active .step-num {
  background: rgba(255,255,255,.25); color: #fff;
}
.shop-step-item.done { background: var(--admin-primary-mint, #d8f3e7); color: var(--admin-dark, #0f2f22); }
.shop-step-item.done .step-num { background: var(--admin-primary, #154b34); color: #fff; }
.shop-step-pane { display: none; }
.shop-step-pane.active { display: block; }

/* ── Photo Grid ───────────────────────────────────────────── */
.shop-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .6rem;
}
.shop-photo-slot {
  position: relative;
  border: 2px dashed var(--admin-border, #e6ebe8);
  border-radius: 12px; overflow: hidden; aspect-ratio: 1;
  background: var(--admin-bg, #f4f6f5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .18s, background .18s;
}
.shop-photo-slot:hover { border-color: var(--admin-primary, #154b34); background: var(--admin-primary-light, #eaf7f1); }
.shop-photo-slot.has-photo { border-style: solid; border-color: var(--admin-primary, #154b34); background: #fff; }
.shop-photo-slot img.slot-img { position:absolute;inset:0;width:100%;height:100%;object-fit:cover; }
.shop-photo-slot .slot-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(15,47,34,.65);
  display: flex; gap: .2rem; justify-content: center; padding: .2rem;
  opacity: 0; transition: opacity .15s;
}
.shop-photo-slot:hover .slot-overlay { opacity: 1; }
.shop-photo-slot .slot-ph {
  display: flex; flex-direction: column; align-items: center; gap: .28rem;
  color: var(--admin-muted, #6b7c74); font-size: .7rem; pointer-events: none;
}
.shop-photo-slot .slot-num {
  position: absolute; top: 5px; left: 6px;
  font-size: .6rem; font-weight: 700;
  background: var(--admin-primary, #154b34); color: #fff;
  border-radius: 4px; padding: 0 4px; line-height: 1.6;
}
.shop-photo-slot .slot-sort-handle {
  position: absolute; top: 5px; right: 6px; cursor: grab; color: rgba(255,255,255,.8);
  font-size: .75rem; display: none;
}
.shop-photo-slot.has-photo .slot-sort-handle { display: block; }
.shop-photo-slot.drag-over { border-color: #0d6efd; background: #e8f0ff; }

/* ── Camera modal ─────────────────────────────────────────── */
.shop-cam-video {
  width: 100%; border-radius: 10px; background: #000;
  max-height: 300px; transform: scaleX(-1);
}
.shop-cam-capture { display: none; max-width: 100%; border-radius: 10px; }
.shop-cover-preview {
  max-height: 80px; border-radius: 10px;
  border: 2px solid var(--admin-border, #e6ebe8);
  display: none; margin-top: .4rem; object-fit: cover;
}

/* ── QR batch ─────────────────────────────────────────────── */
.batch-card {
  border: 1.5px solid var(--admin-border, #e6ebe8);
  border-radius: 12px; padding: .9rem 1rem; background: #fff;
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
}
.batch-card .batch-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--admin-primary-mint, #d8f3e7);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--admin-primary, #154b34); flex-shrink: 0;
}
.batch-card .batch-meta { flex: 1; min-width: 0; }
.batch-card .batch-name { font-weight: 700; font-size: .9rem; }
.batch-card .batch-sub { font-size: .77rem; color: var(--admin-muted, #6b7c74); }
.batch-status { font-size: .72rem; font-weight: 700; border-radius: 20px; padding: .15rem .55rem; }
.batch-status.printed  { background: #fff3cd; color: #856404; }
.batch-status.ready    { background: var(--admin-primary-mint, #d8f3e7); color: #0f2f22; }
.batch-status.used     { background: #e2e3e5; color: #41464b; }

/* ── Product status badges ────────────────────────────────── */
.prod-status-badge { font-size: .7rem; font-weight: 700; border-radius: 20px; padding: .15rem .5rem; }
.prod-status-badge.available  { background: var(--admin-primary-mint,#d8f3e7); color: #0f2f22; }
.prod-status-badge.reserved   { background: #fff3cd; color: #856404; }
.prod-status-badge.sold       { background: #f8d7da; color: #842029; }
.prod-status-badge.unlisted   { background: #e2e3e5; color: #41464b; }

/* ── Compact scrollable admin modals ──────────────────────── */
#shopProductModal .modal-dialog {
  max-height: min(92dvh, 860px);
  margin: .5rem auto;
}
#shopProductModal .modal-content {
  max-height: min(92dvh, 860px);
  display: flex;
  flex-direction: column;
}
#shopProductModal .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(92dvh - 120px);
}
#shopCamModal .modal-body,
#qrNowModal .modal-body,
#orderUpdateModal .modal-body,
#scanRegisterModal .modal-body {
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Inventory action dropleft button group ───────────────── */
.inv-act-btn {
  width: 30px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  border-color: #d1d5db;
  color: #374151;
  background: #fff;
}
.inv-act-btn:hover { background: #f3f4f6; color: #111827; border-color: #9ca3af; }
.btn-group .inv-act-btn:not(:first-child) { border-left-color: transparent; }
.dropstart .dropdown-menu { font-size: .83rem; }

/* ── Inventory table thumbnail ────────────────────────────── */
.shop-prod-thumb {
  width: 42px; height: 42px; object-fit: cover;
  border-radius: 9px; border: 2px solid var(--admin-border, #e6ebe8);
  background: var(--admin-bg, #f4f6f5);
}

/* ── Category badge ───────────────────────────────────────── */
.shop-cat-badge {
  display: inline-block;
  background: var(--admin-primary-mint, #d8f3e7);
  color: var(--admin-dark, #0f2f22);
  border-radius: 20px; padding: .15rem .6rem;
  font-size: .72rem; font-weight: 600;
}

/* ── QR scanner ───────────────────────────────────────────── */
#shopQrReader { width: 100%; border-radius: 10px; overflow: hidden; }
.shop-qr-result {
  background: var(--admin-primary-light, #eaf7f1);
  border: 1px solid var(--admin-primary-mint, #d8f3e7);
  border-radius: 10px; padding: .5rem .75rem;
  font-size: .83rem; word-break: break-all;
}

/* ── Order request card ───────────────────────────────────── */
.order-card {
  border: 1.5px solid var(--admin-border, #e6ebe8);
  border-radius: 12px; padding: .85rem 1rem; background: #fff;
  margin-bottom: .75rem;
}
.order-card.new-order { border-color: var(--admin-primary, #154b34); }
.order-card .order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; flex-wrap: wrap; }
.order-status { font-size: .72rem; font-weight: 700; border-radius: 20px; padding: .15rem .55rem; }
.order-status.pending  { background: #fff3cd; color: #856404; }
.order-status.confirmed{ background: var(--admin-primary-mint,#d8f3e7); color: #0f2f22; }
.order-status.cancelled{ background: #f8d7da; color: #842029; }
.order-status.completed{ background: #e2e3e5; color: #41464b; }

/* ── Dashboard KPI ────────────────────────────────────────── */
.shop-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.shop-kpi { background: #fff; border-radius: 14px; padding: .9rem 1rem;
  border: 1.5px solid var(--admin-border,#e6ebe8); text-align: center; }
.shop-kpi .kpi-num { font-size: 1.6rem; font-weight: 800; color: var(--admin-primary,#154b34); line-height: 1.1; }
.shop-kpi .kpi-label { font-size: .73rem; color: var(--admin-muted,#6b7c74); margin-top: .2rem; }

/* ── Tab strip ────────────────────────────────────────────── */
.shop-admin-tabs {
  border-bottom: 2px solid var(--admin-border,#e6ebe8);
  margin-bottom: 1.25rem;
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.shop-admin-tab {
  padding: .5rem 1rem; font-size: .83rem; font-weight: 600;
  color: var(--admin-muted,#6b7c74); border: none; background: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer;
  border-radius: 8px 8px 0 0; transition: color .15s, background .15s, border-color .15s;
}
.shop-admin-tab.active { color: var(--admin-primary,#154b34); border-bottom-color: var(--admin-primary,#154b34); background: var(--admin-primary-light,#eaf7f1); }
.shop-admin-tab-pane { display: none; }
.shop-admin-tab-pane.active { display: block; }

/* Mobile: centered button / pill tabs */
@media (max-width: 768px) {
  .shop-admin-tabs {
    border-bottom: none;
    justify-content: center;
    gap: .45rem;
    padding: 0 .15rem;
  }
  .shop-admin-tab {
    margin-bottom: 0;
    border: 1.5px solid var(--admin-border,#e6ebe8);
    border-radius: 999px;
    padding: .4rem .85rem;
    background: #fff;
    font-size: .78rem;
  }
  .shop-admin-tab.active {
    border-color: var(--admin-primary,#154b34);
    background: var(--admin-primary,#154b34);
    color: #fff;
    border-bottom-color: var(--admin-primary,#154b34);
  }
}

/* ── QR UID list ──────────────────────────────────────────── */
.qr-uid-row {
  display: flex; gap: .55rem; align-items: flex-start;
  padding: .45rem 0; border-bottom: 1px solid var(--admin-border,#e6ebe8);
  font-size: .8rem;
}
.qr-uid-row:last-child { border-bottom: none; }
.qr-uid-code {
  font-family: monospace; background: var(--admin-primary-mint,#d8f3e7);
  border-radius: 5px; padding: .1rem .4rem; white-space: nowrap; font-size: .8rem;
}

/* ════════════════════════════════════════════════════════════
   PUBLIC SHOP DISPLAY PAGE
════════════════════════════════════════════════════════════ */
.shop-site-nav {
  background: var(--primary-color, #154b34); color: #fff;
  padding: .75rem 1.5rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.shop-site-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .88rem; }
.shop-site-nav a:hover { color: #fff; }
.shop-site-nav .brand { font-weight: 800; font-size: 1.1rem; color: #fff; }

.shop-hero {
  background: linear-gradient(135deg, var(--primary-color,#154b34) 0%, var(--secondary-color,#1f6b4a) 100%);
  color: #fff; padding: 3rem 1rem 2.5rem; text-align: center;
}
.shop-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.shop-hero p  { color: rgba(255,255,255,.78); margin: 0; }

.shop-cat-pill { border-radius: 20px; font-size: .8rem; }
.shop-cat-pill.active {
  background: var(--primary-color,#154b34);
  border-color: var(--primary-color,#154b34); color: #fff;
}

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

.shop-prod-card {
  border-radius: 16px; overflow: hidden; background: #fff;
  box-shadow: 0 4px 18px rgba(15,47,34,.08);
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column; position: relative;
}
.shop-prod-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(15,47,34,.15); }
.shop-prod-card .prod-cover { height: 200px; object-fit: cover; width: 100%; display: block; cursor: pointer; }
.shop-prod-card .prod-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #d8f3e7, #b8e8d0);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(21,75,52,.3);
}
.shop-prod-card .prod-body { padding: .85rem 1rem; flex: 1; }
.shop-prod-card .prod-name { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; color: #1a2e26; }
.shop-prod-card .prod-desc { font-size: .8rem; color: #6b7c74; }
.shop-prod-card .prod-foot {
  padding: .7rem 1rem; border-top: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
}
.prod-price { font-size: 1rem; font-weight: 700; color: #1a2e26; }
.prod-sale-price { color: #c0392b; font-weight: 700; }
.prod-orig-price { text-decoration: line-through; color: #aaa; font-size: .82rem; margin-left: .3rem; }

.shop-featured-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--primary-color,#154b34); color: #fff;
  border-radius: 7px; padding: .15rem .5rem; font-size: .66rem; font-weight: 700;
}
.shop-sold-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: .05em;
}

/* Detail modal */
.shop-thumb-strip { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.shop-thumb-strip img {
  width: 54px; height: 54px; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 2px solid transparent; transition: border-color .15s;
}
.shop-thumb-strip img.active { border-color: var(--primary-color,#154b34); }

/* Lightbox */
.shop-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.88); display: none;
  align-items: center; justify-content: center;
}
.shop-lightbox.open { display: flex; }
.shop-lb-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.shop-lb-inner img { max-width: 92vw; max-height: 88vh; border-radius: 12px; object-fit: contain; display: block; }
.shop-lb-close {
  position: absolute; top: -14px; right: -14px;
  background: #fff; border-radius: 50%; width: 32px; height: 32px;
  border: none; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shop-lb-prev, .shop-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.2); border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 1.1rem; color: #fff; cursor: pointer;
}
.shop-lb-prev { left: -52px; } .shop-lb-next { right: -52px; }
@media(max-width:600px){ .shop-lb-prev{left:4px} .shop-lb-next{right:4px} }

/* Checkout form */
.shop-checkout-wrap { background: #f8faf9; border-radius: 14px; padding: 1.25rem; border: 1.5px solid #e0e8e4; }

/* Cart badge */
.shop-cart-btn { position: relative; }
.shop-cart-count {
  position: absolute; top: -6px; right: -8px;
  background: #c0392b; color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   HOMEPAGE — Shop product grid
════════════════════════════════════════════════════════════ */
.homepage-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
}
@media (max-width: 480px) {
  .homepage-shop-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
}

.homepage-shop-card {
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  background: #fff;
  box-shadow: 0 3px 14px rgba(15,47,34,.07);
  text-decoration: none; color: inherit;
  transition: transform .18s, box-shadow .18s;
  position: relative;
}
.homepage-shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(15,47,34,.14);
  text-decoration: none; color: inherit;
}

.hsc-feat-badge {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  background: var(--primary-color, #154b34); color: #fff;
  border-radius: 7px; padding: .12rem .45rem;
  font-size: .63rem; font-weight: 700;
}
.hsc-sold-overlay {
  position: absolute; inset: 0 0 auto 0; height: 170px; z-index: 1;
  background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: .06em;
  border-radius: 16px 16px 0 0;
}
.hsc-img-wrap { height: 170px; overflow: hidden; background: #f0f5f2; flex-shrink: 0; }
.hsc-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .22s; }
.homepage-shop-card:hover .hsc-img { transform: scale(1.04); }
.hsc-img-placeholder {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d8f3e7, #b8e8d0);
  font-size: 2.5rem; color: rgba(21,75,52,.25);
}
.hsc-body { padding: .75rem .85rem .4rem; flex: 1; }
.hsc-cat {
  display: inline-block; font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--primary-color, #154b34);
  background: rgba(21,75,52,.08); border-radius: 20px; padding: .1rem .45rem;
  margin-bottom: .3rem;
}
.hsc-name { font-weight: 700; font-size: .88rem; color: #1a2e26; line-height: 1.3; margin-bottom: .25rem; }
.hsc-desc { font-size: .75rem; color: #6b7c74; margin: 0; line-height: 1.4; }
.hsc-foot {
  padding: .55rem .85rem .7rem; border-top: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.hsc-price { font-size: .85rem; }
.hsc-price-val { font-weight: 700; color: #1a2e26; }
.hsc-sale { font-weight: 700; color: #c0392b; }
.hsc-orig { color: #aaa; font-size: .77rem; margin-left: .25rem; }
.hsc-ask { color: #888; font-size: .78rem; }
.hsc-badge-sold { background: #f8d7da; color: #842029; border-radius: 20px; padding: .1rem .45rem; font-size: .7rem; font-weight: 700; }
.hsc-badge-res  { background: #fff3cd; color: #856404; border-radius: 20px; padding: .1rem .45rem; font-size: .7rem; font-weight: 700; }
.hsc-cta {
  font-size: .76rem; font-weight: 700; color: var(--primary-color, #154b34);
  white-space: nowrap;
}
