/*
  page-fix.css
  Overrides the SPA display:none rule from style.css + small fixes
  shared by every page. Include this AFTER style.css.
*/

/* The original style.css hides all .page elements (SPA mode). */
.page { display: block !important; }
body { padding-top: 0; }

/* ── Products grid: 3 columns on desktop, responsive below ── */
.products-main { overflow: hidden; min-width: 0; }
.products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.products-grid.list-view { grid-template-columns: 1fr; }
@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .products-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px)  { .gallery-masonry { columns: 1; } }

/* ── Lazy background images: soft placeholder until loaded ── */
[data-bg] { background-color: #e9e2d6; }

/* ── Map embed on contact page ── */
.map-embed {
  display: block; width: 100%; height: 420px; border: 0;
  border-top: 1px solid rgba(139,115,85,0.12);
}
@media (max-width: 768px) { .map-embed { height: 300px; } }

/* ── Gallery lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(20,16,10,0.92);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 88vh; object-fit: contain;
  border-radius: 2px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-btn {
  position: absolute; background: rgba(255,255,255,0.12); color: #fff;
  border: 0; width: 48px; height: 48px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.25); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-caption {
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.85); font-size: 0.85rem; letter-spacing: 0.05em;
}

/* ── Product photo count + modal thumbnails ── */
.product-img-wrap { position: relative; }
.photo-count {
  position: absolute; bottom: 12px; left: 12px; z-index: 2;
  background: rgba(20,16,10,0.72); color: #fff; font-size: 0.7rem;
  letter-spacing: 0.06em; padding: 4px 10px; border-radius: 20px;
}
.modal-img { background-color: #e9e2d6; transition: background-image 0.2s; }
.modal-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.modal-thumbs:empty { display: none; }
.modal-thumb {
  width: 58px; height: 58px; border-radius: 3px; border: 2px solid transparent;
  background-size: cover; background-position: center; background-color: #e9e2d6;
  cursor: pointer; padding: 0; opacity: 0.75; transition: all 0.2s;
}
.modal-thumb:hover { opacity: 1; }
.modal-thumb.active { border-color: var(--gold, #b8924a); opacity: 1; }
@media (max-width: 768px) { .modal-img { height: 280px; min-height: 0; } }

/* ── Gallery: load more ── */
.gallery-more { text-align: center; padding: 0 8% 80px; }
.gallery-more button {
  background: transparent; border: 1px solid var(--stone-dark, #5c4a2a); color: var(--stone-dark, #5c4a2a);
  padding: 14px 36px; font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer;
  border-radius: 2px; transition: all 0.25s;
}
.gallery-more button:hover { background: var(--stone-dark, #5c4a2a); color: #fff; }
.gallery-count { text-align: center; color: var(--mid, #777); font-size: 0.8rem; margin: -8px 0 16px; }
.gallery-filters { flex-wrap: wrap; }

/* ── Full product page (product.html) ── */
.pd-page { padding: 104px 6% 40px; max-width: 1320px; margin: 0 auto; }
.pd-crumbs { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); margin-bottom: 28px; }
.pd-crumbs a { color: var(--stone); text-decoration: none; }
.pd-crumbs a:hover { color: var(--gold); }
.pd-crumbs span { color: var(--stone-dark); font-weight: 500; }
.pd-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.pd-main[hidden], .pd-missing[hidden], .pd-related[hidden] { display: none; }
.pd-gallery { position: sticky; top: 96px; min-width: 0; }
.pd-stage {
  position: relative; background: #efe9df; border-radius: 4px; overflow: hidden;
  height: min(72vh, 640px); display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.pd-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pd-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(253,250,244,0.9); color: var(--stone-dark); font-size: 1.6rem; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center;
}
.pd-nav[hidden] { display: none; }
.pd-nav:hover { background: #fff; }
.pd-prev { left: 14px; } .pd-next { right: 14px; }
.pd-counter, .pd-zoom {
  position: absolute; bottom: 12px; background: rgba(20,16,10,0.65); color: #fff;
  font-size: 0.72rem; letter-spacing: 0.06em; padding: 5px 10px; border-radius: 20px;
}
.pd-counter { left: 12px; } .pd-counter:empty { display: none; }
.pd-zoom { right: 12px; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; padding-bottom: 6px; }
.pd-thumb {
  flex: 0 0 84px; height: 84px; border-radius: 3px; border: 2px solid transparent; cursor: pointer;
  background: #e9e2d6 center/cover no-repeat; opacity: 0.7; transition: opacity .2s, border-color .2s;
}
.pd-thumb:hover { opacity: 1; }
.pd-thumb.active { border-color: var(--gold); opacity: 1; }
.pd-info { min-width: 0; }
.pd-cat { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.pd-name { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.1; color: var(--stone-dark); margin-bottom: 14px; }
.pd-badge { position: static; display: inline-block; margin-bottom: 14px; }
.pd-badge[hidden] { display: none; }
.pd-price { font-size: 0.9rem; color: var(--mid); margin-bottom: 18px; }
.pd-price span { color: var(--stone-dark); font-weight: 600; font-size: 1.1rem; }
.pd-desc { font-size: 1rem; line-height: 1.85; color: var(--mid); font-weight: 300; margin-bottom: 26px; }
.pd-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--stone-dark); margin: 6px 0 12px; }
.pd-finishes { margin-bottom: 22px; } .pd-finishes[hidden] { display: none; }
.pd-dots { display: flex; gap: 10px; }
.pd-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(139,115,85,0.3); }
.pd-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 30px 0 18px; }
.pd-btn {
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  padding: 16px 18px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 2px; transition: all .2s;
}
.pd-btn-wa { background: #25D366; color: #fff; }
.pd-btn-wa:hover { background: #1ebe5a; }
.pd-btn-quote { background: var(--stone-dark); color: var(--cream); }
.pd-btn-quote:hover { background: var(--gold); color: var(--charcoal); }
.pd-back { font-size: 0.85rem; color: var(--stone); text-decoration: none; }
.pd-back:hover { color: var(--gold); }
.pd-related { margin-top: 80px; }
.pd-related-title { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 2rem; color: var(--stone-dark); margin-bottom: 24px; }
.pd-related .product-card { text-decoration: none; color: inherit; display: block; }
.pd-missing { text-align: center; padding: 80px 0; }
.pd-missing h1 { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 2.4rem; color: var(--stone-dark); }
.pd-missing p { color: var(--mid); margin: 10px 0 0; }
@media (max-width: 900px) {
  .pd-page { padding: 88px 16px 32px; }
  .pd-main { grid-template-columns: 1fr; gap: 28px; }
  .pd-gallery { position: static; }
  .pd-stage { height: 62vh; max-height: 520px; }
  .pd-thumb { flex-basis: 64px; height: 64px; }
  .pd-zoom { display: none; }
}
@media (max-width: 420px) { .pd-cta { grid-template-columns: 1fr; } }
