.products-main {
  gap: 1.6rem;
}

[hidden] {
  display: none !important;
}

.products-hero {
  padding: 0.9rem 1.2rem 0.3rem;
  text-align: center;
}

.products-hero h1 {
  margin: 0 auto 0.85rem;
  max-width: 24ch;
  font-family: "Antonio", sans-serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1;
}

.products-hero p {
  margin: 0 auto;
  max-width: 68ch;
}

.products-controls {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(7px);
  box-shadow: var(--shadow);
}

.control {
  display: grid;
  gap: 0.42rem;
}

.control label,
.control-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
}

#searchInput,
#sortSelect,
#categorySelect,
#perPageSelect {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.74rem 0.84rem;
  font: inherit;
  color: var(--text);
}

#searchInput:focus,
#sortSelect:focus,
#categorySelect:focus,
#perPageSelect:focus {
  outline: 2px solid rgba(230, 67, 31, 0.3);
  outline-offset: 1px;
}

.products-list-section {
  padding: 0.2rem 1.2rem 0.8rem;
}

.products-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.pagination {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn,
.page-number {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.48rem 0.7rem;
  cursor: pointer;
}

.page-btn:disabled,
.page-number:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-number.active {
  background: linear-gradient(135deg, var(--brand) 0%, #ff7647 100%);
  border-color: transparent;
  color: #fff;
}

.product-card {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  padding: 0.82rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.18);
}

.product-card.is-featured {
  border-color: rgba(230, 67, 31, 0.5);
  animation: featuredPulse 2.4s ease-in-out infinite;
}

@keyframes featuredPulse {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: 0 18px 45px rgba(230, 67, 31, 0.28);
  }
}

.product-media {
  position: relative;
  margin: 0;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  aspect-ratio: 4 / 3;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: zoom-in;
  background: #f7f7f0;
}

.badges {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.24rem 0.5rem;
}

.badge-chip.promo {
  background: #bc2d0f;
  color: #fff;
}

.badge-chip.featured {
  background: #b8d447;
  color: #12140f;
}

.product-content {
  display: grid;
  gap: 0.42rem;
}

.product-content h3 {
  margin: 0;
  font-family: "Antonio", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  text-wrap: pretty;
}

.product-description {
  margin: 0;
  color: var(--muted);
}

.product-category {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-dark);
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 0.46rem;
  flex-wrap: wrap;
}

.price-original {
  color: #777;
  text-decoration: line-through;
  font-weight: 700;
}

.price-current {
  font-family: "Antonio", sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--brand-dark);
}

.price-economy {
  font-size: 0.8rem;
  font-weight: 800;
  color: #bc2d0f;
}

.buy-btn {
  justify-self: center;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
}

.status-card p {
  margin: 0;
  color: var(--muted);
}

.status-error {
  border-color: rgba(188, 45, 15, 0.35);
  background: rgba(255, 241, 238, 0.96);
}

.spinner {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 3px solid rgba(18, 20, 15, 0.16);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(6, 7, 5, 0.85);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.product-modal[hidden] {
  display: none;
}

.product-modal-image {
  width: min(100%, 980px);
  max-height: 88vh;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: contain;
  background: #0d0f0a;
}

.product-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.product-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.product-modal-nav.prev {
  left: 0.9rem;
}

.product-modal-nav.next {
  right: 0.9rem;
}

.product-modal-nav[hidden] {
  display: none;
}

.product-modal-counter {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (min-width: 700px) {
  .products-controls {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(210px, 0.8fr) minmax(190px, 0.7fr);
    align-items: end;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .products-main {
    gap: 1.2rem;
  }

  .products-hero h1 {
    max-width: 100%;
  }

  .buy-btn {
    justify-self: center;
  }

  .product-modal-nav.prev {
    left: 0.45rem;
  }

  .product-modal-nav.next {
    right: 0.45rem;
  }
}
