/* ============================================================
   HADLAY KALAN – LOCAL SHOP CSS (Mobile-First)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --shop-primary:   #6c63ff;
  --shop-primary2:  #4834d4;
  --shop-accent:    #ff6584;
  --shop-green:     #27ae60;
  --shop-bg:        #f4f6fb;
  --shop-card:      #ffffff;
  --shop-text:      #1a1a2e;
  --shop-sub:       #6c757d;
  --shop-border:    #e2e8f0;
  --shop-shadow:    0 4px 20px rgba(108,99,255,.12);
  --shop-radius:    16px;
  --shop-header-h:  60px;
  font-family: 'Poppins', sans-serif;
}

body {
  background: var(--shop-bg);
  color: var(--shop-text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* ─── SPLASH ──────────────────────────────────────────────── */
.shop-splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #6c63ff 0%, #3b1fa8 100%);
  display: flex; align-items: center; justify-content: center;
  animation: splashFade 0.5s ease 2.2s forwards;
}
.shop-splash-inner { text-align: center; color: #fff; }
.shop-splash-icon  { font-size: 64px; margin-bottom: 14px; animation: splashBounce 0.8s ease infinite alternate; }
.shop-splash-inner h1 { font-size: 26px; font-weight: 700; }
.shop-splash-inner p  { font-size: 13px; opacity: .8; margin-top: 4px; }
.shop-splash-bar  {
  width: 200px; height: 4px; background: rgba(255,255,255,.3);
  border-radius: 99px; margin: 18px auto 0; overflow: hidden;
}
.shop-splash-fill {
  height: 100%; background: #fff; border-radius: 99px;
  animation: splashLoad 2s ease forwards;
}
@keyframes splashLoad   { from { width: 0 } to { width: 100% } }
@keyframes splashFade   { to { opacity: 0; pointer-events: none; visibility: hidden; } }
@keyframes splashBounce { to { transform: translateY(-8px); } }

/* ─── HEADER ─────────────────────────────────────────────── */
.shop-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--shop-header-h);
  background: linear-gradient(135deg, #6c63ff, #4834d4);
  display: flex; align-items: center; padding: 0 12px; gap: 10px;
  box-shadow: 0 2px 12px rgba(108,99,255,.4);
}
.shop-back-btn, .shop-header-cart {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.2); color: #fff; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shop-header-center { flex: 1; display: flex; align-items: center; gap: 8px; }
.shop-header-icon    { font-size: 26px; }
.shop-header-title   { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.2; }
.shop-header-sub     { font-size: 11px; color: rgba(255,255,255,.75); }

/* ─── MAIN ───────────────────────────────────────────────── */
.shop-main {
  margin-top: var(--shop-header-h);
  padding: 0;
}

/* ─── SECTIONS ───────────────────────────────────────────── */
.shop-section { display: none; }
.shop-section.active { display: block; }

/* ─── CATEGORY SCROLL ─────────────────────────────────────── */
.shop-cats-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 4px;
  scrollbar-width: none;
}
.shop-cats-scroll::-webkit-scrollbar { display: none; }
.shop-cat-btn {
  flex-shrink: 0; border: 2px solid var(--shop-border); background: var(--shop-card);
  border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 500;
  color: var(--shop-sub); cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: all .2s;
}
.shop-cat-btn span { font-size: 15px; }
.shop-cat-btn.active, .shop-cat-btn:hover {
  background: var(--shop-primary); border-color: var(--shop-primary);
  color: #fff; transform: translateY(-1px);
}

/* ─── SEARCH ─────────────────────────────────────────────── */
.shop-search-wrap {
  margin: 8px 12px; background: var(--shop-card);
  border-radius: 12px; border: 1.5px solid var(--shop-border);
  display: flex; align-items: center; padding: 0 12px; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.shop-search-wrap i    { color: var(--shop-sub); font-size: 14px; }
.shop-search-wrap input {
  flex: 1; border: none; outline: none; font-size: 14px;
  padding: 11px 0; background: transparent; color: var(--shop-text);
  font-family: inherit;
}
.shop-search-wrap button {
  border: none; background: none; cursor: pointer;
  color: var(--shop-sub); font-size: 14px; padding: 0;
}

/* ─── PRODUCT GRID ───────────────────────────────────────── */
.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 12px;
}

