/* Category landing page template — see design-specs/category-page-template.md */
/* Reused for all 13 category/occasion pages: only content (title/hero image/description/products) changes. */

/* ---------- Hero: red band + product coverflow (node 1519:33993) ---------- */
.cat-hero {
  background: var(--color-brand-red);
  color: var(--color-grey-50);
  min-height: 1080px;
  padding: 204px 0 20px; /* hint sits at y=1040 of an 1080-tall hero */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.cat-hero__eyebrow {
  font: 500 32px/40px var(--font-body);
  color: var(--color-grey-50);
  margin: 0;
  text-align: center;
}

/* No products yet — collapse to a title band instead of a tall empty red block. */
.cat-hero--bare { min-height: 0; padding: 204px 0 80px; gap: 16px; }

/* Slides scroll horizontally and bleed past both edges; the centre one is taller. */
.cat-hero__track {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  height: 525px;
  overflow-x: auto;
  scrollbar-width: none;
  /* No end padding: category.js clones the slides either side, so there is always something
     running off both edges the way Figma draws it. */
  scroll-snap-type: x mandatory;
}
.cat-hero__track::-webkit-scrollbar { display: none; }
.cat-hero__slide {
  flex: 0 0 401px;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;
  scroll-snap-align: center;
  transition: height .3s ease;
  display: block;
}
.cat-hero__slide.is-active { height: 525px; }
.cat-hero__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cat-hero__caption { display: flex; flex-direction: column; align-items: center; gap: 32px; width: 100%; }

/* Kicker centred, pager right, empty column left to balance them (node 1519:34009). */
.cat-hero__meta { display: flex; align-items: center; width: 100%; }
.cat-hero__meta-spacer,
.cat-hero__meta .cat-hero__kicker,
.cat-hero__meta .cat-hero__pager { flex: 1 0 0; min-width: 0; }
.cat-hero__meta .cat-hero__kicker { text-align: center; }
.cat-hero__pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.cat-hero__arrow {
  width: 24px; height: 24px; padding: 0; border: none; background: none;
  color: var(--color-grey-50); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cat-hero__arrow svg { width: 20px; height: 20px; }
.cat-hero__pager span { font: 500 20px/23px var(--font-body); color: var(--color-grey-50); }
.cat-hero__kicker { font: 500 20px/23px var(--font-body); color: var(--color-grey-50); margin: 0; }
.cat-hero__title {
  font-family: var(--font-display);
  font-size: 70px;
  line-height: 70px;
  letter-spacing: 0.7px;
  color: var(--color-grey-50);
  text-align: center;
  margin: 0;
}
.cat-hero__scroll-hint {
  font: 500 16px/20px var(--font-body);
  color: var(--color-grey-50);
  opacity: .8;
  margin: auto 0 0;
  text-align: center;
}

/* Mobile hero: node 1068:20577 — 800px tall, 302px slides, no scroll hint. */
@media (max-width: 767.98px) {
  .cat-hero { min-height: 800px; padding: 120px 0 24px; gap: 24px; justify-content: flex-start; }
  .cat-hero__eyebrow { font: 500 16px/20px var(--font-body); }
  .cat-hero__track { height: 454px; gap: 11px; padding: 0 calc(50% - 151px); }
  .cat-hero__slide { flex-basis: 303px; height: 302px; }
  .cat-hero__slide.is-active { height: 454px; }
  .cat-hero__title { font-size: 32px; line-height: 36px; }
  .cat-hero__kicker { font: 500 16px/20px var(--font-body); }
  .cat-hero__pager span { font: 500 16px/16px var(--font-body); }
  .cat-hero__arrow svg { width: 16px; height: 16px; }
  .cat-hero__scroll-hint { display: none; }
  /* Mobile stacks the pager above the kicker instead of putting it to the right
     (node 1068:20592). */
  .cat-hero__caption { gap: 16px; }
  .cat-hero__meta { flex-direction: column; gap: 28px; }
  .cat-hero__meta-spacer { display: none; }
  .cat-hero__meta .cat-hero__pager { order: -1; flex: none; }
  .cat-hero__meta .cat-hero__kicker { flex: none; }
  .cat-hero__arrow { width: 16px; height: 16px; }
}

/* ---------- Content container ----------
   Figma runs a 240px gutter each side of 1920 -> 1440px of content, so the tiles land
   at 464px. The .container padding was eating 48px and squashing them to 448px. */
.cat-content { padding: 40px 0 80px; max-width: 1440px; }
.cat-breadcrumb {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  color: #1C1C1C;
  margin: 0 0 40px;
}

/* ---------- Filter/Sort Bar ---------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 0 24px;
  gap: 24px;
  flex-wrap: wrap;
}
.filter-bar__heading { max-width: 722px; }
.filter-bar__title { font: 500 32px/40px var(--font-body); color: var(--color-black); margin: 0; }
.filter-bar__desc { font: 400 24px/32px var(--font-body); color: var(--color-grey-600); margin: 4px 0 0; }
.filter-bar__actions { display: flex; align-items: center; gap: 24px; }
.filter-bar__sort-label { font: 400 20px/24px var(--font-body); color: var(--color-text-default); }
.filter-bar__dropdown,
.filter-bar__filter-btn {
  display: flex; align-items: center; gap: 8px; height: 48px; border-radius: var(--radius-sm);
  padding: 8px 8px 8px 16px; font: 500 20px/23px var(--font-body); color: var(--color-text-default); cursor: pointer;
}
.filter-bar__dropdown { border: 1px solid var(--color-grey-400); background: transparent; }
.filter-bar__filter-btn { background: var(--color-brand-gold-bg); border: none; }

@media (max-width: 767.98px) {
  /* Figma mobile: 16px gutter, 398px of content (node 1068:20610). */
  .cat-content { padding: 16px 16px 24px; }
  .cat-breadcrumb { font: 400 13px/16px var(--font-body); margin-bottom: 20px; }

  .filter-bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0; }
  .filter-bar__title { font: 500 20px/23px var(--font-body); }
  .filter-bar__desc { font: 400 13px/16px var(--font-body); }
  .filter-bar__sort-label { font: 500 16px/20px var(--font-body); }
  /* "Sắp xếp theo" gets its own line above the two controls (node 1068:21188). */
  .filter-bar__actions { flex-wrap: wrap; gap: 4px 16px; }
  .filter-bar__sort-label { flex: 0 0 100%; }
  .filter-bar__dropdown, .filter-bar__filter-btn {
    height: 32px; padding: 4px 8px 4px 16px; gap: 16px; font: 400 13px/16px var(--font-body);
  }
}

