.catalog-section {
  --panel-padding: clamp(14px, 2vw, 25px);
  --panel-edge: rgb(184 196 224 / 18%);
  --panel-light: rgb(191 201 235 / 12%);
  --panel-surface: rgb(16 19 27 / 70%);
  --panel-fade: rgb(11 12 16 / 89%);
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: var(--panel-padding);
  border: 1px solid var(--panel-edge);
  border-radius: clamp(17px, 2vw, 24px);
  background: linear-gradient(135deg, var(--panel-light), transparent 37%), var(--panel-surface);
  box-shadow: inset 0 1px rgb(236 241 255 / 8%), 0 12px 42px rgb(0 0 0 / 17%);
}

.catalog-section > .section-head { margin-bottom: clamp(13px, 1.6vw, 20px); }
.catalog-section > .section-head .pill-link { background: var(--panel-surface); }
.catalog-section > .section-head .pill-link:hover { background: var(--surface-raised); }

.catalog-categories .cat-grid { gap: clamp(9px, 1vw, 13px); }
.catalog-categories .cat {
  --tile-dark: rgb(7 10 16 / 94%);
  --tile-haze: rgb(7 10 16 / 53%);
  --tile-clear: rgb(7 10 16 / 6%);
  --tile-image-opacity: .88;
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: start;
  align-content: end;
  gap: 6px;
  min-height: clamp(95px, 9vw, 119px);
  padding: 11px 12px;
  border-color: var(--panel-edge);
  border-radius: 12px;
  background: radial-gradient(ellipse at 88% 13%, color-mix(in srgb, var(--category-color, var(--violet)) 34%, transparent), transparent 78%), var(--panel-surface);
  box-shadow: inset 0 1px rgb(236 241 255 / 9%);
}

.catalog-categories .cat-art,
.catalog-categories .cat::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.catalog-categories .cat-art {
  z-index: -2;
  background: var(--category-art, url('/assets/catalog-glass.webp')) 58% 49% / cover no-repeat;
  opacity: var(--tile-image-opacity);
  transition: opacity 160ms;
}

.catalog-categories .cat::after {
  content: '';
  z-index: -1;
  background:
    linear-gradient(90deg, var(--tile-haze), var(--tile-clear) 72%),
    linear-gradient(0deg, var(--tile-dark) 6%, var(--tile-haze) 52%, var(--tile-clear) 82%);
}

.catalog-categories .cat-icon {
  width: 29px;
  height: 29px;
  border-color: var(--panel-edge);
  background: var(--panel-surface);
  font-size: .86rem;
}

.catalog-categories .cat-icon-with-image {
  --category-icon-size: clamp(44px, 5.3vw, 58px);
  position: relative;
  width: var(--category-icon-size);
  height: var(--category-icon-size);
  background: color-mix(in srgb, var(--category-color, var(--violet)) 12%, var(--panel-surface));
}

.catalog-categories .cat-icon-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: inherit;
  object-fit: contain;
  opacity: 0;
}

.catalog-categories .cat-icon-loaded .cat-icon-image { opacity: 1; }
.catalog-categories .cat-icon-loaded .cat-icon-fallback { visibility: hidden; }

.catalog-categories .cat-name { color: var(--text); font-weight: 740; }
.catalog-categories .cat:hover { border-color: var(--border-strong); }
.catalog-categories .cat:hover .cat-art { opacity: 1; }
.catalog-categories .cat.active,
.catalog-categories .cat[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.catalog-categories .cat.active .cat-name,
.catalog-categories .cat[aria-pressed='true'] .cat-name { color: var(--accent); }

.catalog-products {
  --product-glass: rgb(12 15 22 / 82%);
  --product-dark: rgb(8 11 17 / 97%);
  --product-haze: rgb(8 11 17 / 45%);
  --product-clear: rgb(8 11 17 / 5%);
}

.catalog-products::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, transparent 8%, var(--panel-surface) 55%, var(--panel-fade) 100%),
    var(--catalog-art, url('/assets/catalog-glass.webp')) center top / cover no-repeat;
  opacity: .43;
  pointer-events: none;
}

