.products-page {
  min-height: 100vh;
}

.products-page [hidden] {
  display: none;
}

.products-page .products-skip {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 16px;
  padding: 9px 14px;
  transform: translateY(-150%);
  color: #07111f;
  background: #f5f8fb;
  border-radius: 8px;
}

.products-page .products-skip:focus {
  transform: translateY(0);
}

.products-page .navlinks [aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: .25em;
}

.products-shell {
  padding-top: clamp(35px, 7vw, 88px);
  scroll-margin-top: 118px;
}

.products-intro {
  padding: 0 0 clamp(26px, 5vw, 56px);
  margin-bottom: clamp(24px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
}

.products-intro h1 {
  margin: 0;
  font-size: clamp(2.85rem, 8vw, 6.25rem);
  letter-spacing: -.07em;
}

.products-intro p {
  max-width: 46ch;
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.3vw, 1.18rem);
}

.shop-mode {
  padding: 11px 15px;
  margin: 0 0 19px;
  border: 1px solid #396480;
  border-radius: 9px;
  color: #d9f1fc;
  background: #112d44;
  font-size: .92rem;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 322px);
  align-items: start;
  gap: clamp(22px, 4vw, 36px);
}

.shop-section-heading h2,
.cart-heading h2 {
  margin: 0;
  font-size: 1.27rem;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.cart-heading h2:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 16px;
}

.product-card,
.shop-cart {
  min-width: 0;
  border: 1px solid #25405c;
  border-radius: 17px;
  background: #0a192a;
  overflow-wrap: anywhere;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 246px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(155deg, #122b45 0, #0a192a 65%);
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 44px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}

.product-picture {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin: 0 0 17px;
  overflow: hidden;
  border-radius: 10px;
  background: #f2f5f9;
}

.product-picture img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.product-card h3 {
  font-size: clamp(1.3rem, 2.8vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -.035em;
  margin: 4px 0 8px;
}

.product-category,
.product-description,
.shop-message {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.product-category {
  min-height: 1.4em;
  color: #80d9f3;
}

.product-description {
  margin: 0 0 15px;
}

.product-availability {
  margin: auto 0 0;
  font-size: .9rem;
}

.product-availability strong {
  font-size: 1.1rem;
}

.product-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.shop-cart {
  position: sticky;
  top: 94px;
  padding: 21px;
}

.cart-heading,
.cart-total,
.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-count {
  min-width: 32px;
  padding: 2px 9px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #d3e8fa;
}

.shop-message {
  margin-top: 10px;
}

.shop-error {
  color: #ffaeaa;
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.cart-row {
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}

.cart-row p {
  margin: 0;
}

.cart-row p + p {
  color: var(--muted);
}

.cart-total {
  padding: 16px 0 12px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.cart-total output {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shop-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #3e5c77;
  border-radius: 9px;
  font: inherit;
  font-size: .88rem;
  font-weight: 680;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
  background: #132b43;
  cursor: pointer;
}

.shop-button:hover:not(:disabled) {
  background: #1d3a54;
  text-decoration: none;
}

.shop-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.shop-button:disabled {
  color: #b3c5d8;
  background: #203447;
  border-color: #203447;
  cursor: default;
}

.shop-primary {
  border-color: #6bd7fa;
  color: #062033;
  background: #6bd7fa;
}

.shop-primary:hover:not(:disabled) {
  background: #9ae8ff;
}

.shop-cart > .shop-button {
  width: 100%;
}

.cart-remove {
  min-height: 36px;
  flex-shrink: 0;
  padding: 5px 8px;
  font-size: .8rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 920px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-cart {
    position: static;
  }
}

@media (max-width: 580px) {
  .products-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .products-page nav {
    gap: 12px;
  }

  .product-card {
    min-height: 184px;
  }
}
