/* Appily Twenty — Edibles-style catalog (ep-) */

.page-ep-catalog {
  --ep-green: #5a9688;
  --ep-green-light: #7eb8a4;
  --ep-orange: #e8a54b;
  --ep-orange-hot: #f09030;
  --ep-wine: #2d1b2e;
  --ep-gray-bg: #f3f3f3;
  --ep-gray-mid: #888;
  --ep-border: #e5e5e5;
  --ep-ink: #333;
  --ep-white: #fff;
  --ep-serif: 'Instrument Serif', Georgia, serif;
  --ep-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--ep-white);
  font-family: var(--ep-sans);
  color: var(--ep-ink);
}

.page-ep-catalog .page-main {
  padding-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Page head ── */
.ep-pagehead {
  background: var(--ep-gray-bg);
  padding: 2rem 0 1.75rem;
  text-align: center;
  border-bottom: 1px solid var(--ep-border);
}

.ep-pagehead-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.ep-crumb {
  font-size: 0.78rem;
  color: var(--ep-gray-mid);
}

.ep-crumb a {
  color: inherit;
  text-decoration: none;
}

.ep-crumb a:hover {
  color: var(--ep-green);
}

.ep-crumb span[aria-current="page"] {
  color: var(--ep-ink);
}

.ep-pagehead h1 {
  margin: 0;
  font-family: var(--ep-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  color: var(--ep-ink);
}

/* ── Layout ── */
.ep-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
  align-items: start;
}

/* ── Sidebar filters ── */
.ep-sidebar {
  position: sticky;
  top: 1rem;
}

.ep-filter-block {
  border-bottom: 1px solid var(--ep-border);
}

.ep-filter-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ep-ink);
  cursor: pointer;
  text-align: left;
}

.ep-filter-caret {
  font-size: 0.75rem;
  color: var(--ep-gray-mid);
  transition: transform 0.2s;
}

.ep-filter-block.is-open .ep-filter-caret {
  transform: rotate(180deg);
}

.ep-filter-panel {
  padding: 0 0 1rem;
  display: grid;
  gap: 0.55rem;
}

.ep-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ep-gray-mid);
  cursor: pointer;
  line-height: 1.35;
}

.ep-check input {
  margin-top: 0.15rem;
  accent-color: var(--ep-green);
}

.ep-check span {
  flex: 1;
}

.ep-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ep-price-row input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ep-border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.82rem;
}

.ep-price-apply {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--ep-border);
  background: var(--ep-white);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
}

.ep-price-apply:hover {
  border-color: var(--ep-green);
  color: var(--ep-green);
}

.ep-clear-filters {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--ep-green);
  text-decoration: underline;
}

/* ── Toolbar ── */
.ep-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ep-border);
}

.ep-count {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ep-gray-mid);
  flex: 1;
}

.ep-count strong {
  color: var(--ep-ink);
  font-weight: 700;
}

.ep-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ep-gray-mid);
}

.ep-sort select {
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  border: 1px solid var(--ep-border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--ep-white);
  cursor: pointer;
}

.ep-view-switch {
  display: flex;
  gap: 0.25rem;
}

.ep-view-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ep-border);
  background: var(--ep-white);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ep-gray-mid);
  display: grid;
  place-items: center;
  border-radius: 3px;
}

.ep-view-btn.is-active {
  background: var(--ep-orange-hot);
  border-color: var(--ep-orange-hot);
  color: #fff;
}

/* ── Product grid ── */
.ep-grid {
  display: grid;
  gap: 12px;
}

.ep-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ep-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ep-grid-5 { grid-template-columns: repeat(5, 1fr); }
.ep-grid-6 { grid-template-columns: repeat(6, 1fr); }

/* ── Product card ── */
.ep-card {
  position: relative;
  border: 1px solid var(--ep-border);
  background: var(--ep-white);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.ep-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ep-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: capitalize;
  padding: 0.2rem 0.45rem;
  background: var(--ep-green);
  color: #fff;
  border-radius: 2px;
}

.ep-card-out {
  background: #666;
}

.ep-card-media {
  position: relative;
}

.ep-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 1rem;
  text-decoration: none;
}

.ep-card-img img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.ep-card-hover {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.ep-card:hover .ep-card-hover {
  opacity: 1;
}

.ep-card-quick {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--ep-white);
  border: 1px solid var(--ep-border);
  border-radius: 50%;
  text-decoration: none;
  color: var(--ep-ink);
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ep-card-quick:hover {
  background: var(--ep-orange-hot);
  border-color: var(--ep-orange-hot);
  color: #fff;
}

.ep-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ep-card-body h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  flex: 1;
}

.ep-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.ep-card-body h3 a:hover {
  color: var(--ep-green);
}

.ep-card-stars {
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: #ddd;
  margin-bottom: 0.45rem;
}

.ep-card-stars .is-on {
  color: var(--ep-orange);
}

.ep-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.ep-card-price strong {
  font-size: 0.85rem;
  font-weight: 700;
}

.ep-card-price s {
  font-size: 0.7rem;
  color: var(--ep-gray-mid);
  margin-left: 0.25rem;
}

.ep-card-cart {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ep-gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ep-card:hover .ep-card-cart:not(.is-disabled) {
  background: var(--ep-orange-hot);
}

.ep-card-cart.is-disabled {
  opacity: 0.4;
}

.ep-card.is-sold-out .ep-card-img {
  opacity: 0.55;
}

/* ── Empty state ── */
.ep-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ep-gray-mid);
}

.ep-empty a {
  color: var(--ep-green);
  font-weight: 600;
}

/* ── Pagination ── */
.ep-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.ep-page-num,
.ep-page-arrow {
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ep-border);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ep-ink);
  background: var(--ep-white);
}

.ep-page-num.is-active {
  background: var(--ep-orange-hot);
  border-color: var(--ep-orange-hot);
  color: #fff;
}

.ep-page-arrow:hover,
.ep-page-num:not(.is-active):hover {
  border-color: var(--ep-green);
  color: var(--ep-green);
}

.ep-page-next {
  background: var(--ep-green);
  border-color: var(--ep-green);
  color: #fff;
}

.ep-page-next:hover {
  background: var(--ep-green-light);
  border-color: var(--ep-green-light);
  color: #fff;
}

.ep-page-gap {
  padding: 0 0.25rem;
  color: var(--ep-gray-mid);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ep-grid-6 { grid-template-columns: repeat(4, 1fr); }
  .ep-grid-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .ep-layout {
    grid-template-columns: 1fr;
  }

  .ep-sidebar {
    position: static;
    border: 1px solid var(--ep-border);
    padding: 0 1rem;
    border-radius: 6px;
  }

  .ep-grid-4,
  .ep-grid-5,
  .ep-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .ep-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ep-view-switch {
    justify-content: flex-end;
  }

  .ep-grid-3,
  .ep-grid-4,
  .ep-grid-5,
  .ep-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .ep-grid-3,
  .ep-grid-4,
  .ep-grid-5,
  .ep-grid-6 {
    grid-template-columns: 1fr;
  }
}