.catalog-products .prod {
  --art-window: clamp(111px, 12vw, 160px);
  position: relative;
  isolation: isolate;
  padding-top: var(--art-window);
  border-color: var(--panel-edge);
  background: radial-gradient(ellipse at 82% 4%, var(--panel-light), transparent 58%), var(--panel-surface);
  box-shadow: inset 0 1px rgb(236 241 255 / 12%);
}

.catalog-products .prod-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  aspect-ratio: auto;
  border: 0;
  background: radial-gradient(ellipse at 60% 5%, color-mix(in srgb, var(--category-color, var(--violet)) 23%, transparent), transparent 68%);
  pointer-events: none;
}

.catalog-products .prod-img img { object-position: 50% 31%; }

.catalog-products .prod-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--product-clear) 8%, var(--product-clear) 25%, var(--product-haze) 54%, var(--product-dark) 100%);
}

.catalog-products .prod-body {
  background: linear-gradient(180deg, var(--product-glass), var(--product-dark));
  border-top: 1px solid var(--panel-edge);
}

.catalog-products .prod:hover,
.catalog-products .prod:focus-within { border-color: color-mix(in srgb, var(--accent) 43%, var(--border-strong)); }
.catalog-products .prod:hover { box-shadow: 0 13px 34px rgb(0 0 0 / 34%); }

.catalog-products .prod-grid > .empty {
  border: 1px dashed var(--panel-edge);
  border-radius: 12px;
  background: var(--panel-surface);
}

@media (max-width: 570px) {
  .catalog-section { --panel-padding: 11px; }
  .catalog-section > .section-head .pill-link { padding-inline: 8px; }
  .catalog-categories .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-categories .cat { min-height: 86px; padding: 9px 10px; }
  .catalog-products .prod { --art-window: clamp(83px, 22vw, 120px); }
  .catalog-products .prod-body { padding-inline: 10px; }
  .catalog-products .prod-img img { object-position: 50% 28%; }
}

