/* ============================================================
   VARIABLES
   ============================================================ */
:root{
  --marble:        #EDE9DF;
  --marble-dark:   #DED8C8;
  --stone:         #2B271F;
  --stone-soft:    #4A4438;
  --verdigris:     #4C7A6D;
  --verdigris-dark:#375A50;
  --gold:          #A9873F;
  --pompeii:       #8C3A2E;
  --line:          #c9c1ac;
}

/* Tema oscuro: automático según el sistema/teléfono, salvo que el
   usuario haya forzado explícitamente el tema claro con el botón */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --marble:        #1C1A16;
    --marble-dark:   #232019;
    --stone:         #EDE9DF;
    --stone-soft:    #C9C1AC;
    --verdigris:     #5C9384;
    --verdigris-dark:#4C7A6D;
    --gold:          #C6A45C;
    --pompeii:       #B24E3D;
    --line:          #3A352B;
  }
}

/* Tema oscuro forzado manualmente (botón), sin importar el sistema */
:root[data-theme="dark"]{
  --marble:        #1C1A16;
  --marble-dark:   #232019;
  --stone:         #EDE9DF;
  --stone-soft:    #C9C1AC;
  --verdigris:     #5C9384;
  --verdigris-dark:#4C7A6D;
  --gold:          #C6A45C;
  --pompeii:       #B24E3D;
  --line:          #3A352B;
}

/* Transición suave entre temas */
body{
  transition: background-color .25s ease, color .25s ease;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html{
  scroll-behavior: smooth;
}
body{
  background: var(--marble);
  color: var(--stone);
  font-family: 'Piazzolla', serif;
  font-size: 17px;
  line-height: 1.6;
}
h1, h2, h3, .display{
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--stone);
}
a{
  color: inherit;
  text-decoration: none;
}
img{
  color: transparent; /* evita ver el texto del alt mientras la imagen decodifica */
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px){
  .wrap{ padding: 0 20px; }
}

/* ============================================================
   TEXTURA DE MÁRMOL
   ============================================================ */
.marble-bg{
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(120,110,85,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(120,110,85,0.05) 0%, transparent 55%),
    repeating-linear-gradient(115deg, rgba(80,70,50,0.02) 0px, rgba(80,70,50,0.02) 1px, transparent 1px, transparent 90px);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--marble) 92%, transparent);
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease, background-color .25s ease; /* mostrar/ocultar con scroll */
}
header::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}
header.header-hidden{
  transform: translateY(-100%);
}

nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.logo{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--stone);
}
.logo svg{
  width: 26px;
  height: 26px;
}
.nav-links{
  display: flex;
  gap: 30px;
  align-items: center;
}
.nav-links a{
  font-size: 15px;
  color: var(--stone-soft);
  transition: color .2s;
}
.nav-links a:hover{
  color: var(--gold);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn{
  display: inline-block;
  padding: 11px 26px;
  border: 1px solid var(--stone);
  font-family: 'Piazzolla', serif;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-solid{
  background: var(--stone);
  color: var(--marble);
  border-color: var(--stone);
}
.btn-solid:hover{
  background: var(--gold);
  border-color: var(--gold);
}
.btn-ghost{
  background: transparent;
  color: var(--stone);
  border-color: var(--stone-soft);
}
.btn-ghost:hover{
  border-color: var(--stone);
  background: rgba(0,0,0,0.03);
}

/* ============================================================
   NAV CTA (botón + selector de idioma)
   ============================================================ */
.nav-cta{
  display: flex;
  gap: 14px;
  align-items: center;
}
.nav-cta a.link{
  font-size: 15px;
  color: var(--stone-soft);
}

/* ---- Selector de idioma ---- */
.lang-switch{
  position: relative;
  display: flex;
  align-items: center;
}
.lang-switch::after{
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--stone-soft);
  opacity: 0.6;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lang-switch:hover::after{
  opacity: 1;
}
.lang-switch select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--stone-soft);
  font-family: 'Piazzolla', serif;
  font-size: 14px;
  padding: 6px 26px 6px 12px;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.lang-switch select:hover{
  background: rgba(0,0,0,0.035);
  border-color: var(--line);
  color: var(--stone);
}
.lang-switch select:focus{
  outline: none;
  background: rgba(0,0,0,0.035);
  border-color: var(--verdigris-dark);
  color: var(--stone);
}

/* ============================================================
   ANIMACIÓN DE ENTRADA ESCALONADA (header)
   ============================================================ */

/* --- Wrapper interno del header: fade + slide down --- */
@keyframes headerFadeIn{
  from{
    opacity: 0;
    transform: translateY(-12px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}
.header-inner{
  animation: headerFadeIn 0.5s ease-out;
}

/* --- Links del medio --- */
@keyframes navLinksFadeIn{
  from{
    opacity: 0;
    transform: translateY(8px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}
.nav-links{
  opacity: 0;
  animation: navLinksFadeIn 0.5s ease-out forwards;
  animation-delay: 0.4s;
}

/* --- Botón Contáctanos: entra desde la derecha --- */
@keyframes ctaFadeIn{
  from{
    opacity: 0;
    transform: translateX(40px);
  }
  to{
    opacity: 1;
    transform: translateX(0);
  }
}
.nav-cta .btn{
  opacity: 0;
  animation: ctaFadeIn 0.5s ease-out forwards;
  animation-delay: 0.8s;
}

/* --- Logo: rodando como piedra desde la izquierda --- */
@keyframes logoRollIn{
  from{
    transform: translateX(-120px) rotate(-360deg);
    opacity: 0;
  }
  to{
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}
.logo img{
  opacity: 0;
  animation: logoRollIn 1.2s cubic-bezier(0.34, 0.02, 0.15, 1) forwards;
  animation-delay: 0.8s;
}

/* ============================================================
   BOTÓN VOLVER ARRIBA
   ============================================================ */
.scroll-top-btn{
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--stone-soft);
  background: var(--marble);
  color: var(--stone);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease, background .2s ease, border-color .2s ease, visibility 0s .3s;
  z-index: 60;
}
.scroll-top-btn.visible{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .3s ease, transform .3s ease, background .2s ease, border-color .2s ease, visibility 0s 0s;
}
.scroll-top-btn:hover{
  background: var(--gold);
  color: var(--marble);
  border-color: var(--gold);
}
.scroll-top-btn:disabled{
  cursor: not-allowed;
  pointer-events: none;
}
.scroll-top-btn svg{
  stroke: currentColor;
}

/* ============================================================
   SECCIONES DE CONTENIDO
   ============================================================ */
.section{
  padding: 80px 32px;
}
.section-hero{
  padding: 100px 32px;
  text-align: center;
}
.section-hero h1{
  font-size: 42px;
  margin-bottom: 20px;
}
.section-hero p{
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--stone-soft);
}
.section-title{
  margin-bottom: 40px;
}

.card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card-grid-pricing{
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ---- Carrusel (infinito, con flechas sutiles) ---- */
.carousel{
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.carousel-viewport{
  overflow-x: hidden;
  overflow-y: visible;
  flex: 1;
}
.carousel-track{
  display: flex;
  gap: 24px;
  will-change: transform;
}
.carousel-track .card{
  flex: 0 0 280px;
  width: 280px;
}
.carousel-track .card.featured{
  border-color: var(--gold);
  border-width: 2px;
}
.carousel-arrow{
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--stone-soft);
  opacity: 0.5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease, background .2s ease, color .2s ease;
}
.carousel-arrow:hover{
  opacity: 1;
  background: rgba(0,0,0,0.04);
  color: var(--stone);
}
@media (max-width: 640px){
  .carousel-arrow{
    width: 30px;
    height: 30px;
  }
  .carousel-track .card{
    flex: 0 0 auto;
  }
}

.card{
  border: 1px solid var(--line);
  padding: 28px;
}
.card h3{
  font-size: 20px;
  margin-bottom: 12px;
}
.card p{
  color: var(--stone-soft);
  margin-bottom: 16px;
}

.card-pricing{
  padding: 32px;
  text-align: center;
}
.card-pricing.featured{
  border-color: var(--gold);
}
.card-pricing h3{
  margin-bottom: 8px;
}
.card-pricing .price{
  font-size: 28px;
  font-family: 'Cinzel', serif;
  margin-bottom: 16px;
}
.card-pricing p:not(.price){
  color: var(--stone-soft);
  margin-bottom: 20px;
}

.section-about p{
  max-width: 700px;
  color: var(--stone-soft);
}

.section-contact{
  text-align: center;
}
.section-contact p{
  color: var(--stone-soft);
  margin-bottom: 28px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer{
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--stone-soft);
}
.footer-links{
  display: flex;
  gap: 20px;
}

/* ============================================================
   REDES SOCIALES FIJAS (WhatsApp / Instagram)
   ============================================================ */
@keyframes socialFadeIn{
  from{
    opacity: 0;
    transform: translateX(-46px);
  }
  to{
    opacity: 1;
    transform: translateX(0);
  }
}
.social-fixed{
  opacity: 0;
  position: fixed;
  bottom: 28px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 60;
  animation: socialFadeIn 0.5s ease-out forwards;
  animation-delay: 0.8s;
}
.social-fixed a{
  display: inline-block;
  transition: transform .2s ease;
}
.social-fixed a:hover{
  transform: scale(1.1);
}

/* ============================================================
   TOGGLE DE TEMA (claro/oscuro)
   ============================================================ */
.theme-toggle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--stone);
  flex-shrink: 0;
}
.theme-icon{
  display: none;
  flex-shrink: 0;
}
/* Claro (por defecto): se ve la luna → clickear pasa a oscuro */
.theme-icon-moon{
  display: block;
}
/* Oscuro forzado manualmente: se ve el sol → clickear pasa a claro */
:root[data-theme="dark"] .theme-icon-sun{
  display: block;
}
:root[data-theme="dark"] .theme-icon-moon{
  display: none;
}
/* Oscuro por sistema (sin forzar claro): mismo criterio */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .theme-icon-sun{
    display: block;
  }
  :root:not([data-theme="light"]) .theme-icon-moon{
    display: none;
  }
}

/* ============================================================
   HAMBURGUESA (solo visible en mobile)
   ============================================================ */
.hamburger{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger span{
  display: block;
  width: 100%;
  height: 2px;
  background: var(--stone);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.hamburger.open span:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2){
  opacity: 0;
}
.hamburger.open span:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
.nav-brand-mobile-only{
  display: none;
}

@media (max-width: 768px){
  nav.wrap{
    position: relative;
    flex-wrap: wrap;
  }

  .hamburger{
    display: flex;
  }

  /* Sin animación de entrada en mobile: la línea del header queda fija */
  .header-inner{
    animation: none;
  }

  .nav-cta-desktop-only{
    display: none;
  }

  .nav-brand-mobile-only{
    display: flex;
  }

  /* El menú de links se convierte en un dropdown debajo del header */
  .nav-links{
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--marble);
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height .3s ease, padding .3s ease, border-color .3s ease;
    border-bottom: 1px solid transparent;
  }
  .nav-links.open{
    border-bottom-color: var(--line);
    max-height: 320px;
    padding: 16px 20px;
  }
  .nav-links a{
    padding: 10px 0;
    width: 100%;
  }

  .nav-cta{
    gap: 10px;
  }
  .nav-cta .btn{
    padding: 9px 18px;
    font-size: 14px;
  }

  .section-hero h1{
    font-size: 30px;
  }
  .section-hero p{
    font-size: 15px;
  }

  .card-pricing .price{
    font-size: 24px;
  }

  .scroll-top-btn{
    bottom: 16px;
  }
  .social-fixed{
    bottom: 90px;
    left: 16px;
  }
  .scroll-top-btn{
    right: 16px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px){
  .section-hero{
    padding: 70px 20px;
  }
  .section{
    padding: 56px 20px;
  }
  .section-hero h1{
    font-size: 26px;
  }
  .carousel-track .card{
    flex-basis: 220px;
    width: 220px;
  }
  .lang-switch select{
    font-size: 13px;
    padding: 6px 22px 6px 10px;
  }
}

/* Packs de precios ocultos por producto: presentes en el DOM (indexables
   por buscadores) pero no visibles hasta que JS los inyecta en el carrusel */
.pricing-pack{
  display: none;
}

/* ============================================================
   MODALES LEGALES (Términos / Privacidad)
   ============================================================ */
.legal-modal{
  border: none;
  border-radius: 6px;
  padding: 0;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  background: var(--marble);
  color: var(--stone);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.legal-modal[open]{
  position: fixed;
  inset: 0;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.legal-modal::backdrop{
  background: rgba(43,39,31,0.55);
  backdrop-filter: blur(2px);
}
.legal-modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.legal-modal-header h2{
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 20px;
}
.legal-modal-close{
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--stone-soft);
  padding: 0 4px;
  flex-shrink: 0;
}
.legal-modal-close:hover{
  color: var(--stone);
}
.legal-modal-body{
  padding: 24px;
  overflow-y: auto;
}
.legal-modal-body p{
  margin-bottom: 14px;
  line-height: 1.6;
}
.legal-modal-body p:last-child{
  margin-bottom: 0;
}

html.modal-open{
  overflow: hidden;
}

@media (max-width: 480px){
  .legal-modal{
    width: 94%;
    max-height: 85vh;
  }
  .legal-modal-header{
    padding: 16px 18px;
  }
  .legal-modal-body{
    padding: 18px;
  }
}