.catalog-bg-media {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.catalog-bg-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: transparent;
}

.catalog-page {
  min-height: 0;
}

.catalog-section {
  padding-top: 26px;
}

.catalog-top h1 {
  margin: 0;
  font-size: 34px;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.catalog-top p {
  margin: 8px 0 0;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.catalog-controls {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
}

.catalog-controls input,
.catalog-controls select,
.product-view-info select,
.qty-controls input {
  height: 46px;
  border: 1px solid #cfd8c8;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 17px;
  color: var(--text);
  background: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.catalog-item {
  background: var(--card);
  border: 1px solid #dde4d8;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.catalog-item-image {
  width: 100%;
  height: 190px;
  border-radius: 12px;
  background: #e5ebdf center / cover no-repeat;
  cursor: pointer;
}

.catalog-item h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  cursor: pointer;
}

.catalog-item .muted {
  margin: 0;
  font-size: 16px;
  min-height: 42px;
  flex: 1 1 auto;
}

.catalog-item-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.price-stack {
  display: grid;
  gap: 4px;
}

.price-promo-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.price-old {
  font-size: 18px;
  color: #7d8681;
  text-decoration: line-through;
  font-weight: 600;
}

.price-new {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  color: #bf2c2c;
}

.price-current {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
}

.promo-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #c33131;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.catalog-item-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-top: auto;
}

.catalog-category {
  color: var(--muted);
  font-size: 15px;
}

.catalog-cart-zone {
  display: flex;
  align-items: end;
  margin-top: 2px;
}

.catalog-cart-zone > * {
  width: 100%;
}

.catalog-item button,
.product-view-actions button,
.qty-inline button {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 22px;
  height: 42px;
  padding: 0 16px;
  font-size: 16px;
  cursor: pointer;
}

.qty-inline {
  display: inline-grid;
  grid-template-columns: 42px 72px 42px;
  gap: 8px;
  align-items: center;
}

.qty-inline button {
  border-radius: 12px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.qty-inline input {
  height: 42px;
  border: 1px solid #cfd8c8;
  border-radius: 12px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  padding: 0 8px;
  background: #fff;
}

.catalog-modal {
  width: min(1120px, 95vw);
  border: none;
  border-radius: 16px;
  padding: 0;
}

.catalog-modal::backdrop {
  background: rgba(14, 18, 14, 0.52);
}

.catalog-modal .modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid #e4e8e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.catalog-modal .modal-head h3 {
  margin: 0;
  font-size: 34px;
}

.modal-close-btn {
  height: 40px;
  border-radius: 12px;
  padding: 0 16px;
}

.catalog-modal .modal-body {
  padding: 20px;
}

.product-view-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}

.product-main-image {
  width: 100%;
  height: 480px;
  border-radius: 14px;
  background: #e8eee3 center / cover no-repeat;
}

.product-thumb-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.product-thumb {
  height: 76px;
  border-radius: 10px;
  border: 1px solid #cfd8c8;
  background: #ecf2e8 center / cover no-repeat;
  cursor: pointer;
}

.product-thumb.active {
  border-color: #2f6f3a;
  box-shadow: 0 0 0 2px rgba(47, 111, 58, 0.2);
}

.product-view-buy-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.product-view-purchase {
  display: grid;
  gap: 12px;
  align-content: start;
}

.product-view-variant-field {
  display: grid;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: #223522;
}

.product-view-variant-field select {
  width: 100%;
}

.product-view-actions {
  margin-top: 0;
}

.product-view-actions .qty-inline {
  display: inline-grid;
}

.product-view-actions > div {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.product-cart-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cart-go-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.cart-go-btn:hover {
  background: #f5f9f2;
}

.product-view-info {
  display: grid;
  gap: 12px;
  align-content: start;
}

.price-box {
  background: #f5f9f2;
  border: 1px solid #d7e6ce;
  border-radius: 14px;
  padding: 10px 12px;
}

.product-price {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
}

.product-price .price-current {
  font-size: 34px;
}

.product-price .price-old {
  font-size: 18px;
}

.product-price .price-new {
  font-size: 34px;
}

.stock-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
}

