/* ============================================================================
   CYRAHOP — store.css
   Two pages: store listing (/stores.php) and store detail (/store.php).
   Mobile-first.
   ============================================================================ */

/* ===========================================================================
   LISTING (/stores.php)
   =========================================================================== */
.stores-layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding-block: 20px; }

.filters { order: -1; }
.filter-block { margin-bottom: 18px; }
.filter-block h4 { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 0.85rem; font-weight: 500;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.filter-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.filter-toggle input { width: auto; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.results-head h1 { font-size: 1.3rem; }

.store-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap-card); }
.store-grid .store-card { width: auto; }     /* override rail fixed-width */
.empty-state { padding: 40px 0; text-align: center; }
.infinite-sentinel { height: 1px; }
.load-spinner { min-height: 40px; }

/* ===========================================================================
   DETAIL (/store.php)
   =========================================================================== */
.store-hero {
  position: relative; height: 180px; border-radius: var(--radius-lg);
  background: var(--border) center/cover no-repeat; overflow: hidden;
  margin-top: 16px;
}
.store-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45)); }
.store-hero-logo {
  position: absolute; left: 16px; bottom: 16px; z-index: 1;
  width: 64px; height: 64px; border-radius: var(--radius-md);
  background: #fff center/cover no-repeat; border: 2px solid #fff;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}

.store-info {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-top: 12px;
}
.store-info h1 { font-size: 1.4rem; margin-bottom: 8px; }
.store-info-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.85rem; color: var(--text-muted); }
.store-info-meta .badge { font-size: 0.75rem; }

