.products-page {
  --products-surface-dark: #111b2e;
  --products-surface-elevated-dark: #16233b;
  --products-border-dark: rgba(148, 163, 184, 0.2);
  --products-text-muted-dark: #9fb0c8;
}

.mobile-sort-active {
  border-bottom: 2px solid #1b7a33;
  color: #1b7a33;
}

.desktop-filter-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.dark .desktop-filter-card {
  background: rgba(21, 40, 28, 0.92);
}

.product-card:hover img {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .product-card img {
    transition: none !important;
  }
}

.price-filter-field {
  position: relative;
}

.price-filter-prefix {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  pointer-events: none;
}

.dark .products-sort-bar {
  background: color-mix(in srgb, var(--products-surface-dark) 90%, transparent);
  border: 1px solid var(--products-border-dark);
}

.dark .products-filter-panel {
  background: color-mix(in srgb, var(--products-surface-dark) 92%, transparent);
  border-color: var(--products-border-dark);
}

.dark .products-category-chip {
  background: color-mix(in srgb, var(--products-surface-elevated-dark) 92%, transparent);
  color: #dbe4f1;
}

.dark .products-category-chip-active {
  background: rgba(27, 122, 51, 0.18);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.3);
}

.dark .product-card-surface {
  background: color-mix(in srgb, var(--products-surface-dark) 96%, transparent);
  border-color: var(--products-border-dark);
}

.dark .product-meta-muted {
  color: var(--products-text-muted-dark);
}

.dark .product-old-price {
  color: #94a3b8;
}


.product-gallery-shell {
  display: grid;
  gap: 0.875rem;
}

.product-gallery-stage {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: #f8fafc;
}

.product-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
}

.product-gallery-thumbs {
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.product-gallery-thumb[data-active="true"] {
  border-color: #1b7a33;
  box-shadow: 0 0 0 2px rgba(27, 122, 51, 0.14);
}

body.lightbox-open {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body.lightbox-open main,
body.lightbox-open header,
body.lightbox-open footer {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

body.lightbox-open #imageLightbox,
body.lightbox-open #imageLightbox * {
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.product-gallery-thumb img {
  display: block;
  transition: transform 180ms ease;
  object-position: center center;
}

.product-gallery-thumb:hover img {
  transform: scale(1.04);
}

@media (min-width: 1024px) {
  .product-gallery-shell {
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
  }

  .product-gallery-thumbs {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: 560px;
    padding-bottom: 0;
    padding-right: 0.25rem;
  }

  .product-gallery-thumb img {
    width: 100%;
    height: 88px;
  }

  .product-gallery-stage:hover .product-gallery-image {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {

  .product-gallery-thumb img,
  #mainProductImage {
    transition: none !important;
  }
}

.product-rich-content :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.25;
  color: rgb(15 23 42);
}

.dark .product-rich-content :where(h1, h2, h3, h4, h5, h6) {
  color: rgb(241 245 249);
}

.product-rich-content h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.product-rich-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.product-rich-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.product-rich-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
}

.product-rich-content p {
  margin: 0.7em 0;
  line-height: 1.75;
}

.product-rich-content ul,
.product-rich-content ol {
  margin: 0.8em 0;
  padding-left: 1.3rem;
}

.product-rich-content ul {
  list-style: disc;
}

.product-rich-content ol {
  list-style: decimal;
}

.product-rich-content li {
  margin: 0.25rem 0;
}

.product-rich-content blockquote {
  margin: 1rem 0;
  border-left: 4px solid #1b7a33;
  padding: 0.6rem 0.9rem;
  background: rgba(27, 122, 51, 0.06);
  border-radius: 0.75rem;
  color: rgb(51 65 85);
}

.dark .product-rich-content blockquote {
  background: rgba(148, 163, 184, 0.12);
  color: rgb(203 213 225);
}

.product-rich-content a {
  color: #1b7a33;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.product-rich-content hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid rgb(226 232 240);
}

.dark .product-rich-content hr {
  border-top-color: rgb(71 85 105);
}

.product-rich-content :where(img, video, iframe) {
  display: block;
  max-width: 100%;
  border-radius: 0.9rem;
  margin: 1rem auto;
}

.product-rich-content figure {
  margin: 1rem 0;
}

.product-rich-content figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgb(100 116 139);
  text-align: center;
}

.dark .product-rich-content figure figcaption {
  color: rgb(148 163 184);
}

.product-rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.product-rich-content th,
.product-rich-content td {
  border: 1px solid rgb(226 232 240);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.dark .product-rich-content th,
.dark .product-rich-content td {
  border-color: rgb(71 85 105);
}

.product-rich-content th {
  background: rgb(248 250 252);
  font-weight: 700;
}

.dark .product-rich-content th {
  background: rgb(30 41 59);
}

.product-rich-content pre {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.8rem;
  background: rgb(15 23 42);
  color: rgb(226 232 240);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

.product-rich-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88em;
}

.product-rich-content :not(pre)>code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
  background: rgb(241 245 249);
  color: rgb(15 23 42);
}

.dark .product-rich-content :not(pre)>code {
  background: rgb(51 65 85);
  color: rgb(226 232 240);
}