/* =========================================================
   SHOP PAGE
========================================================= */

/* ── Page header ──────────────────────────────────────────── */

.shop-page-header {
  text-align: center;
  padding: 32px 40px 0;
}

.shop-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0b6b6a;
  margin: 0 0 4px;
}

.shop-vendor-back {
  text-align: center;
  margin: 6px 0 0;
  font-size: 14px;
}
.shop-vendor-back a { color: #0b6b6a; text-decoration: none; font-weight: 600; }
.shop-vendor-back a:hover { text-decoration: underline; }

/* ── Toolbar ──────────────────────────────────────────────── */

.shop-toolbar {
  max-width: 1300px;
  margin: 20px auto 0;
  padding: 0 40px;
}

/* Category pills */
.shop-cat-pills-outer {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.shop-cat-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.shop-cat-pills::-webkit-scrollbar { display: none; }

/* Always-visible scroll buttons — pills only scroll by touch/drag otherwise,
   which isn't discoverable with a mouse. */
.shop-cat-pills-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ddeaea;
  background: #fff;
  color: #0b6b6a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, color 0.15s;
}
.shop-cat-pills-arrow:hover { background: #0b6b6a; color: #fff; border-color: #0b6b6a; }
.shop-cat-pills-arrow.arrow-left  { margin-right: 8px; }
.shop-cat-pills-arrow.arrow-right { margin-left: 8px; }

.shop-cat-pill {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid #ddeaea;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
}
.shop-cat-pill:hover  { border-color: #0b6b6a; color: #0b6b6a; }
.shop-cat-pill.active { background: #0b6b6a; border-color: #0b6b6a; color: #fff; }

/* Controls row */
.shop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
  flex-wrap: wrap;
}

/* Default-hidden until shop.js decides the page mode — prevents a flash of
   the category pills before JS determines whether browse mode applies. */
.shop-controls-pending {
  display: none;
}

.shop-count {
  display: none;
}

.shop-sort {
  padding: 7px 12px;
  border: 1.5px solid #ddeaea;
  border-radius: 8px;
  font-size: 13px;
  color: #444;
  background: #fff;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}
.shop-sort:focus { border-color: #0b6b6a; }

/* Active filter chip */
.shop-active-filter {
  display: none;
  align-items: center;
  gap: 5px;
  background: #e8f5f5;
  border: 1px solid #b8dede;
  border-radius: 20px;
  padding: 4px 6px 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0b6b6a;
}
.shop-active-filter.show { display: inline-flex; }

.shop-active-filter button {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(11, 107, 106, 0.12);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #0b6b6a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  touch-action: manipulation;
}
.shop-active-filter button:hover { background: rgba(11, 107, 106, 0.22); }

/* ── Product grid ─────────────────────────────────────────── */

.product-grid {
  max-width: 1300px;
  margin: 16px auto 0;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ── Product card ─────────────────────────────────────────── */
/* Card itself now lives in product-card.css (shared with the Store page) */

/* ── Skeleton loader ──────────────────────────────────────── */

.shop-skeleton {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eef3f3;
}

.shop-skel-img {
  aspect-ratio: 1;
  background: #edf0f0;
  position: relative;
  overflow: hidden;
}
.shop-skel-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: skel-sweep 1.4s infinite;
}

@keyframes skel-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.shop-skel-line {
  height: 12px;
  border-radius: 4px;
  background: #edf0f0;
  margin: 12px 14px 6px;
  position: relative;
  overflow: hidden;
}
.shop-skel-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: skel-sweep 1.4s infinite 0.15s;
}
.shop-skel-line.short { width: 48%; margin-top: 0; margin-bottom: 14px; }

/* ── Empty / error state ──────────────────────────────────── */

.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  color: #aaa;
  font-size: 15px;
}
.shop-empty strong {
  display: block;
  font-size: 18px;
  color: #888;
  margin-bottom: 8px;
}

/* ── Browse mode (horizontal scroll rows) ────────────────── */

#shop-browse { display: none; }

.shop-browse {
  max-width: 1300px;
  margin: 0 auto;
  padding: 8px 40px 64px;
}

.shop-row {
  margin-bottom: 32px;
}

.shop-row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shop-row-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.shop-row-see-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0b6b6a;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 12px;
}
.shop-row-see-all:hover { text-decoration: underline; }

.shop-row-outer {
  position: relative;
}

.shop-row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.shop-row-track::-webkit-scrollbar { display: none; }

.shop-row-track .sp-card-wrap {
  min-width: 175px;
  max-width: 175px;
  scroll-snap-align: start;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.shop-row-track .sp-card-wrap .sp-card {
  flex: 1;
}

/* Arrow buttons — always visible at low opacity, desktop only; brighten on
   row hover and go fully solid on direct hover so they stay discoverable
   without competing with the product cards at rest. */
.shop-row-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 44px;
  height: auto;
  border: 1.5px solid rgba(11, 107, 106, 0.4);
  background: transparent;
  color: #0b6b6a;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  text-shadow: 0 1px 4px rgba(255,255,255,0.9);
  opacity: 0.35;
  pointer-events: auto;
  transition: opacity 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
}
.shop-row-arrow.arrow-left  { left: 0; border-radius: 0 10px 10px 0; }
.shop-row-arrow.arrow-right { right: 0; border-radius: 10px 0 0 10px; }
.shop-row-outer:hover .shop-row-arrow { opacity: 0.75; }
.shop-row-arrow:hover {
  opacity: 1;
  background: rgba(11, 107, 106, 0.35);
  border-color: #0b6b6a;
  color: #fff;
  text-shadow: none;
}

/* Skeleton row title */
.shop-skel-title {
  width: 140px;
  height: 18px;
  border-radius: 4px;
  background: #edf0f0;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.shop-skel-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: skel-sweep 1.4s infinite;
}

/* Skeleton cards inside rows */
.shop-row-skel-card {
  min-width: 175px;
  max-width: 175px;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .shop-page-header { padding: 24px 14px 0; }
  .shop-title       { font-size: 1.5rem; }
  .shop-toolbar     { padding: 0 14px; margin-top: 16px; }
  .product-grid     { padding: 0 14px 48px; gap: 14px; }
  .shop-browse      { padding: 4px 14px 48px; }
  .shop-row         { margin-bottom: 24px; }
  .shop-row-track .sp-card-wrap,
  .shop-row-skel-card { min-width: 155px; max-width: 155px; }
  .shop-row-arrow   { display: none; }
  .shop-cat-pills-arrow { display: none; }
}

@media (max-width: 600px) {
  /* Pills get their own full row; sort sits cleanly underneath */
  .shop-cat-pills-outer {
    flex-basis: 100%;
    width: 100%;
  }
  .shop-controls-right {
    width: 100%;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .product-grid    { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-sort       { font-size: 1rem; padding: 10px 12px; }
  .shop-cat-pill   { min-height: 40px; padding: 0 14px; display: flex; align-items: center; }
  .shop-controls   { gap: 8px; }
  .shop-row-track .sp-card-wrap,
  .shop-row-skel-card { min-width: 140px; max-width: 140px; }
}
