/* ============================================================
   PRODUCTS PAGE STYLES – Redesigned
============================================================ */

/* ---- PAGE BANNER ---- */
.page-banner {
  padding: 7rem 0 3rem;
  background-image: linear-gradient(135deg, rgba(7, 63, 50, 0.78) 0%, rgba(5, 46, 36, 0.85) 100%),
                    url('heroimage.avif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-white);
  text-align: center;
}

.page-banner .eyebrow {
  color: var(--color-vanilla);
}

.page-banner .heading-1 {
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.page-banner .body-text {
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  margin-inline: auto;
}

.breadcrumb {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-vanilla);
}

.breadcrumb__sep {
  margin-inline: 0.5rem;
}

/* ============================================================
   STICKY FILTER WRAP – sticks toolbar + tabs below header
============================================================ */
.sticky-filter-wrap {
  position: sticky;
  top: 73px;
  z-index: 18;
  background: var(--bg-primary);
  transition: box-shadow 0.25s ease;
}

.sticky-filter-wrap.is-stuck {
  box-shadow: 0 4px 20px rgba(7, 63, 50, 0.08);
}

/* ============================================================
   TOOLBAR – Search + Filter
============================================================ */
.products-toolbar {
  padding: 1.25rem 0;
}

.toolbar {
  display: flex;
  gap: 0;
  max-width: 720px;
  margin-inline: auto;
  background: var(--color-white);
  border-radius: 14px;
  box-shadow: 0 2px 20px rgba(7, 63, 50, 0.08), 0 0 0 1px rgba(7, 63, 50, 0.06);
  overflow: visible;
  position: relative;
}

/* -- Search input area -- */
.toolbar__search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.toolbar__search-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar__input {
  width: 100%;
  padding: 0.9375rem 2.75rem 0.9375rem 3rem;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  border: none;
  border-radius: 14px 0 0 14px;
  background: transparent;
  color: var(--text-primary);
  outline: none;
}

.toolbar__input::placeholder {
  color: var(--text-muted);
}

.toolbar__clear {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-soft-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast);
}

.toolbar__clear svg {
  width: 13px;
  height: 13px;
  color: var(--text-primary);
}

.toolbar__clear:hover {
  background: var(--color-vanilla);
}

/* -- Filter button -- */
.toolbar__filter {
  position: relative;
  flex-shrink: 0;
}

.toolbar__filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9375rem 1rem 0.9375rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-left: 1px solid rgba(7, 63, 50, 0.1);
  border-radius: 0 14px 14px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.toolbar__filter-btn:hover {
  background: rgba(7, 63, 50, 0.03);
}

.toolbar__filter-icon {
  width: 18px;
  height: 18px;
  color: var(--color-deep-green);
  flex-shrink: 0;
}

.toolbar__filter-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar__filter-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.toolbar__filter.is-open .toolbar__filter-chevron {
  transform: rotate(180deg);
}

/* -- Filter dropdown (portaled to body) -- */
.filter-dropdown {
  display: none;
  position: fixed;
  width: 300px;
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(7, 63, 50, 0.18), 0 0 0 1px rgba(7, 63, 50, 0.08);
  z-index: 99999;
}

.filter-dropdown.is-visible {
  display: block;
}

.filter-dropdown__inner {
  padding: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.filter-dropdown__inner::-webkit-scrollbar {
  width: 5px;
}

.filter-dropdown__inner::-webkit-scrollbar-track {
  background: transparent;
}

.filter-dropdown__inner::-webkit-scrollbar-thumb {
  background: rgba(7, 63, 50, 0.15);
  border-radius: 10px;
}

.filter-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.filter-opt:hover {
  background: rgba(7, 63, 50, 0.04);
}

.filter-opt.is-active {
  background: var(--color-deep-green);
  color: var(--color-white);
}

.filter-opt__count {
  font-size: 0.6875rem;
  font-weight: 400;
  opacity: 0.6;
  flex-shrink: 0;
}

.filter-opt.is-active .filter-opt__count {
  opacity: 0.8;
}

/* -- Active filter tag -- */
.toolbar__active-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 720px;
  margin: 1rem auto 0;
}

.toolbar__active-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-deep-green);
  background: rgba(7, 63, 50, 0.07);
  border-radius: var(--radius-pill);
}

.toolbar__active-tag button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(7, 63, 50, 0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  padding: 0;
}

.toolbar__active-tag button svg {
  width: 11px;
  height: 11px;
  color: var(--color-deep-green);
}

.toolbar__active-tag button:hover {
  background: rgba(7, 63, 50, 0.2);
}

.toolbar__result-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================================
   CATEGORY TABS (infinite marquee carousel)
============================================================ */
.category-tabs-wrap {
  padding: 0.75rem 0;
  background: var(--bg-primary);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

.category-tabs:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.cat-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--color-white);
  border: 1px solid rgba(7, 63, 50, 0.08);
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cat-tab:hover {
  color: var(--text-primary);
  border-color: rgba(7, 63, 50, 0.15);
  background: var(--color-white);
}

.cat-tab.is-active {
  color: var(--color-white);
  background: var(--color-deep-green);
  border-color: var(--color-deep-green);
}

.cat-tab__count {
  font-size: 0.6875rem;
  font-weight: 400;
  opacity: 0.5;
}

.cat-tab.is-active .cat-tab__count {
  opacity: 0.75;
}

