/* ============================================================
   QDP Brand & Collection Page Templates
   ============================================================ */

/* ---- Shared page wrapper ---- */
.qdp-page {
  --qdp-accent:    #c8a96e;
  --qdp-dark:      #1a1a1a;
  --qdp-mid:       #555;
  --qdp-light:     #f7f7f7;
  --qdp-border:    #e2e2e2;
  --qdp-radius:    4px;
  --qdp-max-width: 1160px;
  color: var(--qdp-dark);
}

.qdp-page-container {
  max-width: var(--qdp-max-width);
  margin-left:  auto;
  margin-right: auto;
  padding-left:  24px;
  padding-right: 24px;
}

.qdp-page-section {
  padding: 60px 0;
}

.qdp-page-section + .qdp-page-section {
  padding-top: 0;
}

.qdp-page-content {
  max-width: 780px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--qdp-mid);
}

.qdp-section-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--qdp-dark);
  margin: 0 0 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--qdp-accent);
  display: inline-block;
}

.qdp-page-empty {
  color: var(--qdp-mid);
  font-style: italic;
}

/* ---- Breadcrumb ---- */
.qdp-breadcrumb {
  background: var(--qdp-light);
  border-bottom: 1px solid var(--qdp-border);
  padding: 10px 0;
  font-size: 13px;
}

.qdp-breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.qdp-breadcrumb__list li + li::before {
  content: '/';
  margin-right: 6px;
  color: #bbb;
}

.qdp-breadcrumb__list a {
  color: var(--qdp-accent);
  text-decoration: none;
}

.qdp-breadcrumb__list a:hover {
  text-decoration: underline;
}

/* ============================================================
   Brand Hero
   ============================================================ */

.qdp-brand-hero {
  background: var(--qdp-light);
  border-bottom: 1px solid var(--qdp-border);
  padding: 52px 0;
}

.qdp-brand-hero .qdp-page-container {
  display: flex;
  align-items: center;
  gap: 40px;
}

.qdp-brand-hero__logo {
  flex: 0 0 auto;
  width: 180px;
  max-width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qdp-brand-hero__logo img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.qdp-brand-hero__text {
  flex: 1;
}

.qdp-brand-hero__title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--qdp-dark);
  line-height: 1.2;
}

.qdp-brand-hero__excerpt {
  font-size: 17px;
  color: var(--qdp-mid);
  margin: 0;
  max-width: 640px;
  line-height: 1.6;
}

/* ============================================================
   Collection Grid (on Brand page)
   ============================================================ */

.qdp-brand-collections-section {
  background: #fff;
}

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

.qdp-collection-card {
  border: 1px solid var(--qdp-border);
  border-radius: var(--qdp-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.15s;
}

.qdp-collection-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.qdp-collection-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.qdp-collection-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--qdp-light);
}

.qdp-collection-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.qdp-collection-card:hover .qdp-collection-card__image {
  transform: scale(1.06);
}

.qdp-collection-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ebebeb 0%, #d8d8d8 100%);
}

/* ---- Collection card flip effect ----
   Requires: .qdp-collection-card--flip on the <article>
   and --qdp-collection-hover-bg CSS var set inline with the hover image URL.
   The featured image (front face) fades out on hover to reveal the hover image. */

.qdp-collection-card--flip .qdp-collection-card__image-wrap {
  position: relative;
}

/* Hover image — hidden background that reveals on hover */
.qdp-collection-card__flip-inner {
  position: absolute;
  inset: 0;
  background-image: var(--qdp-collection-hover-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Front face — sits above the hover image and fades out on hover */
.qdp-collection-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.45s ease;
}

.qdp-collection-card__face--front {
  opacity: 1;
}

.qdp-collection-card__face--front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qdp-collection-card--flip:hover .qdp-collection-card__face--front,
.qdp-collection-card--flip:focus-within .qdp-collection-card__face--front {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .qdp-collection-card__face {
    transition: opacity 0.15s ease;
  }
}

.qdp-collection-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--qdp-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}

.qdp-collection-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 18px;
}

.qdp-collection-card__cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qdp-accent);
  background: rgba(200, 169, 110, 0.1);
  border: 1px solid rgba(200, 169, 110, 0.3);
  border-radius: 2px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

.qdp-collection-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--qdp-dark);
  line-height: 1.3;
}

.qdp-collection-card__excerpt {
  font-size: 13px;
  color: var(--qdp-mid);
  line-height: 1.55;
  margin: 0 0 14px;
  flex: 1;
}

.qdp-collection-card__cta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--qdp-accent);
  text-transform: uppercase;
}

/* ============================================================
   Collection Hero
   ============================================================ */

.qdp-collection-hero {
  position: relative;
  background: var(--qdp-dark);
  padding: 72px 0;
  overflow: hidden;
}

.qdp-collection-hero.has-image {
  min-height: 340px;
  display: flex;
  align-items: center;
}

.qdp-collection-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.45;
}

.qdp-collection-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
}

.qdp-collection-hero__content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.qdp-collection-hero__title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.15;
  max-width: 720px;
}

.qdp-collection-hero__excerpt {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.82);
  max-width: 620px;
  margin: 0 0 28px;
  line-height: 1.6;
}

/* ---- CTA button ---- */
.qdp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--qdp-radius);
  padding: 13px 28px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.qdp-btn--primary {
  background: var(--qdp-accent);
  color: #fff;
}

.qdp-btn--primary:hover,
.qdp-btn--primary:focus {
  background: #b5903a;
  box-shadow: 0 4px 14px rgba(200, 169, 110, 0.45);
  outline: none;
}

/* ============================================================
   Product Grid (on Collection page)
   ============================================================ */

.qdp-collection-products-section {
  background: var(--qdp-light);
}

.qdp-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.qdp-product-card {
  border: 1px solid var(--qdp-border);
  border-radius: var(--qdp-radius);
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.qdp-product-card:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.qdp-product-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.qdp-product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--qdp-light);
}

.qdp-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.qdp-product-card:hover .qdp-product-card__image {
  transform: scale(1.04);
}

.qdp-product-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ebebeb 0%, #d8d8d8 100%);
}

/* ---- Product card flip effect ----
   Mirrors the collection card flip. Requires .qdp-product-card--flip on the
   <article> and --qdp-product-hover-bg set inline with the hover image URL. */
.qdp-product-card__flip-inner {
  position: absolute;
  inset: 0;
  background-image: var(--qdp-product-hover-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.qdp-product-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.45s ease;
}

.qdp-product-card__face--front {
  opacity: 1;
}

.qdp-product-card__face--front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qdp-product-card--flip:hover .qdp-product-card__face--front,
.qdp-product-card--flip:focus-within .qdp-product-card__face--front {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .qdp-product-card__face {
    transition: opacity 0.15s ease;
  }
}

.qdp-product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
}

.qdp-product-card__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--qdp-dark);
  line-height: 1.3;
}

.qdp-product-card__excerpt {
  font-size: 12px;
  color: var(--qdp-mid);
  line-height: 1.5;
  margin: 0 0 10px;
  flex: 1;
}

.qdp-product-card__cta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--qdp-accent);
  text-transform: uppercase;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .qdp-brand-hero .qdp-page-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .qdp-brand-hero__logo {
    width: 140px;
  }

  .qdp-page-section {
    padding: 40px 0;
  }

  .qdp-collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }

  .qdp-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .qdp-collection-hero {
    padding: 48px 0;
  }
}

@media (max-width: 480px) {
  .qdp-collection-grid,
  .qdp-product-grid {
    grid-template-columns: 1fr 1fr;
  }
}