/* ---------- Product Grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 24px;
  margin-top: 28px;   /* filter bar sits 28px above the grid (node 1519:34031) */
  padding-bottom: 80px;
}
/* Empty category (node 1538:39514) */
.cat-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 120px 0; text-align: center;
}
.cat-empty__title {
  font-family: var(--font-display); font-size: 48px; line-height: 56px;
  color: var(--color-grey-500); margin: 0;
}
.cat-empty__text { font: 500 16px/20px var(--font-body); color: var(--color-grey-600); margin: 0 0 16px; }
.cat-empty__text a { color: var(--color-brand-red); }
.cat-empty__art { width: 197px; height: auto; display: block; }

@media (max-width: 767.98px) {
  .cat-empty { padding: 56px 16px; }
  .cat-empty__title { font-size: 20px; line-height: 28px; }
  .cat-empty__text { font-size: 13px; line-height: 18px; }
  .cat-empty__art { width: 140px; }
}

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 13px; padding: 10px;
  margin-bottom: 80px;
}
.pagination__label { font: 500 20px/23px var(--font-body); color: var(--color-text-default); }
/* 44px hit area around the 20px glyph — the arrow itself stays the size Figma draws. */
.pagination__arrow {
  width: 44px; height: 44px; color: var(--color-text-default);
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination__arrow svg { width: 20px; height: 20px; }
/* Dim rather than vanish: the pager used to jump sideways between the first and last page. */
.pagination__arrow--disabled { opacity: .3; pointer-events: none; }

/* ---------- Sort / filter popovers ---------- */
.filter-menu { position: relative; }
.filter-menu__panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 220px;
  margin: 0; padding: 8px 0; list-style: none;
  background: #fff; border: 1px solid var(--color-grey-300); border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  display: none;
}
.filter-menu__panel--right { left: auto; right: 0; }
.filter-menu.is-open .filter-menu__panel { display: block; }
.filter-menu__panel a {
  display: block; padding: 10px 16px;
  font: 500 16px/20px var(--font-body); color: var(--color-text-default); text-decoration: none;
  white-space: nowrap;
}
.filter-menu__panel a:hover { background: var(--color-brand-gold-bg); }
.filter-menu__panel a.is-active { color: var(--color-brand-red); }