/* ============================================================
   PRODUCT GRID
============================================================ */
.products-listing {
  padding: 2rem 0 4rem;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* -- Card entrance animation -- */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Product Card -- */
.prod-card {
  background: var(--color-white);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(7, 63, 50, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  display: flex;
  flex-direction: column;
  animation: cardFadeIn 0.4s ease both;
}

.prod-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(7, 63, 50, 0.14), 0 8px 16px rgba(7, 63, 50, 0.06);
  border-color: rgba(7, 63, 50, 0.15);
}

.prod-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
}

.prod-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s ease;
}

.prod-card:hover .prod-card__img {
  transform: scale(1.05);
}

/* -- Zoom icon overlay -- */
.prod-card__zoom-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prod-card__zoom-icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-deep-green);
}

.prod-card:hover .prod-card__zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.prod-card__body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  background: var(--color-deep-green);
  color: var(--color-white);
}

.prod-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prod-card__category {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-jonquil);
  background: rgba(234, 200, 0, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.prod-card__name {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.45;
}

.prod-card__code {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
}

.prod-card__enquire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: auto;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: #e67e22;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.25s ease, gap 0.25s ease, transform 0.25s ease;
  align-self: flex-start;
}

.prod-card__enquire:hover {
  background: #d35400;
  gap: 0.5rem;
  transform: translateX(2px);
}

.prod-card__enquire svg {
  width: 13px;
  height: 13px;
}

/* ============================================================
   LOAD MORE BUTTON
============================================================ */
.load-more-wrap {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-deep-green);
  background: transparent;
  border: 2px solid rgba(7, 63, 50, 0.15);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-base);
}

.load-more-btn:hover {
  background: var(--color-deep-green);
  color: var(--color-white);
  border-color: var(--color-deep-green);
}

.load-more-count {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.8125rem;
}

/* ============================================================
   LIGHTBOX
============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 63, 50, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.lightbox.is-open .lightbox__content {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  z-index: 2;
}

.lightbox__close svg {
  width: 20px;
  height: 20px;
  color: var(--color-white);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--color-white);
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox__info {
  text-align: center;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-items: center;
}

.lightbox__name {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
}

.lightbox__category {
  font-size: 0.8125rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lightbox__code {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
}

/* ============================================================
   NAV CURRENT PAGE INDICATOR
============================================================ */
.nav__link.is-current {
  color: var(--accent);
}

.nav__link.is-current::after {
  width: 100%;
  background: var(--accent);
}

/* ============================================================
   EMPTY STATES
============================================================ */
.empty-state {
  padding: 5rem 0;
  text-align: center;
}

.empty-state__inner {
  max-width: 400px;
  margin-inline: auto;
}

.empty-state__icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: rgba(7, 63, 50, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state__icon-wrap svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.empty-state .heading-3 {
  margin-bottom: 0.5rem;
}

.empty-state .body-text {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .prod-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .sticky-filter-wrap {
    top: 64px;
  }

  .page-banner {
    padding: 6rem 0 2.5rem;
  }

  .toolbar {
    border-radius: 12px;
  }

  .toolbar__input {
    border-radius: 12px 0 0 12px;
    padding: 0.8125rem 2.5rem 0.8125rem 2.75rem;
    font-size: 0.875rem;
  }

  .toolbar__filter-btn {
    border-radius: 0 12px 12px 0;
    padding: 0.8125rem 0.75rem;
  }

  .toolbar__filter-label {
    display: none;
  }

  .toolbar__filter-chevron {
    display: none;
  }

  .filter-dropdown {
    width: calc(100vw - 3rem);
    right: -0.5rem;
  }

  .category-tabs {
    gap: 0.375rem;
  }

  .cat-tab {
    padding: 0.4375rem 0.75rem;
    font-size: 0.75rem;
  }

  .prod-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .prod-card {
    border-radius: 12px;
  }

  .prod-card__body {
    padding: 0.75rem 0.875rem 0.875rem;
    gap: 0.375rem;
  }

  .prod-card__name {
    font-size: 0.8125rem;
  }

  .prod-card__category {
    font-size: 0.5rem;
  }

  .prod-card__code {
    font-size: 0.625rem;
  }

  .prod-card__enquire {
    font-size: 0.6875rem;
    padding: 0.4375rem 0.75rem;
  }

  .lightbox__img {
    max-height: 60vh;
    padding: 1rem;
    border-radius: 8px;
  }

  .lightbox__close {
    top: -2.5rem;
  }

  .lightbox__name {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .toolbar {
    border-radius: 10px;
  }

  .toolbar__input {
    border-radius: 10px 0 0 10px;
    padding: 0.75rem 2.25rem 0.75rem 2.5rem;
    font-size: 0.8125rem;
  }

  .toolbar__search-icon {
    left: 0.875rem;
    width: 16px;
    height: 16px;
  }

  .toolbar__filter-btn {
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 0.625rem;
  }

  .prod-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .prod-card__body {
    padding: 0.625rem 0.75rem 0.75rem;
    gap: 0.25rem;
  }

  .prod-card__name {
    font-size: 0.75rem;
  }

  .prod-card__enquire {
    font-size: 0.625rem;
    padding: 0.375rem 0.625rem;
  }

  .prod-card__zoom-icon {
    display: none;
  }

  .empty-state {
    padding: 3rem 0;
  }

  .empty-state__icon-wrap {
    width: 64px;
    height: 64px;
  }

  .empty-state__icon-wrap svg {
    width: 28px;
    height: 28px;
  }

  .lightbox__content {
    max-width: 95vw;
  }

  .lightbox__img {
    max-height: 55vh;
    padding: 0.75rem;
  }
}
