:root {
  --bg: #06150d;
  --forest: #0B4A2A;
  --emerald: #0B5E32;
  --glow: #2fd08a;
  --gold: #E3C27E;
  --wine: #6B1F2A;
  --cream: #EDEBDD;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font: 17px/1.6 'Jost', system-ui, sans-serif;
  overflow-x: hidden;
}

canvas#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ===== NAVEGACIÓN Y MENÚ ===== */
nav {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5vw;
  backdrop-filter: blur(12px);
  background: rgba(6, 21, 13, .55);
  border-bottom: 1px solid rgba(227, 194, 126, .25);
}

nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

nav .brand img {
  height: 38px;
  width: auto;
}

nav b {
  font: 700 24px 'Cormorant Garamond', serif;
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 15px;
  position: relative;
  padding: 8px 0;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 1px;
  width: 0;
  background: var(--gold);
  transition: width .3s;
}

nav a:hover::after { width: 100%; }

/* Botón Hamburguesa */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 2.2rem;
  cursor: pointer;
  padding: 0 10px;
}

/* Responsividad del Menú (Celulares) */
@media (max-width: 768px) {
  .menu-toggle {
    display: block; 
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(6, 21, 13, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    text-align: center;
    padding: 0;
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(227, 194, 126, .25);
  }
  
  .nav-links.activo {
    display: flex !important; 
  }
  
  .nav-links a {
    padding: 15px;
    display: block;
    border-bottom: 1px solid rgba(227, 194, 126, 0.1);
    margin: 0;
  }
  
  .nav-links a:last-child {
    border-bottom: none;
  }
}

/* ===== SECCIONES GENERALES ===== */
section {
  position: relative;
  z-index: 1;
  padding: 110px 5vw;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
}

.kicker {
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--glow);
}

h1 {
  font: 700 clamp(40px, 8vw, 92px)/1.02 'Cormorant Garamond', serif;
  margin: 14px 0 20px;
  max-width: 760px;
  color: #fff;
}

h1 em { color: var(--gold); font-style: italic; }

.hero p {
  max-width: 480px;
  margin: 0 0 30px;
  color: #cfd9d2;
}

.btns { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  color: #04140b;
  background: linear-gradient(135deg, var(--glow), #8af0c0);
  border: 0;
  cursor: pointer;
  transition: box-shadow .3s, transform .2s;
  box-shadow: 0 0 0 rgba(47, 208, 138, 0);
}

.btn:hover { box-shadow: 0 0 34px rgba(47, 208, 138, .55); }

.btn.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn.ghost:hover {
  background: rgba(227, 194, 126, .12);
  box-shadow: 0 0 28px rgba(227, 194, 126, .3);
}

.pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 44px;
  align-items: center;
}

.pills span {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9fb3a7;
  width: 100%;
}

.pill {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(227, 194, 126, .4);
  background: rgba(6, 21, 13, .5);
  color: var(--cream);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: .25s;
}