@media (max-width: 767.98px) {
  .product-grid { grid-template-columns: 1fr; gap: 24px; margin-top: 20px; padding-bottom: 40px; }
  .pagination { margin-bottom: 40px; }
}

/* ---------- Product Card ---------- */
.product-card { display: flex; flex-direction: column; gap: 20px; }
.product-card__image {
  position: relative; display: block; width: 100%; height: 556px;
  background-color: var(--color-grey-50); background-size: cover; background-position: center;
  border-radius: var(--radius-sm); overflow: hidden;
}
.product-card__image-link { position: absolute; inset: 0; z-index: 0; }
.product-card__badges { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; z-index: 1; }
.product-card__badge {
  height: 36px; padding: 8px 16px; border-radius: var(--radius-sm);
  font: 400 14px/20px var(--font-body); display: flex; align-items: center;
}
.product-card__badge--new { background: #fff; color: #1C1C1C; }
.product-card__badge--sale { background: var(--color-brand-red); color: #fff; }
.product-card__badge--out-of-stock { background: var(--color-grey-400); color: #fff; }

/* Figma parks the pill 102px below the image and slides it in on hover (node 722:18122). */
.product-card__add-to-cart {
  position: absolute; right: 16px; bottom: 24px; left: 16px; z-index: 1;
  height: 60px; margin: 0;
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.product-card__image:hover .product-card__add-to-cart,
.product-card__add-to-cart:focus-within {
  transform: translateY(0);
  opacity: 1;
}
.product-card__add-to-cart button {
  all: unset; box-sizing: border-box; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--color-brand-red-deep); border-radius: var(--radius-sm);
  color: var(--color-grey-50); font: 500 20px/23px var(--font-body); cursor: pointer;
}
.product-card__add-to-cart svg { width: 28px; height: 28px; }

/* Figma nests name+price in their own 8px-gap column, then leaves 12px before the
   swatch row (node 1519:34033). */
.product-card__info { display: flex; flex-direction: column; gap: 8px; }
.product-card__swatches { margin-top: 4px; }
.product-card__name {
  font: 500 32px/40px var(--font-body); color: #1C1C1C; text-decoration: none; display: block;
}
.product-card__price { font: 500 24px/32px var(--font-body); color: var(--color-text-default); margin: 0; }
.product-card__compare-price {
  font-size: 16px; color: var(--color-grey-400); text-decoration: line-through; margin-left: 8px;
}
/* Figma: 24px-wide swatch, 10px of colour with 4px padding above and below, and the
   selected one underlined in black (node 1519:34033). */
.product-card__swatches { display: flex; align-items: center; gap: 9px; }
.product-card__swatch {
  box-sizing: content-box; /* the global border-box would swallow the 4px padding */
  width: 24px; height: 10px; padding: 4px 0;
  background-clip: content-box;
  border-bottom: 1px solid transparent;
}
.product-card__swatch--active { border-bottom-color: #000; }

.product-card--out-of-stock .product-card__image { opacity: 0.6; }

/* The PDP's two card variants drop the swatch row (nodes 826:20692 / 826:21046), which
   is what makes them 656px and 520px tall rather than the catalogue card's 686px. */
.product-card--collection .product-card__swatches,
.product-card--related .product-card__swatches { display: none; }
.product-card--related .product-card__name { font: 600 24px/32px var(--font-body); }
.product-card--related .product-card__price { font: 500 24px/32px var(--font-body); margin-top: 0; }

/* Collection cross-sell / Related products variants (used on the Product Detail page) —
   on desktop the floating pill overlaps the bottom edge of the image instead of sitting inset.
   Scoped to desktop only — mobile always uses the shared icon-only inset style below. */
@media (min-width: 768px) {
  .product-card--collection .product-card__image,
  .product-card--related .product-card__image {
    overflow: visible;
  }
  .product-card--collection .product-card__add-to-cart,
  .product-card--related .product-card__add-to-cart {
    left: auto; right: 24px; bottom: -30px; width: auto; padding: 0 16px;
  }
  /* 428 + 20 gap + 72 of copy = the 520px tile Figma draws (node 826:21046). */
  .product-card--related .product-card__image { height: 428px; }
}

@media (max-width: 767.98px) {
  .product-card__image { height: 470px; }
  /* No hover on touch — the icon button stays visible. */
  .product-card__add-to-cart {
    right: 16px; bottom: 16px; left: auto; width: 44px; height: 44px;
    transform: none; opacity: 1;
  }
  .product-card__add-to-cart button {
    border-radius: var(--radius-sm); background: rgba(247, 243, 238, 0.5); padding: 0; gap: 0; color: #1C1C1C;
  }
  .product-card__add-to-cart .cta-label { display: none; }
  .product-card__name { font: 500 20px/23px var(--font-body); }
  .product-card__price { font: 500 16px/20px var(--font-body); }
}

/* ---------- Artist collaboration banner (node 1519:34045) ---------- */
.promo-banner {
  display: flex; gap: 80px; padding: 80px 240px; background: var(--color-brand-gold); align-items: center;
}
.promo-banner__text { flex: 1 1 0; min-width: 0; max-width: 680px; display: flex; flex-direction: column; gap: 24px; }
.promo-banner__eyebrow { font: 500 20px/23px var(--font-body); color: var(--color-grey-50); margin: 0; }
.promo-banner__title { font: 400 32px/44px var(--font-body); color: var(--color-grey-50); margin: 0; }
.promo-banner__cta {
  display: inline-flex; align-self: flex-start; padding: 16px 24px; border-radius: var(--radius-sm);
  background: #fff; color: #1C1C1C; font: 500 20px/23px var(--font-body); text-decoration: none;
}
.promo-banner__image {
  flex: 0 0 760px; height: 660px; border-radius: 8px; overflow: hidden;
  background-color: var(--color-grey-300);
}
.promo-banner__image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Mobile: photo on top, copy below, CTA right-aligned (node 1068:20633). */
@media (max-width: 767.98px) {
  .promo-banner { flex-direction: column; gap: 12px; padding: 0 0 24px; }
  .promo-banner__image { order: -1; flex: none; width: 100%; height: 340px; border-radius: 0; }
  .promo-banner__text { max-width: none; gap: 12px; padding: 0 16px; }
  .promo-banner__eyebrow { font: 500 16px/20px var(--font-body); }
  .promo-banner__title { font: 400 13px/16px var(--font-body); }
  .promo-banner__cta { align-self: flex-end; padding: 8px 12px; font: 500 16px/20px var(--font-body); }
}
