/* ============================================================
   LOFT LINE — Product Quick View Modal + Color Swatches
   Shared component for all pages
   ============================================================ */

/* ── CARD: isolate blend context ── */
.product-image-wrap,
.ll-prod-img-wrap {
  isolation: isolate;
}

/* ── CARD: Color Overlay (inside image wrap) ── */
.pqv-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.45s ease, background-color 0.45s ease;
  opacity: 0;
}

/* ── CARD: Swatch Row ── */
.pqv-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 4px;
}

/* Inside loft cards — sits between ll-prod-footer and ll-prod-actions */
.ll-product-card .pqv-swatches {
  padding: 8px 0 4px;
  margin-top: 2px;
}

/* Inside index.html cards — sits between product-footer and add-to-cart-btn */
.product-card .pqv-swatches {
  padding: 10px 0 6px;
  margin-top: 0;
}

/* Hide old material-dot system — replaced by pqv-swatches */
.product-materials {
  display: none;
}

.pqv-swatch {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  /* Inner gap between colour and the outer ring */
  border: 2px solid rgba(255, 255, 255, 0.2);
  /* Outer ring — visible on dark backgrounds */
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  outline: none;
  flex-shrink: 0;
}

/* Light-background cards (index.html — cream #f7f5f2) */
.product-card .pqv-swatch {
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18);
}

.pqv-swatch:hover {
  transform: scale(1.25);
}

.pqv-swatch.is-active {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2.5px #c9a96e;
  transform: scale(1.15);
}

.product-card .pqv-swatch.is-active {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2.5px #c9a96e;
}

/* ── MODAL: Overlay ── */
.pqv-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pqv-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── MODAL: Dialog ── */
.pqv-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1201;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

.pqv-dialog.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

/* ── MODAL: Close Button ── */
.pqv-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #f0ede8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.pqv-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

/* ── MODAL: Left — Image Panel ── */
.pqv-image-panel {
  position: relative;
  background: #111;
  display: flex;
  flex-direction: column;
}

.pqv-main-img-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: zoom-in;
  isolation: isolate;
  min-height: 300px;
}

.pqv-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.45s ease;
}

.pqv-main-img-wrap:hover .pqv-main-img {
  transform: scale(1.07);
}

.pqv-img-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.45s ease, background-color 0.45s ease;
  opacity: 0;
}

/* ── MODAL: Thumbnails ── */
.pqv-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: #141414;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.pqv-thumbs::-webkit-scrollbar { display: none; }

.pqv-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: opacity 0.25s, border-color 0.25s, filter 0.35s;
}

.pqv-thumb.is-active,
.pqv-thumb:hover {
  opacity: 1;
  border-color: #c9a96e;
}

/* ── MODAL: Right — Info Panel ── */
.pqv-info-panel {
  position: relative;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  max-height: calc(100dvh - 40px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  color: #f0ede8;
}

.pqv-cat {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #c9a96e;
  margin-bottom: 10px;
}

.pqv-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  color: #f0ede8;
  line-height: 1.25;
  margin-bottom: 10px;
}

.pqv-desc {
  font-size: 13px;
  color: rgba(240, 237, 232, 0.55);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Price ── */
.pqv-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.pqv-price {
  font-size: 30px;
  font-weight: 700;
  color: #f0ede8;
  letter-spacing: -0.5px;
}

.pqv-old-price {
  font-size: 16px;
  color: rgba(240, 237, 232, 0.35);
  text-decoration: line-through;
}

/* Divider */
.pqv-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

/* ── Color Selector ── */
.pqv-color-wrap {
  margin-bottom: 22px;
}

.pqv-color-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.55);
  margin-bottom: 12px;
}

.pqv-color-label span {
  color: #c9a96e;
  font-weight: 600;
}

.pqv-modal-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pqv-mswatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease;
  outline: none;
}

.pqv-mswatch::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.22s ease;
}

.pqv-mswatch.is-active::after {
  border-color: #c9a96e;
}

.pqv-mswatch:hover {
  transform: scale(1.15);
}

/* ── Quantity Selector ── */
.pqv-qty-wrap {
  margin-bottom: 22px;
}

.pqv-qty-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.55);
  margin-bottom: 12px;
}

.pqv-qty-row {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.pqv-qty-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  color: #f0ede8;
  border: none;
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.pqv-qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pqv-qty-num {
  min-width: 48px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #f0ede8;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 6px;
  line-height: 40px;
  user-select: none;
}

/* ── Add to Cart Button ── */
.pqv-add-btn {
  width: 100%;
  padding: 15px 20px;
  background: #c9a96e;
  color: #111;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background 0.3s, transform 0.2s;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.pqv-add-btn:hover {
  background: #d9bb80;
  transform: translateY(-1px);
}

.pqv-add-btn.pqv-added {
  background: #2d8a56;
  color: #fff;
}

/* ── Payment Icons ── */
.pqv-payments {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pqv-pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(240, 237, 232, 0.7);
  gap: 5px;
}

/* ── Delivery Info ── */
.pqv-delivery {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 4px;
  font-size: 12px;
  color: rgba(240, 237, 232, 0.65);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.pqv-delivery svg {
  flex-shrink: 0;
  color: #c9a96e;
  margin-top: 1px;
}

/* ── Feature Icons Grid ── */
.pqv-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.pqv-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  text-align: center;
}

.pqv-feature svg {
  color: #c9a96e;
  flex-shrink: 0;
}

.pqv-feature span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.5);
  line-height: 1.4;
}

/* ── Prevent body scroll when modal open ── */
body.pqv-open {
  overflow: hidden;
}

/* ============================================================
   RESPONSIVE — Mobile Full Screen Slide-Up
   ============================================================ */

@media (max-width: 680px) {
  .pqv-dialog {
    grid-template-columns: 1fr;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 94dvh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%) !important;
    overflow-y: auto;
    /* Remove center-transform so slide-up works */
    margin: 0;
  }

  .pqv-dialog.is-open {
    transform: translateY(0) !important;
  }

  .pqv-main-img-wrap {
    min-height: 260px;
    max-height: 340px;
  }

  .pqv-main-img-wrap {
    aspect-ratio: 4/3;
    height: auto;
    min-height: unset;
  }

  .pqv-info-panel {
    padding: 22px 20px 40px;
    max-height: none;
    overflow-y: visible;
  }

  .pqv-name {
    font-size: 20px;
  }

  .pqv-price {
    font-size: 24px;
  }

  .pqv-features {
    grid-template-columns: repeat(3, 1fr);
  }

  .pqv-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
  }

  /* Drag handle indicator */
  .pqv-image-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .pqv-features {
    grid-template-columns: repeat(3, 1fr);
  }
  .pqv-feature span {
    font-size: 8px;
  }
}

/* ── Loft card: tighten action row gap when swatches are present ── */
.ll-product-card .pqv-swatches + .ll-prod-actions {
  margin-top: 6px;
}

/* ── Animation for product cards filter-hidden state ── */
.product-card.filter-hidden,
.ll-product-card.filter-hidden {
  opacity: 0;
  pointer-events: none;
}
