/* =====================================
   PRODUCT PAGE
===================================== */

/* This page inherits the homepage colour system from style.css. */
:root {
  --collection-background: var(--bg);
  --collection-card: var(--panel);
  --collection-text: var(--text);
  --collection-muted: var(--muted);
  --collection-border: var(--border);
  --collection-accent: var(--accent);
  --collection-accent-dark: var(--accent-2);
  --collection-sold: #8b2727;
}


/* =====================================
   GENERAL HELPERS
===================================== */

.hidden {
  display: none !important;
}

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


/* =====================================
   COLLECTION HEADING
===================================== */

.collection-hero {
  padding: 140px 0 58px;
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      var(--collection-background) 100%
    );
  text-align: left;
}

.collection-hero .eyebrow {
  margin: 0 0 12px;
  color: var(--collection-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.collection-hero h1 {
  max-width: 850px;
  margin: 0;
  color: var(--collection-text);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.05;
}

.collection-introduction {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--collection-muted);
  font-size: 1rem;
  line-height: 1.75;
}


/* =====================================
   CATALOGUE SECTION
===================================== */

.product-catalogue {
  min-height: 650px;
  padding: 55px 0 100px;
  background: var(--collection-background);
}


/* =====================================
   TOOLBAR
===================================== */

.catalogue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 30px;
}

.catalogue-result-count {
  margin: 0;
  color: var(--collection-muted);
  font-size: 0.9rem;
}

.catalogue-search-wrapper {
  width: min(100%, 340px);
}

.catalogue-search {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--collection-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--collection-text);
  font: inherit;
  outline: none;
}

.catalogue-search::placeholder {
  color: #96928e;
}

.catalogue-search:focus {
  border-color: var(--collection-accent);
  box-shadow:
    0 0 0 3px rgba(232, 111, 37, 0.13);
}


/* =====================================
   FOUR REELS IN EACH ROW
===================================== */

.products-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 25px;
  align-items: stretch;
}


/* =====================================
   PRODUCT CARD
===================================== */

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--collection-border);
  border-radius: 0;
  background: var(--collection-card);
  box-shadow:
    0 7px 22px rgba(0, 0, 0, 0.045);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.1);
}


/* =====================================
   PRODUCT IMAGE
===================================== */

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ece9e5;
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.product-card:hover .product-image {
  transform: scale(1.035);
}


/* =====================================
   IMAGE COUNTER
===================================== */

.product-image-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.78);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(5px);
}


/* =====================================
   SOLD LABEL
===================================== */

.product-status-label {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--collection-text);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.product-status-label.sold {
  background: rgba(30, 30, 30, 0.9);
  color: #ffffff;
}


/* =====================================
   PRODUCT INFORMATION
===================================== */

.product-information {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.product-id {
  margin: 0 0 7px;
  color: var(--collection-accent);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.product-name {
  margin: 0;
  color: var(--collection-text);
  font-size: 1.05rem;
  line-height: 1.4;
}

.product-description {
  display: -webkit-box;
  margin: 12px 0 20px;
  overflow: hidden;
  color: var(--collection-muted);
  font-size: 0.87rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}


/* =====================================
   PRICE
===================================== */

.product-price-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--collection-border);
}

.product-price {
  color: var(--collection-text);
  font-size: 1.08rem;
  font-weight: 800;
}

.product-price.sold-price {
  color: #9a9692;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: line-through;
}

.product-out-of-stock {
  color: var(--collection-sold);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}


/* =====================================
   LOADING AND ERROR
===================================== */

.catalogue-message {
  padding: 90px 20px;
  color: var(--collection-muted);
  text-align: center;
}

.catalogue-message h2 {
  margin: 0 0 10px;
  color: var(--collection-text);
}

.catalogue-message p {
  margin: 0;
}

.catalogue-error {
  color: #8b2727;
}

.catalogue-retry-button {
  min-height: 42px;
  margin-top: 20px;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: var(--collection-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.catalogue-retry-button:hover {
  background: var(--collection-accent-dark);
}

.loading-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--collection-accent);
  border-radius: 50%;
  animation: catalogue-spin 700ms linear infinite;
}

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


/* =====================================
   TABLET: TWO REELS PER ROW
===================================== */

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


/* =====================================
   MOBILE: ONE REEL PER ROW
===================================== */

@media (max-width: 560px) {
  .collection-hero {
    padding: 75px 0 45px;
  }

  .product-catalogue {
    padding: 38px 0 70px;
  }

  .catalogue-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalogue-search-wrapper {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