/* Shimmer */
.shop-shimmer {
  background: linear-gradient(90deg, #e8eaf0 25%, #f5f6fa 50%, #e8eaf0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--shop-radius);
  height: 220px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Product Card */
.shop-product-card {
  background: var(--shop-card); border-radius: var(--shop-radius);
  overflow: hidden; box-shadow: var(--shop-shadow);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  position: relative;
}
.shop-product-card:active { transform: scale(.97); }
.shop-product-card:hover  { box-shadow: 0 8px 28px rgba(108,99,255,.2); }

.prod-card-img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: #f0f0f5;
}
.prod-card-img-placeholder {
  width: 100%; aspect-ratio: 1/1;
  background: linear-gradient(135deg, #ece9ff, #d8d4ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.prod-card-body { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prod-card-title { font-size: 13px; font-weight: 600; color: var(--shop-text); line-height: 1.3; }
.prod-card-price { font-size: 15px; font-weight: 700; color: var(--shop-primary); }
.prod-card-mrp   { font-size: 11px; color: var(--shop-sub); text-decoration: line-through; }
.prod-card-shop  { font-size: 11px; color: var(--shop-sub); display: flex; align-items: center; gap: 4px; }

.prod-discount-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--shop-accent); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 6px;
  padding: 2px 6px;
}

/* ─── EMPTY ──────────────────────────────────────────────── */
.shop-empty {
  text-align: center; padding: 60px 20px;
  color: var(--shop-sub);
}
.shop-empty-icon { font-size: 60px; margin-bottom: 14px; }
.shop-empty h3   { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.shop-empty p    { font-size: 13px; }

/* ─── PRODUCT DETAIL ─────────────────────────────────────── */
.pd-img-scroll {
  overflow-x: auto; display: flex; gap: 0;
  scrollbar-width: none;
}
.pd-img-scroll::-webkit-scrollbar { display: none; }
.pd-img-item {
  flex-shrink: 0; width: 100vw; height: 52vw; max-height: 260px;
  cursor: zoom-in; position: relative;
}
.pd-img-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.pd-img-zoom-hint {
  position: absolute; bottom: 8px; right: 10px;
  background: rgba(0,0,0,.45); color: #fff;
  border-radius: 50%; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; pointer-events: none;
}
.pd-img-placeholder {
  width: 100vw; height: 52vw; max-height: 260px;
  background: linear-gradient(135deg, #ece9ff, #d8d4ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}

/* ─── IMAGE LIGHTBOX ─────────────────────────────────────── */
#shopLightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.slb-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.92);
}
.slb-container {
  position: relative; width: 100%; max-width: 560px; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.slb-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  width: 100%; flex: none;
}
.slb-track::-webkit-scrollbar { display: none; }
.slb-slide {
  flex-shrink: 0; width: 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  min-height: 50vw; max-height: 70vh;
}
.slb-slide img {
  max-width: 100%; max-height: 70vh; object-fit: contain;
  user-select: none; pointer-events: none;
}
.slb-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.18); border: none;
  color: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.slb-prev, .slb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px;
  cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.slb-prev { left: 10px; }
.slb-next { right: 10px; }
.slb-dots {
  display: flex; justify-content: center; gap: 8px;
  position: absolute; bottom: 20px; width: 100%;
}
.slb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer; transition: background .2s;
}
.slb-dot.active { background: #fff; }

.pd-body { padding: 16px 14px; }
.pd-title   { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.pd-price   { font-size: 24px; font-weight: 800; color: var(--shop-primary); }
.pd-mrp     { font-size: 14px; color: var(--shop-sub); text-decoration: line-through; margin-left: 6px; }
.pd-unit    { font-size: 13px; color: var(--shop-sub); margin-top: 2px; }
.pd-desc    { font-size: 14px; color: var(--shop-sub); margin: 12px 0; line-height: 1.6; }
.pd-divider { border: none; border-top: 1px solid var(--shop-border); margin: 14px 0; }

.pd-seller-card {
  background: linear-gradient(135deg, #f8f7ff, #ece9ff);
  border-radius: 14px; padding: 14px;
  display: flex; gap: 14px; align-items: center;
}
.pd-seller-photo {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  background: var(--shop-primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
}
.pd-seller-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pd-seller-name { font-size: 15px; font-weight: 600; }
.pd-seller-shop { font-size: 13px; color: var(--shop-primary); font-weight: 500; }
.pd-seller-addr { font-size: 12px; color: var(--shop-sub); margin-top: 2px; }

.pd-contact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pd-contact-btn  {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: 12px; border: none; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: opacity .2s;
}
.pd-contact-btn:active { opacity: .8; }
.pd-btn-call { background: linear-gradient(135deg, #27ae60, #16a085); color: #fff; }
.pd-btn-wp   { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; }

/* ─── SELLER AUTH ─────────────────────────────────────────── */
.seller-auth-tabs {
  display: flex; gap: 0; margin: 16px 16px 0;
  background: var(--shop-border); border-radius: 12px; padding: 3px;
}
.seller-tab {
  flex: 1; padding: 9px; border: none; background: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--shop-sub); transition: all .2s;
}
.seller-tab.active {
  background: var(--shop-card); color: var(--shop-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.seller-form {
  padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; animation: fadeUp .3s ease;
}
.seller-form-icon { font-size: 48px; text-align: center; }
.seller-form h2   { font-size: 20px; font-weight: 700; text-align: center; }

/* ─── INPUT GROUPS ───────────────────────────────────────── */
.shop-input-group {
  display: flex; align-items: center; gap: 10px;
  background: var(--shop-card); border: 1.5px solid var(--shop-border);
  border-radius: 12px; padding: 0 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.shop-input-group i { color: var(--shop-sub); font-size: 14px; flex-shrink: 0; }
.shop-input-group input,
.shop-input-group select,
.shop-input-group textarea {
  flex: 1; border: none; outline: none; font-size: 14px;
  padding: 12px 0; background: transparent; color: var(--shop-text);
  font-family: inherit;
}
.shop-input-group select { -webkit-appearance: none; }
.shop-input-group textarea { padding: 10px 0; resize: none; }
.textarea-group { align-items: flex-start; padding-top: 10px; }
.textarea-group i { margin-top: 2px; }
.toggle-pass {
  border: none; background: none; cursor: pointer;
  color: var(--shop-sub); font-size: 14px; padding: 0;
}
.shop-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ─── TOGGLE SWITCH ──────────────────────────────────────── */
.shop-toggle-label {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--shop-text); width: 100%; justify-content: space-between;
  padding: 10px 0;
}
.shop-toggle        { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.shop-toggle input  { opacity: 0; width: 0; height: 0; }
.shop-toggle-slider {
  position: absolute; inset: 0; border-radius: 99px; cursor: pointer;
  background: #ccc; transition: .3s;
}
.shop-toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px; transition: .3s;
}
.shop-toggle input:checked + .shop-toggle-slider { background: var(--shop-primary); }
.shop-toggle input:checked + .shop-toggle-slider::before { transform: translateX(20px); }

/* ─── PHOTO UPLOAD ───────────────────────────────────────── */
.shop-photo-upload {
  border: 2px dashed var(--shop-border); border-radius: 12px;
  padding: 16px; text-align: center; cursor: pointer;
  color: var(--shop-sub); font-size: 13px; display: flex;
  align-items: center; justify-content: center; gap: 8px;
  transition: border-color .2s;
}
.shop-photo-upload:hover { border-color: var(--shop-primary); color: var(--shop-primary); }
.shop-photo-upload i { font-size: 20px; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.shop-btn-primary {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #6c63ff, #4834d4);
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; display: flex;
  align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s, transform .1s;
}
.shop-btn-primary:active { transform: scale(.98); opacity: .9; }
.shop-btn-primary:disabled { opacity: .6; pointer-events: none; }
.shop-btn-secondary {
  flex: 1; padding: 13px; border-radius: 12px;
  border: 2px solid var(--shop-border); background: var(--shop-card);
  color: var(--shop-text); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}

/* ─── DASHBOARD ──────────────────────────────────────────── */
.dash-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding: 14px 12px 0;
}
.dash-stat-card {
  background: var(--shop-card); border-radius: 14px;
  padding: 14px 12px; text-align: center;
  box-shadow: var(--shop-shadow);
}
.dash-stat-icon {
  width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.dash-stat-val   { font-size: 22px; font-weight: 800; }
.dash-stat-label { font-size: 11px; color: var(--shop-sub); margin-top: 2px; }

.dash-ws-status {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 12px 0; padding: 8px 12px;
  background: var(--shop-card); border-radius: 10px;
  font-size: 12px; color: var(--shop-sub);
}
.ws-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ccc; flex-shrink: 0;
}
.ws-dot.connected { background: var(--shop-green); box-shadow: 0 0 6px var(--shop-green); animation: pulse-dot 1.5s infinite; }
.ws-dot.error     { background: var(--shop-accent); }
@keyframes pulse-dot { 0%,100%{ opacity:1 } 50%{ opacity:.4 } }

.dash-section-title {
  font-size: 15px; font-weight: 700; padding: 16px 12px 8px;
  display: flex; align-items: center; gap: 8px;
}
.dash-add-btn {
  margin-left: auto; background: var(--shop-primary); color: #fff;
  border: none; border-radius: 8px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px; font-family: inherit;
}

.dash-recent-list { padding: 0 12px; display: flex; flex-direction: column; gap: 6px; }
.dash-click-item  {
  background: var(--shop-card); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); animation: fadeUp .3s ease;
}
.dash-click-icon { font-size: 22px; flex-shrink: 0; }
.dash-click-info { flex: 1; }
.dash-click-title { font-size: 13px; font-weight: 600; }
.dash-click-meta  { font-size: 11px; color: var(--shop-sub); }
.dash-empty-text  { font-size: 13px; color: var(--shop-sub); padding: 10px 0; }

/* Click history pagination */
.dash-click-pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 0 4px;
}
.dcp-btn {
  border: 1.5px solid var(--shop-primary); background: transparent;
  color: var(--shop-primary); border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s;
}
.dcp-btn:disabled { border-color: #ccc; color: #ccc; cursor: default; }
.dcp-btn:not(:disabled):active { background: var(--shop-primary); color: #fff; }
.dcp-info { font-size: 12px; color: var(--shop-sub); font-weight: 600; }

.dash-product-list { padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.dash-prod-item {
  background: var(--shop-card); border-radius: 14px; padding: 12px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shop-shadow);
}
.dash-prod-img {
  width: 60px; height: 60px; border-radius: 10px; object-fit: cover;
  background: var(--shop-bg); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.dash-prod-img img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.dash-prod-body { flex: 1; }
.dash-prod-title { font-size: 14px; font-weight: 600; }
.dash-prod-price { font-size: 13px; color: var(--shop-primary); font-weight: 700; margin-top: 2px; }
.dash-prod-stats { font-size: 11px; color: var(--shop-sub); margin-top: 3px; display: flex; gap: 10px; }
.dash-prod-btns  { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.dash-prod-btn   {
  border: none; border-radius: 8px; padding: 6px 10px; font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.dash-prod-btn.edit   { background: #ece9ff; color: var(--shop-primary); }
.dash-prod-btn.delete { background: #ffe9ed; color: var(--shop-accent); }

.dash-footer-btns {
  display: flex; gap: 10px; padding: 20px 12px;
}
.dash-footer-btn {
  flex: 1; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--shop-border); background: var(--shop-card);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--shop-text);
}
.dash-footer-btn.danger { color: var(--shop-accent); border-color: #ffd0d9; background: #fff5f7; }

/* ─── ADD PRODUCT ────────────────────────────────────────── */
.add-product-wrap { padding: 16px 12px; }
.add-product-wrap h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

.prod-img-upload-area {
  border: 2px dashed var(--shop-border); border-radius: 12px;
  padding: 20px; text-align: center; cursor: pointer;
  color: var(--shop-sub); font-size: 13px; display: flex;
  align-items: center; justify-content: center; gap: 8px;
}
.prod-img-upload-area i { font-size: 22px; }
.prod-img-preview-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.prod-img-thumb {
  width: 70px; height: 70px; border-radius: 10px; object-fit: cover; position: relative;
}
.prod-img-thumb-wrapper {
  position: relative; width: 70px; height: 70px;
}
.prod-img-thumb-wrapper img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.prod-img-remove {
  position: absolute; top: -5px; right: -5px; width: 20px; height: 20px;
  background: var(--shop-accent); color: #fff; border-radius: 50%; border: none;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.add-prod-btns { display: flex; gap: 10px; margin-top: 8px; }

/* ─── EDIT PROFILE ──────────────────────────────────────── */
.seller-photo-edit {
  width: 90px; height: 90px; border-radius: 50%; position: relative;
  margin: 0 auto 16px; cursor: pointer; overflow: hidden;
  background: var(--shop-primary);
}
.seller-photo-edit img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.seller-photo-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}

/* ─── MODAL ──────────────────────────────────────────────── */
.shop-modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  overflow-y: auto;
}
.shop-modal-content {
  background: var(--shop-card);
  border-radius: var(--shop-radius) var(--shop-radius) 0 0;
  margin-top: 10vh; min-height: 90vh;
  animation: slideUp .3s ease;
}
.pd-modal-close {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 14px; background: var(--shop-card);
  border-bottom: 1px solid var(--shop-border);
}
.pd-modal-close button {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--shop-bg); color: var(--shop-text); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pd-modal-close span { font-size: 15px; font-weight: 600; flex:1; }

/* ─── AD POPUP ───────────────────────────────────────────── */
.shop-ad-popup {
  position: fixed; bottom: 20px; left: 12px; right: 12px; z-index: 800;
  animation: slideUpAd .4s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUpAd { from { transform: translateY(120%); opacity:0 } to { transform: translateY(0); opacity:1 } }
.shop-ad-inner {
  background: var(--shop-card); border-radius: 18px;
  box-shadow: 0 8px 32px rgba(108,99,255,.25);
  overflow: hidden; display: flex; align-items: stretch;
  position: relative; border: 2px solid rgba(108,99,255,.15);
}
.shop-ad-close {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.5); color: #fff; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ad-img-side {
  width: 90px; flex-shrink: 0; background: var(--shop-bg);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.ad-img-side img { width: 100%; height: 100%; object-fit: cover; }
.ad-body { flex: 1; padding: 12px 14px 12px 12px; }
.ad-badge { font-size: 10px; color: var(--shop-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.ad-title { font-size: 14px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.ad-price { font-size: 16px; font-weight: 800; color: var(--shop-primary); }
.ad-shop  { font-size: 11px; color: var(--shop-sub); margin-top: 2px; }
.ad-cta   {
  margin-top: 8px; display: inline-block; background: var(--shop-primary);
  color: #fff; font-size: 11px; font-weight: 600; border-radius: 8px; padding: 5px 12px;
}

/* ─── TOAST ──────────────────────────────────────────────── */
.shop-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1a1a2e; color: #fff; padding: 10px 20px; border-radius: 99px;
  font-size: 13px; font-weight: 500; white-space: nowrap; z-index: 9000;
  transition: transform .3s, opacity .3s; opacity: 0; pointer-events: none;
}
.shop-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes slideUp { from { transform: translateY(40px); opacity:0 } to { transform: translateY(0); opacity:1 } }
@keyframes fadeUp  { from { transform: translateY(16px); opacity:0 } to { transform: translateY(0); opacity:1 } }

/* ─── CATEGORY EMOJI MAP ─────────────────────────────────── */
/* Used by JS */

/* ─── MISC ───────────────────────────────────────────────── */
.shop-loader {
  text-align: center; padding: 40px; color: var(--shop-sub); font-size: 28px;
}

/* for inline active toggle badge */
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.status-active   { background: #d4edda; color: #155724; }
.status-inactive { background: #f8d7da; color: #721c24; }

/* safe area bottom */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   SHOP — DESKTOP / LAPTOP LAYOUT (≥ 768px)
   ============================================================ */
@media (min-width: 768px) {
  /* Centre the whole app in a max-width shell */
  body {
    background: #f0f2f8;
  }

  .shop-header {
    max-width: 960px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 4px 20px rgba(108,99,255,.3);
  }

  .shop-main {
    max-width: 960px;
    margin: var(--shop-header-h) auto 0;
    background: var(--shop-bg);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,.08);
    border-radius: 0 0 18px 18px;
  }

  .shop-product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .shop-cats-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
    padding: 14px 16px 8px;
    gap: 10px;
  }

  .shop-search-wrap {
    margin: 8px 16px;
  }

  /* Seller section gets two-column layout on desktop */
  .seller-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Product detail modal gets a side-by-side layout */
  .shop-product-detail {
    flex-direction: row;
    max-height: 90vh;
    max-width: 760px;
  }

  .shop-product-detail-img {
    width: 340px;
    flex-shrink: 0;
    max-height: 100%;
    max-width: none;
    object-fit: cover;
    border-radius: 16px 0 0 16px;
  }
}

@media (min-width: 1100px) {
  .shop-header { max-width: 1100px; }
  .shop-main   { max-width: 1100px; }
  .shop-product-grid { grid-template-columns: repeat(4, 1fr); }
}