#productViewName {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

#productViewDescription {
  margin: 0;
  color: #334533;
  font-size: 17px;
  line-height: 1.5;
}

.attr-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #334533;
}


@media (max-width: 980px) {
  .catalog-controls {
    grid-template-columns: 1fr;
  }

  .product-view-layout {
    grid-template-columns: 1fr;
  }

  .product-main-image {
    height: 360px;
  }

  .catalog-modal .modal-head h3,
  #productViewName,
  .product-price,
  .catalog-item h3 {
    font-size: 26px;
  }
}

.catalog-item.is-sold-out {
  background: #f4f4f1;
  border-color: #d8ddd1;
  opacity: 1;
}

.catalog-item.is-sold-out .catalog-item-image {
  filter: grayscale(1);
}

.catalog-cart-box {
  display: grid;
  gap: 8px;
}

.catalog-cart-box .muted {
  min-height: 0;
  font-size: 14px;
}

.product-view-info select option:disabled {
  color: #7d8681;
}


.catalog-item.is-sold-out {
  position: relative;
  overflow: hidden;
}

.catalog-item.is-sold-out::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #e7e9e3;
  pointer-events: none;
  z-index: 1;
}

.catalog-item.is-sold-out > * {
  position: relative;
  z-index: 2;
}


.photo-lightbox-modal {
  width: min(1200px, 96vw);
  max-width: 1200px;
  height: min(92vh, 900px);
  border: none;
  border-radius: 18px;
  padding: 0;
  background: rgba(14, 18, 14, 0.96);
  color: #fff;
}

.photo-lightbox-modal::backdrop {
  background: rgba(10, 14, 10, 0.78);
}

.photo-lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  box-sizing: border-box;
}

.photo-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  background: transparent;
}

.photo-lightbox-close,
.photo-lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
}

.photo-lightbox-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 30px;
  line-height: 1;
}

.photo-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  border-radius: 16px;
  font-size: 42px;
  line-height: 1;
}

.photo-lightbox-nav.prev { left: 14px; }
.photo-lightbox-nav.next { right: 14px; }

.product-main-image {
  cursor: zoom-in;
}

@media (max-width: 980px) {
  .catalog-modal {
    width: min(100vw, 680px);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 18px 18px 0 0;
    margin: 0;
  }

  .catalog-modal .modal-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    padding: 12px 14px;
  }

  .catalog-modal .modal-body {
    padding: 12px 14px 18px;
  }

  .product-view-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-view-buy-column {
    gap: 10px;
  }

  .product-main-image {
    height: auto;
    min-height: 260px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }

  .product-thumb-list {
    grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
    gap: 6px;
  }

  .product-thumb {
    height: auto;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
  }

  .price-box {
    padding: 10px 12px;
  }

  .product-view-purchase,
  .product-view-info {
    gap: 10px;
  }

  .product-view-actions > div {
    width: 100%;
  }

  .product-cart-actions-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-view-actions .qty-inline {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .qty-inline input {
    width: 100%;
  }

  .cart-go-btn,
  .product-view-actions button[data-action="modal-add"] {
    width: 100%;
  }

  .catalog-modal .modal-head h3,
  #productViewName,
  .product-price,
  .catalog-item h3 {
    font-size: 26px;
  }

  .photo-lightbox-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }

  .photo-lightbox-stage {
    padding: 64px 16px 24px;
  }

  .photo-lightbox-nav {
    width: 42px;
    height: 56px;
    font-size: 34px;
  }

  .photo-lightbox-nav.prev { left: 8px; }
  .photo-lightbox-nav.next { right: 8px; }

  .photo-lightbox-close {
    top: 10px;
    right: 10px;
  }
}