.pill:hover { border-color: var(--gold); transform: translateY(-2px); }
.pill.on { background: var(--gold); color: #241a05; border-color: var(--gold); }

h2 {
  font: 700 clamp(34px, 5vw, 56px)/1.1 'Cormorant Garamond', serif;
  color: var(--gold);
  margin: 0 0 14px;
}

.panel {
  background: linear-gradient(180deg, rgba(6, 21, 13, .8), rgba(6, 21, 13, .92));
  backdrop-filter: blur(6px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  margin-top: 36px;
  perspective: 900px;
}

.card {
  border: 1px solid rgba(227, 194, 126, .35);
  padding: 28px;
  border-radius: 18px;
  background: rgba(11, 74, 42, .25);
  transition: transform .15s, border-color .3s, background .3s;
  transform-style: preserve-3d;
  will-change: transform;
}

.card:hover { border-color: var(--gold); background: rgba(11, 74, 42, .45); }
.card .n { font: 600 52px 'Cormorant Garamond', serif; color: var(--gold); opacity: .8; }
.card h3 { font: 600 28px 'Cormorant Garamond', serif; margin: 6px 0 8px; color: #fff; }
.card p { margin: 0 0 16px; font-size: 15px; color: #cfd9d2; }
.card button { background: none; border: 0; color: var(--glow); font: inherit; font-size: 15px; cursor: pointer; padding: 10px 0; min-height: 44px; }
.card button:hover { text-decoration: underline; }

.txt { max-width: 720px; color: #cfd9d2; }
.center { text-align: center; }
.center .txt { margin: 0 auto 30px; }

.links { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 30px; font-size: 15px; }
.links a { color: var(--gold); }

.rv { opacity: 0; transform: translateY(40px); transition: opacity .9s, transform .9s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }

footer { position: relative; z-index: 1; text-align: center; padding: 24px; font-size: 13px; color: #7d9486; background: var(--bg); }

.logo {
  width: clamp(150px, 22vw, 230px);
  height: auto;
  display: block;
  margin: 0 0 6px -12px;
  filter: drop-shadow(0 0 30px rgba(47, 208, 138, .25));
}

body[data-view=catalogo] .home { display: none; }
body:not([data-view=catalogo]) .cat { display: none; }
.cat { padding-top: 130px; min-height: 100svh; }

.tabs { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 8px; }
.tab {
  min-height: 52px;
  padding: 0 26px;
  border-radius: 14px;
  border: 1px solid rgba(227, 194, 126, .4);
  background: rgba(6, 21, 13, .6);
  color: var(--cream);
  font: 600 22px 'Cormorant Garamond', serif;
  cursor: pointer;
  transition: .25s;
}
.tab:hover { border-color: var(--gold); transform: translateY(-2px); }
.tab.on { background: linear-gradient(135deg, var(--gold), #f3dca4); color: #241a05; border-color: var(--gold); box-shadow: 0 0 30px rgba(227, 194, 126, .3); }
.sub { margin: 6px 0 0; color: #9fb3a7; font-size: 15px; min-height: 26px; }
.cats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }

/* ===== CATÁLOGO DE JOYERÍA (AESTHETIC) ===== */
#items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  justify-content: center;
  margin-top: 30px;
}

.tarjeta-joya {
  background-color: #061e12;
  border: 1px solid #d8ba6f;
  border-radius: 16px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
  font-family: Arial, sans-serif;
}

.tarjeta-joya:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 28px rgba(4, 114, 77, 0.12);
  border-color: var(--gold);
}

.contenedor-imagen {
  position: relative;
  background-color: #f7f5ed;
  text-align: center;
  padding: 20px 0;
  overflow: hidden;
}

.img-joya {
  width: 80%;
  height: auto;
  display: inline-block;
  transition: transform 0.7s ease;
  will-change: transform;
  cursor: pointer;
}

.tarjeta-joya:hover .img-joya { transform: scale(1.08); }

.etiqueta-talla {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: #d8ba6f;
  color: #061e12;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 2;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.etiqueta-ver3d {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background-color: rgba(30, 40, 30, 0.85);
  border: 1px solid #dcb06b;
  color: #dcb06b;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
}

.contenido-texto {
  padding: 20px;
  color: #ffffff;
}

.titulo-joya {
  font-family: 'Times New Roman', serif;
  font-size: 22px;
  margin: 0 0 8px 0;
  font-weight: normal;
  letter-spacing: 0.5px;
}

.precio-joya {
  color: #dcb06b;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.botones-accion {
  display: flex;
  gap: 12px;
}

.btn-cotizar {
  background-color: #67e49e;
  color: #061e12;
  border: none;
  padding: 12px;
  border-radius: 25px;
  flex: 1;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-cotizar:hover {
  background-color: #04724D;
  color: #ffffff;
}

.btn-3d {
  background-color: transparent;
  color: #dcb06b;
  border: 1px solid #dcb06b;
  padding: 12px;
  border-radius: 25px;
  flex: 1;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-3d:hover {
  background-color: #04724D;
  color: #ffffff;
  border-color: #04724D;
}

/* ===== VISOR 3D FLOTANTE ===== */
.vw {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 12, 8, .88);
  backdrop-filter: blur(10px);
  padding: 20px;
  text-align: center;
}

.vw.on { display: flex; }
.vbox { max-width: 440px; width: 100%; position: relative; }

.vx {
  position: absolute;
  right: -4px;
  top: -6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(6, 21, 13, .8);
  color: var(--gold);
  font-size: 24px;
  cursor: pointer;
  z-index: 3;
}

.stage {
  perspective: 1100px;
  height: min(78vw, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.stage:active { cursor: grabbing; }

.plate {
  position: relative;
  width: min(70vw, 320px);
  aspect-ratio: 1;
  transform-style: preserve-3d;
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 2px solid var(--gold);
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(47, 208, 138, .25);
}

.face img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.face.f { transform: translateZ(8px); }
.face.b {
  transform: rotateY(180deg) translateZ(8px);
  background: #050510;
  display: flex;
  align-items: center;
  justify-content: center;
}
.face.b img { width: 60%; height: auto; }

.shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
  background-size: 250% 100%;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.vbox h3 { font: 700 36px 'Cormorant Garamond', serif; color: var(--gold); margin: 10px 0 0; }
.vbox p { margin: 0 0 14px; color: #cfd9d2; }
.vbox small { display: block; margin-top: 12px; color: #7d9486; }

@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .item { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== PÁGINAS INTERNAS (ENVÍOS Y GUÍA DE TALLAS) ===== */
.nav-interna {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5vw;
  background: rgba(6, 21, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(227, 194, 126, 0.25);
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(227, 194, 126, 0.4);
  background: rgba(11, 74, 42, 0.25);
  transition: 0.25s;
}

.btn-volver:hover {
  background: var(--gold);
  color: #06150d;
}

.container-legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 5vw 80px;
}

.politicas {
  background: rgba(11, 74, 42, 0.22);
  border: 1px solid rgba(227, 194, 126, 0.35);
  border-radius: 18px;
  padding: clamp(24px, 5vw, 44px);
}

.politicas h1 {
  font: 700 clamp(32px, 5vw, 48px)/1.1 'Cormorant Garamond', serif;
  color: var(--gold);
  margin: 0 0 8px;
  max-width: none;
}

.politicas h2 {
  font: 600 24px/1.2 'Cormorant Garamond', serif;
  color: var(--glow);
  margin: 28px 0 10px;
}

.politicas p, .politicas li {
  color: #cfd9d2;
  font-size: 16px;
  line-height: 1.7;
}

.politicas ul {
  padding-left: 20px;
  margin: 10px 0 18px;
}

.politicas strong {
  color: var(--cream);
}

/* ===== MEDIDOR DE ANILLOS (GUÍA DE TALLAS + REGLA VERTICAL) ===== */
.app {
  max-width: 450px;
  margin: 0 auto;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app h1 {
  font: 700 22px/1.1 'Cormorant Garamond', serif;
  letter-spacing: .04em;
  color: var(--gold);
  margin: 0;
  max-width: none;
}

.app .sub {
  font-size: 12px;
  color: #9fb3a7;
  margin: 0;
  min-height: auto;
}

.app .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.app .card {
  padding: 16px;
  transform: none !important;
}

.seg {
  display: flex;
  gap: 6px;
}

.seg button, .btn-tool {
  background: rgba(6, 21, 13, 0.75);
  color: var(--cream);
  border: 1px solid rgba(227, 194, 126, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  font: 500 13px 'Jost', sans-serif;
  cursor: pointer;
  transition: .2s;
}

.seg button.on {
  background: var(--gold);
  color: #06150d;
  font-weight: 600;
  border-color: var(--gold);
}

.tabs-tool button { flex: 1; }

.primary-tool {
  background: linear-gradient(135deg, var(--glow), #8af0c0);
  color: #04140b;
  font-weight: 600;
  width: 100%;
  border: 0;
  padding: 11px;
  border-radius: 999px;
  cursor: pointer;
}

.app input[type=range] {
  width: 100%;
  accent-color: var(--gold);
}

.hid { display: none !important; }

.row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.row .btn-tool { flex: 1; }

.mono { font-family: ui-monospace, Menlo, monospace; }

.big {
  font: 700 36px/1 'Cormorant Garamond', serif;
  color: var(--gold);
  margin: 2px 0 0;
}

.stage-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
}

.ring {
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: rgba(47, 208, 138, .12);
  box-shadow: 0 0 24px rgba(47, 208, 138, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.ring span {
  background: #06150d;
  border: 1px solid var(--gold);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--gold);
}

#vcard {
  width: 100%;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--forest), var(--bg), var(--emerald));
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gold);
}

.app table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}

.app th {
  background: var(--bg);
  color: var(--gold);
  padding: 8px 4px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
}

.app td {
  padding: 8px 4px;
  border-top: 1px solid rgba(227, 194, 126, .2);
  cursor: pointer;
}

.app tr.sel td {
  background: rgba(227, 194, 126, .18);
  color: var(--gold);
  font-weight: 600;
}

.tw {
  max-height: 260px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(227, 194, 126, .2);
}

.app input[type=number] {
  flex: 2;
  background: var(--bg);
  border: 1px solid rgba(227, 194, 126, 0.35);
  color: var(--cream);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
}

.app p {
  margin: 0;
  font-size: 13px;
  color: #cfd9d2;
  line-height: 1.45;
}

.app h2 {
  margin: 0 0 6px;
  font: 700 22px/1.1 'Cormorant Garamond', serif;
  color: var(--gold);
}

.item-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.item-cat a {
  color: var(--bg);
  background: var(--gold);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Regla Vertical para Celular */
.sw {
  display: flex;
  justify-content: center;
  padding: 10px 0 14px;
}

#strip {
  width: 68px;
  min-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background-color: var(--emerald);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  touch-action: none;
  cursor: ns-resize;
  position: relative;
}

#strip b {
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

#strip:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: var(--gold);
  border-radius: 0 0 9px 9px;
}

#toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
}