/* ════════════════════════════════════════════════════════
   JEV Diamantes y Joyas — UX/UI Improvements
   Shared across all pages
   ════════════════════════════════════════════════════════ */

/* ─── Focus visible (accesibilidad teclado) ─────────────── */
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

/* ─── Skip to content link ──────────────────────────────── */
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  background: #111;
  color: #fff;
  padding: 10px 22px;
  z-index: 9999;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
  border: none;
}
.skip-link:focus { top: 16px; }

/* ─── Body scroll lock cuando menú móvil está abierto ───── */
body.nav-open { overflow: hidden !important; }

/* ─── Backdrop overlay para menú móvil ─────────────────── */
#nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;           /* Nunca bloquear taps cuando está oculto */
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}
#nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ─── Burger — 3 líneas clásicas, touch target 44px ────── */
@media (max-width: 768px) {
  .burger {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 10px !important;
  }
  .burger span {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    background: #111 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
  }
}

/* ─── Menú móvil — normalización de estilos entre páginas ── */
@media (max-width: 768px) {
  /* Container padding consistente con el home (28px en lugar de 32px desktop) */
  .container { padding: 0 28px !important; }

  /* z-index: encima del overlay (999) y del header (1000) */
  .nav-links.open {
    z-index: 1001 !important;
    align-items: stretch !important;
    gap: 0 !important;
  }
  /* Normalizar items del menú abierto en todas las páginas */
  .nav-links.open > li {
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .nav-links.open > li > a {
    padding: 17px 0 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    display: block !important;
    width: 100% !important;
    color: #333 !important;
  }
  .nav-links.open > li > a:hover,
  .nav-links.open > li > a.active { color: #111 !important; }
}

/* ─── Indicador de página activa en desktop ─────────────── */
@media (min-width: 769px) {
  .nav-links a.active {
    color: #111 !important;
    position: relative;
  }
  .nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: #111;
  }
}

/* ─── Back-to-top button ────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 104px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 996;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s, border-color 0.2s, transform 0.2s;
  color: #666;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.09);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  background: #111;
  border-color: #111;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
#back-to-top:active {
  transform: translateY(0);
}

/* ─── WhatsApp float — label contextual ─────────────────── */
.wa-float {
  display: flex !important;
  align-items: center !important;
  flex-direction: row-reverse;
  gap: 10px;
}
.wa-float-label {
  background: #fff;
  color: #111;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 14px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  border-left: 2.5px solid #25D366;
}
.wa-float:hover .wa-float-label,
.wa-float:focus-within .wa-float-label {
  opacity: 1;
  transform: translateX(0);
}

/* ─── Social buttons — touch target 44px ────────────────── */
.soc-btn {
  width: 44px !important;
  height: 44px !important;
}

/* ─── Pantallas muy pequeñas (<360px) ──────────────────── */
@media (max-width: 360px) {
  .product-grid { grid-template-columns: 1fr !important; }
  .container { padding: 0 14px !important; }
  .hero-title, h1 { font-size: 1.9rem !important; }
}

/* ─── Mobile landscape: hero no demasiado alto ──────────── */
@media (max-height: 500px) and (max-width: 900px) {
  #hero,
  section.hero {
    min-height: 100svh !important;
    padding-top: 90px !important;
    padding-bottom: 40px !important;
  }
  .hero-inner { padding-top: 20px !important; padding-bottom: 20px !important; }
}

/* ─── Touch feedback para móvil ─────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .product-card:active .product-img-fill {
    transform: scale(0.97) !important;
  }
  .btn:active,
  .product-action:active,
  .nav-cta a:active {
    opacity: 0.75 !important;
    transform: scale(0.98) !important;
  }
}

/* ─── Imágenes — fondo mientras carga ───────────────────── */
img:not([src^="data:"]) {
  background-color: #f2f2f2;
}

/* ─── Espaciado de secciones en móvil ───────────────────── */
@media (max-width: 768px) {
  #anillos { padding: 70px 0 55px !important; }
  #otras-joyas { padding: 65px 0 !important; }
  #cita { padding: 70px 0 !important; }
  #nosotros { padding: 60px 0 !important; }
  .section-head { margin-bottom: 44px !important; }
  .steps-row { margin: 44px 0 !important; }
  .products-section { padding: 70px 0 55px !important; }
}

/* ─── Trust bar en pantallas muy pequeñas ───────────────── */
@media (max-width: 420px) {
  .trust-item {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 10px 6px !important;
  }
  .trust-item:not(:last-child) { border-right: none !important; }
}

/* ─── Footer legal en móvil ─────────────────────────────── */
@media (max-width: 500px) {
  .footer-bottom { gap: 12px !important; }
  .footer-legal {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }
}

/* ─── Banner intermezzo en móvil ────────────────────────── */
@media (max-width: 768px) {
  #intermezzo { padding: 55px 0 !important; }
  .intermezzo-text { font-size: clamp(1.1rem, 4vw, 1.5rem) !important; }
}

/* ─── Cat-banner (páginas de categoría) en móvil ────────── */
@media (max-width: 768px) {
  .cat-banner {
    min-height: 45vw !important;
    padding: 60px 0 40px !important;
  }
}

/* ─── CTA strip en móvil ─────────────────────────────────── */
@media (max-width: 768px) {
  .cta-strip { padding: 55px 0 !important; }
}

/* ─── Mejoras al header en scroll ───────────────────────── */
#header {
  transition: box-shadow 0.3s ease, background 0.3s ease !important;
}
#header.scrolled {
  background: rgba(255, 255, 255, 0.99) !important;
}

/* ─── Product grid gap mejorado en móvil ────────────────── */
@media (max-width: 500px) {
  .product-grid { gap: 14px !important; }
  .product-name { font-size: 0.9rem !important; }
}

/* ─── Pulse en botón WA flotante (sutil, atrae atención) ── */
@keyframes wa-pulse {
  0%   { box-shadow: 0 4px 22px rgba(37, 211, 102, 0.42); }
  50%  { box-shadow: 0 4px 28px rgba(37, 211, 102, 0.65), 0 0 0 8px rgba(37, 211, 102, 0.08); }
  100% { box-shadow: 0 4px 22px rgba(37, 211, 102, 0.42); }
}
.wa-float a {
  animation: wa-pulse 3s ease-in-out infinite !important;
}
.wa-float a:hover {
  animation: none !important;
  transform: scale(1.09) !important;
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.55) !important;
}

/* ─── Scroll suave en todos los anchos ──────────────────── */
html {
  scroll-behavior: smooth !important;
}

/* ─── Mejoras al dropdown de desktop ────────────────────── */
@media (min-width: 769px) {
  .dropdown {
    padding: 12px 0 !important;
  }
  .dropdown a {
    padding: 11px 22px !important;
    transition: background 0.15s, color 0.15s, padding-left 0.15s !important;
  }
  .dropdown a:hover {
    padding-left: 28px !important;
  }
}

/* ─── Scrollbar personalizada (webkit) ─────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8f8f8; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
