/* ==========================================================================
   RALLY NUTRITION — UNIFORM CATALOGUE CARDS, /PRODUCTS & DETAIL SHOWROOM
   ========================================================================== */

/* --------------------------------------------------------------------------
   SHARED IMAGE STAGE + SHIMMER
   -------------------------------------------------------------------------- */
.product-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: #161616;
  overflow: hidden;
}

.product-stage .stage-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    110deg,
    rgba(22, 22, 22, 0.6) 28%,
    rgba(38, 38, 38, 0.85) 48%,
    rgba(22, 22, 22, 0.6) 68%
  );
  background-size: 220% 100%;
  animation: productShimmer 1.35s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.product-stage.is-loading .stage-shimmer {
  opacity: 1;
}

@keyframes productShimmer {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

.product-stage img {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transition: transform 0.45s var(--ease-cinematic);
  will-change: transform;
}

.product-stage.is-loaded img {
  opacity: 1;
}

.product-stage img.is-fallback-opaque {
  border-radius: 3px;
}

.product-stage--studio {
  padding: 0;
  background-color: #0b0b0b;
}

.product-stage--studio img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-stage.product-stage--studio {
  padding: 0;
  background-color: #0b0b0b;
}

/* --------------------------------------------------------------------------
   EQUAL-IMPORTANCE MATTE CHARCOAL PRODUCT CARD (.catalog-card)
   -------------------------------------------------------------------------- */
.catalog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #121212;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  overflow: hidden;
  transition:
    border-color 0.28s ease,
    background-color 0.28s ease;
}

.catalog-card:hover {
  border-color: rgba(182, 255, 0, 0.4);
  background-color: #151515;
}

.catalog-card-media-link {
  display: block;
}

.catalog-card:hover .product-stage img {
  transform: scale(1.05);
}

.catalog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.catalog-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.catalog-card-brand {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-card-size {
  font-size: 0.68rem;
  font-weight: 500;
  color: #8c8c8c;
  white-space: nowrap;
  flex-shrink: 0;
}

.catalog-card-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: #f4f4f2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.55rem;
}

.catalog-card:hover .catalog-card-title {
  color: #ffffff;
}

.catalog-card-price-row {
  padding-top: 2px;
  min-height: 24px;
  display: flex;
  align-items: center;
}

.catalog-card-price {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--color-accent);
}

.catalog-card-price.is-enquire {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.catalog-card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.catalog-btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.03);
  color: #f4f4f2;
  font-size: 0.78rem;
  font-weight: 500;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.catalog-btn-view svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.28s var(--ease-cinematic);
}

.catalog-btn-view:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.catalog-btn-view:hover svg {
  transform: translateX(3px);
}

.catalog-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1px solid rgba(182, 255, 0, 0.35);
  background-color: rgba(182, 255, 0, 0.08);
  color: var(--color-accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.catalog-btn-wa:hover {
  background-color: var(--color-accent);
  color: #050505;
}

/* --------------------------------------------------------------------------
   CATALOGUE GRIDS & TOOLBAR (/ & /products)
   -------------------------------------------------------------------------- */
.catalogue-page {
  background-color: #080808;
  min-height: calc(100svh - 200px);
}

.catalogue-hero {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 32px;
}

.catalogue-heading {
  font-size: clamp(2.6rem, 5.8vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.catalogue-heading .reveal-line-inner {
  color: #ffffff;
}

.catalogue-heading .accent {
  color: var(--color-accent);
}

.toolbar-clear-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(182, 255, 0, 0.45);
  color: var(--color-accent);
  font-size: 0.76rem;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.toolbar-clear-btn:hover {
  background-color: var(--color-accent);
  color: #050505;
}

.toolbar-clear-btn[hidden] {
  display: none;
}

.catalogue-sections {
  display: flex;
  flex-direction: column;
}

.catalogue-category-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 640px;
  padding-top: clamp(44px, 5.5vw, 64px);
  margin-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.catalogue-category-section:first-child {
  margin-top: 0;
  padding-top: 8px;
  border-top: none;
}

.catalogue-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(22px, 3vw, 32px);
}

.catalogue-cat-title-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.catalogue-cat-index {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

.catalogue-cat-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #f4f4f2;
}

.catalogue-cat-count {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.catalogue-cat-filter-btn {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: transparent;
  color: rgba(244, 244, 242, 0.86);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.22s ease, color 0.22s ease;
}

.catalogue-cat-filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.catalogue-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   INDIVIDUAL PRODUCT DETAIL SHOWROOM (/products/:slug) & 404 PAGE
   -------------------------------------------------------------------------- */
.detail-page {
  background-color: #080808;
}

.detail-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.detail-top-bar .breadcrumb {
  margin-bottom: 0;
}

.detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.detail-gallery-sticky {
  position: sticky;
  top: clamp(90px, 11svh, 124px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-stage {
  aspect-ratio: 4 / 4.1;
  max-height: 540px;
  width: 100%;
  padding: clamp(20px, 3.5vw, 40px);
  background-color: #121212;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  cursor: zoom-in;
}

.detail-stage:hover img {
  transform: scale(1.04);
}

.detail-gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-thumb-btn {
  width: 64px;
  height: 64px;
  padding: 6px;
  background-color: #121212;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.detail-thumb-btn.is-active,
.detail-thumb-btn:hover {
  border-color: var(--color-accent);
  background-color: #181818;
}

.detail-gallery-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.detail-gallery-counter {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
}

.detail-nav-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f4f4f2;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.detail-nav-arrow:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.detail-nav-arrow svg {
  width: 16px;
  height: 16px;
}

.detail-zoom-hint {
  z-index: 4;
  border-radius: 2px;
  background-color: rgba(8, 8, 8, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.detail-option-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.qty-btn {
  width: 44px;
  height: 44px;
}

.detail-wa-cta {
  min-height: 48px;
  border-radius: 3px;
}

.detail-wa-cta svg {
  transition: transform 0.3s var(--ease-cinematic);
}

.detail-wa-cta:hover svg {
  transform: translateX(4px);
}

.detail-accordions {
  margin-top: clamp(48px, 6vw, 76px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-acc-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-acc-trigger {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f4f4f2;
  transition: color 0.25s ease;
}

.detail-acc-trigger:hover,
.detail-acc-item.is-open .detail-acc-trigger {
  color: var(--color-accent);
}

.detail-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.36s var(--ease-cinematic);
}

.detail-acc-item.is-open .detail-acc-panel {
  grid-template-rows: 1fr;
}

.detail-acc-inner {
  overflow: hidden;
}

.detail-acc-body {
  padding-bottom: 22px;
  font-size: 0.94rem;
  line-height: 1.72;
  color: rgba(244, 244, 242, 0.8);
  max-width: 68ch;
}

.detail-acc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-acc-list li::before {
  content: '— ';
  color: var(--color-accent);
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 8px;
}

/* Studio Dark Lightbox */
.lightbox-content {
  background-color: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* --------------------------------------------------------------------------
   RESPONSIVE GRID BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .catalogue-grid,
  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .detail-split {
    grid-template-columns: 1fr;
  }

  .detail-gallery-sticky {
    position: static;
  }

  .catalogue-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }

  .cat-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px 20px;
    padding-bottom: 10px;
    max-width: 100%;
    scrollbar-width: none;
  }

  .cat-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 359px) {
  .catalogue-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-stage .stage-shimmer {
    animation: none !important;
  }
  .product-stage img,
  .catalog-btn-view svg {
    transition: none !important;
  }
}