/* sticky category nav */
.menu-nav {
  position: sticky; top: 100px; z-index: 10;
  background: var(--bg-page);
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 0; margin-top: 12px;
}
.menu-nav::-webkit-scrollbar { display: none; }
.menu-nav a {
  flex: 0 0 auto; padding: 8px 14px; border-radius: var(--radius-pill);
  background: #fff; border: 1px solid var(--border); font-size: 0.85rem; font-weight: 500;
}
.menu-nav a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* product groups */
.menu-group { margin-top: 20px; }
.menu-group h2 { font-size: 1.05rem; margin-bottom: 12px; }
/* Snoonu-style product cards: image on top, price, add button. */
.product-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.product {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; padding: 0; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.product:hover { box-shadow: 0 8px 22px rgba(32,55,59,.10); transform: translateY(-2px); }
.product-img {
  width: 100%; height: 150px; border-radius: 0;
  background: var(--bg-elev) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.product-body { padding: 12px 14px 14px; min-width: 0; }
.product-name { font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.product-desc { font-size: 0.82rem; color: var(--text-muted); margin: 4px 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 800; font-size: 1.05rem; color: var(--primary-dark); }
/* The add / quantity control sits as a floating circle over the image corner. */
.product-action { position: absolute; right: 10px; top: 128px; z-index: 2; }

/* add / quantity stepper — float over the product image (Snoonu-style) */
.add-btn { border: none; color: #fff; background: var(--primary);
  border-radius: var(--radius-pill); padding: 9px 16px; font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(32,55,59,.18); }
.add-btn:hover { background: var(--primary-dark); }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border);
  background: #fff; border-radius: var(--radius-pill); overflow: hidden; box-shadow: 0 4px 12px rgba(32,55,59,.18); }
.qty button { width: 32px; height: 34px; color: var(--primary); font-size: 1.1rem; font-weight: 600; }
.qty button:hover { background: var(--primary-light); }
.qty .qty-n { min-width: 28px; text-align: center; font-weight: 600; font-size: 0.9rem; }

/* sticky cart summary */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad-x); box-shadow: 0 -4px 14px rgba(0,0,0,0.12);
  transform: translateY(100%); transition: transform 0.2s ease;
}
.cart-bar.is-on { transform: translateY(0); }
.cart-bar-info { font-size: 0.9rem; font-weight: 500; }
.cart-bar-info b { font-weight: 600; }
.cart-bar .btn { background: #fff; color: var(--primary); }
/* On mobile the app tab bar sits at the very bottom — lift the cart bar above it. */
@media (max-width: 760px) {
  .cart-bar { bottom: 62px; }
}

/* ===========================================================================
   Desktop (>=768px)
   =========================================================================== */
@media (min-width: 768px) {
  .stores-layout { grid-template-columns: 240px 1fr; align-items: start; }
  .filters { order: 0; position: sticky; top: 116px; }

  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .store-hero { height: 280px; }
  .store-hero-logo { width: 84px; height: 84px; }
  .product-list { grid-template-columns: repeat(3, 1fr); }

  /* desktop: cart becomes a sticky right rail instead of bottom bar */
  .cart-bar {
    position: sticky; top: 116px; left: auto; right: auto; bottom: auto;
    width: 300px; border-radius: var(--radius-lg); transform: none;
    flex-direction: column; align-items: stretch; gap: 12px;
    box-shadow: var(--shadow-card);
  }
}

@media (min-width: 992px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Bulk laundry declaration modal ------------------------------------- */
.co-item-decl { display: block; font-size: .76rem; margin-top: 2px; }
.bulk-modal { position: fixed; inset: 0; background: rgba(20,40,44,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.bulk-modal[hidden] { display: none !important; }
.bulk-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 420px; position: relative; box-shadow: var(--shadow-hover); }
.bulk-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.bulk-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
.bulk-photo-preview { margin-top: 8px; }
.bulk-photo-preview img { max-height: 120px; border-radius: 10px; border: 1px solid var(--border); }

/* Polish: 4-up product grid on wide screens + uniform card height. */
@media (min-width: 1100px) { .product-list { grid-template-columns: repeat(4, 1fr); } }
.product { min-height: 226px; }

/* ============================================================================
   PROD2 — reference-style product card (header bar + price/unit + turnaround)
   Uses the site's coral/pink theme.
   ============================================================================ */
.product-list{ display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:600px){ .product-list{ grid-template-columns:repeat(2,1fr); } }

.product.prod2{
  display:block; padding:0; overflow:hidden;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:16px; box-shadow:var(--shadow-card);
  transition:box-shadow .18s ease, transform .18s ease;
}
.product.prod2:hover{ box-shadow:var(--shadow-hover); transform:translateY(-2px); }

.prod2-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:linear-gradient(180deg,#DCF1FA,#C7E9F6);
  padding:12px 16px;
}
.prod2-name{ font-family:var(--font-head); font-weight:700; font-size:1.08rem; color:#33302E; }

.prod2-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px 16px; }
.prod2-meta{ min-width:0; }
.prod2-price{ font-family:var(--font-head); font-weight:800; font-size:1.9rem; color:#2F2A28; line-height:1; }
.prod2-unit{ font-size:.92rem; font-weight:600; color:var(--text-muted); margin-left:1px; }
.prod2-tat{ display:flex; align-items:center; gap:6px; color:var(--text-main); font-size:.92rem; margin-top:10px; }
.prod2-svc{ color:var(--text-muted); font-size:.86rem; margin-top:3px; }
.prod2-icon{ flex:0 0 auto; width:96px; height:96px; display:flex; align-items:center; justify-content:center; }
.prod2-icon img{ width:100%; height:100%; object-fit:contain; opacity:.9; }

/* The Add button / qty stepper sits in the header bar, right side. */
.prod2-head .product-action{ display:flex; align-items:center; }
.prod2-head .add-btn{
  background:var(--primary); color:#fff; font-family:var(--font-head); font-weight:600;
  border-radius:var(--radius-pill); padding:7px 16px; font-size:.85rem;
}
.prod2-head .add-btn:hover{ background:var(--primary-dark); }
.prod2-head .qty{
  display:inline-flex; align-items:center; gap:12px;
  background:rgba(255,255,255,.6); border-radius:var(--radius-pill); padding:4px 6px;
}
.prod2-head .qty button{
  width:28px; height:28px; border-radius:50%; background:#fff; color:var(--primary);
  font-size:1.1rem; line-height:1; display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 3px rgba(20, 50, 70,.18);
}
.prod2-head .qty button:hover{ background:var(--primary); color:#fff; }
.prod2-head .qty-n{ font-family:var(--font-head); font-weight:700; min-width:14px; text-align:center; }

/* ============================================================================
   SHOP2 — shop card styled like the product card (header bar + meta + thumb),
   tweaked: rating stars, open/closed pill, photo thumbnail (no price/stepper).
   Used on the homepage shop grid and the shops category page.
   ============================================================================ */
.shop2{
  display:block; padding:0; overflow:hidden;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:16px; box-shadow:var(--shadow-card);
  transition:box-shadow .18s ease, transform .18s ease;
}
.shop2:hover{ box-shadow:var(--shadow-hover); transform:translateY(-3px); }
.shop2.is-soon{ opacity:.85; }
.shop2-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:linear-gradient(180deg,#DCF1FA,#C7E9F6); padding:12px 16px;
}
.shop2-name{ font-family:var(--font-head); font-weight:700; font-size:1.06rem; color:#33302E;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shop2-status{ flex:0 0 auto; font-size:.72rem; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap; }
.shop2-status.is-open{ background:rgba(95,185,122,.20); color:#3C8B53; }
.shop2-status.is-closed{ background:rgba(192,57,43,.14); color:var(--danger); }
.shop2-status.is-soon{ background:rgba(255,255,255,.55); color:var(--text-muted); }
.shop2-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px 16px; }
.shop2-meta{ min-width:0; }
.shop2-stars{ color:#E8C24A; font-size:.9rem; letter-spacing:2px; }
.shop2-rating{ color:var(--text-main); font-weight:700; font-family:var(--font-head); margin-left:5px; letter-spacing:0; font-size:.9rem; }
.shop2-line{ color:var(--text-muted); font-size:.86rem; margin-top:5px; display:flex; align-items:center; gap:6px; }
.shop2-thumb{ flex:0 0 auto; width:86px; height:86px; border-radius:12px;
  background:var(--bg-elev) center/cover no-repeat; box-shadow:inset 0 0 0 1px var(--border); }

/* Keep the floating cart bar above the mobile bottom tab bar (which is fixed
   at bottom with z-index 200 and ~56px tall). */
@media (max-width: 760px) {
  #svcCartBar { bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important; }
  .cart-bar   { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}
