/* Django-specific additions on top of the ported reference stylesheet (site.css).
   Only covers elements that have no 1:1 counterpart in the reference SPA:
   sub-pages (catalog, category, product detail), unit toggle, availability variants. */

/* hidden attribute must always win (quick-view layer, menu icons) */
[hidden] {
  display: none !important;
}

/* Sub-pages start below the fixed header */
.page-section {
  padding-top: clamp(120px, 14vw, 168px);
}

/* Price-list header */
.price-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

/* Availability badge variants (Django availability levels) */
.badge.badge-out {
  color: #f3ded6;
  background: rgba(189, 87, 73, 0.88);
  border-color: rgba(255, 199, 183, 0.42);
}

.badge.badge-soon {
  color: #1a1007;
  background: rgba(178, 156, 131, 0.88);
  border-color: rgba(243, 230, 209, 0.42);
}

/* Links inside cards / price list keep the reference text colors */
.product-info h3 a,
.price-list-info h4 a {
  color: inherit;
  text-decoration: none;
}

.product-info h3 a:hover,
.price-list-info h4 a:hover {
  color: var(--color-amber);
}

.product-image-container > a {
  display: block;
  width: 100%;
  height: 100%;
}

.price-list-empty {
  padding: 18px 4px;
  color: var(--color-muted);
}

.catalog-products-heading {
  margin-top: clamp(28px, 5vw, 54px);
}

.catalog-product-grid {
  margin-top: 0;
}

.ornate-panel::before {
  inset: 5px;
  border-color: rgba(232, 178, 102, 0.2);
  border-radius: 7px;
  opacity: 0.76;
}

.ornate-panel:hover::before {
  border-color: rgba(232, 178, 102, 0.26);
  opacity: 0.84;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  cursor: pointer;
}

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

.product-card.ornate-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(232, 178, 102, 0.2);
  border-radius: 7px;
  opacity: 0.76;
}

.product-card-stretched-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card-stretched-link:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: -6px;
}

.product-card .product-image-container,
.product-card .product-info {
  position: relative;
  z-index: auto;
}

.product-card .product-image-container {
  margin: 0;
  border: 0;
  border-radius: 6px 6px 2px 2px;
}

.product-card .product-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding-inline: 14px;
  padding-bottom: 14px;
}

.product-category {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--color-amber);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.product-price span {
  display: inline;
  margin-top: 0;
  margin-left: 4px;
}

.product-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.product-card-actions .product-price {
  min-width: 0;
  margin: 0;
  line-height: 1.12;
}

.product-card-actions .add-to-cart-btn {
  position: relative;
  z-index: 2;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.68rem;
  line-height: 1;
  text-align: center;
}

.catalog-empty-card {
  min-height: 220px;
}

@media (max-width: 420px) {
  .product-card-actions {
    gap: 8px;
  }

  .product-card-actions .product-price {
    font-size: 1.18rem;
  }

  .product-card-actions .add-to-cart-btn {
    padding-inline: 8px;
  }
}

/* ---------- Product detail page ---------- */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.detail-back:hover {
  color: var(--color-amber);
}

.product-detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(22px, 3.4vw, 42px);
}

.product-detail-media {
  position: relative;
}

.product-detail-media .badge {
  top: 16px;
  right: 16px;
  z-index: 3;
}

.product-detail-slider {
  position: relative;
}

.product-detail-img {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--hairline-brass);
  filter: saturate(1.04) contrast(1.02);
}

.product-detail-img.active {
  display: block;
}

.product-detail-copy h1 {
  margin: 10px 0 14px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: 0.03em;
  color: var(--color-text);
}

.product-detail-copy .product-desc {
  max-width: 56ch;
}

.product-detail-price {
  margin-top: 18px;
  font-size: 1.5rem;
}

.product-detail-alt-price {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.product-detail-actions {
  margin-top: 24px;
}

@media (max-width: 860px) {
  .product-detail-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .price-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Availability note inside price-list rows (out of stock / coming soon) */
.price-list-availability {
  font-style: normal;
  color: var(--status-error);
  letter-spacing: 0.04em;
}