/* The light storefront uses the page background between the glass cards. */
:root[data-theme='light'] .storefront .catalog-section {
  --panel-edge: rgb(104 160 188 / 34%);
  --panel-surface: rgb(246 251 255 / 70%);
  --glass-edge: rgb(255 255 255 / 92%);
  --glass-shadow: 0 1px 1px rgb(85 138 164 / 14%), 0 8px 22px rgb(81 130 158 / 12%);
  margin-block: clamp(23px, 2.5vw, 38px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

:root[data-theme='light'] .storefront .catalog-section > .section-head {
  align-items: center;
  margin-bottom: clamp(10px, 1.35vw, 18px);
}

:root[data-theme='light'] .storefront .catalog-section > .section-head h2 {
  color: #102433;
  font-size: clamp(1.36rem, 2.25vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.025em;
}

:root[data-theme='light'] .storefront .catalog-section > .section-head .pill-link {
  border-color: var(--glass-edge);
  background: var(--panel-surface);
  color: #244a5d;
}

:root[data-theme='light'] .storefront .catalog-section > .section-head .pill-link:hover {
  border-color: var(--panel-edge);
  background: #f8fdff;
}

:root[data-theme='light'] .storefront .catalog-categories .cat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 16px);
}

:root[data-theme='light'] .storefront .catalog-categories .cat {
  --tile-image-opacity: 1;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 5px;
  min-height: clamp(112px, 10.9vw, 167px);
  padding: clamp(10px, 1.65vw, 25px);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: clamp(12px, 1.5vw, 21px);
  background: linear-gradient(150deg, #eefaff, #cce7f0 70%, #b8dbe9);
  box-shadow: inset 0 1px 0 white, var(--glass-shadow);
}

:root[data-theme='light'] .storefront .catalog-categories .cat-art {
  inset-inline-start: 12%;
  background-position: 70% 56%;
}

:root[data-theme='light'] .storefront .catalog-categories .cat::after {
  background:
    linear-gradient(90deg, rgb(232 247 253 / 95%), rgb(232 247 253 / 82%) 24%, transparent 66%),
    linear-gradient(180deg, rgb(255 255 255 / 24%), transparent 46%);
}

:root[data-theme='light'] .storefront .catalog-categories .cat-name {
  grid-row: 1;
  max-width: 62%;
  color: #102433;
  font-size: clamp(1rem, 1.65vw, 1.52rem);
  font-weight: 780;
  line-height: 1.28;
}

:root[data-theme='light'] .storefront .catalog-categories .cat-icon {
  grid-row: 2;
  width: 23px;
  height: 23px;
  border: 1px solid var(--glass-edge);
  border-radius: 7px;
  background: rgb(255 255 255 / 58%);
  font-size: .78rem;
}

:root[data-theme='light'] .storefront .catalog-categories .cat-icon-with-image {
  --category-icon-size: clamp(36px, 3.8vw, 52px);
  width: var(--category-icon-size);
  height: var(--category-icon-size);
  box-shadow: 0 2px 8px rgb(80 131 161 / 13%);
}

:root[data-theme='light'] .storefront .catalog-categories .cat:hover,
:root[data-theme='light'] .storefront .catalog-products .prod:hover {
  border-color: var(--panel-edge);
  box-shadow: 0 12px 25px rgb(53 107 145 / 20%);
}

:root[data-theme='light'] .storefront .catalog-categories .cat[aria-pressed='true'] {
  border-color: #658d1a;
  box-shadow: inset 0 0 0 1px #b5e84d, var(--glass-shadow);
}

:root[data-theme='light'] .storefront .catalog-categories .cat[aria-pressed='true'] .cat-name { color: #31501a; }

:root[data-theme='light'] .storefront .catalog-categories .cat:focus-visible,
:root[data-theme='light'] .storefront .catalog-products .buy-btn:focus-visible {
  outline-color: #245d7b;
}

:root[data-theme='light'] .storefront .catalog-products::before {
  background: linear-gradient(180deg, rgb(235 247 255 / 26%), rgb(235 247 255 / 90%)),
    var(--catalog-art, none) center 45% / cover no-repeat;
  opacity: .34;
}

:root[data-theme='light'] .storefront .catalog-products .prod-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.3vw, 20px);
}

:root[data-theme='light'] .storefront .catalog-products .prod {
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: clamp(12px, 1.3vw, 19px);
  background: #deedf5;
  box-shadow: var(--glass-shadow);
}

:root[data-theme='light'] .storefront .catalog-products .prod-img {
  position: relative;
  inset: auto;
  z-index: auto;
  aspect-ratio: 2 / 1;
  border-bottom: 1px solid var(--glass-edge);
  background: linear-gradient(150deg, #e6f6fc, #c5e3f1);
}

:root[data-theme='light'] .storefront .catalog-products .prod-img img { object-position: 50% 53%; }

:root[data-theme='light'] .storefront .catalog-products .prod-img::after {
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), transparent 78%, rgb(240 249 254 / 12%));
}

:root[data-theme='light'] .storefront .catalog-products .prod-body {
  padding: clamp(11px, 1.4vw, 21px);
  border-top: 0;
  background: linear-gradient(145deg, rgb(252 254 255 / 84%), rgb(230 245 252 / 93%));
}

:root[data-theme='light'] .storefront .catalog-products .prod-title {
  color: #102433;
  font-size: clamp(1.02rem, 1.5vw, 1.36rem);
  font-weight: 760;
}

:root[data-theme='light'] .storefront .catalog-products .prod-cat { color: #405d6c; }
:root[data-theme='light'] .storefront .catalog-products .price { color: #193f50; }

:root[data-theme='light'] .storefront .catalog-products .buy-btn:not(:disabled) {
  border-color: #93ba3a;
  background: #d0fb5f;
  color: #19321b;
  font-weight: 720;
}

:root[data-theme='light'] .storefront .catalog-products .buy-btn:hover:not(:disabled) { background: #bde94d; }

@media (max-width: 940px) {
  :root[data-theme='light'] .storefront .catalog-categories .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root[data-theme='light'] .storefront .catalog-categories .cat-grid,
  :root[data-theme='light'] .storefront .catalog-products .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  :root[data-theme='light'] .storefront .catalog-categories .cat-art { background-position: 78% 56%; }
  :root[data-theme='light'] .storefront .catalog-products .prod-img { aspect-ratio: 16 / 10; }
}
