/* ===== TÍTULO DE PÁGINA ===== */

.gallery-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  text-align: center;
  color: #222;
  margin: 60px 0 8px;
  letter-spacing: -.3px;
}

.gallery-desc {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  text-align: center;
  color: #666;
  margin: 0 auto 28px;
  max-width: 520px;
  line-height: 1.6;
}

/* ===== GALERÍA DE PRODUCTOS ===== */

.gallery-container {
  background-color: transparent;
  min-height: 100vh;
  border-radius: 20px;
  box-shadow: 0 8px 15px rgba(0,0,0,.06);
  margin-bottom: 10px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* --- Grid responsive --- */
.gallery-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 10px;
}

@media (min-width: 480px)  { .gallery-row { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 640px)  { .gallery-row { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .gallery-row { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .gallery-row { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1500px) { .gallery-row { grid-template-columns: repeat(6, 1fr); } }

/* --- Card individual --- */
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
  min-width: 0;
}

.product-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

/* --- Imagen --- */
.product-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
}

.product-img-wrap .lightbox {
  display: block;
  width: 100%;
  height: 100%;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.04);
}

/* --- Botón compartir (sobre la imagen, esquina superior derecha) --- */
.btn-share {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.88);
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  opacity: 0;
  transition: opacity .2s, background .2s;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.btn-share svg {
  width: 18px;
  height: 18px;
}

/* Siempre visible en mobile (sin hover) */
@media (hover: none) {
  .btn-share { opacity: 1; }
}

.product-card:hover .btn-share,
.product-card:focus-within .btn-share {
  opacity: 1;
}

.btn-share:hover {
  background: #fff;
  color: #222;
}

/* --- Footer de la card --- */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 8px;
  gap: 6px;
  background: #fff;
}

.product-code {
  font-family: Merriweather, serif;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Botón WhatsApp consulta */
.btn-consultar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  transition: background .2s;
  flex-shrink: 0;
}

.btn-consultar svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.btn-consultar:hover {
  background: #1eb656;
}

/* Botón Comprar (solo aparece si hay buyUrl) */
.btn-comprar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #222;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
  letter-spacing: .3px;
}

.btn-comprar svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
}

.btn-comprar:hover {
  background: #444;
  color: #fff;
}

/* ===== LIGHTBOX ===== */

#lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}

#lb-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lb-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 2;
}

.lb-close:hover { background: rgba(255,255,255,.25); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 2;
}

.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 56px 70px 16px;
}

#lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.lb-bar {
  width: 100%;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lb-info { flex: 1; min-width: 0; }

.lb-code {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  display: block;
}

.lb-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin: 4px 0 0;
  line-height: 1.45;
}

.lb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity .15s;
}

.lb-btn:hover { opacity: .82; }

.lb-btn-wp    { background: #25D366; color: #fff; }
.lb-btn-share { background: rgba(255,255,255,.15); color: #fff; }
.lb-btn-buy   { background: #fff; color: #222; }

@media (max-width: 600px) {
  .lb-desc { font-size: 15px; line-height: 1.5; }

  .lb-btn-text { display: none; }

  .lb-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }

  .lb-img-wrap { padding: 50px 14px 12px; }
  .lb-nav { width: 36px; height: 36px; font-size: 22px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-bar { padding: 12px 14px 16px; }
  .lb-btn { padding: 7px 12px; font-size: 12px; }
}

/* ===== POPUP DE COMPARTIR ===== */

#share-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}

#share-popup.visible {
  opacity: 1;
  pointer-events: all;
}

.share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.share-box {
  position: relative;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px 28px;
  width: 100%;
  max-width: 480px;
  transform: translateY(40px);
  transition: transform .25s;
  z-index: 1;
}

#share-popup.visible .share-box {
  transform: translateY(0);
}

.share-title {
  font-family: Raleway, sans-serif;
  font-size: 16px;
  color: #222;
  margin: 0 0 18px;
  text-align: center;
}

.share-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-width: 90px;
  transition: opacity .15s;
}

.share-btn:hover { opacity: .85; }

.share-wp   { background: #25D366; color: #fff; }
.share-ig   { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.share-copy { background: #f0f0f0; color: #333; }

.share-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 4px;
}

/* ===== FOOTER ===== */

footer1 {
  background: var(--footer-bg, #f3f0ec);
  border-top: 1px solid rgba(0,0,0,.07);
  padding: 50px 0 30px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  margin: auto;
  gap: 16px;
}

/* ===== RESPONSIVE AJUSTES ===== */

@media (max-width: 765px) {
  .gallery-container {
    border-radius: 0;
  }

  .product-code {
    font-size: 12px;
  }

  .btn-comprar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }

  .btn-comprar svg {
    width: 15px;
    height: 15px;
  }

  .btn-comprar-text {
    display: none;
  }
}

@media screen and (max-width: 1024px) {
  footer1 {
    justify-content: space-evenly;
  }

  .partFooter,
  .partFooter1,
  .partFooter2 {
    width: 20%;
    margin-bottom: 20px;
  }

  .social-media a {
    font-size: 20px;
    display: inline-block;
    color: #adb6c7;
    border: 1px solid #adb6c7;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    line-height: 36px;
    cursor: pointer;
    text-align: center;
    transition: all ease-in-out .3s;
    margin-right: 5px;
  }
}
