/* ── Catalog: shared across /shops/ebac-store/ (grid) and /shops/ebac-store/product/ (detail) ── */

.cat-hero { padding: 40px 0 28px; background: linear-gradient(160deg, #ffffff 0%, #ffffff 55%, var(--sage-pale) 100%); }
.cat-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 8px; }
.cat-hero p { color: var(--ink-soft); font-size: 1rem; margin: 0; }

/* Category filter — collapsed to one row by default; tap to expand the list, tap a category (or
   outside) to collapse again. Keeps the page compact instead of wrapping into several rows of pills. */
.cat-filter-bar { display: flex; align-items: center; gap: 10px; padding: 22px 0 6px; flex-wrap: wrap; }
.cat-filter { position: relative; }
.cat-filter-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 9999px; border: 1px solid var(--border); background: var(--white);
  color: var(--ink); font-weight: 700; font-size: 0.9rem; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.cat-filter-btn:hover { border-color: var(--ink); }
.cat-filter-btn svg { width: 15px; height: 15px; color: var(--ink-faint); transition: transform .18s; flex-shrink: 0; }
.cat-filter.is-open .cat-filter-btn svg { transform: rotate(180deg); }
.cat-filter-btn .count { color: var(--ink-faint); font-weight: 600; }

.cat-filter-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; max-height: 340px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 30;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.cat-filter.is-open .cat-filter-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.cat-filter-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 10px 14px; border-radius: 12px; border: none; background: none; text-align: left; cursor: pointer;
  color: var(--ink); font-weight: 600; font-size: 0.92rem; font-family: inherit; transition: background .12s;
}
.cat-filter-item:hover { background: var(--sage-pale); }
.cat-filter-item.is-active { background: var(--sage-pale); color: var(--sage-deep); font-weight: 800; }
.cat-filter-item .n { color: var(--ink-faint); font-weight: 600; font-size: 0.82rem; }
.cat-filter-sep { height: 1px; background: var(--border); margin: 6px 10px; }

/* Only rendered while a category is active — the escape hatch for someone who landed here from a
   shared category link and wants to see the whole catalog. */
.cat-clear-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 9999px;
  border: 1px solid var(--border); background: var(--sage-pale); color: var(--sage-deep); font-weight: 700;
  font-size: 0.9rem; cursor: pointer; font-family: inherit; transition: all .15s;
}
.cat-clear-btn:hover { border-color: var(--sage-deep); }
.cat-clear-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Phone widths: tighten the three controls so they sit on one or two rows instead of stacking
   into three, which pushed the first product row below the fold. */
@media (max-width: 520px) {
  .cat-filter-bar { gap: 8px; padding: 18px 0 4px; }
  .cat-filter-btn, .cat-clear-btn, .cat-share-btn { padding: 9px 13px; font-size: 0.85rem; }
  .cat-filter-panel { min-width: min(260px, calc(100vw - 48px)); }
}

.cat-share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 9999px;
  border: 1px solid var(--border); background: var(--white); color: var(--ink); font-weight: 700;
  font-size: 0.9rem; cursor: pointer; font-family: inherit; transition: all .15s;
}
.cat-share-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.cat-share-btn svg { width: 15px; height: 15px; }

/* Product grid */
.cat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 24px 0 64px;
}
@media (min-width: 620px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
@media (min-width: 1160px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }

.p-card {
  display: block; text-decoration: none; color: inherit; background: var(--white);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  transition: all .18s;
}
.p-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--sage-soft); }
.p-card .p-photo { position: relative; aspect-ratio: 1/1; background: var(--sage-pale); overflow: hidden; }
.p-card .p-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-condition {
  position: absolute; top: 10px; left: 10px; padding: 4px 11px; border-radius: 9999px;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: #fff; backdrop-filter: blur(4px);
}
.p-condition.new { background: rgba(46,109,164,0.92); }
.p-condition.used { background: rgba(21,23,15,0.72); }
.p-card .p-body { padding: 13px 14px 16px; }
.p-card .p-name { font-size: 0.92rem; font-weight: 700; margin: 0 0 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .p-price { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0; }
.p-card .p-buy {
  margin-top: 10px; width: 100%; padding: 9px; border-radius: 9999px; border: 1px solid var(--ink);
  background: var(--white); color: var(--ink); font-weight: 700; font-size: 0.82rem; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.p-card .p-buy:hover { background: var(--ink); color: #fff; }

.cat-empty, .cat-loading { text-align: center; padding: 80px 20px; color: var(--ink-faint); }
.cat-loading .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--sage-deep); margin: 0 auto 16px; animation: cat-spin 0.8s linear infinite; }
@keyframes cat-spin { to { transform: rotate(360deg); } }

/* ── Product detail page ── */
.pd-wrap { padding: 28px 0 70px; }
.pd-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 860px) { .pd-grid { grid-template-columns: 1fr 1fr; gap: 48px; } }

.pd-gallery-main { position: relative; aspect-ratio: 1/1; border-radius: 22px; overflow: hidden; background: var(--sage-pale); box-shadow: var(--shadow-md); }
.pd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.pd-thumb { flex-shrink: 0; width: 68px; height: 68px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--sage-pale); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb.is-active { border-color: var(--ink); }

.pd-category { color: var(--sage-deep); font-weight: 700; font-size: 0.84rem; text-transform: uppercase; letter-spacing: .03em; display: inline-block; }
.pd-category:hover { text-decoration: underline !important; }
.pd-name { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 8px 0 14px; }
.pd-price { font-size: 1.7rem; font-weight: 800; margin: 0 0 14px; }
.pd-desc { color: var(--ink-soft); line-height: 1.7; white-space: pre-line; margin: 0 0 24px; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.pd-actions .btn { flex: 1 1 auto; justify-content: center; }
.pd-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 22px; border-radius: 9999px; border: 1px solid var(--border); background: var(--white);
  color: var(--ink); font-weight: 700; font-size: 0.96rem; cursor: pointer; font-family: inherit; transition: all .15s;
}
.pd-share:hover { border-color: var(--ink); transform: translateY(-2px); }
.pd-share svg { width: 18px; height: 18px; }

.pd-contact-card { background: var(--cream); border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px; }
.pd-contact-card h4 { margin: 0 0 10px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); }
.pd-contact-card a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; margin-bottom: 8px; font-size: 0.98rem; }
.pd-contact-card a:last-child { margin-bottom: 0; }
.pd-contact-card svg { width: 18px; height: 18px; color: var(--sage-deep); flex-shrink: 0; }

.pd-more { padding-top: 56px; border-top: 1px solid var(--border); margin-top: 56px; }
.pd-more h3 { margin-bottom: 20px; }
.pd-more-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.pd-more-scroll .p-card { flex: 0 0 160px; scroll-snap-align: start; }

/* Toast (share fallback / copy confirmation) */
.cat-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 24px; border-radius: 9999px; font-weight: 700;
  font-size: 0.88rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.cat-toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Buy modal */
.cat-modal-overlay {
  position: fixed; inset: 0; background: rgba(21,23,15,0.5); display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 150; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.cat-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.cat-modal { background: #fff; border-radius: 22px; padding: 28px; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg); position: relative; }
.cat-modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--sage-pale); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cat-modal h3 { margin: 0 0 6px; }
.cat-modal p.sub { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 18px; }
