/* ==========================================================================
   Unicorn Store — Shop Catalog Page (Comic Pop Design System)
   ========================================================================== */

/* --- Shop Hero Stage ----------------------------------------------------- */

.shop-hero {
  position: relative;
  background: var(--u-paper-2);
  border-bottom: var(--ink-border);
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  overflow: hidden;
  isolation: isolate;
}

.shop-hero__stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.shop-hero__burst {
  position: absolute;
  top: 50%;
  left: 85%;
  width: 900px;
  height: 900px;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 197, 49, 0.22) 0deg 15deg,
    transparent 15deg 30deg
  );
  opacity: 0.8;
}

.shop-hero__dots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--u-ink) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: 0.05;
}

.shop-hero__content {
  text-align: center;
  max-width: 800px;
  margin-inline: auto;
}

.shop-hero__title {
  font-size: var(--fs-h1);
  margin-bottom: 0.5rem;
  line-height: var(--lh-tight);
}

.shop-hero__lead {
  font-size: var(--fs-lead);
  color: var(--u-ink-soft);
  max-width: 60ch;
  margin-inline: auto;
}

/* --- Quick Category Pills Rail ------------------------------------------- */

.shop-pills {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 1.5rem 0 0.5rem;
  margin-top: 1.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  flex-wrap: wrap;
}

.shop-pills::-webkit-scrollbar {
  display: none;
}

.shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border: var(--ink-border);
  border-radius: var(--r-pill);
  background: var(--u-white);
  color: var(--u-ink);
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: var(--shadow-sticker-sm);
  white-space: nowrap;
  cursor: pointer;
  transition:
    translate var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    background-color var(--t-fast),
    color var(--t-fast);
}

.shop-pill:hover {
  translate: -2px -2px;
  box-shadow: var(--shadow-sticker);
  background: var(--u-paper-2);
}

.shop-pill.is-active {
  background: var(--u-primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sticker);
  translate: -1px -1px;
}

.shop-pill__count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

/* --- Main Layout Grid ---------------------------------------------------- */

.shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 1024px) {
  .shop-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

/* --- Sidebar Filters ----------------------------------------------------- */

.shop-sidebar {
  background: var(--u-white);
  padding: 1.75rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.shop-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--ink-border);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.shop-sidebar__title {
  font-size: var(--fs-h3);
  margin: 0;
}

.shop-sidebar__reset {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--u-danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.shop-sidebar__reset:hover {
  color: var(--u-ink);
}

.shop-filter-group {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px dashed rgba(18, 21, 28, 0.12);
}

.shop-filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.shop-filter-group__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.shop-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--u-ink-soft);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-sm);
  transition: background-color var(--t-fast), color var(--t-fast);
}

.shop-filter-item:hover,
.shop-filter-item.is-active {
  background: var(--u-paper-2);
  color: var(--u-ink);
}

.shop-filter-item.is-active {
  font-weight: 700;
  outline: 2px solid var(--u-ink);
}

.shop-filter-item__badge {
  font-size: 0.6875rem;
  background: var(--u-paper);
  border: 1.5px solid var(--u-ink);
  border-radius: var(--r-pill);
  padding: 0.1rem 0.45rem;
  font-weight: 700;
}

/* Character chip swatches */
.shop-char-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.shop-char-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid var(--u-ink);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--u-paper);
  color: var(--u-ink);
  cursor: pointer;
  transition: translate var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}

.shop-char-chip:hover {
  translate: -1px -1px;
  box-shadow: 2px 2px 0 var(--u-ink);
}

.shop-char-chip.is-active {
  background: var(--u-secondary);
  color: var(--on-secondary);
  box-shadow: 2px 2px 0 var(--u-ink);
  translate: -1px -1px;
}

/* Price Range chips */
.shop-price-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shop-price-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--u-ink);
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--u-paper);
  cursor: pointer;
  transition: background-color var(--t-fast), translate var(--t-fast);
}

.shop-price-chip:hover {
  background: var(--u-paper-2);
}

.shop-price-chip.is-active {
  background: var(--u-accent);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--u-ink);
}

/* --- Top Control Bar ----------------------------------------------------- */

.shop-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--u-white);
  margin-bottom: 2rem;
}

.shop-controls__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

.shop-count-badge {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--u-ink);
  white-space: nowrap;
}

.shop-search {
  position: relative;
  flex-grow: 1;
  max-width: 380px;
}

.shop-search__input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 2px solid var(--u-ink);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  background: var(--u-paper);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.shop-search__input:focus {
  outline: none;
  background: var(--u-white);
  box-shadow: var(--shadow-sticker-sm);
}

.shop-search__icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--u-ink-soft);
}

.shop-controls__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shop-sort-select {
  padding: 0.55rem 2rem 0.55rem 1rem;
  border: 2px solid var(--u-ink);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 700;
  background: var(--u-paper) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312151C' stroke-width='2.5'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 0.75rem center / 14px;
  appearance: none;
  cursor: pointer;
}

.shop-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: var(--ink-border);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 0.875rem;
  background: var(--u-accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sticker-sm);
  cursor: pointer;
}

@media (max-width: 1023px) {
  .shop-sidebar {
    display: none; /* Controlled by mobile drawer */
  }
  .shop-filter-toggle {
    display: inline-flex;
  }
}

/* --- Active Filter Tags -------------------------------------------------- */

.shop-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--u-paper-2);
  border: 1.5px solid var(--u-ink);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.shop-tag__remove {
  cursor: pointer;
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--u-danger);
  border: none;
  background: none;
  padding: 0;
}

/* --- Mobile Filter Drawer ------------------------------------------------ */

.shop-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 21, 28, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-mid), visibility var(--t-mid);
  z-index: 170;
}

.shop-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.shop-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: var(--u-paper);
  border-right: var(--ink-border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--t-mid) var(--ease-back);
  z-index: 180;
  overflow-y: auto;
  box-shadow: var(--shadow-lift);
}

.shop-drawer-overlay.is-open .shop-drawer {
  transform: translateX(0);
}

/* --- Empty Results State ------------------------------------------------- */

.shop-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--u-white);
  border: var(--ink-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sticker);
  margin-block: 2rem;
}

.shop-empty__icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.shop-empty__title {
  font-size: var(--fs-h2);
  margin-bottom: 0.5rem;
}

.shop-empty__text {
  color: var(--u-ink-soft);
  max-width: 45ch;
  margin: 0 auto 1.5rem;
}

/* --- Trust / Guarantee Comic Spread Strip -------------------------------- */

.shop-trust-strip {
  background: var(--u-paper-2);
  border-top: var(--ink-border);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  margin-top: 3rem;
}

.shop-trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.shop-trust-card {
  background: var(--u-white);
  padding: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.shop-trust-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.shop-trust-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.shop-trust-card__text {
  font-size: var(--fs-small);
  color: var(--u-ink-soft);
  line-height: 1.45;
}

/* Ensure dynamic shop grid cards are always visible */
#shop-grid .product-card {
  opacity: 1;
}
