/* Solo en la demo: «Personaliza tu web» (estudio.js). Panel oscuro propio: se lee igual con cualquier estilo y color.
   Solo se animan transform y opacity. */
.estudio {
  --es-fondo: #151113; --es-borde: rgba(255, 255, 255, .1); --es-texto: #f8f1ec; --es-texto-2: rgba(248, 241, 236, .62);
  --es-oro: #e2bd78; --es-oro-osc: #2a1d0b; --es-muelle: cubic-bezier(.32, 1.36, .48, 1); --es-salida: cubic-bezier(.55, 0, .75, .2);
  position: fixed; z-index: 90; left: 0; right: 0; bottom: var(--teclado, 0px); margin: 0 auto; width: min(600px, 100%);
  padding: 4px 0 calc(14px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  font-family: var(--sans); color: var(--es-texto); background: var(--es-fondo);
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1px var(--es-borde);
  transform: translate3d(0, calc(100% + 40px), 0) scale(.94); opacity: 0; transform-origin: 50% 100%;
  transition: transform .42s var(--es-salida), opacity .3s ease .08s; will-change: transform; touch-action: pan-x;
}
.estudio[hidden] { display: none; }
.estudio.abierta { transform: none; opacity: 1; transition: transform .62s var(--es-muelle), opacity .22s ease; }
.estudio.arrastrando { transition: none; }
@media (min-width: 640px) { .estudio { bottom: calc(16px + var(--teclado, 0px)); border-radius: 28px; } }
.es-asa { display: grid; place-items: center; height: 22px; cursor: grab; touch-action: none; }
.es-asa span { width: 40px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .28); }
.es-cab { display: flex; align-items: center; gap: 8px; padding: 0 14px 12px 20px; }
.es-cab > div { flex: 1; min-width: 0; }
.es-cab h2 { margin: 0; font: 700 1.12rem/1.2 var(--sans); letter-spacing: -.02em; color: var(--es-texto); font-style: normal; text-transform: none; }
.es-pista { margin: 2px 0 0; font-size: .82rem; line-height: 1.3; color: var(--es-texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-copiar, .es-listo { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 999px; font: 600 .84rem var(--sans); cursor: pointer; transition: transform .2s var(--es-muelle); }
.es-copiar { padding: 0 14px; color: var(--es-texto); background: rgba(255, 255, 255, .09); }
.es-listo { padding: 0 20px; font-size: .95rem; font-weight: 700; color: var(--es-oro-osc); background: var(--es-oro); box-shadow: 0 8px 22px -10px rgba(226, 189, 120, .9); }
.es-copiar:active, .es-listo:active { transform: scale(.94); }
@media (max-width: 380px) { .es-copiar { display: none; } }
.es-tabs { --tab: 0; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 16px 14px; padding: 4px; border-radius: 18px; background: rgba(255, 255, 255, .07); }
.es-tab-luz { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 14px; background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 16px -8px rgba(0, 0, 0, .6); transform: translate3d(calc(var(--tab) * 100%), 0, 0); transition: transform .5s var(--es-muelle); }
.es-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 6px; border: 0; border-radius: 14px; font: 600 .86rem var(--sans); color: var(--es-texto-2); background: none; cursor: pointer; transition: color .25s; }
.es-tab .i { width: 19px; height: 19px; transition: transform .45s var(--es-muelle); }
.es-tab[aria-selected="true"] { color: var(--es-texto); }
.es-tab[aria-selected="true"] .i { transform: scale(1.14); color: var(--es-oro); }
.es-cuerpo { min-height: 178px; }
.es-fila { display: flex; gap: 10px; overflow-x: auto; padding: 4px 20px 6px; scroll-padding: 0 20px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.es-fila::-webkit-scrollbar { display: none; }
.es-tarjeta { position: relative; flex: none; display: grid; align-content: start; gap: 4px; width: 132px; padding: 7px 7px 10px; border: 0; border-radius: 20px; font: inherit; color: var(--es-texto); text-align: left; scroll-snap-align: start; cursor: pointer;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: transform .35s var(--es-muelle), box-shadow .25s, background-color .25s; }
.es-tarjeta:active { transform: scale(.95); }
.es-tarjeta.elegida { background: rgba(226, 189, 120, .14); box-shadow: inset 0 0 0 2px var(--es-oro), 0 10px 26px -14px rgba(226, 189, 120, .9); }
.es-nombre { margin: 4px 4px 0; font-size: .88rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-sub { margin: 0 4px; font-size: .72rem; line-height: 1.25; color: var(--es-texto-2); }
.es-ok { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--es-oro-osc); background: var(--es-oro);
  opacity: 0; transform: scale(.3); transition: transform .4s var(--es-muelle), opacity .2s; }
.es-ok .i { width: 14px; height: 14px; }
.es-tarjeta.elegida .es-ok { opacity: 1; transform: none; }

/* Muestra de cada estilo: su letra y su forma */
.es-muestra { position: relative; display: grid; place-items: center; height: 86px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.es-letra { font: italic 500 2.3rem/1 'Cormorant Garamond', Georgia, serif; margin-top: -14px; }
.es-muestra { grid-template-columns: 1fr auto; padding: 0 14px; }
.es-muestra .es-letra { margin: -10px 0 0; justify-self: start; }
.es-muestra i { position: absolute; left: 14px; width: 44px; bottom: 14px; height: 7px; border-radius: 9px; background: var(--a); }
/* La uña de cada estilo, con su forma y su brillo */
.es-muestra b { width: 30px; height: 50px; background: var(--a); -webkit-mask: var(--f) 0 0 / 100% 100%; mask: var(--f) 0 0 / 100% 100%; box-shadow: inset 6px 0 0 -2px rgba(255, 255, 255, .45); }
.es-atelier { --f: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cpath d='M50 0C80 0 100 32 100 72V118Q100 140 78 140H22Q0 140 0 118V72C0 32 20 0 50 0Z'/%3E%3C/svg%3E"); }
.es-glam { --f: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cpath d='M50 0C60 20 100 52 100 88V120Q100 140 80 140H20Q0 140 0 120V88C0 52 40 20 50 0Z'/%3E%3C/svg%3E"); }
.es-pop { --f: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cpath d='M16 0H84Q100 0 100 16V120Q100 140 80 140H20Q0 140 0 120V16Q0 0 16 0Z'/%3E%3C/svg%3E"); }
.es-glam .es-letra { color: var(--m); }
.es-glam b { background: linear-gradient(160deg, var(--a), var(--m)); }
.es-pop .es-letra { font: 700 2.2rem/1 'Montserrat', Arial, sans-serif; letter-spacing: -.06em; transform: rotate(-6deg); text-shadow: 3px 3px 0 var(--m); }
.es-pop i { border-radius: 6px; box-shadow: 2px 2px 0 currentColor; }

.es-color { width: 112px; }
.es-circulos { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: 86px; padding: 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.es-circulos span { border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.es-circulos span:first-child { grid-row: span 2; border-radius: 999px; }
.es-color .es-ok { top: 6px; right: 6px; }

.es-boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 15px; font: 600 .95rem var(--sans); color: var(--es-texto); background: rgba(255, 255, 255, .09); cursor: pointer; transition: transform .2s var(--es-muelle); }
.es-boton:active { transform: scale(.96); }
.es-boton .i { width: 18px; height: 18px; }
.es-principal { color: var(--es-oro-osc); background: var(--es-oro); }
.es-nombre-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 20px 6px; }
#estudio .es-nombre-form input { -webkit-text-fill-color: var(--es-texto); min-width: 0; min-height: 52px; padding: 0 16px; border: 0; border-radius: 15px; font: 600 1.05rem var(--sans); color: var(--es-texto); background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); outline: none; }
#estudio .es-nombre-form input:focus { box-shadow: inset 0 0 0 2px var(--es-oro); }

/* Entrada en cascada */
.estudio.abierta .es-cab, .estudio.abierta .es-tabs { animation: es-sube .6s var(--es-muelle) both; }
.estudio.abierta .es-cab { animation-delay: .08s; }
.estudio.abierta .es-tabs { animation-delay: .14s; }
.es-cuerpo.entra .es-tarjeta, .es-cuerpo.entra .es-nombre-form > * { animation: es-ficha .7s var(--es-muelle) both; animation-delay: calc(.1s + var(--i, 0) * 50ms); }
.es-cuerpo.entra .es-nombre-form > :nth-child(2) { --i: 1; }
@keyframes es-sube { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes es-ficha { 0% { opacity: 0; transform: translate3d(46px, 26px, 0) rotate(6deg) scale(.86); } 60% { opacity: 1; } }

/* Pastilla para volver a abrirlo */
.es-pastilla {
  position: fixed; z-index: 31; left: 10px; bottom: calc(84px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 16px 4px 4px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 .86rem var(--sans); color: #f8f1ec; background: #151113;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1px rgba(255, 255, 255, .1);
  transform: translate3d(0, 20px, 0) scale(.6); opacity: 0; pointer-events: none; transition: transform .5s cubic-bezier(.32, 1.36, .48, 1), opacity .2s;
}
.es-pastilla.visible { transform: none; opacity: 1; pointer-events: auto; }
.es-pastilla.visible:active { transform: scale(.94); }
.es-pastilla-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #2a1d0b;
  background: conic-gradient(from 200deg, #e2bd78, #e86a8f, #7c6cf2, #5fb39a, #e2bd78); }
.es-pastilla-ico .i { width: 20px; height: 20px; }
.es-pastilla.saluda.visible .es-pastilla-ico { animation: es-gira 1.6s cubic-bezier(.32, 1.36, .48, 1) .4s 2; }
@keyframes es-gira { 45% { transform: rotate(200deg) scale(1.12); } 100% { transform: rotate(360deg); } }
@media (min-width: 760px) { .es-pastilla { left: 24px; bottom: 92px; } }
@media (max-width: 759px) {
  /* En el móvil baja del todo mientras no está la barra de abajo, y sube con ella */
  .es-pastilla { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .barra-movil.visible ~ .es-pastilla.visible { transform: translate3d(0, -70px, 0); }
}

/* Con el panel abierto, lo fijo de abajo se aparta */
.estudio-abierto .barra-movil, .estudio-abierto .demo-panel, .estudio-abierto .wa-flotante { opacity: 0; pointer-events: none; transform: translate3d(0, 30px, 0); transition: opacity .2s, transform .3s; }

.es-onda { position: fixed; z-index: 89; width: 40px; height: 40px; border-radius: 50%; pointer-events: none; will-change: transform, opacity; }
.es-aviso { position: fixed; z-index: 95; left: 50%; top: calc(76px + env(safe-area-inset-top)); max-width: calc(100% - 32px); margin: 0; padding: 11px 18px; border-radius: 999px;
  font: 600 .88rem var(--sans); color: #f8f1ec; background: #151113; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6);
  transform: translate3d(-50%, -12px, 0); opacity: 0; pointer-events: none; transition: transform .4s cubic-bezier(.32, 1.36, .48, 1), opacity .2s; }
.es-aviso.visible { transform: translate3d(-50%, 0, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .estudio, .estudio.abierta, .es-pastilla { transition: opacity .2s; }
  .estudio { transform: none; }
  .estudio *, .es-pastilla * { animation: none !important; }
}
.es-fila-estilos .es-tarjeta { width: calc((100% - 20px) / 3); min-width: 104px; }
.es-fila-estilos .es-sub { font-size: .68rem; }
