
    :root{
      --brown-50:#faf4ed; --brown-100:#f3e9dd; --brown-200:#e8d9c5; --brown-300:#d9c2a6; --brown-400:#c9a983;
      --brown-500:#b58963; --brown-600:#996b47; --brown-700:#7b5234; --brown-800:#5e3f29; --brown-900:#3e271a;
      --amber-50:#fffbeb; --amber-500:#f59e0b;
      --ink:#1c140f; --muted:rgba(0,0,0,.76);
      
    }
    *{box-sizing:border-box}
    html,body{height:100%}
    body{
      margin:0; color:var(--ink); font-family:'Cormorant Garamond', serif;
      background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.12), transparent 60%),
        radial-gradient(1000px 500px at 100% 10%, rgba(255,255,255,.06), transparent 65%),
        linear-gradient(120deg, var(--brown-900) 0%, var(--brown-800) 22%, var(--brown-700) 45%, var(--brown-600) 65%, var(--brown-700) 82%, var(--brown-800) 100%);
      background-attachment:fixed;
      cursor:var(--cursor-quill);
    }
    .backdrop{min-height:100vh; background:rgba(255,255,255,.02); backdrop-filter:blur(6px) saturate(98%)}
    .container{max-width:1240px; margin:0 auto; padding:0 16px}
    header{position:sticky; top:0; z-index:10; background:rgba(62,39,26,.55); backdrop-filter:blur(8px) saturate(120%); border-bottom:1px solid rgba(62,39,26,.35)}
    .brand{font-family:'Cormorant Garamond', serif, cursive; color:#fffbeb; font-size:28px; letter-spacing:.02em; text-shadow:0 1px 0 rgba(0,0,0,.3)}
    .muted{opacity:.9}
    .toolbar{display:flex; gap:8px; align-items:center; margin-left:auto}
    .input{display:none} @media (min-width:640px){ .input{display:block} }
    .input input{background:rgba(0,0,0,.2); color:#fff; border:1px solid rgba(62,39,26,.35); padding:8px 10px; border-radius:10px; font-size:14px; cursor:text}

    .tabs button{border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.06); color:#fef3c7; padding:6px 10px; border-radius:10px; font-size:14px; cursor:var(--cursor-quill); transition:all .2s ease}
    .tabs button:hover{transform:translateY(-1px); box-shadow:0 4px 10px rgba(0,0,0,.18); background:rgba(255,255,255,.12)}
    .tabs button.active{background:var(--brown-700); color:#fff; border-color:var(--brown-800)}

    .classic-frame{position:relative; background:linear-gradient(180deg, rgba(247,239,229,.66), rgba(247,239,229,.36)); border-radius:22px; border:1px solid rgba(62,39,26,.35);
      box-shadow:0 10px 30px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.3)}
    .classic-frame:before,.classic-frame:after{content:""; position:absolute; inset:8px; border-radius:16px; pointer-events:none}
    .classic-frame:before{border:1px solid rgba(62,39,26,.35); box-shadow:inset 0 0 0 1px rgba(255,255,255,.25)}
    .classic-frame:after{background:radial-gradient(12px 12px at 0 0, rgba(62,39,26,.5), transparent 60%),radial-gradient(12px 12px at 100% 0, rgba(62,39,26,.5), transparent 60%),radial-gradient(12px 12px at 0 100%, rgba(62,39,26,.5), transparent 60%),radial-gradient(12px 12px at 100% 100%, rgba(62,39,26,.5), transparent 60%); mix-blend-mode:multiply; opacity:.12}

    h1,h2{font-family:'Cormorant Garamond', serif, cursive; letter-spacing:.02em}
    h1{font-size:40px; margin:0} h2{font-size:28px; margin:0 0 10px}

    .hero{padding:24px}
    .grid{display:grid; gap:24px}
    @media (min-width:980px){.grid-cols-2{grid-template-columns:1.1fr .9fr}}

    .chip-group{display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 12px}
    .chip{padding:6px 12px; border-radius:999px; border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.35); font-size:14px; cursor:var(--cursor-quill); transition:all .18s ease}
    .chip:hover{background:rgba(255,255,255,.55); box-shadow:0 2px 6px rgba(0,0,0,.12)}
    .chip.selected{background:rgba(181,137,99,.26); border-color:var(--brown-600); color:#1f2937; box-shadow:0 1px 0 rgba(0,0,0,.05)}

    .btn-primary{background:var(--brown-700); color:#fff; border:none; padding:10px 14px; border-radius:12px; cursor:var(--cursor-quill); transition:transform .08s ease, box-shadow .2s ease, background .2s ease}
    .btn-primary:hover{box-shadow:0 8px 18px rgba(0,0,0,.25); background:var(--brown-600)}
    .btn{border:1px solid rgba(62,39,26,.3); background:rgba(255,255,255,.45); padding:8px 12px; border-radius:10px; cursor:var(--cursor-quill); transition:all .18s ease}
    .btn:hover{background:rgba(255,255,255,.7); box-shadow:0 6px 14px rgba(0,0,0,.18)}

    /* Columna derecha (logo + imagen) */
.hero-side .hero-logo {
  font-family: 'Cormorant Garamond', serif, cursive;
  font-size: 40px;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 10px;

  color: transparent;
  background: linear-gradient(
    180deg,
    #5c3a22  0%,    /* brillo dorado */
    #b58963 35%,   /* oro viejo */
    #b58963 70%,   /* bronce cálido */
    #5c3a22 100%   /* bronce oscuro */
  );
  -webkit-background-clip: text;
  background-clip: text;

  /* 🔑 Truco: asegura que el degradado cubra todo el bloque */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;

  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.descubre-title {
  font-family: 'Cormorant Garamond', serif, cursive;
  font-size: 40px;
  font-weight: 300;     /* más fino (prueba también 200 si la fuente lo soporta) */
  line-height: 1.3;
  text-align: center;
  margin-bottom: 10px;

  letter-spacing: 0.5px;  /* un poco de aire entre letras */

  color: transparent;
  background: linear-gradient(
    180deg,
    #5c3a22 0%,    /* bronce oscuro */
    #b58963 35%,   /* oro viejo */
    #b58963 70%,   /* bronce cálido */
    #5c3a22 100%   /* bronce profundo */
  );
  -webkit-background-clip: text;
  background-clip: text;

  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;

  text-shadow: 0 1px 3px rgba(0,0,0,0.25); /* más sutil para no engordar la letra */
}

    .hero-side .cover{aspect-ratio:3/4; width:100%; overflow:hidden; border-radius:16px; border:1px solid rgba(0,0,0,.12); box-shadow:0 6px 20px rgba(0,0,0,.25)}
    .hero-side .cover img{width:100%; height:100%; object-fit:cover}
:root{
  --font-title: "Cormorant Garamond", serif;
  --font-text:  "Source Serif 4", serif;
  --font-ui:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Tipografía base */
body{
  font-family: var(--font-text);
  font-weight: 400;
  font-optical-sizing: auto;
  font-variant-ligatures: common-ligatures;
  font-variant-numeric: oldstyle-nums proportional-nums;
  line-height: 1.6;
}

/* Títulos */
h1,h2,h3{
  font-family: var(--font-title);
  font-weight: 700;           /* Cormorant “gordo” para drama elegante */
  font-optical-sizing: auto;
  letter-spacing: .2px;
  margin: 0 0 .25em 0;
}
h1{ font-size: clamp(2.1rem, 1.1rem + 3.2vw, 3.3rem); line-height: 1.08; }
h2{ font-size: clamp(1.5rem, 1.0rem + 1.4vw, 2.2rem); line-height: 1.15; }
h3{ font-size: clamp(1.2rem, .9rem + .9vw, 1.6rem);   line-height: 1.2;  }

/* UI: chips, botones, inputs, tabs */
.btn, .btn-primary, .chip, .tabs button, input, select, textarea, .pill, .page-btn, .page-num, .page-indicator{
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: .1px;
}

/* Marca: si quieres mantener el toque gótico del logo */
.brand{ font-family:'Cormorant Garamond', serif, cursive; }

/* Bio del autor y textos largos */
#bmSynopsis, .bm-author-bio, .result-meta, .muted { 
  font-family: var(--font-text);
  font-weight: 400;
  font-optical-sizing: auto;
}

    /* Resultados en columnas */
    .results-head{display:flex; justify-content:space-between; align-items:center; gap:12px; margin:0 0 8px 0}
    .results-grid{display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
    .result-card{background:rgba(255,255,255,.55); border:1px solid rgba(62,39,26,.25); border-radius:12px; padding:10px; transition:transform .12s ease, box-shadow .2s ease; cursor:var(--cursor-quill)}
    .result-card:hover{transform:translateY(-2px); box-shadow:0 8px 20px rgba(0,0,0,.2)}
    .result-cover{width:100%; aspect-ratio:3/4; border-radius:10px; overflow:hidden; border:1px solid rgba(0,0,0,.08); margin-bottom:8px}
    .result-cover img{width:100%; height:100%; object-fit:cover}
    .result-title{font-weight:700; line-height:1.2}
    .result-meta{font-size:12px; color:#333; opacity:.9}
    .result-actions{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap}

    /* Paginación */
    .pagination{display:flex; gap:8px; justify-content:center; align-items:center; margin-top:12px; flex-wrap:wrap}
    .page-btn, .page-num{border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.55); padding:6px 10px; border-radius:10px; cursor:var(--cursor-quill)}
    .page-btn[disabled]{opacity:.5; cursor:not-allowed}
    .page-num.active{background:var(--brown-700); color:#fff}
    .page-indicator{font-size:13px; color:#111; background:rgba(255,255,255,.6); border:1px solid rgba(62,39,26,.25); padding:6px 10px; border-radius:10px}
.pagination-scroll {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.perg-numbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  width: 42px;
  height: 50px;
  background: linear-gradient(145deg, #e8d9c5, #f3e9dd);
  border: 2px solid #b58963;
  border-radius: 12px;
  color: #5e3f29;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0);
}

.page:hover {
  background: linear-gradient(160deg, #f3e9dd, #faf4ed);
  transform: scale(1.08) rotate(-1deg);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.page.active {
  background: #c9a983;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Botones de navegación (<< < > >>) */
.perg-btn {
  width: 44px;
  height: 50px;
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(145deg, #f3e9dd, #e8d9c5);
  color: #7b5234;
  border: 2px solid #b58963;
  border-radius: 14px;
  transition: all 0.3s ease;
}




.perg-btn:hover {
  background: #faf4ed;
  transform: scale(1.05);
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(62, 39, 26, 0.55);
  backdrop-filter: blur(8px) saturate(120%);
  border-bottom: 1px solid rgba(62, 39, 26, 0.35);
}

.header-inner {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.input input {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border: 1px solid rgba(62, 39, 26, 0.35);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  cursor: text;
}

.tabs button {
  border: 1px solid rgba(62, 39, 26, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fef3c7;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tabs button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.12);
}

.tabs button.active {
  background: var(--brown-700);
  color: #fff;
  border-color: var(--brown-800);
}

.login-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fef3c7, #e8d9c5);
  border: 1px solid rgba(62, 39, 26, 0.35);
  color: #3e271a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-btn:hover {
  background: linear-gradient(180deg, #fff8e1, #f3e9dd);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}




    /* Overlay/loader */
    .overlay{position:fixed; inset:0; display:none; place-items:center; background:rgba(10,10,10,.7); backdrop-filter:blur(4px); z-index:50}
    .overlay.show{display:grid}
    .loader{width:52px; height:52px; border:2px solid rgba(255,255,255,.25); border-top-color:var(--amber-500); border-radius:50%; animation:spin 1s linear infinite; margin:12px auto}
    @keyframes spin{to{transform:rotate(360deg)}}

    /* Modal genérico */
    .modal-overlay{position:fixed; inset:0; display:none; place-items:center; background:rgba(15,10,8,.55); backdrop-filter:blur(8px) saturate(120%); z-index:60}
    .modal-overlay.show{display:grid}
    .modal{background:linear-gradient(180deg, rgba(247,239,229,.92), rgba(247,239,229,.8)); border:1px solid rgba(62,39,26,.35); border-radius:16px; padding:16px; width:min(860px,92vw); max-height:92vh; overflow:auto; box-shadow:0 20px 60px rgba(0,0,0,.35)}
    .modal-title{font-family:'Cormorant Garamond', serif, cursive; font-size:24px; margin:0 0 10px}
    .modal-close{float:right; border:1px solid rgba(62,39,26,.3); background:rgba(255,255,255,.6); padding:6px 10px; border-radius:10px; cursor:var(--cursor-quill)}
    .modal-row{display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end}
    .modal .field{display:flex; flex-direction:column; gap:6px}
    .modal input[type="number"], .modal select{padding:8px 10px; border-radius:10px; border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.9)}
    .modal .actions{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap}

    footer{margin:64px 0 40px; text-align:center; font-size:12px; opacity:.75}
    .feel-form textarea{width:100%; min-height:110px; resize:vertical; padding:10px 12px; border-radius:12px; border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.55); cursor:text}
    .pill{display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:12px; border:1px solid rgba(62,39,26,.35); background:rgba(255,255,255,.4); margin:4px 6px 0 0}
    a{cursor:var(--cursor-quill)}

    /* Bloque "Cuéntame: ¿cómo te sientes y qué buscas?" */
.feel-form .muted {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 14px; /* opcional: un poco más legible */
  font-weight: 800; /* opcional: da más presencia */
}


/* ==== Panel de preferencias — estética clásica mejorada ==== */

/* Textura de papel MUY sutil sobre el frame */
.classic-frame.hero {
  background:
    radial-gradient(300px 150px at 15% 10%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(260px 130px at 85% 0%, rgba(255,255,255,.12), transparent 60%),
    linear-gradient(180deg, rgba(247,239,229,.86), rgba(247,239,229,.66));
  position: relative;
}
.classic-frame.hero::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; border-radius: 22px;
  background-image:
    radial-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,.02) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;  /* grano finísimo */
  background-position: 0 0, 1px 1px;
  mix-blend-mode: multiply;
  opacity: .35;
}

/* Títulos de grupo con ornamento */
.section-title {
  font-family: 'Cormorant Garamond', serif, cursive;
  font-size: 1.05rem;
  letter-spacing: .02em;
  color: #3e271a;
  margin: 6px 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(139,107,69,.5), rgba(139,107,69,0));
  opacity: .7;
}

/* Grids con aire */
.grid[style*="minmax(260px"] { /* tu contenedor de chips */
  row-gap: 22px !important;
}

/* Chips con relieve clásico */
.chip {
  background: linear-gradient(145deg, #eddfc7, #d7bb90);
  border: 1px solid #8b6b45;
  border-bottom-color: #6e4c25;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  color: #2b1c12;
  box-shadow:
    0 1px 0 rgba(255,255,255,.65) inset,
    0 1px 2px rgba(0,0,0,.18);
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
  backdrop-filter: blur(1px);
}
.chip:hover {
  background: linear-gradient(145deg, #f5e7cf, #dbbf95);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.75) inset,
    0 6px 14px rgba(0,0,0,.18);
  filter: saturate(110%);
}
.chip.selected {
  background: linear-gradient(145deg, #b8905a, #9e7a46);
  color: #fff;
  border-color: #6e4c25;
  box-shadow:
    0 1px 0 rgba(255,255,255,.25) inset,
    0 6px 16px rgba(66,41,21,.35);
}

/* Focus accesible y bonito */
.chip:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(245,158,11,.35),
    0 6px 14px rgba(0,0,0,.18);
}

/* Microanimación de entrada secuencial */
@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chip[data-animate] {
  opacity: 0;
  animation: chipIn .35s ease forwards;
}

/* Ajuste tipográfico del párrafo bajo el H1 */
#hero p.muted {
  line-height: 1.5;
  max-width: 62ch;
}

/* Separación vertical entre bloques de chips */
.chip-group { gap: 10px !important; }


/* Tarjetas para cada grupo de chips */
.pref-card{
  position: relative;
  border-radius: 16px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(62,39,26,.28);
  background:
    linear-gradient(180deg, rgba(247,239,229,.70), rgba(247,239,229,.52));
  /* blur sutil */
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  box-shadow:
    0 6px 18px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.35);
  transform-style: preserve-3d;
  transition: transform .28s ease, box-shadow .28s ease, background .28s ease;
  will-change: transform;
}
.pref-card::before{
  content:"";
  position:absolute; inset:8px; border-radius:12px;
  pointer-events:none;
  border:1px solid rgba(62,39,26,.25);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  opacity:.9;
}
/* Semi-rotación controlada por variables CSS */
.pref-card:hover{
  transform:
    perspective(900px)
    rotateX(var(--tiltX, 0deg))
    rotateY(var(--tiltY, 0deg))
    translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,.22);
}
/* Teclado también activa el efecto */
.pref-card:focus-within{
  outline: 2px solid rgba(245,158,11,.5);
  outline-offset: 2px;
  transform:
    perspective(900px)
    rotateX(calc(var(--tiltX, 0deg) * .6))
    rotateY(calc(var(--tiltY, 0deg) * .6))
    translateY(-1px);
}
/* Respeta usuarios con motion reducido */
@media (prefers-reduced-motion: reduce){
  .pref-card, .pref-card:hover, .pref-card:focus-within{ transition:none; transform:none !important; }
}

/* Ajustes de densidad dentro de la tarjeta */
.pref-card .chip-group{ gap:10px; }
.pref-card .section-title{ margin:2px 0 8px; }

/* === Tokens con alfa (añádelos en :root si quieres reusarlos) === */
:root{
  --beige-25: rgba(247,239,229,.25);
  --beige-35: rgba(247,239,229,.35);
  --beige-45: rgba(247,239,229,.45);
  --brown-warm-20: rgba(94,63,41,.20);   /* #5e3f29 con alfa */
  --brown-warm-30: rgba(94,63,41,.30);
  --brown-warm-50: rgba(94,63,41,.50);
}

/* === Tarjeta base con blur semitransparente === */
.pref-card{
  position: relative;
  border-radius: 16px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(255,255,255,.22);

  /* fondo translúcido + blur de lo que hay detrás */
  background:
    linear-gradient(180deg, var(--beige-45), var(--beige-35));
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);

  /* tinte cálido muy leve para integrarse con el fondo */
  box-shadow:
    0 8px 18px rgba(0,0,0,.18),
    0 0 0 1px var(--brown-warm-20) inset,
    0 1px 0 rgba(255,255,255,.35) inset;
  transform-style: preserve-3d;
  transition:
    transform .28s ease,
    box-shadow .28s ease,
    background .28s ease,
    backdrop-filter .28s ease,
    -webkit-backdrop-filter .28s ease,
    border-color .28s ease;
}

/* ornamento interior sutil */
.pref-card::before{
  content:"";
  position:absolute; inset:8px; border-radius:12px; pointer-events:none;
  border:1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  opacity:.65;
}

/* === Hover: más blur y virado marrón–beige === */
.pref-card:hover{
  /* subimos el blur y bañamos con un degradado cálido */
  background:
    linear-gradient(160deg,
      var(--beige-35) 0%,
      rgba(217,194,166,.35) 40%,   /* #d9c2a6 con alfa */
      rgba(181,137,99,.30) 100%    /* #b58963 con alfa */
    ),
    radial-gradient(60% 80% at 10% 0%, var(--brown-warm-20), transparent 60%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);

  border-color: var(--brown-warm-30);
  box-shadow:
    0 14px 28px rgba(0,0,0,.22),
    0 0 0 1px var(--brown-warm-30) inset,
    0 1px 0 rgba(255,255,255,.28) inset;

  /* si ya tienes el tilt, esto se suma */
  transform:
    perspective(900px)
    rotateX(var(--tiltX, 0deg))
    rotateY(var(--tiltY, 0deg))
    translateY(-2px);
}

/* Focus teclado: accesible y coherente */
.pref-card:focus-within{
  outline: 2px solid rgba(245,158,11,.55);
  outline-offset: 2px;
  backdrop-filter: blur(15px) saturate(122%);
  -webkit-backdrop-filter: blur(15px) saturate(122%);
}

/* Motion reducido: no mareamos */
@media (prefers-reduced-motion: reduce){
  .pref-card,
  .pref-card:hover,
  .pref-card:focus-within{
    transition: none !important;
    transform: none !important;
  }
}

/* Ajustes internos (por si te vienen bien) */
.pref-card .chip-group{ gap:10px; }
.pref-card .section-title{ margin:2px 0 8px; }




@media (max-width: 640px){
  #bookModal .book-modal-grid{
    grid-template-columns: 1fr;
  }
  #bookModal .book-modal-cover{
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }
}

/* ===== Modal de libro: versión responsive ===== */
@media (max-width: 768px){
  #bookModal .modal{
    width: 94vw;
    padding: 14px;
  }
  #bookModal .book-modal-grid{
    grid-template-columns: 1fr;          /* portada arriba, texto debajo */
    gap: 12px;
    align-items: start;
  }
  #bookModal .book-modal-cover{
    width: 100%;
    max-width: 260px;
    margin: 0 auto;                      /* centra la portada */
  }
  #bmTitle, #bmMeta { text-align: left; }
  #bmTags { justify-content: flex-start; }
  #bmSynopsis{
    text-align: justify;                 /* sinopsis justificada */
    text-justify: inter-word;
    hyphens: auto;
  }
}

/* Modal de libro: disposición vertical (portada arriba) */
#bookModal .book-modal-vertical{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#bookModal .book-modal-cover{
  display: grid; place-items: center;
}

#bookModal .book-modal-cover img{
  width: 100%;
  max-width: 260px;            /* tamaño recomendado en modal */
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

#bookModal .bm-title{
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  margin-top: 2px;
}

#bookModal .bm-meta{
  font-size: 14px;
  opacity: .9;
  margin: 4px 0 6px 0;
}

#bookModal .bm-tags{
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}

#bookModal .bm-synopsis{
  text-align: justify;          /* lo que pedías */
  text-justify: inter-word;
  hyphens: auto;
  line-height: 1.55;
  white-space: pre-line;
}

#bookModal .bm-actions{
  margin-top: 12px;
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Un pelín más compacto en móviles */
@media (max-width: 480px){
  #bookModal .modal{ padding: 14px; }
  #bookModal .bm-title{ font-size: 20px; }
  #bookModal .bm-synopsis{ line-height: 1.6; }
}

/* Títulos de las tarjetitas (mini-cards) */
.bm-works-title-small{
  font-family: "Cormorant Garamond", ui-serif, Georgia, serif;
  font-weight: 600;                     /* elegante, pero firme */
  font-size: clamp(14px, 1.2vw + .2rem, 18px);
  line-height: 1.15;
  letter-spacing: .2px;
  color: #1f1f1f;                       /* alto contraste sobre fondos claros */
  margin: 6px 0 0;

  /* 2 líneas, elipsis si se pasa */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  /* suavidad tipográfica */
  font-kerning: normal;
  font-feature-settings: "liga","clig";
}

/* Hover sutil acorde a tu dorado */
.works-item:hover .bm-works-title-small{
  color: #8b6b3e;                       /* dorado oscuro */
  transition: color .2s ease;
}

/* Accesibilidad: foco visible si el título es link */
.bm-works-title-small:focus-visible{
  outline: 2px solid #8b6b3e;
  outline-offset: 2px;
}

/* Si usas fondo oscuro en alguna card */
.works-item.is-dark .bm-works-title-small{
  color: #f3f3f3;
}


/* Overlay del modal con scroll propio */
#bookModal{
  position: fixed;
  inset: 0;
  overflow-y: auto;                /* 👈 scroll en toda la ventana del modal */
  -webkit-overflow-scrolling: touch;
  z-index: 9999;
}

/* Cuerpo del modal: permite crecer en altura (que el scroll lo lleve #bookModal) */
#bookModal .modal{
               /* 👈 dejamos que crezca */
  margin: 24px auto;
}

/* Evita que se desplace el fondo al abrir el modal */
body.modal-open{
  overflow: hidden;
}

/* (Opcional) transición del bloque expandible si aún quieres animación suave */
#bmAuthorExpand{
  overflow: hidden;
  transition: max-height .28s ease;
}

#bmAuthorToggle {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: #2a2a2a;

  background: #ffffffa6;
  border: 1px solid #d4af7a;          /* dorado suave */
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;

  transition: all 0.25s ease;
}

/* Hover dinámico */
#bmAuthorToggle:hover {
  background: linear-gradient(135deg, #b08d57, #d4af7a);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Al hacer clic (feedback activo) */
#bmAuthorToggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) inset;
}

/* Accesibilidad: foco */
#bmAuthorToggle:focus-visible {
  outline: 2px solid #d4af7a;
  outline-offset: 2px;
}

/* Estado inicial: oculto */
.author-works {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-5px);
  transition: all 0.4s ease;
}

/* Estado visible: se despliega */
.author-works.is-visible {
  max-height: 800px;   /* lo bastante grande para el contenido */
  opacity: 1;
  transform: translateY(0);
}





/* ===== Autor en modal ===== */
.bm-author{
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(62,39,26,.25);
  background: rgba(247,239,229,.55);
  backdrop-filter: blur(6px);
}


.bm-author-head{
  display: flex; gap: 12px; align-items: center; margin-bottom: 8px;
}
.bm-author-head img{
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.bm-author-meta{ display:flex; flex-direction:column; gap:4px; }
.bm-author-name{ font-weight: 700; font-size: 16px; }
.bm-author-link{
  font-size: 12px; border:1px solid rgba(62,39,26,.25);
  padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.65);
  display: inline-block; width: fit-content;
}
.bm-author-bio{
  font-size: 14px; line-height: 1.55; text-align: justify; white-space: pre-line;
}

/* ===== Carrusel de obras ===== */
.bm-works{ margin-top: 12px; }
.bm-works-title{
  font-family: 'Cormorant Garamond', serif, cursive;
  font-size: 1rem; margin: 0 0 6px 0;
  display:flex; align-items:center; gap:8px;
}
.bm-works-title::after{
  content:""; flex:1; height:1px;
  background: linear-gradient(90deg, rgba(139,107,69,.5), rgba(139,107,69,0));
  opacity:.7;
}
.bm-works-strip{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 120px;
  gap: 10px;
  overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.bm-works-item{
  scroll-snap-align: start;
  background: rgba(255,255,255,.6);
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px; padding:6px; cursor: var(--cursor-quill);
  transition: transform .12s ease, box-shadow .2s ease;
}
.bm-works-item:hover{ transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.2); }
.bm-works-cover{ width:100%; aspect-ratio:3/4; border-radius:8px; overflow:hidden; border:1px solid rgba(0,0,0,.08); }
.bm-works-cover img{ width:100%; height:100%; object-fit:cover; }
.bm-works-title-small{ font-size:12px; margin-top:4px; line-height:1.2; font-weight:600; }

@media (max-width: 480px){
  .bm-author-head img{ width: 56px; height: 56px; }
}


.bm-author-link{
  font-size:12px; border:1px solid rgba(62,39,26,.25);
  padding:4px 8px; border-radius:999px; background:rgba(255,255,255,.65);
  cursor: var(--cursor-quill);
}
.bm-author-expand{ overflow:hidden; transition:max-height .32s ease; }

/* Encabezados detectados desde texto plano de Wikipedia */
.bm-wiki-h2, .bm-wiki-h3, .bm-wiki-h4{
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  color: #3e271a;
  display: block;
}
.bm-wiki-h2{ font-size: 1.1rem;  margin: 12px 0 6px; }
.bm-wiki-h3{ font-size: 1.02rem; margin: 10px 0 4px; opacity: .95; }
.bm-wiki-h4{ font-size: .98rem;  margin: 8px 0 2px;  opacity: .9; }
#bmAuthorFullBio p{ margin: 6px 0; }


/* Scrollbars sutiles y redondeados (solo en desktop con ratón) */
@media (hover: hover) and (pointer: fine){
  :root{
    --sb-thumb: rgba(181,137,99,.45);        /* marrón cálido semitransparente */
    --sb-thumb-hover: rgba(181,137,99,.7);
    --sb-track: transparent;
  }

  /* Firefox */
  *{
    scrollbar-width: thin;                   /* “thin” = más fino */
    scrollbar-color: var(--sb-thumb) var(--sb-track);
  }

  /* Chrome / Edge / Safari */
  *::-webkit-scrollbar{ width: 8px; height: 8px; }
  *::-webkit-scrollbar-track{ background: var(--sb-track); }
  *::-webkit-scrollbar-thumb{
    background: var(--sb-thumb);
    border-radius: 999px;
    border: 2px solid transparent;          /* da efecto “pill” */
    background-clip: padding-box;
  }
  *::-webkit-scrollbar-thumb:hover{ background: var(--sb-thumb-hover); }
  *::-webkit-scrollbar-corner{ background: transparent; }
}


/* Carrusel sin barra por defecto */
.bm-works-strip{
  scrollbar-width: none;                 /* Firefox: oculta */
}
.bm-works-strip::-webkit-scrollbar{
  height: 0;                             /* WebKit: oculta */
}

/* Al pasar el ratón, muestra una fina sutil */
@media (hover: hover) and (pointer: fine){
  .bm-works-strip:hover{ scrollbar-width: thin; }
  .bm-works-strip:hover::-webkit-scrollbar{ height: 8px; }
}

/* Fading lateral en el carrusel */
.bm-works-strip{
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}

/* Fading vertical en el contenido largo del modal (bio completa) */
#bmAuthorFullBio{
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

/* Panel de usuario estilo clásico */
.user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 4px 8px;
  border-radius: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--brown-900); /* tono clásico oscuro */
}

/* Avatar redondo */
.user-panel img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Botón cerrar sesión estilo chip */
.logout-btn {
  background: var(--brown-100);  /* Beige claro */
  border: 1px solid var(--brown-300);
  color: var(--brown-900);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
}

.logout-btn:hover {
  background: var(#3e271a);
  transform: translateY(-1px);
}
/* 🎴 Tarjeta usuario minimalista */
.user-card {
  display: inline-block;
  border-radius: 16px;
  background: linear-gradient(145deg, #7b5234, #a97a55 60%, #caa27a);
  padding: 6px 12px;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Hover elegante pero sobrio */
.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* 💫 Interior */
.user-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 215, 0, 0.5); /* filo dorado */
  padding: 6px 12px;
  background: rgba(255,255,255,0.05); /* toque de vitrina sin perder legibilidad */
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
}

/* Avatar circular */
#userAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Nombre dorado legible */
#userName {
  font-weight: 600;
  font-size: 14px;
  color: #f4e3b3; /* dorado */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Botón logout en forma de chip */
.logout-btn {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255,215,0,0.4);
  background: rgba(123,82,52,0.25);
  color: #f4e3b3;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.logout-btn:hover {
  background: rgba(123,82,52,0.4);
  transform: translateY(-1px);
}

/* 📱 Responsive: pill más compacto en móvil */
@media (max-width: 480px) {
  .user-card-inner {
    gap: 6px;
    padding: 4px 8px;
  }
  #userName {
    max-width: 90px;
    font-size: 13px;
  }
  #userAvatar {
    width: 28px;
    height: 28px;
  }
  .logout-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
}



/* Tarjeta usuario minimalista */
.user-card {
  display: inline-block;
  border-radius: 999px; /* pill */
  background: linear-gradient(145deg, #7b5234, #a97a55 60%, #caa27a);
  padding: 2px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* Interior */
.user-card-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,215,0,0.4);
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
}

/* Avatar pequeño */
#userAvatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.4);
}

/* Nombre truncado */
#userName {
  font-weight: 600;
  font-size: 13px;
  color: #f4e3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px; /* menos ancho */
}

/* Botón logout compacto */
.logout-btn {
  background: none;
  border: none;
  color: #f4e3b3;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.logout-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* 📱 Responsive: en móvil solo pill */
@media (max-width: 480px) {
  .user-card {
    max-width: 200px;
  }
  #userName {
    max-width: 70px;
  }
  .logout-btn {
    font-size: 16px; /* un poco más grande el icono */
  }
}



.book-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.book-card .cover img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 8px;
}

.book-card .title {
  font-size: 16px;
  font-weight: 600;
}

.book-card .author {
  font-size: 14px;
  color: #555;
}

/* === Bloque biografía del autor === */
.author-bio-block {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.author-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #b58963;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
    width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #fffaf2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  object-fit: cover;

}

.author-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.author-summary {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
  border-radius: 10px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  text-align: justify;
  box-sizing: border-box;
}


.author-avatar:hover {
  transform: scale(1.05);
}




/* === Bloque general del autor === */
.author-bio-block {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

/* === Imagen del autor === */
.author-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #b58963;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  margin-bottom: 0;
  display: block;
  transition: transform 0.3s ease;
}
.author-avatar:hover {
  transform: scale(1.05);
}

/* === Contenedor de texto e interacciones === */
.author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* === Biografía resumen === */
.author-summary {
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
  text-align: justify;
}

/* === Botón toggle === */
.toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #b58963;
  color: #7b5234;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.toggle-btn[aria-expanded="true"] {
  transform: rotate(45deg);
}



/* === Contenido Expandido === */
.author-extra {
  display: none;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 14px;
  border-left: 4px solid #d1a97a;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  line-height: 1.5;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
.author-extra.open {
  display: block;
  opacity: 1;
  max-height: 500px; /* ajustable */
}

/* === Responsive (hasta 768px) === */
@media (max-width: 768px) {
  .author-bio-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-avatar {
    margin: 0 auto;
  }

  .author-info {
    width: 100%;
    align-items: center;
  }

  .author-summary {
    background: rgba(255, 255, 255, 0.92);
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
    text-align: justify;
  }

  .author-extra {
    width: 100%;
    text-align: justify;
  }

  .book-card {
    flex-direction: column;
    align-items: center;
  }

  .cover {
    margin-bottom: 8px;
  }

  .book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .cover {
    margin-bottom: 12px;
  }

  .author-bio-block {
    width: 100%;
    order: 2; /* Garantiza que vaya después de la portada */

}

.book-detail-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: start;
  position: relative;
}

.book-detail-card{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.book-detail-left{display:flex;flex-direction:column;gap:10px;width:170px}
.book-detail-right{flex:1;min-width:260px;display:flex;flex-direction:column;gap:10px}
.synopsis-below{font-size:14px;line-height:1.55;margin:0;max-width:170px;opacity:.95}
@media (max-width:768px){
  .book-detail-card{flex-direction:column}
  .book-detail-left{width:100%;max-width:420px}
  .synopsis-below{max-width:unset}
}


@media (max-width: 768px) {
  .book-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .author-bio-block {
    width: 100%;
  }

  .author-summary {
    width: 100%;
  }
  

  .cover {
    width: 100% !important;
    max-width: 280px;
    margin: 0 auto 16px;
  }
}

.glass-card {
  position: relative;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.25); /* fondo translúcido */
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.18); /* borde tipo iOS */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  margin-top: 20px;
  transition: all 0.3s ease;
}





/* === Botón Toggle === */
.toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #b58963;
  color: #7b5234;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
  align-self: flex-start;
}

.toggle-btn[aria-expanded="true"] {
  transform: rotate(45deg);
}



/* 👤 Avatar */
.user-card-inner img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* 📝 Nombre */
.user-card-inner span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  color: var(--brown-900);
}

/* ⛔ Botón */
.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--brown-900);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px) scale(1.02);
}


/* 🔐 Tarjeta envolvente para el botón de login */
.login-card {
  perspective: 1000px;
  transition: all 0.4s ease;
  display: inline-block;
  border-radius: 16px;
}

.login-card:hover {
  transform: rotateY(5deg) rotateX(1deg) scale(1.02);
}

/* 🎩 Botón de iniciar sesión estilo chip */
.login-btn {
  background: var(--brown-100);
  border: 1px solid var(--brown-300);
  color: var(--brown-900);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    animation: gold-glow 3s ease-in-out infinite;
  font-weight: bold;
}

.login-card:hover .login-btn {
  background: var(--brown-200); /* Oscurece al hacer hover */
  transform: translateY(-1px);
}

@keyframes glow-border {
  0% {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  }
  50% {
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  }
  100% {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  }
}




.modal-actions {
  display: flex;
  flex-wrap: wrap;         /* Permite que bajen si no caben */
  justify-content: center; /* Centra los botones */
  gap: 12px;               /* Espacio entre botones */
  margin-top: 24px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto; /* scrolla todo el overlay */
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;   /* ✅ scroll interno */
  border-radius: 8px;
  padding: 20px;
  position: relative;

  /* 🔥 añadido */
  display: flex;
  flex-direction: column;
}

.modal-title {
  margin-top: 0;      /* evita espacio arriba */
  padding-top: 0;
}



#userName {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
 color: #e7ceb1;
  font-weight: 600;
  text-transform: capitalize;
}



/* Botones premium beige-marrón con efecto sutil */
.login-btn {
  background: rgba(243, 233, 221, 0.7); /* crema translúcido */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(201, 169, 131, 0.4); /* beige-marrón fino */
  color: #3e271a; /* Marrón oscuro (texto) */
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: bold;
  padding: 9px 16px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.3);
   display: inline-flex; /* O inline-block si prefieres */
  align-items: center;
  justify-content: center;
  min-width: 130px; /* Para mantener consistencia */
}

.login-btn:hover {
  background: rgba(233, 216, 195, 0.9); /* más opaco al hover */
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* Estilo base heredado de .login-btn */
.login-btn.google {
  background: rgba(255, 255, 255, 0.6); /* Más claro que los otros */
  border: 1px solid rgba(201, 169, 131, 0.4);
  color: #3e271a;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-btn.google:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.pagination-card {
  background: var(--brown-100); /* Beige claro */
  border: 1px solid var(--brown-200);
  border-radius: 20px;
  padding: 12px 20px;
  margin-top: 32px;
  display: flex;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px) saturate(130%);
   box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.08);
}


#pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botones */
#pagination .page {
  background: var(--brown-50);
  border: 1px solid var(--brown-300);
  color: var(--brown-800);
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

#pagination .page:hover {
  background: var(--brown-200);
  transform: translateY(-1px);
}

#pagination .page.active {
  background: var(--brown-600);
  color: white;
  font-weight: bold;
  border-color: var(--brown-700);
}


.pagination-card {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.08);
}

.page.active {
  position: relative;
  overflow: hidden;
}

.page.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brown-700);
  animation: inkFlow 0.4s ease forwards;
  z-index: -1;
  border-radius: 50%;
  transform: scale(0);
}

@keyframes inkFlow {
  to {
    transform: scale(4);
    opacity: 0.2;
  }
}

.page.active {
  position: relative;
  overflow: hidden;
}

.page.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brown-700);
  animation: inkFlow 0.4s ease forwards;
  z-index: -1;
  border-radius: 50%;
  transform: scale(0);
}

@keyframes inkFlow {
  to {
    transform: scale(4);
    opacity: 0.2;
  }
}

.page:hover {
  transform: rotateX(5deg);
}

.book-grid.fade {
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
}


.glass-card {
  background: rgba(255, 255, 255, 0.15); /* Blanco translúcido */
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
}

.glass-card:hover {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}


.glass-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  width: 100%;
  box-sizing: border-box;
}


.glass-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
}

/* ==================================================
   PALETA DE COLORES Y VARIABLES
================================================== */
:root {
  --brown-50: #faf4ed;
  --brown-100: #f3e9dd;
  --brown-200: #e8d9c5;
  --brown-300: #d9c2a6;
  --brown-400: #c9a983;
  --brown-500: #b58963;
  --brown-600: #996b47;
  --brown-700: #7b5234;
  --brown-800: #5e3f29;
  --brown-900: #3e271a;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --ink: #1c140f;
  --muted: rgba(0, 0, 0, .76);
  --font-title: "Cormorant Garamond", serif;
  --font-text: "Source Serif 4", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --beige-25: rgba(247,239,229,.25);
  --beige-35: rgba(247,239,229,.35);
  --beige-45: rgba(247,239,229,.45);
  --brown-warm-20: rgba(94,63,41,.20);
  --brown-warm-30: rgba(94,63,41,.30);
  --brown-warm-50: rgba(94,63,41,.50);
}

/* ==================================================
   HERO MOBILE — PANTALLA INICIAL
================================================== */
.title-block {
  margin-top: 20px;
  padding: 0 16px;
  text-align: center;
  animation: fadeInDown 0.6s ease-in-out;
}

.title-block h1 {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--brown-800);
  margin-bottom: 8px;
  line-height: 1.3;
}

.title-block p {
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.chip-block {
  background: var(--brown-50);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  margin-bottom: 20px;
}

.chip-block h3 {
  font-family: var(--font-title);
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--brown-200);
  padding-bottom: 4px;
  color: var(--brown-800);
  display: inline-block;
}

.chip-block {
  animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-ui);
  background: var(--brown-100);
  color: var(--brown-800);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--brown-200);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
}

.chip.selected {
  background: var(--brown-500);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}


.chip:hover,
.chip:focus {
  background: var(--brown-300);
  transform: scale(1.05);
}

.chip.active {
  background-color: var(--brown-300);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--brown-500);
}


.cta-recommend {
  margin: 16px auto 0;
  text-align: center;
}

.cta-recommend button {
  background: var(--brown-700);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 20px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
}

.cta-recommend button:hover {
  background: var(--brown-800);
  transform: translateY(-2px);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#btnTextRecommend {
  flex: 1;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #b08d57, #d4af7a); /* degradado dorado */
  color: #2B1D12;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  transition: all 0.3s ease;
}

#btnTextRecommend:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#btnTextRecommend.is-loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}


/* ==================================================
   VISUALIZACIÓN DE LIBROS — ESTILO MÓVIL PREMIUM
================================================== */

.result-card {
  background: linear-gradient(180deg, var(--brown-100), var(--brown-50));
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 16px 14px;
  margin: 0 auto 16px;
  max-width: 360px;
  animation: fadeInUpSmooth 0.4s ease-out;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.result-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.result-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 14px;
  transition: filter 0.2s ease;
}

.result-card img:hover {
  filter: brightness(1.05);
}

.result-card h4 {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--ink);
  text-align: center;
  margin: 0 0 6px;
}

.result-card p {
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--brown-700);
  text-align: center;
  margin: 0;
}

@media (max-width: 480px) {
  .result-card {
    padding: 14px 10px;
    border-radius: 16px;
  }

  .result-card h4 {
    font-size: 16px;
  }

  .result-card p {
    font-size: 13px;
    line-height: 1.4;
  }
}

.search-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px; /* mejora la separación en responsive */
}
@media (min-width: 480px) {
  .search-buttons {
    flex-direction: row;
    justify-content: center;
  }
}


.search-block {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.search-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}

.search-label .subtle {
  font-weight: normal;
  font-style: italic;
  color: rgba(0, 0, 0, 0.45);
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Cormorant Garamond', serif;
  border: 1px solid rgba(62, 39, 26, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  resize: none;
  transition: box-shadow 0.2s ease;
  margin-top: 6px;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--brown-300);
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}

.extracted-text {
  font-size: 12px;
  flex: 1 1 auto;
  min-width: 100%;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (min-width: 420px) {
  .extracted-text {
    min-width: auto;
    flex: 1;
  }

  .btn-group {
    flex-wrap: nowrap;
  }
}


input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  max-width: 400px;
  margin: auto;
}

.main-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* === Unifica estilo visual con tarjetas de chips === */
.filter-card {
  background: linear-gradient(to bottom, #fdf7ed, #f3e9dd);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* === Efecto de semirotación al pasar el ratón === */
.tilt-card:hover {
  transform: perspective(800px) rotateX(1.5deg) rotateY(1.5deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.search-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.6;
  color: #3e271a;

  background-image: linear-gradient(to bottom right, #fdf7ed, #e8d9c5);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-origin: border-box;

  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  border-radius: 12px;
  display: block;
}



.search-input::placeholder {
  color: rgba(60, 40, 20, 0.4);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

.search-input:focus {
  box-shadow: inset 0 0 5px rgba(0,0,0,0.06);
  transition: box-shadow 0.8s ease;
}


/* === Modal compacto (menos alto de pantalla) === */
.modal-compact{
  width: min(860px, 92vw);
  max-height: 84vh;              /* ⬅️ ocupa menos vertical */
  overflow: hidden;              /* el scroll vive en la tarjeta */
  position: relative;
}

/* Layout vertical del modal de libro (ya lo usabas) */
#bookModal .book-modal-vertical{
  display: flex; flex-direction: column; gap: 12px;
}

/* ===== Tarjeta desplazable SOLO para el contenido largo ===== */
.modal-scroll-card{
  position: relative;
  margin-top: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(62,39,26,.22);
  background: rgba(255,255,255,.58);
  max-height: 50vh;                /* ⬅️ zona desplazable controlada */
  overflow: auto;                  /* ⬅️ aquí vive el scroll */
  box-shadow: 0 6px 16px rgba(0,0,0,.12) inset;
  /* Difuminado universal mediante máscaras */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 14px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
/* Fades visibles como fallback (sticky, no bloquean clics) */
.modal-scroll-card::before,
.modal-scroll-card::after{
  content:"";
  position: sticky;
  left: 0; right: 0;
  height: 16px;
  pointer-events: none;
  z-index: 1;
}
.modal-scroll-card::before{
  top: 0;
  background: linear-gradient(to bottom, rgba(247,239,229,.95), rgba(247,239,229,0));
}
.modal-scroll-card::after{
  bottom: 0;
  background: linear-gradient(to top, rgba(247,239,229,.95), rgba(247,239,229,0));
}
/* Más alto en móvil para respirar */
@media (max-width:640px){
  .modal-scroll-card{ max-height: 60vh; }
}

/* ===== Botón de cerrar “premium” ===== */
.modal { position: relative; }
.modal-close{
  position: absolute;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  color: #3e271a;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.modal-close:hover{
  background: rgba(192,57,43,.92);  /* rojo elegante */
  color: #fff;
  transform: scale(1.08) rotate(-8deg);
  box-shadow: 0 12px 28px rgba(192,57,43,.35);
}
.modal-close:focus-visible{
  outline: 2px solid #c0392b;
  outline-offset: 2px;
}

/* ===== Bloqueo de scroll global cuando hay modal abierto ===== */
html.no-scroll, body.no-scroll { overflow: hidden; }


#bookModal .bm-synopsis,
#bookModal .author-bio-block {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 17px;         /* un poco mayor */
  line-height: 1.65;       /* más aire entre líneas */
  color: #2a1e14;          /* tono marrón-negro, más cálido */
}
 #bookModal .bm-synopsis,
#bookModal .author-bio-block {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 17px;         /* un poco mayor */
  line-height: 1.65;       /* más aire entre líneas */
  color: #2a1e14;          /* tono marrón-negro, más cálido */
}

/* === Capitular "editorial" en la sinopsis del modal === */
#bookModal #bmSynopsis::first-letter,
#bookModal .bm-synopsis::first-letter,         /* por si usas la clase */
#bookModal .bm-synopsis p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  color: #3e271a;

  /* Fallback clásico */
  float: left;
  font-size: 3.2rem;
  line-height: .9;
  margin: 2px 10px 0 0;
  padding: 2px 6px 0 2px;

  /* Soporte moderno (Safari y algunos Chromium) */
  initial-letter: 2;
  -webkit-initial-letter: 2;

  /* Detalle sutil de “tinta” */
  text-shadow: 0 1px 0 rgba(0,0,0,.06);
}

/* Ajuste en móviles */
@media (max-width: 480px){
  #bookModal #bmSynopsis::first-letter,
  #bookModal .bm-synopsis::first-letter,
  #bookModal .bm-synopsis p:first-of-type::first-letter {
    font-size: 2.6rem;
    margin-right: 8px;
  }
}

/* Título del libro en el modal */
#bookModal #bmTitle {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #2a1e14;
}

/* Autor del libro en el modal */
#bookModal #bmMeta {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 15px;
  font-style: italic;
  color: #4a3b2c;
  margin-top: 4px;
}


/* Forzamos tipografía Cormorant Garamond en toda la bio del autor */
#bookModal .author-bio-block,
#bookModal .author-bio-block * {
  font-family: 'Cormorant Garamond', serif !important;
  color: #2a1e14 !important;
}

/* Nombre del autor */
#bookModal .author-bio-block strong,
#bookModal .author-bio-block .author-name {
  font-weight: 700 !important;
  font-size: 16px !important;
}

/* Texto biográfico */
#bookModal .author-bio-block .author-extra {
  font-style: italic !important;
  font-size: 15px !important;
}


body.modal-open {
  overflow: hidden; /* Desactiva scroll solo con modal abierto */
}


/* Bloqueo de scroll SOLO con modal abierto */
body.modal-open { overflow: hidden; }

/* Asegura scroll global y del modal */
html, body { min-height: 100%; overflow-y: auto; }
.modal-overlay { overflow-y: auto; align-items: flex-start; padding: 16px; }
.modal { max-height: calc(100vh - 32px); overflow: auto; -webkit-overflow-scrolling: touch; }

/* ==== Tarjeta de frases (glass beige + avatar) ==== */
.quote-mount { margin-top: 14px; }

.quote-section {
  display: block;
  max-width: 760px;
  margin: 0 auto;
}

.quote-card {
  position: relative;
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.55), rgba(240,225,203,.35) 60%, rgba(226,206,182,.32)),
    linear-gradient(180deg, rgba(245,232,214,.86), rgba(229,209,185,.78));
  box-shadow:
    0 14px 34px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter: blur(9px);
  border: 1px solid rgba(62,39,26,.18);
}

.quote-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: start;
}

.quote-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.5);
  border: 1px solid rgba(62,39,26,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(250,244,236,.9));
  display: grid; place-items: center;
  user-select: none;
}
.quote-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.quote-avatar-inits {
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
  color: #3e271a;
}

.quote-header {
  display: flex; align-items: baseline; gap: 8px;
  min-height: 24px;
}
.quote-author {
  font-weight: 700; color: #3e271a; font-size: 16px;
}
.quote-title {
  font-size: 13px; color: rgba(62,39,26,.75);
  border-left: 1px solid rgba(62,39,26,.2); padding-left: 8px;
}

.quote-text {
  grid-column: 1 / -1;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  line-height: 1.55;
  color: #3e271a;
  margin: 6px 0 2px;
}

.quote-why {
  grid-column: 2;
  font-size: 13px;
  color: rgba(62,39,26,.85);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(62,39,26,.16);
  padding: 8px 10px;
  border-radius: 10px;
  margin-top: 6px;
}

.quote-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.quote-btn {
  appearance: none;
  border: 1px solid rgba(62,39,26,.22);
  background: rgba(255,255,255,.75);
  border-radius: 10px;
  padding: 6px 9px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.quote-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.92); }
.quote-btn:active { transform: translateY(0); }

/* Transiciones */
.quote-fade-enter { opacity: 0; transform: translateY(6px); }
.quote-fade-enter-active {
  opacity: 1; transform: translateY(0);
  transition: opacity .28s ease, transform .28s ease;
}
.quote-fade-exit { opacity: 1; transform: translateY(0); }
.quote-fade-exit-active {
  opacity: 0; transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease;
}

@media (max-width: 768px) {
  .quote-card { padding: 14px; }
  .quote-avatar { width: 52px; height: 52px; }
  .quote-text { font-size: 20px; }
  .quote-title { display: none; } /* compacta en móvil */
}


/* Avatar de cita: imagen + fallback de iniciales */
.quote-header{
  display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:12px;
}
.quote-author-img{
  width:42px; height:42px; border-radius:50%; object-fit:cover;
  background:#fff; border:2px solid rgba(255,255,255,.7);
  box-shadow:0 2px 6px rgba(0,0,0,.25);
  display:block;
}
.quote-avatar-fallback{
  width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(250,244,236,.9));
  border:2px solid rgba(255,255,255,.7);
  box-shadow:0 2px 6px rgba(0,0,0,.25);
  font-weight:700; font-size:14px; color:#3e271a; letter-spacing:.3px;
}


/* Avatar estable y con transición suave del <img> */
.quote-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.04);
}

.quote-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  /* El JS ya aplica opacity + transition, pero no molesta reforzarlo aquí */
  transition: opacity 280ms ease;
}

/* Iniciales */
.quote-avatar-inits {
  font-weight: 600;
  font-size: 18px;
  color: rgba(58,42,29,.9);
}

/* Transiciones de la tarjeta */
.quote-fade-exit       { opacity: 1; transform: translateY(0); }
.quote-fade-exit-active{ opacity: 0; transform: translateY(6px); transition: opacity .22s ease, transform .22s ease; }
.quote-fade-enter      { opacity: 0; transform: translateY(-6px); }
.quote-fade-enter-active{ opacity: 1; transform: translateY(0); transition: opacity .3s ease, transform .3s ease; }


/* ===== Libris.app — Tarjeta de citas a juego con el layout (beige/marrón/dorado) ===== */

/* Caja principal (glass cálido + borde sutil + sombra profunda) */
.quote-card{
  --bg1: #F2E8D8;  /* beige claro */
  --bg2: #DEC9AE;  /* beige tostado */
  --stroke: rgba(88, 62, 40, .22); /* marrón tenue */
  --accent: #C9A66B; /* dorado suave */
  --text: #2B1D12;   /* café oscuro */

  background:
    radial-gradient(140% 160% at 12% 0%, rgba(255,255,255,.65), rgba(240,225,203,.36) 60%, rgba(226,206,182,.32)),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  border: 1px solid var(--stroke);
  box-shadow:
    0 18px 40px rgba(0,0,0,.15),
    0 6px 14px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-radius: 18px;
  padding: 20px 18px;
}

/* Layout centrado, como en la maqueta */
.quote-inner{
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:12px;
}

/* Avatar centrado con aro dorado */
.quote-avatar{
  width: 96px; height: 96px; border-radius:50%;
  overflow:hidden; display:grid; place-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(245,235,215,.92));
  border: 2px solid color-mix(in oklab, var(--accent) 70%, #fff 30%);
  box-shadow: 0 8px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.6);
}
.quote-avatar img{ width:100%; height:100%; object-fit:cover; border-radius:inherit; }

/* Nombre + línea ornamental centrada */
.quote-header{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.quote-author{
  position:relative; padding-top:10px; margin-top:2px;
  font: 700 18px/1.1 "Source Serif 4","Alice","Cormorant Garamond",serif;
  color: var(--text);
}
.quote-author::before{
  content:""; position:absolute; top:0; left:50%;
  width:72px; height:2px; transform:translateX(-50%);
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 65%, #6b4b2d 35%), transparent);
  border-radius:2px;
}
.quote-title{
  font-size: 13px; color: rgba(62,39,26,.70);
  padding-top: 1px; font-style: italic;
}

/* Frase protagonista, tono café y comillas bronce */
.quote-text{
  margin: 8px 0 2px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px; line-height: 1.6; font-weight: 500;
  color: #3A2A1D;
  quotes: "“" "”" "‘" "’";
}
.quote-text::before{ content: open-quote; color: var(--accent); }
.quote-text::after { content: close-quote; color: var(--accent); }

/* Caja “por qué leerlo” a juego (si se muestra) */
.quote-why{
  width: min(640px, 100%);
  font-size: 14px; line-height: 1.55; color:#3a2a1d;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(88,62,40,.18);
  padding: 10px 14px; border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}

/* Botones discretos arriba a la derecha, estilo pill */
.quote-controls{ position:absolute; top:12px; right:12px; display:flex; gap:6px; }
.quote-btn{
  border: 1px solid rgba(88,62,40,.24);
  background: rgba(255,255,255,.86);
  color: #3a2a1d;
  border-radius: 10px; padding: 6px 9px;
  font-size: 14px; line-height:1;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: background .18s ease, transform .12s ease;
}
.quote-btn:hover{ background: rgba(255,255,255,.96); transform: translateY(-1px); }
.quote-btn:active{ transform: translateY(0); }

/* Transiciones sutiles */
.quote-fade-enter{ opacity:0; transform: translateY(-6px); }
.quote-fade-enter-active{ opacity:1; transform:translateY(0); transition: opacity .28s, transform .28s; }
.quote-fade-exit{ opacity:1; transform: translateY(0); }
.quote-fade-exit-active{ opacity:0; transform: translateY(6px); transition: opacity .22s, transform .22s; }

/* Responsive coherente con el layout */
@media (max-width: 740px){
  .quote-card{ padding: 16px; }
  .quote-avatar{ width: 88px; height: 88px; }
  .quote-text{ font-size: 20px; }
  .quote-title{ display:none; } /* compacta como en tu captura */
}

/* ===========================
   Medallones dorados — versión PRO
   =========================== */

:root{
  --gold-1:#d4af37;      /* base */
  --gold-2:#b8891c;      /* sombra */
  --gold-3:#ffe7a3;      /* brillo */
  --gold-4:#8b6f23;      /* profundidad */
  --ivory:#fff8e1;
  --coffee:#2b1d12;
}

/* contenedor */
.quote-controls{
  position:absolute; top:12px; right:12px;
  display:flex; gap:10px; z-index:3;
}
@media (max-width:740px){
  .quote-controls{ position:static; justify-content:center; margin-top:10px; }
}

/* botón base */
.quote-btn{
  --size:40px;
  inline-size:var(--size); block-size:var(--size);
  border-radius:50%;
  display:grid; place-items:center;
  border:0; cursor:pointer;
  color:var(--ivory);
  background:
    radial-gradient(120% 140% at 25% 20%, var(--gold-3), var(--gold-1) 42%, var(--gold-2) 72%, var(--gold-4) 100%);
  box-shadow:
    0 10px 20px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -2px 8px rgba(0,0,0,.25);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  position:relative; isolation:isolate;
  -webkit-tap-highlight-color: transparent;
}

/* aro interior (biseles) */
.quote-btn::before{
  content:""; position:absolute; inset:3px; border-radius:inherit;
  background:
    radial-gradient(100% 100% at 50% 30%, rgba(255,255,255,.65), transparent 55%),
    radial-gradient(120% 160% at 70% 80%, rgba(0,0,0,.18), transparent 55%);
  mix-blend-mode:soft-light; pointer-events:none;
}

/* brillo tipo “specular” */
.quote-btn::after{
  content:""; position:absolute; inset:0; border-radius:inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 55%);
  transform:translateY(-2px);
  opacity:.6; pointer-events:none;
}

/* iconografía: usa texto ‹ › o un SVG dentro */
.quote-btn > svg{ inline-size:18px; block-size:18px; }

/* hover/active */
.quote-btn:hover{
  transform:translateY(-1px) scale(1.06);
  box-shadow:
    0 14px 26px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.65),
    inset 0 -2px 10px rgba(0,0,0,.28);
  filter:saturate(1.05) contrast(1.03);
}
.quote-btn:active{
  transform:translateY(0) scale(.97);
  box-shadow:
    0 6px 14px rgba(0,0,0,.35),
    inset 0 2px 6px rgba(0,0,0,.35);
}

/* focus accesible */
.quote-btn:focus-visible{
  outline:none;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px color-mix(in oklab, var(--gold-1) 70%, #fff 30%),
    0 10px 20px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.55);
}

/* disabled */
.quote-btn[disabled]{
  cursor:not-allowed; opacity:.55; filter:grayscale(.25);
  box-shadow: inset 0 0 0 999px rgba(255,255,255,.08), 0 0 0 0 transparent;
}

/* tamaños */
.quote-btn--sm{ --size:34px; }
.quote-btn--lg{ --size:48px; }

/* variante ghost (para botones secundarios en la tarjeta) */
.quote-btn--ghost{
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.65));
  color:var(--coffee);
  box-shadow:0 6px 14px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.8);
  border:1px solid rgba(88,62,40,.22);
}
.quote-btn--ghost:hover{
  transform:translateY(-1px);
  filter:none;
  box-shadow:0 10px 18px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.9);
}

/* loading (por si bloqueas spam de clics) */
.quote-btn.is-loading{
  pointer-events:none;
}
.quote-btn.is-loading::after{
  content:""; position:absolute; inset:6px; border-radius:inherit;
  border:2px solid rgba(255,255,255,.7);
  border-right-color:transparent;
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(1turn)}}

/* Respeta reduced motion */
@media (prefers-reduced-motion: reduce){
  .quote-btn{ transition:none; }
}
 
/* =========================================
   Libris.app — Tarjeta de cita (v2 premium)
   ========================================= */
:root{
  --bg1:#F3E9D8;        /* beige base */
  --bg2:#E4D3BA;        /* beige tostado */
  --stroke:rgba(88,62,40,.22);
  --text:#2B1D12;       /* café */
  --muted:#6b4b2d;      /* café claro */
  --gold:#d4af37;
  --gold-deep:#8b6f23;
  --beige:#fff8e6;
  --brown:#6a4a2f;
}

/* CARD */
.quote-card{
  position:relative;
  background:
    radial-gradient(140% 160% at 12% 0%, rgba(255,255,255,.68), rgba(240,225,203,.36) 60%, rgba(226,206,182,.32)),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  border:1px solid var(--stroke);
  border-radius:18px;
  padding:22px 18px 18px;
  box-shadow:
    0 18px 40px rgba(0,0,0,.14),
    0 6px 14px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter:blur(10px);
  color:var(--text);
}
.quote-inner{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}

/* AVATAR 100% REDONDO (a prueba de óvalos) */
.quote-avatar{
  inline-size:96px; block-size:96px;
  border-radius:50%;
  overflow:hidden;
  display:grid; place-items:center;
  background:linear-gradient(180deg,#fff, #f5ead8);
  border:2px solid color-mix(in oklab, var(--gold) 70%, #fff 30%);
  box-shadow:0 8px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.6);
}
.quote-avatar img{
  inline-size:100%; block-size:100%;
  object-fit:cover;             /* rellena sin deformar */
  aspect-ratio:1 / 1;           /* fuerza cuadrado */
  border-radius:50%;            /* máscara circular real */
  image-rendering:auto;         /* suaviza bordes */
}

/* TITULAR */
.quote-header{display:flex;flex-direction:column;align-items:center;gap:6px}
.quote-author{
  position:relative;padding-top:10px;margin-top:2px;
  font:700 18px/1.1 "Source Serif 4","Alice","Cormorant Garamond",serif;
}
.quote-author::before{
  content:""; position:absolute; top:0; left:50%;
  inline-size:74px; block-size:2px; transform:translateX(-50%);
  background:linear-gradient(90deg, transparent, color-mix(in oklab, var(--gold) 65%, var(--muted) 35%), transparent);
  border-radius:2px;
}
.quote-title{font-size:13px; color:rgba(62,39,26,.68); font-style:italic}

/* TEXTO */
.quote-text{
  margin:10px 0 2px;
  font-family:"Cormorant Garamond",serif;
  font-size:22px; line-height:1.6; font-weight:500; color:#3A2A1D;
  quotes:"“" "”" "‘" "’";
}
.quote-text::before{content:open-quote; color:var(--gold)}
.quote-text::after {content:close-quote; color:var(--gold)}

/* WHY (opcional) */
.quote-why{
  width:min(640px,100%);
  font-size:14px; line-height:1.55; color:#3a2a1d;
  background:rgba(255,255,255,.62);
  border:1px solid rgba(88,62,40,.18);
  padding:10px 14px; border-radius:12px;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.05);
}

/* CONTROLES (medallones) */
.quote-controls{
  position:absolute; top:12px; right:12px; display:flex; gap:10px; z-index:2;
}
@media (max-width:740px){
  .quote-controls{ position:static; justify-content:center; margin-top:6px }
}

/* Medallón base (dorado) */
.quote-btn{
  --size:40px;
  inline-size:var(--size); block-size:var(--size);
  border-radius:50%; border:0; cursor:pointer; display:grid; place-items:center;
  color:#fffdf0; font-weight:700; font-size:18px; line-height:1;
  background:
    radial-gradient(120% 140% at 25% 20%, #ffe7a3, var(--gold) 45%, #b8891c 72%, var(--gold-deep) 100%);
  box-shadow:0 10px 20px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 8px rgba(0,0,0,.22);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
  -webkit-tap-highlight-color:transparent;
  position:relative; isolation:isolate;
}

/* — Hover marrón/beige (pedido) — */
.quote-btn:hover{
  background: radial-gradient(120% 140% at 25% 20%, var(--beige) 15%, #edbb76 45%, #a3764d 75%, var(--brown) 100%);
  box-shadow:0 14px 26px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.65), inset 0 -3px 10px rgba(0,0,0,.28);
  transform:translateY(-1px) scale(1.06);
  filter:saturate(1.02);
}

/* Active (hundido) */
.quote-btn:active{
  transform:scale(.96);
  box-shadow:0 6px 14px rgba(0,0,0,.34), inset 0 2px 6px rgba(0,0,0,.34);
}

/* Focus accesible */
.quote-btn:focus-visible{
  outline:none;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px color-mix(in oklab, var(--gold) 70%, #fff 30%),
    0 10px 20px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.55);
}

/* Tamaños y variantes */
.quote-btn--sm{ --size:34px }
.quote-btn--lg{ --size:48px }
.quote-btn--ghost{
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
  color:var(--text);
  border:1px solid var(--stroke);
  box-shadow:0 6px 14px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.8);
}

/* Animaciones de contenido */
.quote-fade-enter{ opacity:0; transform:translateY(-6px) }
.quote-fade-enter-active{ opacity:1; transform:translateY(0); transition:opacity .28s, transform .28s }
.quote-fade-exit{ opacity:1; transform:translateY(0) }
.quote-fade-exit-active{ opacity:0; transform:translateY(6px); transition:opacity .22s, transform .22s }

@media (max-width:740px){
  .quote-card{ padding:18px }
  .quote-avatar{ inline-size:88px; block-size:88px }
  .quote-text{ font-size:20px }
  .quote-title{ display:none }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .quote-btn{ transition:none }
  .quote-fade-enter,
  .quote-fade-enter-active,
  .quote-fade-exit,
  .quote-fade-exit-active{ opacity:1; transform:none; transition:none }
}


/* ====== Caja de texto elegante para búsqueda ====== */
#freeText {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  font-family: "Inter", "Source Serif 4", serif;
  color: #3a2a1a; /* marrón oscuro */
  background: #fdfaf6; /* beige cálido */
  border: 1px solid rgba(88, 62, 40, .25); /* marrón tenue */
  border-radius: 10px;
  resize: vertical;
  transition: all 0.25s ease;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}

#freeText::placeholder {
  color: rgba(88, 62, 40, .55);
  font-style: italic;
}

#freeText:focus {
  border-color: #c9a66b; /* dorado suave */
  box-shadow: 0 0 0 3px rgba(201,166,107,.25);
  background: #fffdfa;
}

/* ====== Botones base ====== */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  outline: none;
  text-decoration: none;
  min-width: 140px;
}

/* Botón secundario */
.btn {
  background: #f7f3ed; /* beige claro */
  color: #5a4634;      /* marrón */
  border: 1px solid rgba(88, 62, 40, 0.25);
}

.btn:hover {
  background: #ede4d8;
  border-color: rgba(88, 62, 40, 0.4);
}

/* Botón primario */
.btn-primary {
  background: #c9a66b; /* dorado suave */
  color: #fff;
  border: 1px solid #b58f4f;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn-primary:hover {
  background: #b58f4f; /* dorado más intenso */
  border-color: #9c7a3d;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Accesibilidad: foco visible */
.btn:focus,
.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(201,166,107,0.4);
}


/* ====== Caja de texto premium ====== */
#freeText {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  font-family: "Source Serif 4", Georgia, serif; /* un toque editorial */
  color: #3b2a1c;           /* marrón oscuro */
  background: linear-gradient(135deg, #fdfaf6 0%, #f8f3eb 100%); /* efecto papel */
  border: 1px solid rgba(88, 62, 40, 0.25); /* línea principal */
  border-radius: 12px;
  resize: vertical;
  outline: none;

  /* sutil relieve interior */
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06),
              inset 0 -1px 2px rgba(255,255,255,0.5);
  transition: all 0.25s ease;
}

#freeText::placeholder {
  color: rgba(88, 62, 40, 0.55);
  font-style: italic;
  letter-spacing: 0.3px;
}

#freeText:focus {
  border-color: #c9a66b; /* dorado suave */
  box-shadow: 
    0 0 0 3px rgba(201,166,107,0.25), /* halo dorado */
    inset 0 1px 3px rgba(0,0,0,0.08);
  background: #fffdfa;
  transform: scale(1.01); /* sutil “zoom in” al foco */
}

/* ====== Botones premium ====== */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

/* Estilo secundario */
.btn {
  background: linear-gradient(135deg, #faf6f0, #f2e8d8);
  color: #4b3727;
  border: 1px solid rgba(88,62,40,0.25);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), inset 0 1px 1px rgba(255,255,255,0.6);
}
.btn:hover {
  background: linear-gradient(135deg, #f2e8d8, #e7dcc9);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.12);
}

/* Estilo primario */
.btn-primary {
  background: linear-gradient(135deg, #d4b277, #c9a66b);
  color: #fff;
  border: 1px solid #b58f4f;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #c19a5c, #b58f4f);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.18);
}

/* Foco accesible */
.btn:focus,
.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(201,166,107,0.35);
}

/* Efecto “ripple” sutil al hacer clic */
.btn::after,
.btn-primary::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.6s ease;
  opacity: 0;
}
.btn:active::after,
.btn-primary:active::after {
  width: 220%;
  height: 220%;
  opacity: 0;
  transition: 0s;
}

/* Bloquear el resize del textarea */
#freeText {
  resize: none;        /* quita el manejador de redimensionado */
  min-height: 120px;   /* alto cómodo por defecto */
  max-height: 220px;   /* evita que crezca demasiado */
  overflow: auto;      /* muestra scroll si el texto excede */
}

#freeText {
    width: 100%;
    min-height: 100px;
    padding: 14px 16px;
    font-size: 20px;
    line-height: 1.55;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #3b2a1c;
    background: linear-gradient(135deg, #fdfaf6 0%, #f8f3eb 100%);
    border: 1px solid rgba(88, 62, 40, 0.25);
    border-radius: 12px;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 -1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.25s 
ease;
}

/* ==== Botón de login premium ==== */
.login-btn {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px; /* forma medallón */
  background: linear-gradient(145deg, #f5e6d3, #d8b890); /* beige → dorado suave */
  color: #3b2b1a;
  border: 1px solid rgba(90, 65, 40, 0.4);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.6), /* brillo interno */
    inset 0 -2px 4px rgba(0,0,0,0.15),    /* sombra interna */
    0 4px 10px rgba(0,0,0,0.25);          /* sombra exterior */
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover: más brillo */
.login-btn:hover {
  background: linear-gradient(145deg, #f8eede, #e2c9a7);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.7),
    inset 0 -2px 4px rgba(0,0,0,0.1),
    0 6px 14px rgba(0,0,0,0.3);
}

/* Activo: efecto pulsado */
.login-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.15);
}



/* ===== Modal Login — Premium bronce/madera refinado ===== */
#loginModal.modal-overlay{
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
  backdrop-filter: blur(8px);
}
#loginModal.modal-overlay.show{ opacity:1; visibility:visible; }

/* Panel */
#loginModal .modal{
  max-width: 520px;
  border-radius: 22px;
  padding: 28px 26px 24px;
  color:#2d1b0d;
  background:
    linear-gradient(180deg,#ead1b1 0%,#c9986b 44%,#8e5f3f 100%);
  border:1px solid rgba(80,50,30,.32);
  box-shadow:
    0 18px 42px rgba(58,35,20,.48),
    inset 0 1px 0 rgba(255,255,255,.22);
  /* anim solo CSS */
  opacity:0; transform: translateY(18px) scale(.985);
  transition: opacity .35s ease, transform .35s ease;
}
#loginModal.show .modal{ opacity:1; transform: translateY(0) scale(1); }

/* Cerrar */
#loginModal .modal-close{
  position:absolute; top:14px; right:14px;
  width:36px; height:36px; border-radius:999px;
  border:1px solid rgba(80,50,30,.28);
  background: linear-gradient(180deg,#f7efe5,#e8d7c5);
  color:#3e2a1a; display:grid; place-items:center;
  box-shadow: 0 8px 18px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
#loginModal .modal-close:hover{ transform: translateY(-1px); filter: saturate(1.03); }
#loginModal .modal-close:active{ transform: translateY(0); box-shadow: inset 0 2px 4px rgba(0,0,0,.2); }

/* Título */
#loginModal .modal-title{
  margin: 2px 4px 18px;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px; line-height:1.15; font-weight:700;
  background: linear-gradient(180deg,#3b2618,#5a3a26);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  letter-spacing:.3px; text-align:center;
}

/* Form */
#loginModal .field{ display:flex; flex-direction:column; gap:6px; }
#loginModal .field + .field{ margin-top:12px; }

#loginModal .field label{
  font-size:12px; letter-spacing:.06em; text-transform:uppercase;
  color:#4a2f1e; font-weight:700;
}

/* Inputs */
#loginModal input{
  width:100%;
  height:44px;
  border-radius:14px;
  padding: 0 14px;
  border:1px solid rgba(120,80,40,.34);
  background: linear-gradient(180deg,#fffdf9,#f6efe7);
  color:#2d1b0d; font-size:15px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.10);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#loginModal input::placeholder{ color: rgba(62,39,26,.55); }
#loginModal input:focus{
  border-color:#b88657;
  box-shadow: 0 0 0 3px rgba(184,134,87,.28), inset 0 1px 3px rgba(0,0,0,.08);
  outline:none;
}
/* estado error (usa .is-error en el input cuando toque) */
#loginModal input.is-error{
  border-color:#b94a48;
  box-shadow: 0 0 0 3px rgba(185,74,72,.2), inset 0 1px 3px rgba(0,0,0,.08);
}

/* Acciones */
#loginModal .modal-actions{
  display:flex; flex-direction:column; gap:12px;
  margin-top:18px;
}

/* Botón base */
#loginModal .login-btn{
  height:50px; border-radius:16px;
  padding:0 16px;
  font-weight:700; font-size:15px; letter-spacing:.01em;
  border:1px solid rgba(90,60,30,.36);
  background: linear-gradient(180deg,#d6ad7a 0%, #b98657 100%);
  color:#fffef9;
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
  box-shadow: 0 10px 22px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
#loginModal .login-btn:hover{
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 14px 26px rgba(0,0,0,.22);
}
#loginModal .login-btn:active{
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.25);
}


/* === CHAT shakesIA === */
.chat-widget{
  position:fixed; right:20px; bottom:20px; z-index:9999;
  font-family: "Source Serif 4", serif;
}
.chat-toggle{
  background: linear-gradient(145deg, #7b5234, #c6a27d);
  color:#fff8e6; border:none; border-radius:999px;
  padding:10px 16px; font-size:14px; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.25); transition:transform .2s, box-shadow .2s;
}
.chat-toggle:hover{ transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.35); }

.chat-box{
  width:320px; height:460px; margin-bottom:10px;
  background: rgba(255,248,230,.96);
  border:2px solid #c6a27d; border-radius:14px;
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  display:flex; flex-direction:column; overflow:hidden;
}
.chat-box.hidden{ display:none; }

.chat-header{
  background:#7b5234; color:#fff8e6; padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between; font-weight:700;
}
.chat-close{ background:transparent; border:none; color:#fff8e6; font-size:18px; cursor:pointer; }

.chat-messages{
  flex:1; padding:12px; overflow-y:auto; font-size:14px; color:#2c1c14;
  background: radial-gradient(1200px 600px at 90% 0%, rgba(198,162,125,.15), transparent);
}
.msg{ margin:0 0 10px; line-height:1.45; }
.msg.user{ text-align:right; font-weight:600; }
.msg.bot{ color:#4a3323; }

.chat-input{ display:flex; border-top:1px solid #c6a27d; gap:8px; padding:8px; }
.chat-input input{
  flex:1; border:1px solid rgba(123,82,52,.25); border-radius:10px; padding:10px 12px; outline:none;
  background:#fffdf6;
}
.chat-input button{
  background:#7b5234; color:#fff8e6; border:none; border-radius:10px; padding:10px 12px; cursor:pointer;
}
@media (max-width: 460px){
  .chat-box{ width: calc(100vw - 28px); right:14px; }
}


/* Google: marfil, coherente con el set */
#loginModal .login-btn.google{
  background: linear-gradient(180deg,#ffffff,#f4f0ea);
  color:#3b2a1c; text-shadow:none;
  border:1px solid rgba(120,80,50,.3);
  box-shadow: 0 8px 18px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.6);
}
#loginModal .login-btn.google:hover{
  background:#fffdfa; transform: translateY(-1px);
}
#loginModal .login-btn.google::before{
  content:""; width:18px; height:18px; margin-right:8px;
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'>\
  <path fill='%234285F4' d='M24 9.5c3.94 0 7.5 1.53 10.23 4.02l6.87-6.87C36.9 2.6 30.8 0 24 0 14.6 0 6.53 5.38 2.53 13.2l8.5 6.6C13 13.3 18.1 9.5 24 9.5z'/>\
  <path fill='%2334A853' d='M46.5 24.5c0-1.4-.14-2.8-.4-4.1H24v8h12.6c-.54 2.9-2.15 5.3-4.6 6.9l7.1 5.5C43.8 37 46.5 31.2 46.5 24.5z'/>\
  <path fill='%23FBBC05' d='M11.03 28.33a14.5 14.5 0 010-8.66l-8.5-6.6A24 24 0 000 24c0 3.9.94 7.6 2.53 10.9l8.5-6.57z'/>\
  <path fill='%23EA4335' d='M24 48c6.48 0 11.93-2.13 15.9-5.8l-7.1-5.5c-2 1.35-4.57 2.1-8.8 2.1-5.9 0-11-3.8-12.97-9.13l-8.5 6.6C6.52 42.62 14.6 48 24 48z'/>\
  </svg>");
  background-size:contain; background-repeat:no-repeat; display:inline-block;
}

/* Accesibilidad: foco claro */
#loginModal .login-btn:focus-visible,
#loginModal .modal-close:focus-visible,
#loginModal input:focus-visible{
  outline:3px solid rgba(184,134,87,.35);
  outline-offset:2px;
  border-color:#b88657;
}

/* Responsive */
@media (max-width: 420px){
  #loginModal .modal{ padding:22px 18px 18px; }
  #loginModal .modal-title{ font-size:24px; }
}


/* Nota elegante en el modal de login */
#loginModal .modal-note {
  margin-top: 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  color: #f5eedd; /* 🔥 beige claro */
  letter-spacing: .02em;
}
#loginModal .modal-note::before {
  content: "⋯ ";
  color: #f5eedd; /* mismo tono beige */
}
#loginModal .modal-note::after {
  content: " ⋯";
  color: #f5eedd;
}


/* === CHAT shakesIA === */
.chat-widget{
  position:fixed; right:20px; bottom:20px; z-index:9999;  /* por encima de todo */
  font-family:"Source Serif 4", serif;
}
.chat-toggle{
  background:linear-gradient(145deg,#7b5234,#c6a27d);
  color:#fff8e6; border:none; border-radius:999px;
  padding:10px 16px; font-size:14px; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.25); transition:transform .2s, box-shadow .2s;
}
.chat-toggle:hover{ transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.35); }

.chat-box{
  width:320px; height:460px; margin-bottom:10px;
  background:rgba(255,248,230,.96);
  border:2px solid #c6a27d; border-radius:14px;
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  display:flex; flex-direction:column; overflow:hidden;
}
.chat-box.hidden{ display:none; }

.chat-header{
  background:#7b5234; color:#fff8e6; padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between; font-weight:700;
}
.chat-close{ background:transparent; border:none; color:#fff8e6; font-size:18px; cursor:pointer; }

.chat-messages{
  flex:1; padding:12px; overflow-y:auto; font-size:14px; color:#2c1c14;
  background:radial-gradient(1200px 600px at 90% 0%, rgba(198,162,125,.15), transparent);
}
.msg{ margin:0 0 10px; line-height:1.45; }
.msg.user{ text-align:right; font-weight:600; }
.msg.bot{ color:#4a3323; }

.chat-input{ display:flex; border-top:1px solid #c6a27d; gap:8px; padding:8px; }
.chat-input input{
  flex:1; border:1px solid rgba(123,82,52,.25); border-radius:10px; padding:10px 12px; outline:none;
  background:#fffdf6;
}
.chat-input button{
  background:#7b5234; color:#fff8e6; border:none; border-radius:10px; padding:10px 12px; cursor:pointer;
}
@media (max-width: 460px){
  .chat-box{ width:calc(100vw - 28px); right:14px; }
}


/* === shakesIA (panel embebido) === */
.chat-panel{
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.chat-header{
  background:#7b5234;
  color:#fff8e6;
  padding:10px 12px;
  font-weight:700;
  letter-spacing:.2px;
  border-top-left-radius:12px;
  border-top-right-radius:12px;
}

.chat-messages{
  max-height: 280px;           /* ajusta si lo quieres más/menos alto */
  overflow-y:auto;
  padding: 12px;
  font-size:14px;
  color:#2c1c14;
  background:
    radial-gradient(1100px 580px at 90% 0%, rgba(198,162,125,.15), transparent),
    linear-gradient(#fffaf0, #fff4e1);
}

.msg{ margin:0 0 10px; line-height:1.45; }
.msg.user{ text-align:right; font-weight:600; }
.msg.bot{ color:#4a3323; }

.chat-input{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid rgba(123,82,52,.25);
  background: #fff9ef;
  border-bottom-left-radius:12px;
  border-bottom-right-radius:12px;
}
.chat-input input{
  flex:1;
  border:1px solid rgba(123,82,52,.25);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
  background:#fffdf6;
}
.chat-input button{
  background:#7b5234;
  color:#fff8e6;
  border:none;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
}

/* ====== shakesIA embebido (premium) ====== */
.chat-panel{
  padding:0; overflow:hidden; border-radius:14px;
  background: linear-gradient(180deg, #fffaf2 0%, #fff2e0 100%);
  border:1px solid rgba(123,82,52,.18);
  box-shadow:
    0 14px 38px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.65);
}

.chat-header{
  display:flex; align-items:baseline; gap:10px;
  padding:12px 14px;
  background:
    linear-gradient(180deg, #7b5234 0%, #6d472c 100%);
  color:#fff6e6;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.chat-title{ font-weight:800; letter-spacing:.3px; }
.chat-sub{ opacity:.85; font-size:12px; }

.chat-messages{
  max-height: 300px; overflow-y:auto; padding:14px 12px;
  background:
    radial-gradient(900px 480px at 90% 0%, rgba(198,162,125,.18), transparent),
    linear-gradient(#fffaf2, #fff5e7);
}

/* Burbujas */
.msg{ margin:0 0 10px; display:flex; }
.msg.bot { justify-content:flex-start; }
.msg.user{ justify-content:flex-end; }
.bubble{
  max-width: 88%;
  padding:10px 12px; line-height:1.45; font-size:14px;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.bot .bubble{
  background:#fff; color:#3a2a20;
  border:1px solid rgba(123,82,52,.15);
  border-radius:12px 12px 12px 6px;
}
.user .bubble{
  background:linear-gradient(145deg, #7b5234, #c6a27d);
  color:#fff8e6; border-radius:12px 12px 6px 12px;
}

/* Indicador “pensando…” */
.typing{ display:inline-flex; gap:6px; align-items:center; opacity:.9; }
.typing .dot{ width:6px; height:6px; border-radius:50%; background:#7b5234; opacity:.5; animation:blink 1.2s infinite; }
.typing .dot:nth-child(2){ animation-delay:.15s; }
.typing .dot:nth-child(3){ animation-delay:.3s; }
@keyframes blink{ 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* Toolbar de sugerencias */
.chat-toolbar{
  display:flex; gap:8px; flex-wrap:wrap;
  padding:10px; border-top:1px dashed rgba(123,82,52,.18);
  background: #fff7ec;
}
.qbtn{
  border:1px solid rgba(123,82,52,.22);
  background:#fffdf7; color:#4a3323;
  border-radius:999px; padding:6px 10px; font-size:12px; cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}
.qbtn:hover{ transform:translateY(-1px); box-shadow:0 6px 12px rgba(0,0,0,.08); }

/* Caja de entrada */
.chat-input{
  display:flex; gap:8px; padding:10px;
  border-top:1px solid rgba(123,82,52,.18);
  background:linear-gradient(180deg,#fff9f0,#fff3e2);
}
.chat-input input{
  flex:1; font-size:14px;
  border:1px solid rgba(123,82,52,.25);
  border-radius:10px; padding:10px 12px; outline:none;
  background:#fffdf6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input input:focus{
  border-color:#c6a27d; box-shadow:0 0 0 3px rgba(198,162,125,.25);
}
.chat-input .chat-send{
  background:linear-gradient(145deg,#7b5234,#c6a27d);
  color:#fff8e6; border:none; border-radius:10px;
  padding:10px 14px; cursor:pointer;
  box-shadow:0 6px 14px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .12s ease, box-shadow .12s ease;
}
.chat-input .chat-send:hover{ transform:translateY(-1px); }
.chat-input .chat-send:active{ transform:translateY(0); box-shadow:0 3px 8px rgba(0,0,0,.18) inset; }

/* Scrollbar sutil (WebKit) */
.chat-messages::-webkit-scrollbar{ height:10px; width:10px; }
.chat-messages::-webkit-scrollbar-thumb{ background:rgba(123,82,52,.25); border-radius:10px; }
.chat-messages::-webkit-scrollbar-track{ background:transparent; }

@media (max-width: 520px){
  .chat-messages{ max-height: 42vh; }
}

/* ====== shakesIA — Tarjeta bronce dorada (minimal & premium) ====== */
:root{
  --bronze-1:#6f4a2c;   /* base oscura */
  --bronze-2:#8b623f;   /* medio */
  --bronze-3:#c6a27d;   /* dorado suave */
  --gold-hi:#e7d2b6;    /* alto brillo */
  --cream:#fff7ea;      /* fondo */
  --ink:#37271c;        /* texto */
}

/* Contenedor tarjeta */
.chat-panel{
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(1200px 700px at 90% -10%, rgba(198,162,125,.18), transparent),
    linear-gradient(180deg, #fffaf2 0%, #fff1df 100%);
  border: 1px solid rgba(111,74,44,.18);
  box-shadow:
    0 20px 50px rgba(0,0,0,.18),
    0 6px 18px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.65);
}

/* Aro metálico sutil (bisel exterior) */
.chat-panel::before{
  content:"";
  position:absolute; inset:0;
  border-radius:16px;
  background:
    linear-gradient(145deg, rgba(231,210,182,.55), rgba(111,74,44,.25) 45%, rgba(231,210,182,.35));
  mix-blend-mode:overlay;
  pointer-events:none;
}

/* Filete interior */
.chat-panel::after{
  content:"";
  position:absolute; inset:6px;
  border-radius:12px;
  border:1px solid rgba(111,74,44,.15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
  pointer-events:none;
}

/* Cabecera */
.chat-header{
  display:flex; align-items:baseline; gap:10px;
  padding:12px 14px;
  color:#fff8e6;
  background:
    linear-gradient(180deg, var(--bronze-1) 0%, #5f3f26 100%),
    linear-gradient(145deg, rgba(255,255,255,.12), transparent);
  border-bottom:1px solid rgba(255,255,255,.15);
}
.chat-title{ font-weight:800; letter-spacing:.3px; }
.chat-sub{ opacity:.9; font-size:12px; }

/* Zona de mensajes (diáfana) */
.chat-messages{
  max-height: 300px;
  overflow-y:auto;
  padding:14px 12px;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(198,162,125,.12), transparent),
    linear-gradient(#fffaf2, #fff5e7);
}

/* Burbujas */
.msg{ margin:0 0 10px; display:flex; }
.msg.bot { justify-content:flex-start; }
.msg.user{ justify-content:flex-end; }

.bubble{
  max-width: 88%;
  padding:10px 12px;
  line-height:1.45;
  font-size:14px;
  border-radius:12px;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}

/* Bot: crema con filete */
.bot .bubble{
  background: linear-gradient(180deg, #ffffff, #fff6e8);
  color: var(--ink);
  border:1px solid rgba(111,74,44,.14);
  border-radius:12px 12px 12px 6px;
}

/* Usuario: bronce pulido con brillo */
.user .bubble{
  color:#fff8e6;
  border-radius:12px 12px 6px 12px;
  background:
    linear-gradient(145deg, var(--bronze-2), var(--bronze-3)),
    linear-gradient(180deg, rgba(255,255,255,.2), transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    0 6px 16px rgba(111,74,44,.25);
}

/* Indicador “pensando…” */
.typing{ display:inline-flex; gap:6px; align-items:center; opacity:.9; }
.typing .dot{ width:6px; height:6px; border-radius:50%; background:var(--bronze-1); opacity:.5; animation:blink 1.2s infinite; }
.typing .dot:nth-child(2){ animation-delay:.15s; }
.typing .dot:nth-child(3){ animation-delay:.3s; }
@keyframes blink{ 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* Sugerencias (chips) */
.chat-toolbar{
  display:flex; gap:8px; flex-wrap:wrap;
  padding:10px;
  background: linear-gradient(180deg,#fff9f0,#fff4e3);
  border-top:1px dashed rgba(111,74,44,.18);
}
.qbtn{
  border:1px solid rgba(111,74,44,.22);
  background:
    linear-gradient(180deg,#ffffff,#fff5e8);
  color:#4a3323;
  border-radius:999px; padding:6px 10px; font-size:12px; cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.qbtn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 16px rgba(0,0,0,.08);
  border-color: rgba(198,162,125,.6);
}

/* Área de escritura */
.chat-input{
  display:flex; gap:8px; padding:10px;
  background:
    linear-gradient(180deg,#fff9f0,#fff3e2);
  border-top:1px solid rgba(111,74,44,.18);
}
.chat-input input{
  flex:1; font-size:14px; background:#fffdf7; color:var(--ink);
  border:1px solid rgba(111,74,44,.25); border-radius:12px; padding:10px 12px; outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input input:focus{
  border-color: var(--bronze-3);
  box-shadow: 0 0 0 3px rgba(198,162,125,.25), inset 0 1px 0 rgba(255,255,255,.7);
}

/* Botón enviar: bronce con relieve */
.chat-input .chat-send{
  min-width:88px;
  background:
    linear-gradient(145deg, var(--bronze-2), var(--bronze-3)),
    linear-gradient(180deg, rgba(255,255,255,.22), transparent);
  color:#fff8e6; border:none; border-radius:12px; padding:10px 14px; cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    0 10px 22px rgba(0,0,0,.18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-input .chat-send:hover{ transform: translateY(-1px); }
.chat-input .chat-send:active{
  transform: translateY(0);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.22);
}

/* Scrollbar sutil (webkit) */
.chat-messages::-webkit-scrollbar{ height:10px; width:10px; }
.chat-messages::-webkit-scrollbar-thumb{ background:rgba(111,74,44,.25); border-radius:10px; }
.chat-messages::-webkit-scrollbar-track{ background:transparent; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .qbtn, .chat-input .chat-send{ transition:none }
}

/* Responsive */
@media (max-width: 520px){
  .chat-messages{ max-height: 42vh; }
}

/* Panel shakesIA */
.chat-panel{ border-radius:var(--r-lg); }

/* Header del chat usa el mismo patrón que card-head */
.chat-header{ composes: card-head; } /* si tu build no soporta composes, duplica estilos */
.chat-header{ /* duplicado directo */
  display:flex; align-items:baseline; gap:10px; padding:12px 14px;
  background: linear-gradient(180deg, var(--bronze-1), #5f3f26);
  color:#fff8e6; font-weight:800; letter-spacing:.2px;
  border-bottom:1px solid rgba(255,255,255,.14);
}
.chat-header .chat-sub{ margin-left:auto; }
.chat-header .chat-badge{ composes: card-badge; } /* o usa .card-badge directamente */

.chat-messages{
  max-height: 300px; padding:14px 12px; overflow:auto; color:var(--ink);
  background: radial-gradient(900px 520px at 85% -10%, rgba(198,162,125,.12), transparent),
              linear-gradient(#fffaf2, #fff5e7);
}

/* Burbujas cohesionadas */
.msg{ margin:0 0 10px; display:flex; }
.msg.bot{ justify-content:flex-start; }
.msg.user{ justify-content:flex-end; }
.bubble{
  max-width:88%; padding:10px 12px; line-height:1.45; font-size:14px; border-radius:12px;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.bot .bubble{
  background: linear-gradient(180deg, #ffffff, #fff6e8);
  border:1px solid rgba(111,74,44,.14);
  border-radius:12px 12px 12px 6px;
}
.user .bubble{
  color:#fff8e6; border-radius:12px 12px 6px 12px;
  background: linear-gradient(145deg, var(--bronze-2), var(--bronze-3)),
              linear-gradient(180deg, rgba(255,255,255,.2), transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px rgba(111,74,44,.22);
}

/* Escribir */
.chat-input{
  display:flex; gap:8px; padding:10px;
  background: linear-gradient(180deg,#fff9f0,#fff3e2);
  border-top:1px solid rgba(111,74,44,.16);
}
.chat-input input{
  flex:1; font-size:14px; background:#fffdf7; color:var(--ink);
  border:1px solid rgba(111,74,44,.25); border-radius:12px; padding:10px 12px; outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input input:focus{
  border-color:var(--bronze-3);
  box-shadow:0 0 0 3px rgba(198,162,125,.22), inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input .chat-send{
  min-width:92px;
  background: linear-gradient(145deg,var(--bronze-2),var(--bronze-3));
  color:#fff8e6; border:none; border-radius:12px; padding:10px 14px; cursor:pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-input .chat-send:hover{ transform:translateY(-1px); }
.chat-input .chat-send:active{ transform:translateY(0); box-shadow: inset 0 3px 8px rgba(0,0,0,.22); }

/* Chips sugerencia del chat (misma familia que tus chips globales) */
.chat-toolbar{
  display:flex; gap:8px; flex-wrap:wrap; padding:10px;
  background: linear-gradient(180deg,#fff9f0,#fff4e3);
  border-top:1px dashed rgba(111,74,44,.16);
}
.qbtn{
  border:1px solid rgba(111,74,44,.22);
  background: linear-gradient(180deg,#ffffff,#fff5e8);
  color:#4a3323; border-radius:999px; padding:6px 10px; font-size:12px; cursor:pointer;
  transition:transform .12s, box-shadow .12s, border-color .12s;
}
.qbtn:hover{ transform:translateY(-1px); box-shadow:0 8px 16px rgba(0,0,0,.08); border-color:rgba(198,162,125,.6); }

/* Indicador “pensando” */
.typing{ display:inline-flex; gap:6px; align-items:center; opacity:.9; }
.typing .dot{ width:6px; height:6px; border-radius:50%; background:var(--bronze-1); opacity:.5; animation:blink 1.2s infinite; }
.typing .dot:nth-child(2){ animation-delay:.15s; } .typing .dot:nth-child(3){ animation-delay:.3s; }
@keyframes blink{ 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* Scrollbar sutil */
.chat-messages::-webkit-scrollbar{ height:10px; width:10px; }
.chat-messages::-webkit-scrollbar-thumb{ background:rgba(111,74,44,.25); border-radius:10px; }
.chat-messages::-webkit-scrollbar-track{ background:transparent; }

/* ====== Chat como tarjeta de quotes ====== */
:root{
  --ink:#2f2219;
  --bronze-1:#6f4a2c;
  --bronze-2:#8b623f;
  --bronze-3:#c6a27d;
  --gold:#e7d2b6;
}

/* Misma base que quotes */
.classic-frame.as-quote{
  position:relative;
  border-radius:14px;
  background:
    radial-gradient(1200px 700px at 90% -10%, rgba(198,162,125,.16), transparent),
    linear-gradient(180deg, #fffaf2 0%, #fff1df 100%);
  border:1px solid rgba(111,74,44,.16);
  box-shadow:
    0 18px 46px rgba(0,0,0,.18),
    0 6px 14px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.62);
  overflow:hidden;
}

/* Filete interior como en quotes */
.classic-frame.as-quote::after{
  content:""; position:absolute; inset:6px; border-radius:10px;
  border:1px solid rgba(111,74,44,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
  pointer-events:none;
}

/* Remaches dorados (idénticos a la tarjeta) */
.classic-frame.as-quote .card-rivets{
  position:absolute; top:10px; right:12px; display:flex; gap:10px; z-index:2;
}
.classic-frame.as-quote .card-rivets i{
  width:12px; height:12px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, var(--gold), var(--bronze-3) 62%, var(--bronze-1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(0,0,0,.25);
}

/* Cabecera “como quotes” (nombre + sublínea) */
.quote-like-head{
  display:flex; align-items:center; gap:10px; padding:12px 14px 6px;
  color:var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.15));
}
.quote-like-head .head-title{
  font-family: "Source Serif 4", serif;
  font-size:16px; line-height:1; margin:0; font-weight:700; letter-spacing:.2px; color:var(--ink);
}
.quote-like-head .head-sub{
  font-size:12px; opacity:.8; margin-top:4px;
  border-top:1px solid rgba(111,74,44,.18);
  width:max-content; padding-top:4px;
}

/* Área de mensajes, idéntica a papel de quotes */
.chat-messages{
  max-height: 300px; overflow-y:auto; padding:12px 12px; color:var(--ink);
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(198,162,125,.10), transparent),
    linear-gradient(#fffaf2, #fff6e8);
}

/* Burbujas alineadas al look */
.msg{ display:flex; margin:0 0 10px; }
.msg.bot{ justify-content:flex-start; }
.msg.user{ justify-content:flex-end; }
.bubble{
  max-width:88%; padding:10px 12px; line-height:1.45; font-size:14px; border-radius:12px;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.bot .bubble{
  background: linear-gradient(180deg, #ffffff, #fff6e8);
  border:1px solid rgba(111,74,44,.14);
  border-radius:12px 12px 12px 6px;
}
.user .bubble{
  color:#fff8e6; border-radius:12px 12px 6px 12px;
  background: linear-gradient(145deg, var(--bronze-2), var(--bronze-3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px rgba(111,74,44,.22);
}

/* Chips (como los tuyos, tono quote) */
.chat-toolbar{
  display:flex; gap:8px; flex-wrap:wrap; padding:10px 12px;
  background: linear-gradient(180deg,#fff9f0,#fff4e3);
  border-top:1px dashed rgba(111,74,44,.16);
}
.qbtn{
  border:1px solid rgba(111,74,44,.22);
  background: linear-gradient(180deg,#ffffff,#fff5e8);
  color:#4a3323; border-radius:999px; padding:6px 10px; font-size:12px; cursor:pointer;
  transition:transform .12s, box-shadow .12s, border-color .12s;
}
.qbtn:hover{ transform:translateY(-1px); box-shadow:0 8px 16px rgba(0,0,0,.08); border-color:rgba(198,162,125,.6); }

/* Input idéntico al papel de quotes */
.chat-input{
  display:flex; gap:8px; padding:10px 12px;
  background: linear-gradient(180deg,#fff9f0,#fff3e2);
  border-top:1px solid rgba(111,74,44,.16);
}
.chat-input input{
  flex:1; font-size:14px; color:var(--ink);
  background:#fffdf7; border:1px solid rgba(111,74,44,.22);
  border-radius:12px; padding:10px 12px; outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input input:focus{
  border-color: var(--bronze-3);
  box-shadow: 0 0 0 3px rgba(198,162,125,.22), inset 0 1px 0 rgba(255,255,255,.7);
}
.chat-input .chat-send{
  min-width:92px;
  background: linear-gradient(145deg, var(--bronze-2), var(--bronze-3));
  color:#fff8e6; border:none; border-radius:12px; padding:10px 14px; cursor:pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-input .chat-send:hover{ transform:translateY(-1px); }
.chat-input .chat-send:active{ transform:translateY(0); box-shadow: inset 0 3px 8px rgba(0,0,0,.22); }

/* Scrollbar sutil */
.chat-messages::-webkit-scrollbar{ height:10px; width:10px; }
.chat-messages::-webkit-scrollbar-thumb{ background:rgba(111,74,44,.25); border-radius:10px; }
.chat-messages::-webkit-scrollbar-track{ background:transparent; }

/* === ShakesIA Chat === */
.chat-section {
  font-family: 'Cormorant Garamond', serif;
  background: linear-gradient(135deg, #f5f2ea, #fefdfb);
  border: 1px solid rgba(145, 115, 80, 0.35);
  border-radius: 18px;
  box-shadow:
    0 8px 22px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.5);
  padding: 16px;
  margin: 24px auto;
  max-width: 640px;
}

.chat-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #7b5234; /* bronce elegante */
  margin-bottom: 12px;
}

.chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(255,255,255,0.65);
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.45;
}

.chat-bubble {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  max-width: 80%;
  word-wrap: break-word;
  animation: fadeIn .3s ease;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #e6dac6, #f8f3eb);
  align-self: flex-end;
  margin-left: auto;
  color: #4a2e1f;
  font-weight: 500;
}

.chat-bubble.ia {
  background: linear-gradient(135deg, #fdfcf9, #f4efe6);
  border: 1px solid rgba(145,115,80,.25);
  color: #3a281c;
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 8px;
}

#chatInput {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(145,115,80,.4);
  background: #fffdf9;
  font-family: 'Cormorant Garamond', serif;
}

.chat-form .btn {
  background: linear-gradient(135deg, #d7b98b, #f6e7c5);
  color: #3a281c;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}
.chat-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}

/* === ShakesIA refinado estilo tarjeta quotes === */
.chat-section {
  font-family: 'Cormorant Garamond', serif;
  background: linear-gradient(180deg, #fdfbf7, #f7f3eb);
  border: 1px solid rgba(123, 82, 52, 0.25);
  border-radius: 16px;
  box-shadow:
    0 14px 32px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.6);
  padding: 0;
  overflow: hidden;
}

/* Cabecera */
.chat-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #6f4a2c;
  padding: 12px;
  background: linear-gradient(180deg, #fdf9f4, #f7efe2);
  border-bottom: 1px solid rgba(123,82,52,.15);
}

/* Mensajes */
.chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #fffdf9, #faf6ee);
}

.chat-bubble {
  display: inline-block;
  padding: 10px 14px;
  margin: 6px 0;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  max-width: 80%;
  box-shadow: 0 3px 6px rgba(0,0,0,.08);
  animation: fadeIn .25s ease;
}

/* Usuario */
.chat-bubble.user {
  background: linear-gradient(145deg, #e8dcc6, #f7f2e6);
  color: #3a281c;
  margin-left: auto;
  font-weight: 500;
  border: 1px solid rgba(123,82,52,.18);
}

/* IA */
.chat-bubble.ia {
  background: linear-gradient(145deg, #fffdf9, #f5eee2);
  border: 1px solid rgba(123,82,52,.15);
  color: #5a3b29;
  font-style: italic;
}

/* Input */
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(123,82,52,.15);
  background: linear-gradient(180deg, #fdfbf7, #f8f3e9);
}

#chatInput {
  flex: 1;
  border: 1px solid rgba(123,82,52,.3);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  outline: none;
  background: #fffdf9;
}
#chatInput:focus {
  border-color: #c6a27d;
  box-shadow: 0 0 0 3px rgba(198,162,125,.2);
}

/* Botón */
.chat-form .btn {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: 'Cormorant Garamond', serif;
  box-shadow: 0 6px 14px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  transition: all .2s ease;
}
.chat-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
}
.chat-form .btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.2);
}


/* === ShakesIA versión final premium === */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px; /* separación uniforme entre mensajes */
}

.chat-bubble {
  display: block;            /* fuerza cada mensaje en su línea */
  width: fit-content;        /* se ajusta al contenido */
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
  animation: fadeIn .25s ease;
  word-break: break-word;
}

/* Usuario */
.chat-bubble.user {
  margin-left: auto;         /* se alinea a la derecha */
  background: linear-gradient(145deg, #e9e1d3, #fdfbf7);
  border: 1px solid rgba(123,82,52,.18);
  color: #3a281c;
  font-weight: 500;
  font-family: 'Cormorant Garamond', serif;
}

/* IA */
.chat-bubble.ia {
  margin-right: auto;        /* se alinea a la izquierda */
  background: linear-gradient(145deg, #fffdf9, #f7f2e8);
  border: 1px solid rgba(123,82,52,.15);
  color: #5a3b29;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

/* Cabecera ShakesIA */
.chat-title {
  font-family: 'Cormorant Garamond', serif;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #6f4a2c;
  padding: 14px;
  background: linear-gradient(180deg, #faf6f0, #f7f3eb);
  border-bottom: 1px solid rgba(123,82,52,.15);
}

.chat-rivets{
  position:absolute; top:10px; right:12px; display:flex; gap:10px; z-index:2;
}
.chat-rivets i{
  width:12px; height:12px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #e7d2b6, #c6a27d 62%, #6f4a2c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(0,0,0,.25);
}

.chat-section {
  background: linear-gradient(180deg, #fbf9f5, #f7f3ed);
  border: 1px solid rgba(123,82,52,.2);
  border-radius: 16px;
  box-shadow: 
    0 16px 38px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.65);
  position: relative; /* necesario para remaches */
}

.chat-bubble.ia,
.chat-title {
  font-family: 'Cormorant Garamond', serif;
}


.chat-messages {
  background: transparent; /* quita el recuadro grisáceo */
  border: none;            /* quita el borde */
  box-shadow: none;        /* elimina sombra interior */
}

.chat-section {
  background: transparent;
}

.chat-section .classic-frame {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.chat-form {
  border-top: none !important; /* elimina la línea superior */
  background: transparent;     /* por si tiene fondo */
  box-shadow: none;            /* quita cualquier relieve */
}


.classic-frame {
  border: none !important;
}

.classic-frame::before,
.classic-frame::after {
  border: none !important;
  box-shadow: none !important;
}

.chat-bubble{display:flex;align-items:flex-start;gap:10px;margin:10px 0;max-width:80%}
.chat-bubble.user{justify-content:flex-end}
.avatar-ia{width:36px;height:36px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid #c8b090;background:#fff}
.bubble-text{font-family:"Cormorant Garamond",serif;font-size:15px;color:#4a3a2a;line-height:1.4}


.chat-bubble.user {
  background: #e6ded3; /* tono más cálido */
  border: 1px solid #d2c2ad;
  border-radius: 16px 16px 0 16px;
  margin-left: auto; 
}


.chat-bubble.ia {
  border-radius: 16px 16px 16px 0;
}

.chat-bubble {
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

#chatMessages {
  position: relative;
  overflow-y: auto;
  padding: 10px 20px;
}

/* Difuminado arriba */
#chatMessages::before,
#chatMessages::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 30px;
  z-index: 2;
  pointer-events: none;
}

#chatMessages::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(249,245,240,1), rgba(249,245,240,0));
}

#chatMessages::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(249,245,240,1), rgba(249,245,240,0));
}


/* Contenedor que hace scroll */
#chatMessages{
  --fade: 28px;                 /* tamaño del difuminado */
  overflow-y: auto;
  position: relative;

  /* Difuminado arriba/abajo con máscara */
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,1) var(--fade),
    rgba(0,0,0,1) calc(100% - var(--fade)),
    rgba(0,0,0,0) 100%
  );
          mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,1) var(--fade),
    rgba(0,0,0,1) calc(100% - var(--fade)),
    rgba(0,0,0,0) 100%
  );
}




/* ===== Lang Switch — Tema oscuro cálido (Libris.app) ===== */
:root {
  --lang-bg: rgba(24, 20, 16, 0.68);      /* fondo glass del menú */
  --lang-stroke: rgba(255, 255, 255, .12);
  --lang-hover: rgba(255, 255, 255, .08);
  --lang-ring: #99b4d1;                   /* azul corporativo */
  --btn-bg: rgba(255, 248, 240, .18);     /* botón translúcido */
  --btn-bg-hover: rgba(255, 248, 240, .28);
  --btn-stroke: rgba(255, 255, 255, .18);
  --text-strong: #f7f2ea;
  --text-dim: #d8d0c6;
}

/* Asegura contenedor y superposición limpia */
#userAuth { position: relative; overflow: visible; }

/* Botón compacto con badge de idioma + label */
.lang-btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:8px 12px; border-radius:14px;
  border:1px solid var(--btn-stroke);
  background: var(--btn-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-strong); font-weight:650;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.lang-btn:hover{ background: var(--btn-bg-hover); transform: translateY(-1px); }
.lang-btn:active{ transform: translateY(0); }
.lang-btn .flag{ font-size:16px; line-height:1; }
.lang-btn .lang-label{ opacity:.9; }
.lang-btn .chev{ opacity:.7; transition: transform .2s ease; }
.lang-btn[aria-expanded="true"] .chev{ transform: rotate(180deg); }

/* Menú glass oscuro con borde suave y sombra profunda */
.lang-menu{
  position:absolute; right:0; top: calc(100% + 8px);
  min-width: 220px; margin:0; padding:8px;
  list-style:none; border-radius:14px;
  border:1px solid var(--lang-stroke);
  background: var(--lang-bg);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: 0 24px 60px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.06);
  color: var(--text-strong);
  opacity:0; transform: translateY(-6px) scale(.98);
  pointer-events:none; transition: opacity .18s ease, transform .18s ease;
  z-index: 9999; /* por encima del hero */
}
.lang-menu.show{ opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }

/* Items con tipografía y alineación limpia */
.lang-menu li{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:10px; cursor:pointer;
  color: var(--text-strong);
  transition: background .12s ease, transform .08s ease, color .12s ease;
}
.lang-menu li .flag{ font-size:18px; width:22px; text-align:center; }
.lang-menu li span:last-child{ color: var(--text-dim); }

/* Hover/selected estados */
.lang-menu li:hover{ background: var(--lang-hover); transform: translateY(-1px); }
.lang-menu li[aria-selected="true"]{
  outline: 2px solid var(--lang-ring);
  color: var(--text-strong);
}

/* Accesibilidad: focus visible */
.lang-btn:focus-visible,
.lang-menu li:focus-visible{
  outline: 3px solid var(--lang-ring);
  outline-offset: 2px; border-radius: 12px;
}

/* Evita que el menú se vea “lavado” sobre el hero */
header, .lang-switch{ isolation: isolate; }

/* Opcional: compactar el botón para que no compita con “Iniciar sesión” */
@media (max-width: 640px){
  .lang-btn .lang-label{ display:none; } /* solo bandera y chevron en móvil */
}


.lang-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-6px) scale(.98);
}
.lang-menu.show {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* === Lang menu ajustado al botón === */
.lang-switch{ position: relative; display: inline-flex; }

.lang-btn{
  /* si quieres que el menú herede este ancho como mínimo */
  min-width: 140px; /* opcional: quítalo si no lo necesitas */
}

/* clave: el menú posiciona relativo a .lang-switch (no al header) */
.lang-menu{
  position: absolute;
  right: 0;          /* ancla al borde derecho del botón */
  left: auto;        /* asegúrate de NO mezclar left/right */
  top: calc(100% + 6px);

  /* que NO se estire: solo lo necesario, pero nunca menos que el botón */
  width: max-content;   /* se adapta al contenido */
  min-width: 100%;      /* al menos igual que el botón */
  max-width: 320px;     /* limite para textos largos, ajusta a gusto */

  /* por si algún reset le mete width:100% */
  box-sizing: border-box;
}

/* animación sin desplazamiento lateral (solo vertical) */
.lang-menu{ transform: translateY(-6px) scale(.98); }
.lang-menu.show{ transform: translateY(0) scale(1); }

/* seguridad: el header por encima del hero */
header{ position: relative; z-index: 5; }


@media (max-width: 640px){
  .lang-menu{ width: 100%; max-width: none; }
}

.lang-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  margin-right: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s;
}
.lang-menu li:hover {
  background: rgba(255,255,255,.08);
}


.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s;
}

.lang-btn:hover {
  background: rgba(255,255,255,.12);
}

.lang-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* menú reducido: solo iconos */
.lang-menu li {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s;
}
.lang-menu li:hover {
  background: rgba(255,255,255,.08);
}


/* Tamaños (ajusta aquí y todo se escala) */
:root{
  --lang-size-btn: 36px;   /* icono en el botón */
  --lang-size-menu: 44px;  /* icono en el menú */
  --lang-radius: 10px;     /* radio de las tarjetas */
}

/* Botón compacto, centrado en el icono */
.lang-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:6px; border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.lang-btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.12); }
.lang-btn .chev{ margin-left:6px; opacity:.7; }

/* Icono principal */
#langIcon{
  width: var(--lang-size-btn);
  height: var(--lang-size-btn);
  border-radius: var(--lang-radius);
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.06) inset;
  image-rendering: -webkit-optimize-contrast;
}

/* Menú más ancho y elevado */
.lang-menu{
  min-width: 220px;            /* ancho del popover */
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(22,20,18,.66);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}

/* Items del menú: grandes, con halo y microinteracción */
.lang-menu li{
  display:flex; align-items:center; justify-content:flex-start;
  gap:12px; padding:10px 8px; border-radius:12px;
  cursor:pointer; user-select:none;
  transition: background .15s ease, transform .08s ease;
}
.lang-menu li:hover{ background: rgba(255,255,255,.08); transform: translateY(-1px); }

/* Iconos del menú más grandes y con glow */
.lang-menu .lang-icon{
  width: var(--lang-size-menu);
  height: var(--lang-size-menu);
  border-radius: var(--lang-radius);
  object-fit: contain;
  box-shadow:
    0 4px 14px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 12px rgba(230, 190, 120, .25); /* glow dorado */
  transition: transform .12s ease, box-shadow .15s ease;
}

/* Estado seleccionado con anillo elegante */
.lang-menu li[aria-selected="true"] .lang-icon{
  box-shadow:
    0 6px 18px rgba(0,0,0,.35),
    0 0 0 2px #99b4d1,               /* tu azul corporativo */
    0 0 14px rgba(230,190,120,.35);  /* glow dorado */
  transform: scale(1.03);
}

/* Si quieres aún más presencia, sube estos dos números */
@media (min-width: 1024px){
  :root{
    --lang-size-btn: 40px;
    --lang-size-menu: 52px;
  }
}


.lang-menu li { padding: 12px; }


.lang-menu li span {
  position: absolute;
  left: 110%;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.lang-menu li:hover span { opacity: 1; }


/* Menú un poco más ancho, estilo columna */
.lang-menu{
  width: 120px;          /* más ancho que antes (puedes subir a 140px si quieres más aire) */
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;   /* centra las tarjetas */
  gap: 14px;             /* espacio entre iconos */
  border-radius: 16px;
}

/* Items del menú: centrados */
.lang-menu li{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Iconos un poco más grandes para dar presencia */
.lang-menu .lang-icon{
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow:
    0 4px 14px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 14px rgba(230,190,120,.3);
  transition: transform .15s ease, box-shadow .2s ease;
}

/* Hover: lift + glow elegante */
.lang-menu li:hover .lang-icon{
  transform: translateY(-2px) scale(1.07);
  box-shadow:
    0 6px 20px rgba(0,0,0,.35),
    0 0 0 2px #99b4d1,
    0 0 18px rgba(230,190,120,.45);
}

/* Quitamos estilos por defecto del focus */
.lang-menu li[aria-selected="true"] {
  outline: none;
  background: none;
}

/* Estilo personalizado del seleccionado */
.lang-menu li[aria-selected="true"] .lang-icon {
  transform: scale(1.1);
  box-shadow:
    0 8px 20px rgba(0,0,0,.4),
    0 0 0 2px rgba(230,190,120,.7),   /* borde dorado */
    0 0 18px rgba(230,190,120,.55);  /* glow dorado */
}

.lang-btn {
  width: var(--lang-size);
  height: var(--lang-size);
  border-radius: var(--lang-radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.28), var(--glow);
}

.lang-menu {
  transform: translateY(-6px) scale(0.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.16,.84,.44,1), opacity .22s ease;
}
.lang-menu.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.language-selector img {
  width: 42px;   /* antes quizá tenías ~50px */
  height: 42px;  /* mantenemos proporción cuadrada */
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-selector img:hover {
  transform: scale(1.1); /* sutil, elegante */
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6); /* glow dorado */
}


.language-selector img {
  width: 34px;   /* antes 42–50px */
  height: 34px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 14px; /* más aire entre iconos */
}

.language-selector img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); /* glow más suave */
}


.language-selector img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.language-selector img:hover {
  transform: scale(1.08);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.4); /* más sutil */
}

.language-selector img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 18px; /* un poco más de aire */
}

.language-selector img:hover {
  transform: scale(1.08);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.3); /* glow más suave */
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 18px; /* más aire entre iconos */
  align-items: center;
}

.language-selector img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.25); /* glow suave inicial */
}

.language-selector img:hover {
  transform: scale(1.05); /* sutil, no salta tanto */
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.35); /* un poco más al pasar hover */
}

.language-selector img.active {
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); /* idioma activo ligeramente destacado */
}


/* Ocultar selector de idioma en móviles */
@media (max-width: 768px) {
  .lang-switch {
    display: none;
  }
}


.big-pref {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.prefs-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.pref-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-subtitle {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #d4af7a; /* bronce elegante */
}


.section-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b08d57; /* bronce elegante */
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.3);
  padding-bottom: 3px;
}


.chip {
  background: #f4f1ed;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.chip.active {
  background: linear-gradient(135deg, #c7a465, #b08d57);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(176, 141, 87, 0.4);
}

.pref-card {
  background: linear-gradient(180deg, #fdfbf8 0%, #f8f5f1 100%);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9c7c47; /* bronce suave */
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(156, 124, 71, 0.25);
  padding-bottom: 4px;
}


.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px; /* más aire */
  margin-bottom: 24px;
}

.chip {
  background: #f7f4ef;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.chip:hover {
  background: #f0e8dd;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.chip.active {
  background: linear-gradient(135deg, #c7a465, #b08d57);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(176, 141, 87, 0.4);
}

.rec-mount{
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  min-height: 140px;              /* deja hueco aunque no haya datos */
  transform-style: preserve-3d;   /* para el tilt */
  will-change: transform;
}
.rec-empty{
  font-size: .95rem;
  color: rgba(62,39,26,.75);
}


.rec-mount{
  margin-top:12px;
  padding:16px;
  border-radius:16px;
  min-height:140px;
  transform-style:preserve-3d;
  will-change:transform;
}
.rec-empty{ font-size:.95rem; color:rgba(62,39,26,.75); }



.rec-mount{
  margin-top:12px;
  padding:16px;
  border-radius:16px;
  min-height:140px;
  transform-style:preserve-3d;
  will-change:transform;
}
.rec-empty{ font-size:.95rem; color:rgba(62,39,26,.75); }

.rec-mount{ margin-top:12px; padding:16px; border-radius:16px; }
.rec-card{ perspective:1600px; }
.rec-grid{ display:grid; grid-template-columns:160px 1fr; gap:16px; align-items:start; }
.rec-cover{ width:160px; aspect-ratio:2/3; border-radius:12px; overflow:hidden; background:rgba(0,0,0,.06); }
.rec-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.rec-eyebrow{ font-size:.75rem; letter-spacing:.04em; text-transform:uppercase; opacity:.7; margin-bottom:6px; }
.rec-title{ margin:.1rem 0 .25rem; font-size:1.1rem; }
.rec-meta{ opacity:.8; margin-bottom:8px; }
.rec-why{ line-height:1.6; margin:8px 0 12px; }
.rec-actions{ display:flex; gap:8px; flex-wrap:wrap; }
@media (max-width:900px){ .rec-grid{ grid-template-columns:1fr; } .rec-cover{ width:100%; } }

.big-pref{ margin-bottom:16px; }


.rec-mount{ margin-top:12px; padding:16px; border-radius:16px; transform-style:preserve-3d; will-change:transform; }
.rec-card{ perspective:var(--flip-persp,1600px); }
.rec-grid{ display:grid; grid-template-columns:160px 1fr; gap:16px; align-items:start; }
.rec-cover{ width:160px; aspect-ratio:2/3; background:rgba(0,0,0,.06); border-radius:12px; overflow:hidden; }
.rec-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.rec-eyebrow{ font-size:.75rem; letter-spacing:.04em; text-transform:uppercase; opacity:.7; margin-bottom:6px; }
.rec-title{ margin:.1rem 0 .25rem; font-size:1.1rem; }
.rec-meta{ opacity:.8; margin-bottom:8px; }
.rec-why{ line-height:1.6; margin:8px 0 12px; }
.rec-actions{ display:flex; gap:8px; flex-wrap:wrap; }
@media (max-width:900px){ .rec-grid{ grid-template-columns:1fr; } .rec-cover{ width:100%; } }


/* Contenedor principal */
.rec-card {
  background: rgba(250, 245, 235, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(176, 141, 87, 0.4);
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  overflow: hidden;
  padding: 16px;
  max-width: 360px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rec-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.3);
}

/* Grid interno */
.rec-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Imagen */
.rec-cover img {
  border-radius: 14px;
  border: 1px solid #b08d57;
  object-fit: cover;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.rec-cover img:hover {
  transform: scale(1.03);
}

/* Info */
.rec-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7a6541;
  margin-bottom: 4px;
}

.rec-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c2c2c;
  margin-bottom: 6px;
}

.rec-meta {
  font-family: "Alice", serif;
  font-size: 0.9rem;
  color: #5a5a5a;
  margin-bottom: 6px;
}

.rec-why {
  font-style: italic;
  color: #2e2e2e;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Botones */
.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(135deg, #b08d57, #d4af7a);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d4af7a, #b08d57);
  transform: scale(1.05);
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ccc;
  background: #f3f3f3;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background: #e4e4e4;
  transform: scale(1.03);
}

.rec-card {
  width: 100%;         /* Ocupa todo el ancho disponible */
  max-width: none;     /* Elimina límites fijos */
  box-sizing: border-box;
}


.rec-grid {
  display: flex;
  flex-direction: column;
  align-items: center; /* centra horizontalmente todo el contenido */
  text-align: center;  /* opcional: centra textos */
}

.rec-cover img {
  width: 100%;      /* ocupa el 80% del ancho de la tarjeta */
  max-width: 260px; /* límite en escritorio */
  border-radius: 12px;
  margin-bottom: 16px;
}


/* La tarjeta ocupa todo el ancho del contenedor */
.rec-card{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

/* Estructura vertical: imagen arriba, texto debajo */
.rec-grid{
  display:flex;
  flex-direction:column;
  align-items:center;        /* centra la portada */
  gap:16px;
}

/* Portada centrada y responsiva */
.rec-cover img{
  width: clamp(180px, 38%, 260px);  /* responsive sin pasarse */
  border-radius:12px;
  display:block;
}

/* Bloque de texto centrado como bloque, pero con texto a la izquierda */
.rec-body{
  width: min(720px, 92%);    /* ancho legible */
  text-align:left;           /* texto izquierdo */
  margin-inline:auto;        /* centra el bloque dentro de la tarjeta */
}

/* Tipografía/ritmo (opcional, suave) */
.rec-eyebrow{ letter-spacing:.08em; opacity:.75; margin-top:4px; }
.rec-title{ margin:0 0 4px 0; }
.rec-meta{ opacity:.7; margin-bottom:6px; }
.rec-why{ margin-top:10px; line-height:1.55; }

/* Acciones al ancho del bloque de texto */
.rec-actions{
  display:flex;
  gap:12px;
  margin-top:14px;
}
.rec-actions .btn,
.rec-actions .btn-primary{ flex:1; }

@media (max-width: 560px){
  .rec-cover img{ width: clamp(160px, 64%, 220px); }
  .rec-body{ width: 94%; }
}

/* contexto seguro */
.rec-card{ position:relative; }
.rec-media{ position:relative; overflow:visible; }
.rec-cover{ position:relative; z-index:1; }

/* GRUPO: arriba-derecha, en fila, siempre visible */
.rec-pearls{
  position:absolute;
  top:16px;
  right:16px;
  left:auto; bottom:auto;
  display:flex;
  flex-direction:row;   /* en fila */
  gap:8px;
  z-index:5;
  opacity:1;            /* siempre visibles */
}

/* BOTONES: usan tu skin quote-btn; anula posiciones antiguas */
.rec-pearls .rec-nav{
  position:static !important;
  --size:34px;                 /* tamaño tipo quote-btn--sm */
  display:grid; place-items:center;
  transform:none !important;
}

/* chevrons */
.rec-pearls .rec-nav::after{
  content:"";
  width:8px; height:8px; margin:auto;
  border-top:2px solid rgba(60,45,30,.9);
  border-right:2px solid rgba(60,45,30,.9);
  transform:rotate(45deg);     /* → */
}
.rec-pearls .prev::after{ transform:rotate(225deg); }  /* ← */

/* si existía un DIV .rec-nav antiguo, escóndelo sin afectar a los botones */
div.rec-nav{ display:none !important; }


/* Grupo arriba-derecha */
.rec-pearls{
  position:absolute;
  top:18px;              /* un poco más abajo para respirar */
  right:18px;
  display:flex;
  flex-direction:row;    /* en fila */
  gap:12px;              /* más separación entre botones */
  align-items:center;    /* centra verticalmente los dos */
  z-index:5;
}

/* Botones */
.rec-pearls .rec-nav{
  position:static !important;
  --size:34px;
  display:grid; 
  place-items:center;
}

/* Chevron */
.rec-pearls .rec-nav::after{
  content:"";
  width:8px; height:8px; margin:auto;
  border-top:2px solid rgba(60,45,30,.9);
  border-right:2px solid rgba(60,45,30,.9);
  transform:rotate(45deg);
}
.rec-pearls .prev::after{ transform:rotate(225deg); }


/* Grupo arriba-derecha */
.rec-pearls{
  position:absolute;
  top:18px;
  right:18px;
  display:flex;
  flex-direction:row;
  gap:12px;
  align-items:center;
  z-index:5;
}

/* Botones base (usan skin de quote-btn dorada) */
.rec-pearls .rec-nav{
  position:static !important;
  --size:34px;
  display:grid;
  place-items:center;
  color:#fff;           /* color del texto dentro */
  font-size:18px;
  font-weight:bold;
  line-height:1;
  text-align:center;
}

/* Eliminar chevrons antiguos */
.rec-pearls .rec-nav::after{ content:none; }

/* Insertar símbolos (< y >) en blanco */
.rec-pearls .prev::before{ content:"<"; }
.rec-pearls .next::before{ content:">"; }

/* Grupo arriba-derecha, siempre visible */
.rec-pearls{
  position:absolute;
  top:18px; right:18px;
  display:flex; flex-direction:row; gap:12px; align-items:center;
  z-index:5;
}

/* Botones: usan la skin de .quote-btn; el texto va dentro */
.rec-pearls .rec-nav{
  position:static !important;
  --size:34px;                     /* ajusta si los quieres + grandes */
  display:grid; place-items:center;
  color:#fff;                      /* texto blanco */
  font-size:18px; font-weight:700; line-height:1;
  text-align:center;
}

/* el span con los signos */
.rec-pearls .rec-nav > span{
  display:block;
  transform: translateY(-1px);     /* pequeño ajuste óptico */
  pointer-events:none;
}

/* Desactiva cualquier pseudo antiguo que dibuje flechas */
.rec-pearls .rec-nav::before,
.rec-pearls .rec-nav::after{ content:none !important; }

/* (opcional) si se te forma una “pastilla” blanca entre botones, aumenta espacio o quita glow */
.rec-pearls{ gap:14px; }


/* Grupo arriba-derecha */
.rec-pearls{
  position:absolute; top:18px; right:18px;
  display:flex; flex-direction:row; gap:12px; align-items:center;
  z-index:5;
}

/* Botón dorado (usa tu .quote-btn) + color del icono */
.rec-pearls .rec-nav{
  position:static !important;
  --size:34px;                 /* ajusta tamaño del medallón */
  display:grid; place-items:center;
  color:#fff;                  /* color del chevrón */
}

/* Chevrón dibujado con bordes (nítido y ligero) */
.rec-pearls .rec-nav .chev{
  --thick: 2.5px;              /* grosor del chevrón */
  --side: 11px;                /* tamaño del chevrón */
  width: var(--side);
  height: var(--side);
  border-top: var(--thick) solid currentColor;
  border-right: var(--thick) solid currentColor;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.25)); /* leve glow para contraste */
  pointer-events:none;
}

/* Dirección del chevrón */
.rec-pearls .prev  .chev{ transform: rotate(225deg); } /* “<” */
.rec-pearls .next  .chev{ transform: rotate(45deg);  } /* “>”  */

/* Si tenías flechas anteriores con pseudo, las apagamos */
.rec-pearls .rec-nav::before,
.rec-pearls .rec-nav::after{ content:none !important; }


/* Botón dorado grande */
.rec-pearls .rec-nav{
  position: static !important;
  --size: 44px;                 /* más grande que antes (34px → 44px) */
  display: grid;
  place-items: center;
  color: #fff;
}

/* Chevrón pequeño dentro */
.rec-pearls .rec-nav .chev{
  --thick: 2px;                 /* grosor de la línea */
  --side: 10px;                 /* tamaño total del chevron */
  width: var(--side);
  height: var(--side);
  border-top: var(--thick) solid currentColor;
  border-right: var(--thick) solid currentColor;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.25));
  pointer-events: none;
}

/* Direcciones */
.rec-pearls .prev .chev{ transform: rotate(225deg); } /* “<” */
.rec-pearls .next .chev{ transform: rotate(45deg); }  /* “>”  */


.rec-card {
  position: relative;
}

.rec-pearls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

/* El contenedor de la imagen será el referente de posición */
.rec-media {
  position: relative;
}

/* Flechas pegadas arriba-derecha de la portada */
.rec-pearls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  z-index: 2;            /* por si hay sombras o tilt */
}

/* Por si el tilt/overflow recorta, evita clipping */
.rec-media .rec-cover,
.rec-media {
  overflow: visible;
}


.rec-card {
  position: relative; /* referencia para las flechas */
}

.rec-pearls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5; /* que no quede detrás de nada */
}


.rec-card {
  position: relative; /* referencia del absolute */
}

/* SOLO las perlas hijas directas del card */
.rec-card > .rec-pearls {
  position: absolute !important;
  top: 12px;
  right: 12px;
  left: auto;               /* asegura que no quede anclado a la izquierda */
  display: flex;
  gap: 8px;
  z-index: 10;
  pointer-events: auto;
}


.rec-card {
  font-family: 'Cormorant Garamond', serif;
}


.rec-synopsis { margin: .5rem 0 0.25rem; opacity:.95; }
.rec-why      { margin-top:.25rem; }


.rec-synopsis {
  margin: .6rem 0 .4rem;
  color: #4a4036;
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.95;
}

.rec-why {
  margin-top: .25rem;
  color: #2a2621;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
}


.rec-subcard {
  background: brown;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-top: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  backdrop-filter: blur(8px);
}

.rec-title {
  font-weight: 600;
  font-size: clamp(22px, 2.2vw, 28px);
  margin-bottom: .3rem;
}

.rec-synopsis {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #3b332b;
}

.rec-why {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.5;
  color: #222;
}


.rec-subcard + .rec-subcard {
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 1rem;
  padding-top: 1rem;
}


.rec-subcard:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  transition: all .25s ease;
}



.rec-subcard.synopsis {
  background: rgba(255,255,255,0.65);
}

.rec-subcard.why {
  background: linear-gradient(145deg, rgba(255,248,240,0.85), rgba(240,220,190,0.85));
  font-style: italic;
  border: 1px solid rgba(176,141,87,0.25); /* dorado leve */
}



.rec-subcard {
  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(245,240,230,0.8));
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 14px;
  padding: 1rem;
  margin-top: 0.8rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  backdrop-filter: blur(6px);
}


.rec-synopsis strong {
  font-weight: 600;
  opacity: 0.85;
  color: #3a3229;
}

.rec-why strong {
  font-weight: 600;
  color: #2a2621;
}

.rec-synopsis { font-size: 0.95rem; color: #4a4036; line-height: 1.55; }
.rec-why { font-size: 1rem; font-style: italic; line-height: 1.6; }


.rec-cover img {
  border-radius: 12px;
  border: 1px solid rgba(255, 220, 180, 0.3); /* dorado translúcido */
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0,0,0,0.06); /* opcional, para que resalte más */
  border-radius: 16px; /* por si quieres esquinas suaves */
}


/* ===== Lightbox de portada (nunca desborda) ===== */
.lb-root[hidden] { display: none !important; }

.lb-root {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  padding: clamp(10px, 2.5vw, 28px);
  background: transparent; /* backdrop va aparte */
}

.lb-root .lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 8, 6, .68);
  backdrop-filter: blur(3px) saturate(120%);
  opacity: 1;
}

.lb-root .lb-figure {
  position: relative; z-index: 2; margin: 0;
  /* Contenedor con límites DUROS al viewport */
  width: min(96vw, 1400px);
  height: calc(100dvh - 2 * clamp(10px, 2.5vw, 28px) - 56px); /* resta padding + botón */
  display: grid; place-items: center;
}

.lb-root .lb-img {
  /* La magia: ocupa TODO el contenedor pero sin deformar */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
  opacity: 1; transform: none; /* puedes reactivar tu fade si quieres */
}

.lb-root .lb-cap {
  position: absolute; bottom: -2.2rem; left: 0; right: 0;
  text-align: center; font-style: italic; color: #eee;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  pointer-events: none;
}

/* Botón cerrar fijo y fuera del flujo de la imagen */
.lb-root .lb-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 3;
  width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: #2a2621;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: grid; place-items: center; cursor: pointer;
}

/* Móvil: más alto útil */
@media (max-width: 640px) {
  .lb-root .lb-figure {
    width: 96vw;
    height: calc(100dvh - 2 * clamp(10px, 2.5vw, 28px) - 48px);
  }
}

/* ==== LIGHTBOX - SIEMPRE DENTRO DE PANTALLA ==== */
.lb-root[hidden]{ display:none !important; }

.lb-root{
  --pad: clamp(16px, 3vw, 32px);          /* margen interior reutilizable */
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  padding: var(--pad);
}

.lb-root .lb-backdrop{
  position: absolute; inset: 0;
  background: rgba(10,8,6,.68);
}
@supports ((backdrop-filter: blur(3px)) or (-webkit-backdrop-filter: blur(3px))){
  .lb-root .lb-backdrop{ backdrop-filter: blur(3px) saturate(120%); -webkit-backdrop-filter: blur(3px) saturate(120%); }
}

.lb-root .lb-figure{
  position: relative; margin: 0; z-index: 2;
  /* límites DUROS al viewport */
  max-width: 88vw;
  max-height: calc(100dvh - (var(--pad) * 2) - 48px); /* resta padding + botón */
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;           /* para que la imagen herede curvas bonitas */
  overflow: hidden;              /* por si haces zoom luego */
}

/* La imagen se adapta; sin !important */
.lb-root .lb-img{
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: inherit;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.lb-root .lb-cap{
  margin-top: .6rem; text-align: center; font-style: italic;
  color: #eee; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  max-width: 88vw;
}

.lb-root .lb-close{
  position: absolute;            /* relativo a la figura */
  top: 12px;
  right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #2a2621;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: transform .12s ease, filter .12s ease;
}
.lb-root .lb-close:hover{
  transform: translateY(-1px);
  filter: brightness(.96);
}

.ft-minimal {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  text-align: center;
  padding: 24px 0;
  color: #c9a44f; /* dorado suave base */
  letter-spacing: 0.02em;
}

.ft-minimal .brand {
  font-weight: 700;
  color: #d4af7a; /* dorado vivo */
}

.ft-minimal .sep {
  margin: 0 10px;
  color: #c9a44f; /* separador uniforme */
  font-weight: 600;
}

.ft-minimal .tag {
  color: #c9a44f;
  letter-spacing: 0.03em; /* más aire en tagline */
}

.ft-minimal .credit {
  color: #c9a44f;
}

.ft-minimal a {
  color: #d4af7a;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}

.ft-minimal a:hover {
  border-bottom: 1px solid #d4af7a; /* subrayado dorado editorial */
}

.ft-minimal {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  text-align: center;
  padding: 20px 0;
  color: #e6cfa3; /* dorado claro más legible */
  letter-spacing: 0.02em;
}

.ft-minimal .brand {
  font-weight: 700;
  color: #d4af7a; /* dorado vivo */
}

.ft-minimal .sep {
  margin: 0 8px;
  color: #e6cfa3; /* separadores claros */
  font-weight: 600;
}

.ft-minimal .tag,
.ft-minimal .credit {
  color: #e6cfa3; /* tagline y crédito uniformes */
}

.ft-minimal a {
  color: #d4af7a;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.ft-minimal a:hover {
  border-bottom: 1px solid #d4af7a;
}

/* Responsive: apila en pantallas estrechas */
@media (max-width: 560px) {
  .ft-minimal {
    font-size: 0.85rem;
    line-height: 1.6;
  }
  .ft-minimal span {
    display: block;
    margin: 4px 0;
  }
  .ft-minimal .sep {
    display: none;
  }
}


.ft-minimal a {
  color: #d4af7a;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
  cursor: pointer; /* 👈 ahora el puntero cambia */
}

.ft-minimal a:hover {
  border-bottom: 1px solid #d4af7a;
}




/* Overlay del modal */
#bookModal {
  opacity: 0;
  pointer-events: none;           /* no clics mientras está oculto */
  transition: opacity .28s ease;  /* fundido sutil */
}

#bookModal.show {
  opacity: 1;
  pointer-events: auto;
}

/* La tarjeta interior del modal */
#bookModal .modal.modal-compact {
  opacity: 0;
  transform: translateY(10px) scale(.985);
  transition:
    opacity .32s ease,
    transform .36s cubic-bezier(.22,.72,.16,1);
  will-change: opacity, transform;
}

#bookModal.show .modal.modal-compact {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Respeta usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  #bookModal,
  #bookModal .modal.modal-compact {
    transition: none;
  }
}


/* Tarjeta base */
.book-card {
  font-family: "Cormorant Garamond", serif;
  color: #2a2a2a;
  background: #ffffffcc;
  border-radius: 14px;
  padding: 12px;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* Portada */
.book-card .cover img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  margin-bottom: 10px;
  transition: transform .3s ease;
}

.book-card:hover .cover img {
  transform: scale(1.03);
}

/* Título */
.book-card .title {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 6px 0 4px;
  color: #1f1f1f;

  /* corte elegante si es muy largo */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Autor */
.book-card .author {
  font-weight: 400;
  font-size: 0.9rem;
  color: #5a4a3a; /* tono cálido, elegante */
  margin-top: 2px;
  opacity: .85;
}


/* ========= SMARTPHONES (<=639px) ========= */
@media (max-width: 639px){

  /* 1) Simplificamos el frame */
  .rec-mount.classic-frame{
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  /* 2) Card más ancha y ligera */
  .rec-card{
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 16px;
    background: #f7f3ee;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }

  /* 3) Apilar portada + texto */
  .rec-grid{
    display: block;
  }
  .rec-media{
    margin-bottom: 1rem;
  }
  .rec-cover img{
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 12px;
  }

  /* 4) Textos más fluidos */
  .rec-title{
    font-size: clamp(1.25rem, 2.5vw + .6rem, 1.6rem);
    line-height: 1.2;
  }
  .rec-meta,
  .rec-body p{
    font-size: clamp(.95rem, 1.2vw + .6rem, 1.05rem);
    line-height: 1.55;
    max-width: 62ch;
  }

  /* 5) Botones de navegación más pequeños visualmente */
  .rec-pearls{
    position: absolute;
    top: .5rem;
    right: .5rem;
    display: flex;
    gap: .5rem;
  }

  .rec-pearls .rec-nav::after{
    content:"";
    position: absolute; inset:-6px;  /* hit-area de 48px */
  }
  .rec-pearls .rec-nav .chev{
    width: 14px; height: 14px;
  }

  /* 6) Subcards con menos padding para mobile */
  .rec-subcard{
    padding: 12px;
    border-radius: 12px;
  }
}


@media (max-width: 639px){

  /* Añadimos espacio arriba en la imagen */
  .rec-media{
    position: relative;
    padding-top: 48px; /* espacio donde vivirán los botones */
  }

  .rec-cover img{
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  /* Botones posicionados en ese padding */
  .rec-pearls{
    position: absolute;
    top: 8px;     /* dentro del padding-top */
    right: 8px;
    display: flex;
    gap: .5rem;
  }

  .rec-pearls .rec-nav{
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: 0 6px 14px rgba(0,0,0,.15);
    position: relative;
  }

  .rec-pearls .rec-nav::after{
    content:"";
    position:absolute; inset:-6px; /* área táctil 48px */
  }

  .rec-pearls .rec-nav .chev{
    width: 8px;
    height: 8px;
    opacity: 0.85; /* más fino, menos invasivo */
  }
}


/* Estilo base (mobile first: smartphones) */
#freeText {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  font-size: 0.95rem;   /* más compacto */
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid #ddd;
  resize: vertical;
}

/* Tablets (>=640px) */
@media (min-width: 640px) {
  #freeText {
    min-height: 140px;
    padding: 14px;
    font-size: 1rem;
    line-height: 1.5;
  }
}

/* Desktop (>=1024px) */
@media (min-width: 1024px) {
  #freeText {
    min-height: 160px;
    padding: 16px 18px;
    font-size: 1.05rem;
    line-height: 1.55;
  }
}


/* ========= SMARTPHONES (<=639px) ========= */
@media (max-width: 639px){

  /* Rejilla de mini-covers */
  .results-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 por fila */
    gap: 12px;
    padding: 8px 0;
  }

  /* Card compacta: solo portada + texto corto */
  .book-card{
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .book-card .cover{
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
  }
  .book-card .cover img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Título/autor compactos con recorte elegante */
  .book-card .title{
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;     /* 2 líneas máximo */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-card .author{
    font-size: 0.76rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Ultra-compact en pantallas muy pequeñas */
  @media (max-width: 360px){
    .results-grid{ grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; } /* 4 por fila si cabe */
    .book-card .title{ -webkit-line-clamp: 1; }
    .book-card .author{ display:none; } /* oculta autor para ganar aire */
  }

  /* Paginación: más baja y táctil */
  .pagination-card{
    margin-top: 12px;
    background: transparent;
    box-shadow: none;
  }
  .pagination-scroll{
    justify-content: center;
    gap: 6px;
  }
  .pagination-scroll .page{
    min-width: 36px;            /* visible pequeño */
    height: 36px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.9rem;
    position: relative;
  }
  .pagination-scroll .page::after{
    content:"";                 /* hit-area 44px */
    position:absolute; inset:-4px;
  }
  .perg-numbers .page{
    border: 1px solid #ddd;
    background: #faf8f5;
  }
}


/* smartphones */
@media (max-width: 639px){
  .results-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:12px;
    padding:8px 6px;
  }

  .book-card{
    display:flex; flex-direction:column;
  }

  .book-card .cover{
    position:relative;
    aspect-ratio: 2 / 3;    /* todas iguales */
    border-radius:12px;
    overflow:hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    background:#ede7df;     /* base para carga/fallback */
  }
  .book-card .cover img{
    width:100%; height:100%;
    object-fit:cover; display:block;
    transition: transform .2s ease;
  }
  .book-card:hover .cover img{ transform: scale(1.02); } /* micro-interacción */

  /* gradiente sutil abajo para leer títulos superpuestos si quieres */
  .book-card .cover::after{
    content:""; position:absolute; inset:0 0 0 0;
    background: linear-gradient(180deg, transparent 65%, rgba(0,0,0,.08));
    pointer-events:none;
  }

  /* textos compactos y elegantes */
  .book-card .title{
    margin-top:6px;
    font-size:.88rem; line-height:1.25; font-weight:600;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .book-card .author{
    font-size:.78rem; color:#6a6a6a;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  /* ultra-compacto en pantallas muy estrechas */
  @media (max-width: 360px){
    .results-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; }
    .book-card .title{ -webkit-line-clamp:1; }
    .book-card .author{ display:none; }
  }
}

@media (max-width: 639px){
  .pagination-card{ background:transparent; box-shadow:none; margin:10px 0 4px; }
  .pagination-scroll{ justify-content:center; gap:6px; }
  .pagination-scroll .page{
    min-width:36px; height:36px; border-radius:999px;
    font-size:.9rem; position:relative; padding:0 10px;
    border:1px solid #e3d9c9; background:#faf7f2;
  }
  .pagination-scroll .page.active{ background:#eadfcf; font-weight:700; }
  .pagination-scroll .page::after{ content:""; position:absolute; inset:-4px; } /* hit 44px */
}

@media (prefers-reduced-motion: reduce){
  .book-card:hover .cover img{ transform:none; }
}

/* separar botones de la imagen */
.quote-controls{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-bottom: 18px; /* espacio entre botones y avatar */
}

/* botones más compactos pero cómodos al tacto */
.quote-controls .quote-btn .rec-pearls .rec-nav{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg,#f6e7c9,#dec080);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  position: relative;
}

/* área táctil segura (48px) */
.quote-controls .quote-btn::after .rec-pearls .rec-nav::after{
  content:"";
  position:absolute;
  inset:-5px;
}
 


/* icono más pequeño dentro */
.quote-controls .quote-btn .rec-pearls .rec-nav .chev{
  font-size: 1rem;  /* «‹ ›» se verán más finos */
  line-height: 1;
}

/* ============ GRID & RESPIRACIÓN ============ */
.results-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr)); /* móvil 3 por fila */
  gap: 16px 12px;                                  /* +aire vertical */
  padding: 8px 8px 72px;                           /* hueco para paginación sticky */
}

/* muy estrecho: 4 por fila */
@media (max-width: 360px){
  .results-grid{ grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px 10px; }
}

/* tablet/desktop */
@media (min-width: 768px){
  .results-grid{ grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px 14px; }
}
@media (min-width: 1200px){
  .results-grid{ grid-template-columns: repeat(6, minmax(0,1fr)); gap: 20px 16px; }
}

/* ============ CARD ============ */
.book-card{
  display:flex; flex-direction:column;
  transition: transform .18s ease, box-shadow .18s ease;
  will-change: transform;
}
.book-card:focus-within,
.book-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}

/* portada consistente */
.book-card .cover{
  position:relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow:hidden;
  background:#ede7df;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.book-card .cover img{
  width:100%; height:100%; object-fit:cover; display:block;
  transition: transform .22s ease;
}
.book-card:hover .cover img{ transform: scale(1.02); }

.book-card .cover::after{ /* gradiente sutil de lectura */
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 65%, rgba(0,0,0,.08));
  pointer-events:none;
}

/* ============ TIPOGRAFÍA (jerarquía limpia) ============ */
.book-card .title{
  margin-top: 8px;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;    /* 2 líneas fijas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card .author{
  margin-top: 2px;
  font-size: .78rem;
  color: #7a7a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* más grandes en desktop */
@media (min-width: 1024px){
  .book-card .title{ font-size: 1rem; }
  .book-card .author{ font-size: .86rem; }
}

/* ============ PLACEHOLDER UNIFICADO ============ */
.cover.is-empty{
  background: radial-gradient(120% 100% at 30% 20%, #fff6e6, #e6d3b5);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.08);
}
.cover.is-empty::before{
  content:"Libris.app";
  position:absolute; inset:auto 0 12px 0;
  text-align:center; font-size:.75rem; color:#725b2e; opacity:.8;
}
.cover.is-empty::after{
  content:""; position:absolute; inset:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24' fill='none' stroke='%23725b2e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5.5A2.5 2.5 0 0 1 6.5 3H20v16.5'/%3E%3Cpath d='M4 5.5h14.5A1.5 1.5 0 0 1 20 7v12.5'/%3E%3C/svg%3E")
             center 36% / 42% no-repeat;
  opacity:.35;
}

/* ============ PAGINACIÓN STICKY ============ */
.pagination-card{
  position: sticky;
  bottom: 8px;
  padding: 8px 0;
  background: linear-gradient(180deg, transparent, rgba(250,247,242,.95) 30%);
  backdrop-filter: blur(2px);
  z-index: 5;
}
.pagination-scroll{
  display:flex; justify-content:center; gap:8px;
}
.pagination-scroll .page{
  min-width: 36px; height: 36px; border-radius: 999px;
  padding: 0 10px; font-size: .9rem;
  border: 1px solid #e3d9c9; background: #faf7f2;
  position: relative;
  transition: background .15s ease, transform .1s ease;
}
.pagination-scroll .page.active{ background:#eadfcf; font-weight:700; }
.pagination-scroll .page:active{ transform: translateY(1px); }
.pagination-scroll .page::after{ content:""; position:absolute; inset:-4px; } /* hit 44px */

/* accesibilidad */
.pagination-scroll .page[aria-current="page"]{ outline: 2px solid #bfa06a; outline-offset: 2px; }

/* reduce motion users */
@media (prefers-reduced-motion: reduce){
  .book-card, .book-card .cover img, .pagination-scroll .page{ transition: none; }
}


/* ===== base elegante y legible */
.book-card .author{
  margin-top: 2px;
  font-size: .82rem;               /* fino pero claro */
  font-weight: 500;
  letter-spacing: .15px;
  color: #f3e4bf;                  /* dorado/crema */
  text-shadow:
    0 1px 1px rgba(0,0,0,.32),     /* ancla de contraste */
    0 0 2px  rgba(243,228,191,.45);/* glow muy sutil */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== hover/focus (desktop): brillo contenido, no “neón” */
@media (hover:hover){
  .book-card .author:hover,
  .book-card .author:focus{
    color: #f7eac6;
    text-shadow:
      0 1px 1px rgba(0,0,0,.34),
      0 0 3px rgba(247,234,198,.55);
  }
}

/* ===== mobile muy estrecho: baja 1px para no reflow */
@media (max-width: 360px){
  .book-card .author{ font-size: .78rem; }
}

/* ===== desktop: un peldaño más grande */
@media (min-width: 1024px){
  .book-card .author{ font-size: .9rem; }
}

/* ===== dark mode: dorado más vivo y sombra un poco más profunda */
@media (prefers-color-scheme: dark){
  .book-card .author{
    color: #ffe5a6;
    text-shadow:
      0 1px 1px rgba(0,0,0,.55),
      0 0 3px rgba(255,229,166,.5);
  }
}

/* ===== usuarios que piden más contraste */
@media (prefers-contrast: more){
  .book-card .author{
    color: #f9e9c2;                 /* sube luminancia */
    text-shadow:
      0 1px 1px rgba(0,0,0,.45),    /* ancla más marcada */
      0 0 2px rgba(249,233,194,.55);
  }
}


/* Paleta */
:root {
  --bg-light: #fdfbf9;
  --bg-grad: linear-gradient(180deg, #fff 0%, #f6eee6 100%);
  --border: #e2d2c2;
  --accent: #b07d55;   /* bronce suave */
  --accent-dark: #8a5b3f;
  --shadow: 0 6px 18px rgba(62, 36, 14, .12);
  --inner: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(0,0,0,.06);
}

/* Contenedor */
.pagination-card {
  display: flex;
  justify-content: center;
  padding: 18px;
  border-radius: 20px;
  background: var(--bg-grad);
  box-shadow: var(--shadow);
  border: 1px solid rgba(176,125,85,.25);
}

.pagination-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Números */
.perg-numbers {
  display: flex;
  gap: 10px;
}

/* Botón base */
.page {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-grad);
  box-shadow: var(--inner), 0 1px 4px rgba(0,0,0,.05);
  color: #5b4637;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  cursor: pointer;
  transition: all .15s ease;
}

/* Hover */
.page:hover {
  transform: translateY(-1px);
  box-shadow: var(--inner), 0 6px 14px rgba(0,0,0,.08);
  border-color: var(--accent);
}

/* Activo */
.page.active {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 14px rgba(0,0,0,.2);
}

/* Focus accesible */
.page:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9),
              0 0 0 6px rgba(176,125,85,.45),
              var(--inner);
}

/* Disabled */
.page[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.book-card { overflow: hidden; } /* por si acaso */
.book-card .authors{
  font-size: .95rem;
  line-height: 1.25;
  color: #d9c9a9;               /* tu dorado-crema */
  max-height: calc(1.25em * 2); /* 2 líneas */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;        /* ← magia */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;       /* evita desbordes por palabras largas */
  hyphens: auto;
}


/* Botones de paginación con estilo de .chat-form .btn */
.pagination-card .page {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: 'Cormorant Garamond', serif;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .15),
              inset 0 1px 0 rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: all .2s ease;
  min-width: 42px;
  height: 42px;
}

/* Hover */
.pagination-card .page:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .2),
              inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* Activo (la página seleccionada) */
.pagination-card .page.active {
  background: linear-gradient(145deg, #8a5b3f, #b07d55);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25),
              inset 0 1px 0 rgba(255, 255, 255, .15);
  transform: none;
}

/* Focus accesible */
.pagination-card .page:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .8),
              0 0 0 6px rgba(198, 162, 125, .6);
}

/* Disabled */
.pagination-card .page[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.book-card .authors {
  font-size: 0.95rem;
  font-weight: 500;
  color: #3a281c; /* marrón oscuro, mismo tono de botones */
  letter-spacing: 0.2px;
}

.pagination-card {
  position: fixed;
  bottom: 18px;          /* se pega al borde inferior */
  left: 50%;
  transform: translateX(-50%); /* centrada */
  z-index: 1000;

  display: flex;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.12); /* glass */
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,220,180,0.35);
  box-shadow: 0 6px 20px rgba(0,0,0,.18), 0 0 10px rgba(198,162,125,.25);

  max-width: 420px;
  width: calc(100% - 40px); /* margen lateral en pantallas pequeñas */
}

/* Botones */
.pagination-card .page {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 40px; height: 40px;
  font: 600 14px 'Cormorant Garamond', serif;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  transition: all .2s ease;
}

.pagination-card .page.active {
  background: linear-gradient(145deg, #8a5b3f, #b07d55);
  color: #fff;
}

/* Hover */
.pagination-card .page:hover {
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 640px) {
  .pagination-card {
    max-width: 320px;
    padding: 8px 12px;
  }
  .pagination-card .page {
    min-width: 34px;
    height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }
}

.pagination-card {
  position: relative;      /* 👈 ya no fija */
  margin: 32px auto 24px;  /* 👈 espacio arriba y abajo */
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 16px;

  max-width: 380px;        /* 👈 estrecha y centrada */
  width: calc(100% - 40px);

  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,220,180,0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 0 10px rgba(198,162,125,.25);
}

.pagination-scroll {
  display: flex;
  gap: 8px;
}

/* Botones */
.pagination-card .page {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  min-width: 38px;
  height: 38px;
  padding: 8px 12px;
  font: 600 14px 'Cormorant Garamond', serif;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  transition: all .2s ease;
}

.pagination-card .page.active {
  background: linear-gradient(145deg, #8a5b3f, #b07d55);
  color: #fff;
}

.pagination-card .page:hover {
  transform: translateY(-2px);
}

/* Responsive compacto */
@media (max-width: 640px) {
  .pagination-card {
    max-width: 300px;
    padding: 10px 12px;
  }
  .pagination-card .page {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }
}

/* Tarjeta de paginación centrada bajo el grid */
.pagination-card{
  position: relative;
  margin: 24px auto 28px;     /* espacio arriba/abajo y centrado */
  max-width: 380px;
  width: calc(100% - 40px);

  display:flex; justify-content:center; padding:12px 16px;
  border-radius:16px;

  background: rgba(255,255,255,.12);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,220,180,.35);
  box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 0 10px rgba(198,162,125,.25);
}

/* Fila interna y botones (tus estilos bronce) */
.pagination-scroll{ display:flex; gap:8px; }
.pagination-card .page{
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color:#3a281c; border:none; border-radius:12px;
  min-width:38px; height:38px; padding:8px 12px;
  font:600 14px 'Cormorant Garamond', serif;
  box-shadow:0 4px 10px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  cursor:pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.pagination-card .page.active{
  background: linear-gradient(145deg, #8a5b3f, #b07d55);
  color:#fff;
}
.pagination-card .page:hover{ transform: translateY(-2px); }

/* Un pelín más compacta en móvil */
@media (max-width:640px){
  .pagination-card{ max-width: 320px; padding:10px 12px; }
  .pagination-card .page{ min-width:34px; height:34px; font-size:13px; }
}


/* Grid de resultados */
.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 👈 ahora 5 por fila */
  gap: 22px;
  align-items: start;
}

/* breakpoints responsivos */
@media (max-width: 1280px) {
  .results-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr; }
}

.book-card .author {
  margin-top: 6px;
  font-size: 1rem; /* 👈 un poco más grande */
  font-weight: 600;
  color: #4a2e1c;  /* 👈 marrón oscuro elegante, más cálido que el negro */
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.3px;
  line-height: 1.3;
  text-align: center;
  transition: color 0.2s ease;
}

/* Hover suave para darle “vida” */
.book-card .author:hover {
  color: #2f1e12; /* un tono más profundo aún */
}

/* ====== SOLO MÓVIL / TABLET PEQUEÑA ====== */
@media (max-width: 640px){

  /* Siempre 2 columnas en smartphone */
  .results-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
    align-items: start;
  }

  /* tarjeta compacta y uniforme */
  .book-card{
    height: auto;              /* deja respirar; el grid manda */
    padding: 10px;
    border-radius: 12px;
  }

  /* portada consistente (2:3) y responsive */
  .book-card .cover{
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
  }
  .book-card .cover img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* título y autor: legibles pero compactos */
  .book-card .title{
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* 2 líneas fijas */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-card .author{
    margin-top: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a2e1c;                  /* marrón oscuro elegante */
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* paginación centrada y compacta en móvil */
  .pagination-card{
    max-width: 320px;
    padding: 10px 12px;
    margin: 18px auto 20px;
    width: calc(100% - 32px);
  }
  .pagination-card .page{
    min-width: 34px;
    height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }
}


/* CENTRADO A PRUEBA DE FLEX, GRID Y TEXT-ALIGN */
.pagination-card{
  /* que NO ocupe todo el ancho */
  width: max-content;          /* se ajusta al tamaño de los botones */
  max-width: 100%;
  /* centrado universal */
  margin: 32px auto !important;/* centra en bloques normales */
  align-self: center;          /* centra si el padre es flex-column con align-items:flex-end */
  float: none;                  /* por si alguna regla flotaba */
  display: inline-flex;         /* permite centrar también con text-align del padre */
  justify-content: center;
}

/* por si el contenedor es un flex que empuja a la derecha */
.classic-frame > .pagination-card{ align-self: center !important; }

/* si el contenedor usa text-align, ayuda extra */
.classic-frame{ text-align: center; }         /* NO rompe el grid hijo */


/* ===== MÓVIL: tarjetas uniformes y diferenciadas ===== */
@media (max-width: 640px){
  :root{
    --card-bg: #f7efe6e6;           /* beige cálido translúcido */
    --card-border: rgba(78, 55, 38, .12);
    --card-shadow: 0 6px 14px rgba(0,0,0,.10);
    --ink-dark: #4a2e1c;            /* marrón oscuro elegante */
  }

  /* Grid: 2 por fila (ya lo tienes), mantenemos gaps */
  .results-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px 14px;
    align-items: start;
  }

  /* Tarjeta: fondo claro, borde y sombra sutil para diferenciar cada libro */
  .book-card{
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;                 /* por si acaso */
  }

  /* Separador minimal opcional entre portada y texto */
  .book-card .cover{ 
    aspect-ratio: 2/3; 
    border-radius: 10px; 
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
  }
  .book-card .cover + .title{
    margin-top: 10px;
    position: relative;
  }
  .book-card .cover + .title::before{
    content:"";
    position:absolute; inset:-10px 0 auto 0; height:1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.06), transparent);
  }

  /* Bloque de texto con alturas fijas para uniformidad */
  .book-card .title{
    font-size: .95rem;
    line-height: 1.25;
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;              /* máx 2 líneas */
    overflow: hidden;
    min-height: calc(1.25em * 2);       /* altura fija de título */
  }

  .book-card .author{
    margin-top: 6px;
    color: var(--ink-dark);
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.25em;                 /* altura fija de autor */
  }

  /* Pie fantasma para igualar base (por si hay badges/botones en otras tarjetas) */
  .book-card::after{
    content:"";
    display:block;
    height: 6px;                         /* respiración igual en todas */
  }

  /* Toques de interacción (sutiles en móvil) */
  .book-card:active{
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
  }

  /* Paginación centrada y compacta */
  .pagination-card{
    width: max-content;
    max-width: 100%;
    margin: 18px auto 20px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(199,164,125,.35);
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
  }
  .pagination-card .page{
    min-width: 34px; height: 34px; padding: 6px 10px; font-size: 13px;
  }
}


/* Modal/Detalle: portada más pequeña SOLO en móvil */
@media (max-width: 640px){
  #bmCover{
    width: clamp(120px, 38vw, 220px); /* menos tamaño visual */
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    image-rendering: auto;
  }
}

:root{
  --gold:#d4af37;
  --bronze-1:#b08d57;   /* bronce base */
  --bronze-2:#7a5a2f;   /* bronce más oscuro */
  --ink:#2b2b2b;
  --cream:#f6f1e7;
}


.btn-saga{
  display:inline-flex; align-items:center; gap:.55rem;
  padding:.58rem 1rem; min-height:42px;
  font-family:"Cormorant Garamond", serif; font-weight:600; letter-spacing:.2px;
  color:var(--bronze-1); background:#fff;
  border:1px solid var(--bronze-1); border-radius:999px;
  cursor:pointer; -webkit-tap-highlight-color:transparent;
  transition: transform .12s ease, border-color .12s ease, color .12s ease;
  will-change: transform; transform: translateZ(0);
}
.btn-saga:hover{ border-color:var(--bronze-2); color:var(--bronze-2); transform:translateY(-1px); }
.btn-saga:active{ transform:translateY(0); }
.btn-saga:focus-visible{ outline:2px solid var(--bronze-1); outline-offset:3px; }

/* Chevron CSS */
.btn-saga .chev{
  inline-size:10px; block-size:10px;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform: rotate(-45deg); transition: transform .12s ease; opacity:.85;
}
.btn-saga[data-expanded="true"] .chev{ transform: rotate(135deg); }

.rec-card .saga-list{ margin-top:.9rem; font-family:"Cormorant Garamond", serif; color:var(--bronze-1); }
.rec-card .saga-ul{
  list-style:none; margin:0; padding:0;
  border-radius:14px;
  background:rgba(255,255,255,.28);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border:1px solid rgba(0,0,0,.05);
}
.rec-card .saga-item{ margin:0; padding:.7rem 1rem; border-bottom:1px solid rgba(0,0,0,.06); }
.rec-card .saga-item:last-child{ border-bottom:none; }

.rec-card .saga-link,
.rec-card .saga-link:link,
.rec-card .saga-link:visited{
  display:block; color:var(--bronze-1) !important;
  text-decoration:none !important; border-bottom:none !important;
  cursor:pointer; position:relative;
  padding:.15rem .1rem; border-radius:8px;
  transition: background-color .12s ease, color .12s ease;
}
.rec-card .saga-link::after{
  content:""; position:absolute; left:0; right:0; bottom:.1rem;
  height:1px; background: currentColor; opacity:.18;
  transform: scaleX(0); transform-origin:left; transition: transform .16s ease;
}
.rec-card .saga-link:hover{
  background:rgba(212,175,55,.08);
  color:var(--bronze-2) !important;
}
.rec-card .saga-link:hover::after{ transform: scaleX(1); }
.rec-card .saga-link:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px #fff, 0 0 0 4px rgba(212,175,55,.55);
}


/* Variante ghost del botón saga (para uso dentro de cada libro) */
.btn-saga.is-ghost{
  background:transparent;
  border:1px solid var(--bronze-1);
  color:var(--bronze-1);
}
.btn-saga.is-ghost:hover{
  background:rgba(212,175,55,.10);
  color:var(--bronze-2);
  border-color:var(--bronze-2);
}


/* Botón normal (para la ficha de la saga) */
.btn-saga {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, var(--cream));
  border: 1px solid rgba(212,175,55,.55);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.btn-saga:hover {
  background: linear-gradient(180deg, #fff8ea, #f0e6d8);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* Variante ghost: discreta, para los hijos */
.btn-saga.is-ghost {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 500;
  font-size: .95rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn-saga.is-ghost:hover {
  background: rgba(212, 175, 55, .08);
  color: #a8861d;            /* tono dorado más oscuro al pasar */
  border-color: #a8861d;
}

/* Icono chevron dentro del botón */
.btn-saga .chev {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-left: .25rem;
}

.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0;
  text-align: center;
  color: #d4af37; /* dorado */
  letter-spacing: 1px;
  position: relative;
}

.results-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  margin: 0.5rem auto 0;
  background: #d4af37; /* subrayado dorado */
  border-radius: 2px;
}


.results-section {
  margin: 2rem 0;
  text-align: center; /* centramos todo */
}

.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0;
  color: #d4af37; /* dorado elegante */
  letter-spacing: 1px;
  position: relative;
  display: inline-block; /* título se ajusta a su texto */
}

.results-title::after {
  content: "";
  display: block;
  width: 60px;       /* fijo */
  height: 2px;
  margin: 0.5rem auto 0;
  background: #d4af37;
  border-radius: 2px;
}

.results-section {
  margin: 2rem 0;
  text-align: center;
}

.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0;
  color: #d4af37;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
}

.results-title::after {
  content: "";
  display: block;
  width: 200px; /* línea más larga */
  height: 2px;
  margin: 0.5rem auto 0;
  background: linear-gradient(
    to right,
    transparent,
    #d4af37,
    transparent
  ); /* extremos afinados */
  border-radius: 2px;
}

/* Botón genérico */
.btn {
  position: relative;
  cursor: pointer;
}

/* Desactivar interacción visualmente */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner minimal cuando está cargando */
.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;                /* ajusta según tu padding */
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: rgba(255,255,255,1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }


/* === Cover universal (grid y modal) ==================== */
.cover{
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;           /* siempre 2:3 */
  border-radius: 14px;
  overflow: hidden;
  background: #efe9e2;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.cover > img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .3s ease, opacity .25s;
}

/* En modal solo cambia el tamaño del bloque, no el estilo */
.cover--modal{ width: clamp(220px, 28vw, 320px); }
@media (max-width:640px){ .cover--modal{ width: min(58vw, 260px); } }

/* === Fallback base: ocupa TODO el alto ================= */
.book-fallback{
  position: absolute;
  inset: 0;                       /* pega a los 4 lados -> llena el cover */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 14px;
  border-radius: 14px;
  font-family: "Cormorant Garamond", serif;
  text-align: left;
}
.bf-title{
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 1.2; font-weight: 600; margin-bottom: 6px;
  max-height: 4.5em; overflow: hidden;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
}
.bf-author{ font-size: clamp(12px, 1.8vw, 14px); opacity:.9; margin-bottom:6px; }
.bf-brand { font-size: 11px; letter-spacing:.4px; opacity:.7; text-transform:uppercase; }

/* === Variantes visuales consistentes (1–4) ============= */
.fallback-style-1{
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(165deg, #f6efe7 0%, #eadfce 55%, #e0d2c0 100%);
  color:#2d241b; text-shadow:0 1px 0 rgba(255,255,255,.35);
  border:1px solid rgba(62,39,26,.08);
}
.fallback-style-2{
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)),
    linear-gradient(145deg, #f0e8dd, #e6d8c5);
  backdrop-filter: blur(2px);
  color:#2d241b; border:1px solid rgba(62,39,26,.08);
}
.fallback-style-3{
  background:
    linear-gradient(0deg, rgba(0,0,0,.06), rgba(0,0,0,.06)),
    linear-gradient(160deg, #efe7db, #dbcbb7);
  box-shadow: inset 0 8px 20px rgba(255,255,255,.45);
  color:#2d241b; border:1px solid rgba(62,39,26,.08);
}
.fallback-style-4{
  background: linear-gradient(160deg, #3b2e21 0%, #5a4636 60%, #7c6451 100%);
  color:#f9f3ed; border:1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 8px 18px rgba(0,0,0,.25);
}
.fallback-style-4 .bf-title{ font-weight:700; text-shadow:0 2px 4px rgba(0,0,0,.5); }
.fallback-style-4 .bf-author{ opacity:.85; }
.fallback-style-4 .bf-brand { opacity:.8; }


/* ===== MODAL COMPACTO Y CENTRADO EN DESKTOP ===== */
@media (min-width: 768px){
  .modal.modal-compact{
    width: clamp(520px, 60vw, 720px);  /* ancho más pequeño */
    max-height: 80vh;                 /* alto controlado */
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Layout vertical en lugar de dos columnas */
  .book-modal-vertical{
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
    height: 100%;
    overflow: hidden;
  }

  /* Portada más pequeña y centrada */
  .book-modal-cover{
    display: flex;
    justify-content: center;
  }
  .book-modal-cover .cover{
    width: clamp(200px, 40%, 260px);
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
  }

  /* Texto debajo de la portada */
  .book-modal-body{
    flex: 1;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 6px;
  }
}


/* === Tarjeta de libro (grid) =================== */
.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdfaf6, #f6f0e9);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  font-family: "Cormorant Garamond", serif;
  text-align: center;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

/* Cover consistente */
.book-card .cover {
  width: 100%;
  max-width: 160px;         /* tamaño base en grid */
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  background: #eee;
}

/* Título */
.book-card .title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
  color: #2c2015;
  margin-top: 6px;
  max-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Autor */
.book-card .author {
  font-size: 0.95rem;
  font-style: italic;
  color: #4a3c2f;
  opacity: 0.85;
}

/* Marca o rating */
.book-card .meta {
  font-size: 0.85rem;
  color: #6d5c4a;
  margin-top: 2px;
}

/* === Responsive ================================ */
@media (max-width: 640px) {
  .book-card {
    gap: 8px;
    padding: 12px 8px;
  }
  .book-card .cover {
    max-width: 130px;
  }
  .book-card .title {
    font-size: 1rem;
  }
  .book-card .author {
    font-size: 0.9rem;
  }
}

/* ===== Carrusel de más libros ===== */
.bm-works-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px;
  scroll-snap-type: x mandatory;
}
.bm-works-item {
  flex: 0 0 auto;
  width: 120px; /* ancho compacto */
  scroll-snap-align: start;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  background: none;
  border: none;
  cursor: pointer;
}
.bm-works-item:focus {
  outline: 2px solid #b58963;
  outline-offset: 2px;
}

/* Portada mini */
.bm-works-cover .cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
  margin-bottom: 6px;
}

/* Título reducido */
.bm-works-title-small {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: #2c2015;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;          /* más separación entre botones */
  margin-top: 24px;
}

.login-btn {
  padding: 14px 18px;   /* más alto y ancho */
  border-radius: 12px;
  font-size: 1.05rem;   /* texto un poco mayor */
  font-weight: 600;     /* tipografía más sólida */
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
}

/* Hover y active para dar feedback */
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

/* Colores diferenciados */
#btnLoginEmail {
  background: linear-gradient(180deg, #3b2e21, #2a1c12);
  color: #fff;
}
#btnRegisterEmail {
  background: linear-gradient(180deg, #7c6451, #5c4939);
  color: #fff;
}
#btnLoginGoogle {
  background: #fff;
  color: #333;
  border: 1px solid rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}
#btnLoginGoogle::before {
  content: url('https://www.svgrepo.com/show/355037/google.svg'); /* icono svg */
  display: inline-block;
  width: 18px; height: 18px;
}


/* Autor reducido dentro del fallback */
.bm-works-item .bf-title {
  font-size: 0.75rem;
  line-height: 1.15;
}
.bm-works-item .bf-author {
  font-size: 0.7rem;
}
.bm-works-item .bf-brand {
  font-size: 0.65rem;
  letter-spacing: .3px;
}


.modal .modal-actions .btn.login-btn {
  min-height: 56px !important;
  padding: 14px 22px !important;
  border-radius: 28px !important;    /* pill shape */
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: .3px;
  transition: all .25s ease;
}

/* Iniciar sesión → protagonista */
#btnLoginEmail {
  background: linear-gradient(180deg, #2a1c12, #3b2e21);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
/* Iniciar sesión → bronce oscuro */
#btnLoginEmail {
  background: linear-gradient(180deg, #8b5e3c, #b08d57) !important;
  color: #fff8ef !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.25) !important;
  transition: all .25s ease !important;
}
#btnLoginEmail:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-2px) !important;
}

/* Registrarse → secundario (bronce claro) */
#btnRegisterEmail {
  background: linear-gradient(180deg, #a6907a, #7c6451) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.25) !important;
  transition: all .25s ease !important;
}
#btnRegisterEmail:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-2px) !important;
}

/* Google → claro y distinguido */
#btnLoginGoogle {
  background: #fff !important;
  color: #333 !important;
  border: 1.5px solid rgba(0,0,0,.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.15) !important;
  transition: all .25s ease !important;
}
#btnLoginGoogle::before {
  content:"" !important;
  width: 20px !important;
  height: 20px !important;
  background: url('https://www.svgrepo.com/show/355037/google.svg') no-repeat center/contain !important;
  display: inline-block !important;
}
#btnLoginGoogle:hover {
  background: #f9f9f9 !important;
  transform: translateY(-2px) !important;
}


/* === Overlay pantalla completa, centra el modal === */
#loginModal.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 9998;

  /* Centro real y seguro */
  display: grid;
  place-items: center;

  /* Evita que el modal toque los bordes y permite scroll si es alto */
  padding: 16px;
  overflow: auto;
}

/* === Reset de reglas anteriores que lo descolocaban === */
#loginModal .modal {
  position: static !important;   /* nada de fixed aquí */
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;

  /* Tamaño y look */
  width: min(92vw, 420px);
  max-width: 420px;
  max-height: calc(100dvh - 32px); /* scroll interno si hace falta */
  overflow: auto;

  border-radius: 20px;

  box-shadow: 0 18px 48px rgba(0,0,0,.35);
  padding: 28px 24px;
  text-align: center;
  z-index: 9999; /* sobre el overlay */
}

/* Móviles muy pequeños: un pelín más compacto */
@media (max-width: 420px) {
  #loginModal .modal {
    width: 100%;
    border-radius: 16px;
    padding: 22px 18px;
    max-height: calc(100dvh - 24px);
  }
}




.user-card { position: relative; }

.user-card-inner {
  display:flex; align-items:center; gap:8px;
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  background: linear-gradient(145deg,#7b5234,#a97a55 55%,#caa27a);
  border:1px solid rgba(212,183,110,.4);
  color:#f0e5c4;
}
.user-card-inner:hover { filter: brightness(1.05); }

.caret { font-size:12px; margin-left:6px; }

/* Menú desplegable */
.user-menu {
  display:none;
  position:absolute;
  top:110%; right:0;
  background: rgba(40,25,15,0.96);
  border:1px solid rgba(212,183,110,.35);
  border-radius:10px;
  padding:6px 0;
  min-width:160px;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
  z-index:20;
}
.user-menu.show { display:block; }

/* Items del menú */
.user-menu-item {
  display:block;
  width:100%;
  padding:8px 14px;
  text-align:left;
  background:none;
  border:none;
  color:#f0e5c4;
  font-size:14px;
  cursor:pointer;
  transition: background .15s ease;
}
.user-menu-item:hover { background:rgba(212,183,110,.15); }
.user-menu-item.logout { color:#ffb8a1; }

.caret-icon {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  filter: drop-shadow(0 0 4px rgba(255, 215, 100, 0.5));
  transition: transform .2s ease, filter .2s ease;
}

.caret-icon {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  filter: drop-shadow(0 0 3px rgba(255, 215, 100, 0.6));
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Un poco más visible al hover */
.user-card-inner:hover .caret-icon {
  opacity: 1;
  transform: translateY(1px);
}

.user-card-inner:hover .caret-icon {
  filter: drop-shadow(0 0 6px rgba(255, 215, 100, 0.8));
  transform: translateY(1px);
}

/* === Menú de usuario refinado === */
.user-menu {
  display: none;
  position: absolute;
  top: 110%; right: 0;
  min-width: 190px;

  background: linear-gradient(165deg, rgba(50,30,20,0.98), rgba(30,18,12,0.96));
  border: 1px solid rgba(212,183,110,0.35);
  border-radius: 14px;

  padding: 8px 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.35),
              inset 0 1px 0 rgba(255,255,255,0.08);
  z-index: 20;

  animation: fadeInMenu .25s ease;
}

/* Sutil animación de aparición */
@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Items del menú */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  padding: 10px 16px;

  background: none;
  border: none;
  color: #f4e3b3;  /* dorado suave */
  font-size: 14px;
  font-weight: 500;
  font-family: 'Cormorant Garamond', serif;

  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.user-menu-item:hover {
  background: rgba(212,183,110,0.12);
  padding-left: 20px;  /* pequeño “deslizamiento” */
  color: #fff6d9;
}

/* Iconos */
.user-menu-item::before {
  font-size: 15px;
}

.menu-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-right: 8px;
  filter: drop-shadow(0 0 2px rgba(255, 215, 100, 0.5));
}

.user-menu-item:hover .menu-icon {
  filter: drop-shadow(0 0 4px rgba(255, 215, 100, 0.7));
}


/* Iconos PNG base */
.menu-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 215, 100, 0.5));
  transition: filter 0.2s ease;
}

.user-menu-item:hover .menu-icon {
  filter: drop-shadow(0 0 5px rgba(255, 230, 150, 0.9));
}

/* Hover general */
.user-menu-item:hover {
  background: rgba(212,183,110,0.12);
  color: #fff6d9;
  padding-left: 20px;
}

/* Logout */
.user-menu-item.logout {
  color: #f5b3a1;
}
.user-menu-item.logout:hover {
  background: rgba(245,179,161,0.15);
  color: #ffdbcf;
}

/* 📱 Responsive: móvil */
@media (max-width: 640px) {
  .menu-icon {
    width: 22px;
    height: 22px;
  }
  .user-menu-item {
    padding: 14px 18px;   /* más área táctil */
    font-size: 15px;
  }
}
/* ===== Cover base ===== */
.cover {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

#heroImg {
  display: block;
  width: 100%;
  height: auto;
  transition: filter .5s ease, transform .5s ease;
  will-change: filter, transform;
}

.cover.trends-open #heroImg {
  filter: blur(10px) brightness(.8);
  transform: scale(1.05);
}

/* ===== Flecha/CTA ===== */
.curtain-cta {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  border: none;
  background: rgba(255,255,255,.25);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
}
.curtain-cta:hover {
  background: rgba(255,255,255,.4);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.cover.trends-open .curtain-cta {
  transform: translateX(-50%) rotate(180deg);
}

/* ===== Cortina ===== */
.trend-curtain {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: inherit;
  z-index: 3;
  transform: translateY(-100%);
  transition: transform .55s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}
.cover.trends-open .trend-curtain {
  transform: translateY(0);
}

/* ===== Header de la cortina ===== */
.trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,.05));
  backdrop-filter: blur(10px);
}
.trend-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .6px;
  color: #2c1c0e;
}
.trend-close {
  border: none;
  background: rgba(255,255,255,.25);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  backdrop-filter: blur(6px);
  transition: background .3s ease, transform .2s ease;
}
.trend-close:hover {
  background: rgba(255,255,255,.35);
  transform: rotate(90deg);
}

/* ===== Lista de tarjetas ===== */
.trend-list {
  padding: 20px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* oculta scroll Firefox */
}
.trend-list::-webkit-scrollbar { display: none; } /* oculta scroll Chrome */

/* ===== Tarjeta trend ===== */
.trend-card {
  scroll-snap-align: start;
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(240,235,230,.85));
  border: 1px solid rgba(62,39,26,.15);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transition: transform .35s ease, box-shadow .35s ease;
  cursor: pointer;
}
.trend-card:hover {
  transform: translateY(-6px) scale(1.03) rotateX(6deg);
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}

.trend-cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  background: #fdfcf9;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

.trend-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: #1e140a;
}
.trend-author {
  font-size: 13px;
  opacity: .75;
  color: #3e2d1f;
}
.trend-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #5c4430;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .trend-list {
    grid-auto-columns: minmax(140px, 160px);
    gap: 14px;
    padding: 14px;
  }
  .trend-card {
    border-radius: 12px;
  }
}

#heroImg {
  display: block;
  width: 100%;
  height: auto;
  /* Quitamos cualquier blur o transform inicial */
  filter: none;
  transform: none;
  transition: filter .5s ease, transform .5s ease;
  will-change: filter, transform;
}

/* Blur solo cuando trends abierto */
.cover.trends-open #heroImg {
  filter: blur(10px) brightness(.85);
  transform: scale(1.05);
}

.cover.trends-open #heroImg {
  filter: blur(6px);      /* solo blur, sin brightness */
  transform: none;        /* evita que escale */
}


.cover.trends-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25); /* oscurece un poco */
  pointer-events: none;
}

.curtain-cta {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;

  border: none;
  background: none;
  font-size: 28px;     
  color: #d4af37;      
  cursor: pointer;

  /* halo inicial */
  text-shadow: 0 0 4px rgba(212,175,55,0.6),
               0 0 8px rgba(212,175,55,0.3);

  /* animación de pulso */
  animation: glowPulse 2.5s infinite ease-in-out;

  transition: transform .25s ease, text-shadow .25s ease, color .25s ease;
}

.curtain-cta:hover {
  transform: translateX(-50%) scale(1.2);

  color: #ffd700;  
  text-shadow: 0 0 6px rgba(255,215,0,0.9),
               0 0 14px rgba(255,215,0,0.7),
               0 0 24px rgba(255,215,0,0.5);
}

/* Al abrir trends → rota */
.cover.trends-open .curtain-cta {
  transform: translateX(-50%) rotate(180deg);
}

/* === Animación del halo parpadeante === */
@keyframes glowPulse {
  0% {
    text-shadow: 0 0 3px rgba(212,175,55,0.4),
                 0 0 6px rgba(212,175,55,0.2);
  }
  50% {
    text-shadow: 0 0 6px rgba(255,215,0,0.9),
                 0 0 12px rgba(255,215,0,0.6),
                 0 0 20px rgba(255,215,0,0.4);
  }
  100% {
    text-shadow: 0 0 3px rgba(212,175,55,0.4),
                 0 0 6px rgba(212,175,55,0.2);
  }
}

/* ===== Paleta y tipografía ===== */
:root{
  --ink: #3e271a;
  --bronze: #b58963;
  --bronze-d: #7b5234;
  --cream: rgba(255,255,255,.65);
  --cream-2: rgba(255,255,255,.85);
  --glass: rgba(30, 20, 10, .35);   /* panel glass oscuro */
}

/* Lista: grid responsivo */
.trend-list{
  display:grid;
  grid-template-columns: repeat( auto-fill, minmax(220px, 1fr) );
  gap: 16px;
  padding: 8px 4px;
  content-visibility: auto; 
  contain-intrinsic-size: 320px;
}

/* ===== Tarjeta bronce + blur (glassmorphism) ===== */
.trend-card{
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)) padding-box,
    linear-gradient(180deg, #d7b98e, #8a5e42) border-box; /* bisel bronce */
  border: 1px solid transparent;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  color: var(--ink);
  isolation: isolate;
  overflow: hidden;
  /* glass */
  background-clip: padding-box, border-box;
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  will-change: transform;
}

/* halo superior sutil */
.trend-card::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.28), transparent 60%);
  pointer-events:none;
  z-index:-1;
}

.trend-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 26px 54px rgba(0,0,0,.30);
}

/* ===== Portada con ratio fijo (anti-CLS) ===== */
.trend-cover{
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* ===== Textos ===== */
.trend-title{
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.2;
  color: transparent;
  background: linear-gradient(180deg, #5c3a22, #b58963 60%, #5c3a22 100%);
  -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}

.trend-author{
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: rgba(62,39,26,.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Meta con “pastilla” bronce */
.trend-meta{
  display:flex; align-items:center; gap:8px; margin-top:auto;
  font-size: 13px; color: rgba(62,39,26,.9);
}
.trend-meta span{
  display:inline-flex; align-items:center; gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--bronze), var(--bronze-d));
  color:#fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

/* ===== Estados de interacción/accesibilidad ===== */
.trend-card:focus{
  outline: 2px solid rgba(212,175,55,.7);
  outline-offset: 3px;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 480px){
  .trend-list{ grid-template-columns: 1fr 1fr; gap: 12px; }
  .trend-card{ border-radius: 14px; padding: 12px; }
}

/* Respeta usuarios con reduce motion */
@media (prefers-reduced-motion: reduce){
  .trend-card{ transition: none; }
}


/* Overlay a pantalla completa, centrado */
.modal-overlay {
  position: fixed !important;      /* que no dependa de ningún padre */
  inset: 0;                         /* top/right/bottom/left = 0 */
  display: none;                    /* por defecto oculto */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  z-index: 10000;                   /* por encima del header/cortina */
  filter: none !important;          /* no heredar blur del padre */
  transform: none !important;       /* evita desplazamientos raros */
}

/* visible */
.modal-overlay[aria-hidden="false"],
.modal-overlay.is-open {
  display: flex;
}

/* Caja modal */
.modal {
  max-width: 420px;
  width: min(92vw, 420px);
  background: rgba(250, 244, 237, .98);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 24px;
  transform: none !important;       /* quita cualquier translate heredado */
}

/* Evita scroll del body cuando esté abierto */
body.modal-open {
  overflow: hidden;
}


:root{
  /* Paleta crema + bronce */
  --cream-bg: #faf4ed;
  --cream-2:  #f3e8d8;
  --bronze:   #b58963;
  --bronze-d: #7b5234;
  --gold:     #d4af37;
  --ink:      #3e271a;
}

/* === OVERLAY === */
.wood-modal-overlay{
  position: fixed !important;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  filter: none !important;
  transform: none !important;
}

/* visible */
.wood-modal-overlay.is-open,
.wood-modal-overlay[aria-hidden="false"]{
  display: flex;
}

/* Evitar scroll del fondo */
body.modal-open{ overflow: hidden; }

/* === CAJA MODAL === */
.wood-modal{
  width: min(92vw, 460px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.75)) padding-box,
    linear-gradient(180deg, #e7d6bf, #cbb090) border-box;
  border: 1px solid transparent;          /* borde “bañado” */
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 22px;
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
}

/* Título y descripción */
.wood-title{
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  color: transparent;
  background: linear-gradient(180deg, #5c3a22 0%, #b58963 35%, #b58963 70%, #5c3a22 100%);
  -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.wood-desc{
  margin: 0 0 14px;
  font-weight: 300;
  font-size: 18px;
  color: rgba(62,39,26,.85);
}

/* Cerrar (X) */
.wood-close{
  position: absolute;
  inset: 10px 10px auto auto;
  width: 32px; height: 32px;
  border: none; border-radius: 999px;
  background: rgba(0,0,0,.05);
  color: var(--ink); cursor: pointer;
}
.wood-close:hover{ background: rgba(0,0,0,.1); }

/* Acciones */
.wood-actions{
  display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px;
}

/* ===== SUGERENCIAS (limpio y coherente) ===== */

/* Contenedor */
.suggestions-grid{
  display:grid !important;
  grid-template-columns:1fr;
  gap:10px;
  max-height:380px;
  overflow:auto;
  padding:8px 4px;
  margin-top:8px;
  scrollbar-width:thin;
}

/* Cards */
.sugg-card{
  display:grid;
  grid-template-columns:56px 1fr;   /* portada + textos */
  align-items:center;
  gap:12px;
  width:100%;
  min-height:86px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:6px;                /* corregido (no 02px) */
  background:rgba(255,255,255,.6);
  backdrop-filter:blur(2px);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-align:left;
}

/* Portada: sutilmente redondeada */
.suggestions-grid .sugg-cover{
  width:56px;
  height:74px;
  border-radius:4px !important;          /* sutil */
  overflow:hidden;
  box-shadow:0 2px 5px rgba(0,0,0,.12);
  background:#eee;
}

/* 💥 Kill global rounding que venga de .cover o img */
.suggestions-grid .sugg-cover .cover,
.suggestions-grid .sugg-cover img{
  width:100%; height:100%;
  display:block;
  object-fit:cover; object-position:center;
  border-radius:4px !important;          /* fuerza el 4px */
  clip-path: inset(0 round 4px);         /* cinturón y tirantes */
}

/* Hover */
.sugg-card:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.8);
  box-shadow:0 6px 14px rgba(0,0,0,.12);
}

/* Tipos */
.sugg-info{ min-width:0; font-family:'Cormorant Garamond', serif; }
.sugg-title{
  font-size:17px; line-height:1.25; font-weight:600; color:#3e271a;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  overflow:hidden; text-overflow:ellipsis;
}
.sugg-author{
  margin-top:2px; font-size:14px; line-height:1.2; color:rgba(62,39,26,.8);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Layout estable y predecible */
.chip-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;                    /* usa gap, no márgenes que “empujan” */
  align-items:flex-start;
  min-height: 40px;           /* reserva un alto base para evitar salto inicial */
  contain: layout style;      /* limita el reflow a dentro del grupo */
}

/* Cada chip con altura fija y bordes estables */
.chip{
  line-height: 32px;          /* altura estable */
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;  /* evita que aparezca un borde luego y empuje */
  border-radius: 999px;
  transition: color .15s, background-color .15s, box-shadow .15s; /* no cambies tamaño */
}
.chip:hover{ box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* Si los chips se montan asíncronos, evita el salto: */
.chip-group[aria-busy="true"]{ min-height: 72px; } /* 2 filas reservadas opcional */

.readers {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,.35);
  padding: 2px 6px;
  border-radius: 999px;
  z-index: 10;
}

.readers .icon-eye {
  width: 16px !important;   /* fuerza tamaño pequeño */
  height: 16px !important;
  object-fit: contain;      /* no deforma */
  flex-shrink: 0;           /* nunca se estira */
  display: inline-block;
}

.trend-heading {
  font-family: 'Cormorant Garamond', serif, cursive;
  font-size: 40px;
  font-weight: 300;     /* más fino (prueba también 200 si la fuente lo soporta) */
  line-height: 1.3;
  text-align: center;
  margin-bottom: 10px;

  letter-spacing: 0.5px;  /* un poco de aire entre letras */

  color: linear-gradient(
    180deg,
    #5c3a22 0%,    /* bronce oscuro */
    #b58963 35%,   /* oro viejo */
    #b58963 70%,   /* bronce cálido */
    #5c3a22 100%   /* bronce profundo */
  );

}

.trend-header {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.trend-tabs { display:flex; gap:8px; }
.trend-tab{
  appearance:none; border:none; cursor:pointer;
  padding:6px 12px; border-radius:999px;
  font-weight:600; font-size:13px; letter-spacing:.2px;
  background:rgba(0,0,0,.25); color:#f3e9d2;
  transition:transform .15s ease, box-shadow .2s ease, background .2s;
  backdrop-filter: blur(2px);
}
.trend-tab:hover { transform:translateY(-1px); }
.trend-tab.active{
  background: linear-gradient(180deg, rgba(181,137,99,.35), rgba(181,137,99,.15));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 8px rgba(0,0,0,.25);
}

.trend-heading {
  margin:0; font-family:'Cormorant Garamond', serif;
  color: var(--beige-800); font-size: clamp(18px, 2.2vw, 22px);
  text-shadow: 0 1px 2px rgba(0,0,0,.15), 0 0 6px rgba(255,255,255,.4);
}

#trendList.loading::after{
  content:""; display:block; height:4px; border-radius:999px; margin:8px auto;
  width:40%; animation: shimmer 1s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
@keyframes shimmer {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}


/* Hero y flecha */
.cover { position: relative; overflow: hidden; border-radius: 16px; }
.curtain-cta {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  border: none; background: none; font-size: 28px; color: #d4af37; cursor: pointer;
  text-shadow: 0 0 4px rgba(212,175,55,.6), 0 0 8px rgba(212,175,55,.3);
  transition: transform .25s ease, text-shadow .25s ease;
}
.curtain-cta:hover { transform: translateX(-50%) translateY(-2px); text-shadow: 0 0 8px rgba(212,175,55,.8), 0 0 16px rgba(212,175,55,.4); }

/* Cortina overlay */
.trend-curtain {
  position: fixed; inset: 0; display: grid; place-items: start center;
  background: rgba(0,0,0,.35); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  padding-top: min(12vh, 120px);
}
.trend-curtain[aria-hidden="false"] { opacity: 1; pointer-events: auto; }

/* Panel */
.trend-panel {
  width: min(1100px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.75));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
}

/* Header */
.trend-header { position: relative; display:flex; align-items:center; gap:16px; padding: 14px 16px; }
.trend-heading {
  font-family: 'Cormorant Garamond', serif, cursive;
  top: 5px;
  font-size: 20px;
  font-weight: 300;     /* más fino (prueba también 200 si la fuente lo soporta) */
  line-height: 1.3;
  text-align: center;
  margin-bottom: 10px;

  letter-spacing: 0.5px;  /* un poco de aire entre letras */

  color: linear-gradient(
    180deg,
    #5c3a22 0%,    /* bronce oscuro */
    #b58963 35%,   /* oro viejo */
    #b58963 70%,   /* bronce cálido */
    #5c3a22 100%   /* bronce profundo */
  );

}
.trend-close {
  margin-left:auto; border:none; background:transparent; font-size:20px; cursor:pointer; color:#2b2b2b;
  width:36px; height:36px; border-radius:12px;
}
.trend-close:hover { background: rgba(0,0,0,.06); }

/* Tabs */
.trend-tabs { display:flex; gap:8px; }
.trend-tab {
  border:none; background: rgba(212,175,55,.12); color:#2b2b2b; cursor:pointer;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.trend-tab.active { background: rgba(212,175,55,.25); text-decoration: underline; }

/* Lista */
.trend-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; padding: 14px 16px 18px;
}
.trend-list.loading { opacity:.6; filter: grayscale(.1); }

/* Card */
.trend-card {
  position: relative; padding:10px; border-radius:16px;
  background: rgba(255,255,255,.78); backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  display:flex; flex-direction:column; gap:8px;
}
.trend-card .rank {
  position:absolute; top:8px; left:10px; font-weight:700; opacity:.65; font-size: 13px;
}
.trend-cover {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 12px; background:#eee;
}
.trend-title { font-weight:600; line-height:1.25; }
.trend-author { font-size:.9rem; opacity:.8; }
.trend-meta { display:flex; align-items:center; gap:8px; font-size:.9rem; }
.trend-meta .readers { margin-left:auto; display:flex; align-items:center; gap:6px; }
.icon-eye { width: 16px; height: 16px; opacity:.8; }

/* Estado hero cuando la cortina está abierta (opcional blur) */
.trends-open img#heroImg { filter: blur(2px) brightness(.85); transform: scale(1.01); transition: filter .25s ease, transform .25s ease; }

/* Responsive pequeño */
@media (max-width: 560px) {
  .trend-list { grid-template-columns: repeat(2, 1fr); }
}


.cover{position:relative;border-radius:20px;overflow:hidden}
.trend-curtain{position:absolute;inset:0;display:flex;justify-content:center;align-items:flex-start;
  padding-top:clamp(16px,5vh,40px);background:linear-gradient(to bottom,rgba(0,0,0,.22),rgba(0,0,0,.35));
  opacity:0;pointer-events:none;transition:opacity .22s;z-index:2}
.trend-curtain[aria-hidden="false"]{opacity:1;pointer-events:auto}
.trends-open #heroImg{filter:blur(2px) brightness(.9);transform:scale(1.01);transition:filter .2s,transform .2s}
.trend-panel{width:min(96%,1100px);max-height:78%;background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(255,255,255,.72));
  border:1px solid rgba(181,137,99,.35);border-radius:18px;box-shadow:0 18px 50px rgba(0,0,0,.35);
  backdrop-filter:blur(8px) saturate(110%);overflow:hidden;display:flex;flex-direction:column}
.trend-header{display:flex;align-items:center;gap:12px;padding:10px 12px;background:linear-gradient(180deg,#fff8ef,rgba(255,255,255,.78));
  border-bottom:1px solid rgba(181,137,99,.35)}
.trend-tabs{display:flex;gap:6px}
.trend-tab{border:none;border-radius:999px;padding:6px 10px;font-weight:700;background:linear-gradient(180deg,#fff,#f6ecdc);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);cursor:pointer}
.trend-tab.active{background:linear-gradient(180deg,#fff2d1,#ffe2a3);box-shadow:inset 0 0 0 2px rgba(212,175,55,.35)}
.trend-list{display:flex;gap:14px;padding:14px;overflow:auto hidden;scroll-snap-type:x mandatory}
.trend-card{flex:0 0 180px;scroll-snap-align:start;position:relative;padding:10px 10px 36px;border-radius:16px;
  background:rgba(255,255,255,.78);box-shadow:0 6px 22px rgba(0,0,0,.10);backdrop-filter:blur(6px)}
.trend-cover{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:12px;background:#eee}
.icon-eye{width:14px;height:14px}

.trend-cover { background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.5), transparent 60%); }


/* Meta pegado al borde inferior, en una línea */
.trend-card { position: relative; padding-bottom: 56px; } /* espacio para la meta */
.trend-meta{
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.trend-meta .meta-left{ display: flex; align-items: center; gap: 8px; }
.trend-meta .pill{ white-space: nowrap; }         /* evita saltos dentro de la pastilla */
.trend-meta .pill-readers{ margin-left: auto; }   /* empuja el ojito a la derecha */

/* Pastillas bronce */
.pill{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  color: #fff;
  background: linear-gradient(180deg, #caa27d, #a97852);
  box-shadow:
    0 2px 8px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.35);
}
.pill-rating{ padding-left: 10px; }
.pill-votes { opacity: .95; }
.pill-readers{ padding-left: 8px; }

/* Icono ojo */
.icon-eye{ width: 14px; height: 14px; display: inline-block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }

/* (Opcional) Si la tarjeta es muy estrecha, que no rompa feo */
@media (max-width: 420px){
  .trend-meta{ gap: 6px; }
  .pill{ padding: 5px 8px; font-size: .85rem; }
}


/* Botón del ojo */
.btn-eye-center {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  border: none;
  background: none;   /* 🔑 sin fondo */
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

/* Icono ojo reducido */
.btn-eye-center img {
  width: 12px;        /* 👁️ mucho más pequeño */
  height: 12px;
  display: block;
  background: none;   /* 🔑 evita fondo de herencia */
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

.btn-eye-center:hover  { transform: translateX(-50%) scale(1.2); }
.btn-eye-center:active { transform: translateX(-50%) scale(0.95); }





/* ===== Desktop ===== */
@media (min-width: 1024px) {
  .modal {
    max-width: 1040px;             /* ensanchado en escritorio */
    width: min(92vw, 1040px);      /* siempre respeta margen lateral */
    border-radius: 40px;           /* bordes más suaves */
    padding: 32px 36px 28px;       /* más aire dentro */
  }
}


.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  min-height: 42px;
  border-radius: 10px;

  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .3px;

  background: #fff;                     /* base clara */
  color: #1f1b16;                       /* texto oscuro */
  border: 1px solid rgba(0,0,0,.12);    /* borde sutil */
  box-shadow: 0 1px 2px rgba(0,0,0,.06);

  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}

/* Hover */
.btn-ghost:hover {
  background: #faf6ef;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* Active */
.btn-ghost:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
}

/* Focus accesible */
.btn-ghost:focus-visible {
  outline: 2px solid #d4af37;   /* dorado elegante */
  outline-offset: 2px;
}

.wood-actions .btn-ghost  {

font-family: Cormorant Garamond, serif;

}

.bm-actions{
  display:flex; gap:.5rem; align-items:center;
  margin: 8px 0 4px; position: relative;
}
.bm-actions .btn-ghost{
  display:inline-flex; align-items:center; gap:.4rem;
  border:none; background: rgba(255,255,255,.35);
  padding:.5rem .75rem; border-radius:999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08) inset;
  cursor:pointer; font-weight:600;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.bm-actions .btn-ghost:hover{ transform: translateY(-1px); background: rgba(255,255,255,.5); }
.bm-actions .btn-ghost.is-active{ background: rgba(212,175,55,.22); box-shadow: 0 0 0 1px rgba(212,175,55,.35) inset; }
.bm-actions .btn-icon{ font-size: 1rem; line-height: 1; }

.bm-share-pop{
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: rgba(35,25,20,.96);
  color: #f7f0e6; border-radius: 12px; padding: .4rem;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
  display:none; z-index: 10;
}
.bm-share-pop.show{ display:block; }
.bm-share-pop a, .bm-share-pop button{
  all:unset; display:block; cursor:pointer;
  padding:.45rem .75rem; border-radius: 8px;
}
.bm-share-pop a:hover, .bm-share-pop button:hover{
  background: rgba(255,255,255,.08);
}

/* Modal de Favoritos */
#favoritesModal .modal { max-width: 860px; width: 92vw; border-radius: 16px; }
#favoritesModal .modal-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,.08);
}
#favoritesModal .modal-body{ padding: 12px 16px 16px; }

.fav-empty{ text-align:center; padding: 24px 0; opacity:.8; }

.fav-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.fav-card{
  display:grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto;
  background: rgba(255,255,255,.55); border-radius: 12px; padding: 10px;
  backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.06);
  align-items:center;
}
.fav-cover{ grid-row: 1 / span 2; width:64px; height:96px; border-radius:8px; overflow:hidden; background:#d9c6ad; }
.fav-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.cover-fallback{ width:100%; height:100%; background: linear-gradient(180deg,#c9a877,#8b6430); }


.fav-info{ padding: 0 8px; min-width:0; }
.fav-title{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fav-author{ opacity:.85; font-size:.9rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.fav-actions{ display:flex; gap:6px; justify-content:flex-end; }
.fav-actions .btn{
  border:none; cursor:pointer; padding:.35rem .6rem; border-radius:999px;
  background: rgba(0,0,0,.06); font-weight:600;
}
.fav-actions .btn:hover{ background: rgba(0,0,0,.12); }


.rec-pearls .rec-nav .chev{

    --thick: 2px;
    --side: 6px;
    width: var(--side);
    height: var(--side);
    border-top: var(--thick) solid currentColor;
    border-right: var(--thick) solid currentColor;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, .25));
    pointer-events: none;

}

/* Orden interno (por si acaso) */
#loginCard{ order:1; }
#userAuth .lang-switch{ order:2; }
#userPanel{ order:3; }

/* Badges y caret */
.lang-badge{ margin-left:auto; font-size:.75rem; padding:2px 6px; border-radius:8px; background:rgba(255,255,255,.12); }
.user-menu .has-sub{ display:flex; align-items:center; gap:8px; }
.user-menu .has-sub .caret{ margin-left:6px; transition:transform .15s; }
.user-menu .has-sub[aria-expanded="true"] .caret{ transform:rotate(180deg); }

/* Submenú interior */
.user-menu .submenu{
  display:flex;            /* visible por defecto */
  flex-direction:column;
  gap:4px;
  padding:6px 8px 8px;
  margin:0;
  list-style:none;
  border-top:1px solid rgba(255,255,255,.08);
  pointer-events:auto;
}
.user-menu .submenu[hidden]{ display:none !important; } /* respeta [hidden] sí o sí */

.user-menu .submenu li{
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:8px; cursor:pointer; outline:0;
  transition:background .15s;
}
.user-menu .submenu li:hover, .user-menu .submenu li:focus{ background:rgba(255,255,255,.06); }
.user-menu .submenu li[aria-selected="true"]{ box-shadow:inset 0 0 0 2px rgba(255,215,160,.55); }

/* Iconos idioma */
.lang-icon{ width:18px; height:18px; border-radius:4px; display:block; }


/* Fuerza la visibilidad del submenú Idioma dentro del user menu */
.user-menu .lang-menu[hidden]{
  display: none !important;
}

.user-menu .lang-menu:not([hidden]){
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 8px;
  margin: 0;
  list-style: none;
  border-top: 1px solid rgba(255,255,255,.08);

  /* anula posibles estilos globales */
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* items */
.user-menu .lang-menu li{
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;                 /* por si algún reset pone color transparente */
  background: transparent;        /* limpia fondos raros */
}
.user-menu .lang-menu li:hover,
.user-menu .lang-menu li:focus{
  background: rgba(255,255,255,.06);
}
.user-menu .lang-menu li[aria-selected="true"]{
  box-shadow: inset 0 0 0 2px rgba(255,215,160,.55);
}

.lang-icon{ width:18px; height:18px; border-radius:4px; display:block; }


/* Submenú Idioma más compacto */
.user-menu .lang-menu:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  gap: 2px;                /* menos separación entre items */
  padding: 4px 6px;        /* reduce padding interno */
  margin: 4px 0 0;         /* pegado al botón */
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(40, 25, 15, .96); /* mismo fondo que tu menú */
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  min-width: 140px;        /* se ajusta a lo necesario */
  max-width: 180px;
  z-index: 1000;
}

/* Items de idioma */
.user-menu .lang-menu li {
  display: flex;
  align-items: center;
  gap: 6px;                /* menos espacio entre icono y texto */
  padding: 6px 8px;        /* más compacto */
  font-size: 13px;         /* más pequeño */
  line-height: 1.3;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
}
.user-menu .lang-menu li:hover,
.user-menu .lang-menu li:focus {
  background: rgba(255,255,255,.08);
}
.user-menu .lang-menu li[aria-selected="true"] {
  box-shadow: inset 0 0 0 1.5px rgba(255,215,160,.55);
}

/* Iconos de bandera más pequeños */
.lang-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: block;
}

/* --- Idioma integrado en el user menu (no tarjeta flotante) --- */
#userMenu .lang-menu {
  font-family: 'Cormorant Garamond', serif;  /* tipografía elegante */

  /* anula estilos del viejo header dropdown */
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;

  /* integra en el panel */
  display: flex !important;
  flex-direction: column;
  gap: 2px;
  width: 100% !important;     /* mismo ancho que el user-menu */
  min-width: 0 !important;
  margin: 0;                   /* sin separación extra */
  padding: 6px 0 6px;          /* compacto y alineado */
  background: transparent !important;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.08); /* separador sutil */

  /* quita “tarjeta” */
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
}

#userMenu .lang-menu[hidden] {
  display: none !important;
}

/* Items compactos y alineados a la izquierda */
#userMenu .lang-menu li {
  font-family: 'Cormorant Garamond', serif;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;           /* igual que tus .user-menu-item */
  font-size: 15px;             /* un pelín más grande para elegancia */
  line-height: 1.3;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

#userMenu .lang-menu li:hover,
#userMenu .lang-menu li:focus {
  background: rgba(255,255,255,.06);
}

#userMenu .lang-menu li[aria-selected="true"] {
  box-shadow: inset 0 0 0 1.5px rgba(255,215,160,.55);
}

/* Icono de bandera más pequeño */
#userMenu .lang-menu .lang-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: block;
}

/* Fila “Idioma”: caret animada y badge a la derecha */
#btnLangToggle.has-sub { 
  display:flex; 
  align-items:center; 
  gap:8px; 
  font-family: 'Cormorant Garamond', serif;
}
#btnLangToggle .caret { margin-left:6px; transition: transform .2s; }
#btnLangToggle[aria-expanded="true"] .caret { transform: rotate(180deg); }

#langCurrent.lang-badge {
  font-family: 'Cormorant Garamond', serif;
  margin-left:auto;
  font-size: .8rem;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
}

/* Avatar: tamaño fijo, visible, sin filtros raros */
#userAvatar {
  width: 28px;               /* o el que uses en la pill */
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent !important;
  filter: none !important;
}

/* Evita que reglas genéricas lo oculten */
.user-card-inner img#userAvatar {
  position: static !important;
  inset: auto !important;
}

/* Si tienes algo como .user-card-inner img { position:absolute } anúlalo: */
.user-card-inner > img { position: static; }

/* Si algún contenedor recorta con overflow, dale aire */
.user-card-inner { overflow: visible; }


/* Biblioteca */
.lib-modal { max-width: 980px; }
.lib-empty { opacity: .7; margin: 1rem 0; text-align: left; }


.lib-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 16px;
}


.lib-card {
display: flex; flex-direction: column;
background: var(--card-bg, rgba(255,255,255,.06));
border-radius: 16px; padding: 12px;
box-shadow: var(--elev-1, 0 2px 12px rgba(0,0,0,.12));
}
.lib-card .cover { width: 100%; height: 240px; border-radius: 12px; overflow: hidden; }
.lib-card .meta { margin-top: 8px; display: grid; gap: 6px; }
.lib-card .title { font: 600 15px/1.2 var(--font-serif, 'Cormorant Garamond', serif); }
.lib-card .author { font-size: 12px; opacity: .8; }
.lib-card .actions { display: flex; gap: 8px; margin-top: auto; }


/* Botón ☆/★ en modal de libro */
.btn-fav { border: 1px solid var(--stroke, rgba(255,255,255,.2)); padding: .5rem .75rem; border-radius: 999px; }
.btn-fav[aria-pressed="true"] { color: gold; border-color: gold; }

.modal-overlay { display: none; position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9999; background: rgba(0,0,0,.45); }
.modal-overlay.show { display: flex; }
.modal-open { overflow: hidden; }

.lib-modal { max-width: 980px; width: min(980px, 92vw); background: var(--card, rgba(20,20,20,.9)); border-radius: 16px; padding: 16px; }
.lib-empty { opacity: .7; margin: 1rem 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; background: rgba(255,255,255,.06); border-radius: 16px; padding: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.lib-card .cover { width: 100%; height: 240px; border-radius: 12px; overflow: hidden; }
.lib-card .actions { display: flex; gap: 8px; margin-top: auto; }
.fav-btn.is-active { /* estilos del estado guardado */ }


.lib-card .title { color: #fff; font-weight: 600; margin-top: .5rem; }
.lib-card .author { color: rgba(255,255,255,.85); font-size: .9rem; }
.lib-card .meta { gap: 8px; }
.lib-card .actions .btn-open,
.lib-card .actions .btn-remove {
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  padding: .4rem .6rem;
  border-radius: 8px;
  cursor: pointer;
}
.lib-card .actions .btn-open:hover,
.lib-card .actions .btn-remove:hover {
  border-color: rgba(255,255,255,.45);
}
.title, .author {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* corta a 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Libris — Biblioteca elegante bronce/beige ===== */

/* Paleta base */
:root{
  --bronze-800:#6f4e37;
  --bronze-700:#8a614a;
  --bronze-600:#a87455;
  --bronze-500:#c38d6b;
  --beige-100:#f4efe9;
  --beige-50:#faf7f3;

  --ink:#1a1a1a;
  --white:#fff;
}

/* Tipografía editorial */
.lib-modal,
.lib-card .title{
  font-family: "Cormorant Garamond", "Cormorant", serif;
}

/* Overlay con degradado elegante (fondo) */
.modal-overlay.show#libraryModal{
  /* ligera viñeta + blur */
  background:
    radial-gradient(1200px 600px at 50% 20%, rgba(0,0,0,.35), rgba(0,0,0,.55)),
    linear-gradient(120deg, rgba(195,141,107,.22), rgba(244,239,233,.06));
  backdrop-filter: blur(6px);
}

/* Contenedor del modal: marco bronceado sutil */
.lib-modal{
  width: min(980px, 92vw);
  border-radius: 20px;
  padding: 20px 18px;
  color: var(--beige-50);
  background:
    linear-gradient(180deg, rgba(244,239,233,.06), rgba(26,26,26,.90)),
    linear-gradient(180deg, rgba(195,141,107,.30), rgba(195,141,107,.05));
  box-shadow:
    0 20px 60px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(195,141,107,.25);
}

/* Título del modal */
.lib-modal .modal-title{
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--beige-50);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
  margin: 4px 6px 14px;
}

/* Grid más compacto */
.lib-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* Card con borde bronce “smoked” */
.lib-card{
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow:
    0 6px 24px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(195,141,107,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.lib-card:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 28px rgba(0,0,0,.30),
    inset 0 0 0 1px rgba(195,141,107,.28);
}

/* Portadas más compactas (relación 3:4) */
.lib-card .cover{
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(195,141,107,.32), rgba(244,239,233,.08));
  box-shadow: inset 0 0 0 1px rgba(195,141,107,.22);
}
.lib-card .cover img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Texto más legible y compacto */
.lib-card .title{
  font-size: 1.02rem;
  line-height: 1.1;
  color: var(--beige-50);
  margin: 2px 2px 0;
  letter-spacing: .1px;
  -webkit-line-clamp: 2;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.lib-card .author{
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: .82rem;
  color: rgba(244,239,233,.82);
  margin: 0 2px 2px;
  -webkit-line-clamp: 1;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}

/* Botones con cromado bronce */
.lib-card .actions{ margin-top: auto; display:flex; gap:8px; }
.lib-card .actions .btn-open,
.lib-card .actions .btn-remove{
  appearance: none;
  border-radius: 10px;
  padding: .42rem .6rem;
  font-size: .82rem;
  color: var(--beige-50);
  background:
    linear-gradient(180deg, rgba(195,141,107,.20), rgba(195,141,107,.10));
  border: 1px solid rgba(195,141,107,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  cursor: pointer;
  transition: filter .15s ease, border-color .15s ease, transform .04s ease;
}
.lib-card .actions .btn-open:hover,
.lib-card .actions .btn-remove:hover{
  filter: brightness(1.06);
  border-color: rgba(195,141,107,.55);
}
.lib-card .actions .btn-open:active,
.lib-card .actions .btn-remove:active{ transform: translateY(1px); }

/* Estado vacío */
.lib-empty{
  color: rgba(244,239,233,.82);
  font-style: italic;
  margin: .25rem 6px 1rem;
}

/* Botón ☆/★ del modal de libro, tono bronce */
#bmFavBtn,
.btn-fav{
  display:inline-flex; align-items:center; gap:.5rem;
  border-radius: 999px;
  padding: .45rem .75rem;
  border: 1px solid rgba(195,141,107,.45);
  background: linear-gradient(180deg, rgba(195,141,107,.22), rgba(195,141,107,.10));
  color: var(--beige-50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
#bmFavBtn.is-active,
.btn-fav[aria-pressed="true"]{
  border-color: rgba(195,141,107,.75);
  background: linear-gradient(180deg, rgba(195,141,107,.35), rgba(195,141,107,.18));
}

/* Scrollbar delicada dentro del modal */
#libraryModal .lib-grid{
  scrollbar-width: thin;
  scrollbar-color: rgba(195,141,107,.55) transparent;
}
#libraryModal .lib-grid::-webkit-scrollbar{ height:10px; width:10px; }
#libraryModal .lib-grid::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(195,141,107,.75), rgba(195,141,107,.45));
  border-radius: 999px;
}


/* === Botón favorito — estilo champagne === */
:is(#bmFavBtn, .btn-fav){
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  letter-spacing: .15px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow:
    0 6px 14px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.25);
  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}

/* Icono dentro del botón (si hay <img>) */
:is(#bmFavBtn, .btn-fav) > img{ width:16px; height:16px; display:block; }

/* Hover */
:is(#bmFavBtn, .btn-fav):hover{
  filter: brightness(1.05);
  box-shadow:
    0 10px 22px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.32);
}

/* Active (click) */
:is(#bmFavBtn, .btn-fav):active{
  transform: translateY(1px);
  box-shadow:
    0 4px 10px rgba(0,0,0,.16),
    inset 0 2px 0 rgba(255,255,255,.28);
}

/* Foco accesible */
:is(#bmFavBtn, .btn-fav):focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(230,205,173,.55),
    0 6px 18px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.25);
}

/* Estado guardado (aria-pressed=true o clase .is-active) */
:is(#bmFavBtn, .btn-fav).is-active,
:is(#bmFavBtn, .btn-fav)[aria-pressed="true"]{
  background: linear-gradient(145deg, #b98c64, #dfc29f);
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-family: 'Cormorant Garamond', serif;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: all .2s ease;
  cursor: pointer;
}

/* Botón “Abrir” — mismo degradado del chat-form */
.actions .btn-open {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
}

/* Botón “Quitar” — versión más oscura del mismo degradado */
.actions .btn-remove {
  background: linear-gradient(145deg, #9f7b56, #c6a27d);
  color: #f6ede3;
}

/* Hover con leve relieve */
.actions .btn-open:hover {
  background: linear-gradient(145deg, #d8b88d, #f0dec2);
  transform: translateY(-1px);
}

.actions .btn-remove:hover {
  background: linear-gradient(145deg, #b3875d, #d2af84);
  transform: translateY(-1px);
}

.inline-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin: 0 4px;
}

.btn-embed {
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  letter-spacing: .15px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
  vertical-align: middle; /* para encajar bien en línea */
}

.btn-embed .inline-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.btn-embed:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .3);
  transform: translateY(-1px);
}

.btn-embed:active {
  transform: translateY(0);
  filter: brightness(.98);
}

.btn-embed:focus-visible {
  outline: 2px solid #b08d57;
  outline-offset: 2px;
}


#bookModal {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .2s ease;
}
#bookModal.show {
  display: block;           /* o flex/grid si tu modal lo necesita */
  opacity: 1;
  pointer-events: auto;
}

#bmScrollCard {
  overflow: visible !important;
  max-height: none !important;
}

.lib-card .title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  line-height: 1.1;
  color: var(--beige-50);
  margin: 2px 2px 0;
  letter-spacing: .1px;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-card .title {
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}

.lib-card .author {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(244, 239, 233, 0.85);
  margin: 0 2px 4px;
  letter-spacing: 0.2px;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}


.btn-primary {
  flex: 1;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #b08d57, #d4af7a);
  color: #2b1d12;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
/* =========================
   Mensaje de autenticación
   ========================= */
#authMessage {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  color: #3a281c;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(182, 132, 90, 0.65);
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.3),
    0 2px 8px rgba(0,0,0,0.25);
  position: relative;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =========================
   Chat IA — estilos base
   ========================= */
.chat-bubble.ia {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fffaf4;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  max-width: 80%;                 /* Desktop: burbuja más estrecha */
  box-sizing: border-box;
}

.chat-bubble.ia .avatar-ia {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-bubble.ia .bubble-text {
  flex: 1 1 auto;                 /* ocupa el resto del ancho */
  width: 100%;
  min-width: 0;                    /* evita overflow en flex */
}

.chat-bubble.ia .ia-text {         /* espacio bajo el título */
  margin-top: 0.75rem;
}

.chat-bubble.ia .ia-text p {
  margin: 0;
  text-align: justify;
  hyphens: auto;
  word-break: break-word;
  line-height: 1.6;
  color: #3b2a1b;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
}


/* =========================
   Responsive (≤ 768px)
   ========================= */
@media (max-width: 768px) {

  /* El contenedor estira las burbujas */
  #chatMessages,
  .chat-messages {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* La burbuja ocupa TODO el ancho */
  .chat-bubble.ia {
    width: 100% !important;
    max-width: none !important;
    align-self: stretch;
    margin: 0;
    padding: 1rem 1.1rem;
    border-radius: 12px;           /* o 0 si la quieres a ras */
  }

  .chat-bubble.ia .bubble-text,
  .chat-bubble.ia .ia-text,
  .chat-bubble.ia .ia-text p {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0;
    margin-right: 0;
  }

  .chat-bubble.ia .ia-text { margin-top: 0.8rem; }
  .chat-bubble.ia .ia-text p { font-size: 0.95rem; }
}

/* 🔒 Aseguramos que NO haya límites de 30–40ch ni fit-content */
.chat-bubble.ia .bubble-text,
.chat-bubble.ia .ia-text,
.chat-bubble.ia .ia-text p {
  /* sin max-width por caracteres ni centrados forzados */
  /* (no definir max-width: 38ch ni width: fit-content aquí) */
}



/* === MODO MÓVIL — estantería 2 columnas compacta === */
@media (max-width: 540px){

  /* El contenido del modal no debe encoger el grid */
  #libraryModal .modal-content{
    max-width: 100vw;
    margin: 0 10px;
    padding: 14px;
  }

  /* 2 columnas siempre en móvil */
  #libGrid{
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    align-items: start;
  }

  /* Tarjeta compacta */
  .lib-card{
    padding: 8px !important;
    border-radius: 12px;
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 8px;
    min-width: 0; /* evita desbordes por títulos largos */
  }

  /* Portada 2:3 estricta (libro vertical) */
  .lib-card .cover{
    aspect-ratio: 2 / 3 !important;
    height: auto !important;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,.22);
  }
  .lib-card .cover img{
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
  }

  /* Título + autor: dos líneas máx y elipsis */
  .lib-card .title{
    font-size: .95rem !important;
    line-height: 1.2;
    margin: 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .lib-card .author{
    font-size: .78rem !important;
    opacity: .8;
    margin: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Acciones mini o en una fila */
  .lib-card .actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
  }
  .lib-card .actions .btn-open,
  .lib-card .actions .btn-remove{
    padding: 8px 6px !important;
    border-radius: 10px;
    font-size: .8rem !important;
    line-height: 1;
  }
}

/* === TABLET: 3 columnas si cabe === */
@media (min-width: 541px) and (max-width: 980px){
  #libGrid{ grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
  .lib-card .cover{ aspect-ratio: 2 / 3; }
}

/* Seguridad extra: asegúrate del ratio aunque otros estilos existan */
.lib-card .cover{ aspect-ratio: 2 / 3; }


/* ===== Portada del modal de detalle ===== */
#bmCoverWrap {
  display: block;
  margin: 0 auto clamp(12px, 3vw, 20px);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.15);
  box-shadow:
    0 8px 22px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.08);
  aspect-ratio: 2 / 3;
  width: min(180px, 40vw); /* tamaño compacto adaptable */
  max-width: 220px;
}

#bmCoverWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* ===== Ajustes en pantallas grandes ===== */
@media (min-width: 900px) {
  #bmCoverWrap {
    width: 140px; /* tamaño fijo más elegante */
    margin-top: 4px;
  }
}

/* ===== En móviles, aún más pequeño y centrado ===== */
@media (max-width: 600px) {
  #bmCoverWrap {
    width: 150px;
    aspect-ratio: 2 / 3;
    margin: 0 auto 14px;
  }
}

/* ===== Mini detalle estético ===== */
#bmCoverWrap img {
  transition: transform 0.25s ease;
}
#bmCoverWrap:hover img {
  transform: scale(1.03);
}

/* ===============================
   Feedback: rating + comentarios
   =============================== */

/* ——— Zona meta (junto al botón de favorito) ——— */
.meta-feedback{
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-left:8px;
  vertical-align:middle;
}
.meta-feedback .agg{
  opacity:.85;
  font-size:.9rem;
  margin-left:6px;
}

/* Estrellas (botones accesibles) */
.stars-ctrl{
  display:inline-flex;
  gap:4px;
  user-select:none;
}
.stars-ctrl .star{
  appearance:none;
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.55;
  transition: transform .12s ease, opacity .12s ease;
}
.stars-ctrl .star.on{ opacity:1; }
@media (hover:hover){
  .stars-ctrl .star:hover{ transform: translateY(-1px); opacity:1; }
}
.stars-ctrl .star:focus-visible{
  outline:2px solid rgba(153,180,209,.85);
  outline-offset:3px;
  border-radius:6px;
}

/* ——— Sección de comentarios ——— */
.comments-sec{
  margin-top:16px;
  display:grid;
  gap:12px;
}
.comment-form{
  display:grid;
  gap:8px;
  grid-template-columns: 1fr auto;
  align-items:start;
}
.comment-form textarea{
  grid-column: 1 / -1;           /* en móviles ocupa todo */
  width:100%;
  min-height:84px;
  resize:vertical;
  border-radius:12px;
  padding:12px 12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.55);
  color:#222;
}
.comment-form .btn-primary{
  justify-self:end;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.15);
  color: inherit;
  font-weight:600;
}
.btn-secondary.small{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  font-size:.85rem;
  font-weight:600;
}

/* Lista */
.comments-list{
  display:grid;
  gap:10px;
}
.comment{
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.06), transparent 60%),
    rgba(0,0,0,.06);
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  padding:12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 6px 16px rgba(0,0,0,.18);
}
.comment header{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  opacity:.85;
  font-size:.9rem;
}
.comment header strong{ font-weight:700; }
.comment header time{ font-variant-numeric: tabular-nums; font-size:.85rem; opacity:.8; }
.comment p{ margin:.45rem 0 0; line-height:1.45; }

/* Estado vacío / loading */
.comments-list .empty,
.comments-list .loading{
  text-align:center;
  opacity:.8;
  padding:12px 6px;
  font-size:.95rem;
}

/* ——— Responsive fino ——— */
@media (max-width: 560px){
  .meta-feedback{ gap:8px; margin-left:6px; }
  .stars-ctrl .star{ font-size:17px; }
  .comment-form textarea{ min-height:78px; }
  .comment-form .btn-primary{ padding:9px 12px; }
}

/* ——— Modo oscuro amigable (si tu tema es oscuro) ——— */
@media (prefers-color-scheme: dark){
  .comment-form textarea{
    background: rgba(255,255,255,.08);
    color: #f2f2f2;
    border-color: rgba(255,255,255,.16);
  }
  .comment{
    background:
      radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.05), transparent 60%),
      rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.12);
  }
  .btn-secondary.small,
  .comment-form .btn-primary{
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.18);
  }
}

/* ——— Respeto a accesibilidad de movimiento ——— */
@media (prefers-reduced-motion: reduce){
  .stars-ctrl .star{ transition: none; }
}


/* Botón "Comentar" — versión oscura con degradado */
#bmCommentCta {
  background: linear-gradient(145deg, #7a5a3e, #9f7b5c); /* más oscuro */
  color: #f6efe7;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  letter-spacing: .15px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}

/* Hover: un pelín más de luz y lift */
#bmCommentCta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* Active: click “táctil” */
#bmCommentCta:active {
  transform: translateY(0);
  filter: brightness(.98);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* Accesibilidad: focus visible sin estridencias */
#bmCommentCta:focus-visible {
  outline: 2px solid rgba(224, 197, 165, .9);
  outline-offset: 3px;
}

/* Modo oscuro: aún más profundo para no “lavarse” */
@media (prefers-color-scheme: dark) {
  #bmCommentCta {
    background: linear-gradient(145deg, #6b4f37, #8d6a4d);
    color: #fff7ee;
    box-shadow:
      0 8px 18px rgba(0, 0, 0, .35),
      inset 0 1px 0 rgba(255, 255, 255, .08);
  }
}


/* ===== Distribución bm-meta (autor, estrellas, botones) ===== */
#bmMeta {
  display: grid;
  grid-template-columns: 1fr auto;   /* izquierda info, derecha botones */
  align-items: center;
  gap: 8px 14px;
}

/* fila superior: autor */
#bmMeta .meta-author {
  grid-column: 1 / 2;
  align-self: center;
}

/* botón favorito a la derecha (misma fila que autor) */
#bmMeta #bmFavBtn {
  grid-column: 2 / 3;
  justify-self: end;
}

/* truco: “abrir” el contenedor de feedback para posicionar sus hijos en la grid del padre */
#bmMeta .meta-feedback { display: contents; }

/* estrellas + media a la izquierda, debajo del autor */
#bmMeta .rating-agg {
  grid-column: 1 / 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* botón Comentar a la derecha, alineado con Favorito */
#bmMeta #bmCommentCta {
  grid-column: 2 / 3;
  justify-self: end;
}

/* respirito entre filas */
#bmMeta .rating-agg,
#bmMeta #bmCommentCta { margin-top: 2px; }

/* ===== Responsive: en móvil todo en columna ===== */
@media (max-width: 560px) {
  #bmMeta {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #bmMeta .meta-author,
  #bmMeta .rating-agg,
  #bmMeta #bmFavBtn,
  #bmMeta #bmCommentCta {
    grid-column: 1 / 2;
    justify-self: start;
  }
  #bmMeta #bmFavBtn,
  #bmMeta #bmCommentCta {
    display: inline-flex;
    margin-right: 8px;
  }
}


/* Estrellas con imagen */
.stars-ctrl{
  display:inline-flex;
  gap:6px;
  user-select:none;
}
.stars-ctrl .star{
  appearance:none;
  border:0;
  background:transparent;
  line-height:1;
  cursor:pointer;
  padding:0;
  transition: transform .08s ease;
}
.stars-ctrl .star-img{
  width:22px; height:22px; display:block;
  image-rendering:-webkit-optimize-contrast;
}
@media (hover:hover){
  .stars-ctrl .star:hover{ transform: translateY(-1px) scale(1.02); }
}
.stars-ctrl .star:focus-visible{
  outline:2px solid rgba(200,170,120,.9);
  outline-offset:4px;
  border-radius:6px;
}

/* --- Icono y estilo del botón Comentar --- */

/* ruta relativa a /css/styles.css */
:root {
  --cmt-icon: url("../resources/img/comentario.png");
}

/* Base del botón */
#bmCommentCta {
  background: linear-gradient(145deg, #d8b998, #f1e0c8);
  color: #3a281c;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  letter-spacing: .15px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, .15),
    inset 0 1px 0 rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}

/* Icono al inicio */
#bmCommentCta::before {
  content: "";
  width: 22px;
  height: 22px;
  display: inline-block;
  background-image: var(--cmt-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  image-rendering: crisp-edges;
  transform: translateZ(0);
}

/* === Layout móvil: fav + comentar en la misma fila, rating debajo === */
@media (max-width: 560px) {
  #bmMeta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
  }

  #bmMeta .meta-author {
    flex: 0 0 100%;
  }

  #bmFavBtn { order: 1; }
  #bmCommentCta { order: 2; }
  #bmMeta .rating-agg {
    order: 3;
    flex: 0 0 100%;
    margin-top: 4px;
  }

  /* Ajustes visuales para botones */
  #bmFavBtn,
  #bmCommentCta {
    min-height: 38px;
    padding: 8px 14px;
  }

  /* Icono un poco más grande en móvil */
  #bmCommentCta::before {
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
  }
}

#bmCommentText {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  line-height: 1.4;
  color: #3a281c;
  background: linear-gradient(180deg, #f6eee0, #e8d8c2);
  border: 1px solid rgba(90, 70, 50, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.08),
    0 1px 2px rgba(255,255,255,0.3);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Efecto al enfocar: brillo champagne */
#bmCommentText:focus {
  outline: none;
  border-color: #b88f63;
  box-shadow:
    0 0 0 3px rgba(184,143,99,0.25),
    inset 0 1px 3px rgba(0,0,0,0.08);
}

/* Placeholder más suave */
#bmCommentText::placeholder {
  color: rgba(58, 40, 28, 0.5);
  font-style: italic;
}


/* === Lista de comentarios === */
#bmCommentsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* Cada comentario */
#bmCommentsList .comment {
  background: linear-gradient(180deg, #f7f1e6, #ebdecc);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #3a281c;
  font-family: "Cormorant Garamond", serif;
  line-height: 1.45;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover sutil */
#bmCommentsList .comment:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Cabecera (nombre + fecha) */
#bmCommentsList .comment header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3a281c;
  border-bottom: 1px solid rgba(58, 40, 28, 0.15);
  padding-bottom: 3px;
}

/* Nombre */
#bmCommentsList .comment strong {
  font-weight: 700;
  color: #3a281c;
}

/* Fecha */
#bmCommentsList .comment time {
  font-size: 0.9rem;
  color: rgba(58, 40, 28, 0.6);
}

/* Texto del comentario */
#bmCommentsList .comment p {
  margin: 6px 0 0;
  font-size: 1rem;
  color: #3a281c;
}


/* Cabecera integrada en el bloque */
#bmCommentsList .comment header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: #3a281c;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(58, 40, 28, 0.12);
  background: transparent; /* elimina fondo sólido */
}

/* Nombre y fecha, tono suave pero con contraste */
#bmCommentsList .comment strong {
  font-weight: 600;
  color: rgba(58, 40, 28, 0.85);
}

#bmCommentsList .comment time {
  font-size: 0.9rem;
  color: rgba(58, 40, 28, 0.55);
}

/* Opcional: un ligero brillo para marcar el autor */
#bmCommentsList .comment header strong::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #c9a576 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.4;
  transform: translateY(-1px);
}


/* Título de la sección */
#bmCommentsTitle{
  font: 700 1.05rem "Cormorant Garamond", serif;
  color:#3a281c;
  margin: 14px 0 10px;
}
#bmCommentsTitle .count{
  font-weight:500;
  color:rgba(58,40,28,.55);
  margin-left:2px;
}

/* Composer como una sola card */
.comment-form{
  background: linear-gradient(180deg,#f6eee0,#e8d8c2);
  border:1px solid rgba(90,70,50,.15);
  border-radius:12px;
  padding:12px;
  box-shadow:
    0 1px 2px rgba(0,0,0,.05),
    inset 0 1px 0 rgba(255,255,255,.35);
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Botón publicar integrado */
.comment-form button{
  align-self:flex-end;
  margin-top:-2px;
  padding:8px 16px;
  border-radius:10px;
}

/* Reduce márgenes entre comentarios */
#bmCommentsList{
  margin-top:10px;
  gap:8px;
}



/* === Fondo del contenedor === */
.comment-form {
  background: linear-gradient(180deg, #f0e3d0, #e3ceb0);
  border: 1px solid rgba(90, 70, 50, 0.15);
  border-radius: 12px;
  padding: 14px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* === Textarea más claro y limpio === */
#bmCommentText {
  background: linear-gradient(180deg, #f9f5ef, #f1e6d8);
  border: 1px solid rgba(58, 40, 28, 0.15);
  border-radius: 10px;
  color: #3a281c;
  padding: 10px 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#bmCommentText:focus {
  outline: none;
  border-color: #b88f63;
  box-shadow: 0 0 0 2px rgba(184, 143, 99, 0.25);
}

/* === Botón más brillante y definido === */
.comment-form button {
  align-self: flex-end;
  background: linear-gradient(145deg, #e9d6b8, #f9eedb);
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-weight: 600;
  color: #3a281c;
  font-family: "Cormorant Garamond", serif;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition:
    transform 0.06s ease,
    box-shadow 0.2s ease;
}

.comment-form button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}


:root{
  --tinta:#3a281c;
  --tinta-soft:#5a4332;
  --cobre:#b68c5a;
  --cobre-soft:#e7d2b6;
}

.rating-agg{
  display:flex; align-items:center; gap:.9rem;
  padding:.35rem .6rem;
  border-radius:12px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.25));
  box-shadow:
    0 6px 16px rgba(0,0,0,.06),
    inset 0 1px 0 rgba(255,255,255,.5);
  width:max-content;
}

/* === Estrellas === */
.stars-ctrl{
  display:flex; align-items:center; gap:.25rem;
}

.stars-ctrl .star{
  appearance:none; border:0; background:transparent; padding:0; margin:0;
  line-height:0; cursor:pointer;
  transform: translateZ(0);
  transition: transform .08s ease, filter .18s ease;
}

.stars-ctrl .star .star-img{
  width:22px; height:22px; display:block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12));
}

.stars-ctrl .star:hover,
.stars-ctrl .star:focus-visible{ transform: translateY(-1px) scale(1.02); }
.stars-ctrl .star:active{ transform: translateY(0) scale(.98); }

.stars-ctrl .star:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(182,140,90,.35);
  border-radius:6px;
}

/* === Contador (media + medallón de votos) === */
.agg{
  display:inline-flex; align-items:center; gap:.45rem;
  font-family:"Cormorant Garamond", serif; color:var(--tinta);
}

#bmAggAvg{
  font-style: italic;
  font-weight:600;
  font-size:1.05rem;
  color:var(--tinta-soft);
}

/* ocultamos los paréntesis y renderizamos medallón en ::before */
#bmAggCount{ position:relative; font-size:0; }
#bmAggCount::before{
  content: attr(data-votes);
  display:inline-grid; place-items:center;
  min-width:28px; height:26px; padding:0 8px;
  border-radius:999px;
  font: 700 .85rem/1 "Cormorant Garamond", serif;
  color:#2e1f14; letter-spacing:.2px;

  background:
    radial-gradient(120% 120% at 22% 20%, rgba(255,255,255,.65), transparent 55%),
    linear-gradient(145deg, var(--cobre), var(--cobre-soft));
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.5),
    inset 0 -10px 14px rgba(0,0,0,.10),
    0 1px 4px rgba(0,0,0,.10);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

#bmAggCount:hover::before,
#bmAggCount:focus-visible::before{
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.6),
    inset 0 -10px 16px rgba(0,0,0,.12),
    0 2px 8px rgba(0,0,0,.16);
}

/* separador · entintado y equilibrado */
.agg > #bmAggAvg::after {
  content: " ·";
  margin: 0 .3rem;
  font-size: 1.15em;
  color: rgba(58, 40, 28, .6); /* tinta marrón cálida */
  text-shadow:
    0 0 1px rgba(58, 40, 28, .15),
    0 1px 1px rgba(255, 255, 255, .6); /* relieve ligero */
  transform: translateY(-0.5px);
}


/* Responsive y accesibilidad */
@media (max-width:480px){
  .rating-agg{ gap:.6rem; padding:.3rem .5rem; }
  #bmAggAvg{ font-size:1rem; }
  #bmAggCount::before{ min-width:24px; height:24px; font-size:.8rem; }
}
@media (prefers-reduced-motion:reduce){
  .stars-ctrl .star, #bmAggCount::before { transition:none; }
}

/* separador elegante (·) */
#bmAggAvg::after {
  content: " ·";
  margin-left: .25rem;
  opacity: .45;
  font-weight: 400;
}


/* Promedio con medallón bronce-perlado */
#bmAggAvg {
  position: relative;
  display: inline-block;
  font-style: italic;
  font-weight: 600;
  font-size: 1.05rem;
  color: #3a281c;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #b68c5a 0%, #e7d9c6 85%);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.65),
    inset 0 -2px 6px rgba(0,0,0,.08),
    0 1px 3px rgba(0,0,0,.1);
  text-shadow:
    0 1px 1px rgba(255,255,255,.6),
    0 -1px 1px rgba(0,0,0,.05);
  letter-spacing: .2px;
  backdrop-filter: blur(2px);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

#bmAggAvg:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.7),
    inset 0 -3px 8px rgba(0,0,0,.1),
    0 2px 6px rgba(0,0,0,.15);
}

/* separador elegante (·) */
.agg > #bmAggAvg::after {
  content: " ·";
  margin: 0 .3rem;
  font-size: 1.1em;
  color: rgba(58, 40, 28, .55);
  text-shadow: 0 0 1px rgba(58, 40, 28, .15);
}

.rating-agg {
  box-shadow: 0 3px 10px rgba(0,0,0,.04), inset 0 1px 1px rgba(255,255,255,.4);
}

.book-detail-card p:first-letter {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.8rem;
  line-height: 0.9;
  float: left;
  margin-right: 0.25em;
  color: #3a281c;
  text-shadow:
    0 1px 1px rgba(255,255,255,.5),
    0 2px 2px rgba(0,0,0,.1);
}


p.empty {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  font-style: italic;
  color: #6e5742;
  text-align: center;
  margin: 1.5rem 0;
  letter-spacing: 0.3px;
  position: relative;
  animation: fadeIn 0.8s ease;
}

/* línea decorativa sutil debajo */
p.empty::after {
  content: "";
  display: block;
  width: 60px;
  height: 1.5px;
  margin: 0.6rem auto 0;
  background: linear-gradient(90deg, transparent, #b99973, transparent);
  border-radius: 2px;
  opacity: 0.7;
}

/* efecto flotante tipo susurro */
p.empty {
  backdrop-filter: blur(3px);
  background: rgba(255, 255, 255, 0.35);
  padding: 0.6rem 1.2rem;
  border-radius: 14px;
  display: inline-block;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6),
              0 2px 8px rgba(0,0,0,0.1);
}

/* entrada suave */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: #3a281c;
  text-align: left;
  letter-spacing: 0.4px;
  margin: 0 0 1rem 0;
  padding: 0;
  background: none; /* 🚫 elimina cualquier fondo */
  position: relative;
  animation: fadeInTitle 0.8s ease;
}

/* línea decorativa inferior (bronce–perlado) */
.modal-title::after {
  content: "";
  display: block;
  width: 70px;
  height: 1.6px;
  margin-top: 6px;
  background: linear-gradient(90deg, #c19a6b, #f2e8dc);
  border-radius: 2px;
  opacity: 0.8;
}

/* animación suave al abrir el modal */
@keyframes fadeInTitle {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #d6b997, #f5e9d5);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.2);
  color: #5e4025;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.4s ease,
    background 0.4s ease,
    filter 0.4s ease;
}

/* ✨ Efecto hover: brillo champagne y halo cálido */
.modal-close:hover {
  background: linear-gradient(145deg, #e7c9a8, #fff6eb);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.25),
    0 0 10px rgba(227, 197, 150, 0.5);
  transform: scale(1.06);
  filter: brightness(1.05);
}

/* ✨ Efecto active: presión realista */
.modal-close:active {
  transform: scale(0.94);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.15);
  background: linear-gradient(145deg, #cba880, #f0e3cf);
}

/* ✨ Ícono “✕” con tono bronce oscuro */


.modal-close:hover::before {
  opacity: 1;
  transform: scale(1.05);
}


.book-card { position: relative; }
.comment-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 14px;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1.2;
}


.meta-feedback #bmCommentCta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.meta-feedback .cta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 .4em;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  background: #111;          /* o var(--btn-bg-strong) */
  color: #fff;
}

.meta-feedback .btn-secondary.small .cta-badge {
  background: #2b2b2b;       /* un poco más suave si quieres */
}

@media (prefers-color-scheme: light) {
  .meta-feedback .cta-badge { background: #333; }
}


.meta-feedback .btn-secondary.small .cta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 .45em;
  border-radius: 999px;

  /* 🎨 Bronce editorial */
  background: radial-gradient(130% 130% at 30% 30%,
    #d4a66f 0%,   /* brillo */
    #b87b3d 55%,  /* bronce medio */
    #7c5227 100%  /* sombra */
  );
  color: #fffaf3;                     /* marfil cálido */
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.1px;
  text-decoration: none;              /* ✨ sin subrayado */
  font-variant-numeric: tabular-nums;

  /* 💎 Relieve suave */
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.1),
    inset 0 1px 1px rgba(255,255,255,0.35),
    0 2px 5px rgba(0,0,0,0.25);
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
  transition: transform .15s ease, box-shadow .15s ease, background .3s ease;
}

.meta-feedback .btn-secondary.small:hover .cta-badge {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.15),
    0 4px 10px rgba(0,0,0,0.35);
  background: radial-gradient(130% 130% at 30% 30%,
    #e7b97b 0%, #c58646 55%, #8b5826 100%);
}

.meta-feedback .btn-secondary.small:active .cta-badge {
  transform: scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

/* 🌙 Modo oscuro */
@media (prefers-color-scheme: dark) {
  .meta-feedback .btn-secondary.small .cta-badge {
    background: radial-gradient(120% 120% at 30% 30%,
      #a66d2d 0%, #815024 70%, #4a2b14 100%);
    color: #fff6e8;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.06),
      0 3px 8px rgba(0,0,0,0.55);
  }
}
/* ===== Tokens base ===== */
:root{
  --btn-h: 44px;
  --btn-w: 220px;
  --btn-radius: 12px;
  --btn-border: rgba(141,110,75,.35);
  --btn-text: #4a3728;
  --btn-font: 600 16px "Cormorant Garamond", serif;
}

/* ===== Contenedor acciones ===== */
.bm-actions{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 10px;
}

/* ===== Botón Biblioteca (neutral elegante) ===== */
.bm-actions .fav-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:var(--btn-h); width:var(--btn-w); padding:0 14px;
  border:1px solid var(--btn-border); border-radius:var(--btn-radius);
  background:linear-gradient(180deg, rgba(236,225,208,.9), rgba(197,176,150,.9));
  color:var(--btn-text); font:var(--btn-font); letter-spacing:.2px;
  box-shadow:0 6px 16px rgba(0,0,0,.08);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor:pointer;
}
.bm-actions .fav-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,.12);
  border-color:rgba(202,160,107,.55);
}
.bm-actions .fav-btn img{ width:18px; height:18px; object-fit:contain; opacity:.95; }

/* ===== Botón IA — dorado con resplandor ===== */
.bm-actions #bmAiTalkBtn.btn-ai{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  height:var(--btn-h); width:var(--btn-w); padding:10px 18px;
  border:none; border-radius:var(--btn-radius);
  background:linear-gradient(145deg, #c6a27d, #e7d2b6);
  color:#3a281c; font:var(--btn-font); letter-spacing:.15px; line-height:1;
  box-shadow:0 6px 14px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  cursor:pointer; transition:transform .08s ease, filter .25s ease, box-shadow .25s ease;
  overflow:hidden; isolation:isolate;
}
.bm-actions #bmAiTalkBtn.btn-ai::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:-1;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,240,200,.28), transparent 70%),
    radial-gradient(circle at 50% 70%, rgba(255,225,170,.22), transparent 80%);
  mix-blend-mode:screen; opacity:.22; filter:blur(.6px);
  animation:goldPulse 5.5s ease-in-out infinite;
}
@keyframes goldPulse{
  0%,100%{ opacity:.18; transform:scale(.99); filter:blur(.6px); }
  50%     { opacity:.32; transform:scale(1.02); filter:blur(1.2px); }
}
.bm-actions #bmAiTalkBtn.btn-ai:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(198,142,72,.35), inset 0 1px 0 rgba(255,255,255,.3);
  filter:brightness(1.05);
}
.bm-actions #bmAiTalkBtn.btn-ai:active{ transform:translateY(0); filter:brightness(.98); }
.bm-actions #bmAiTalkBtn .ai-logo{ width:22px; height:22px; object-fit:contain; filter:drop-shadow(0 0 4px rgba(240,210,140,.3)); }
.bm-actions #bmAiTalkBtn .ai-label{ font-size:15px; color:#3a281c; }

/* ===== Responsive ===== */
@media (max-width:768px){
  .bm-actions{ flex-direction:column; align-items:center; gap:10px; }
  .bm-actions .fav-btn,
  .bm-actions #bmAiTalkBtn.btn-ai{ width:100%; max-width:320px; }
}

/* Motion-safe */
@media (prefers-reduced-motion: reduce){
  .bm-actions #bmAiTalkBtn.btn-ai::after{ animation:none; opacity:.24; }
}
:root{
  --btn-h: 44px;
  --btn-w: 220px;
  --btn-radius: 12px;
  --btn-font: 600 16px "Cormorant Garamond", serif;
  --btn-shadow: 0 6px 14px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ============ Contenedor ============ */
.bm-actions{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  margin:18px 0 10px;
}

/* ============ Base general ============ */
.bm-actions button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  width:var(--btn-w);
  height:var(--btn-h);
  border:none;
  border-radius:var(--btn-radius);
  font:var(--btn-font);
  color:#3a281c;
  letter-spacing:.15px;
  line-height:1;
  cursor:pointer;
  transition:transform .08s ease, filter .25s ease, box-shadow .25s ease;
  box-shadow:var(--btn-shadow);
  overflow:hidden;
  isolation:isolate;
}

/* ---------- Bibliotecas (Bronce claro) ---------- */
.bm-actions .fav-btn{
  background: linear-gradient(145deg, #d5b89e, #f0e0c8);
}
.bm-actions .fav-btn::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:
    radial-gradient(circle at 50% 30%, rgba(250,230,200,.2), transparent 70%),
    radial-gradient(circle at 50% 70%, rgba(240,210,180,.15), transparent 80%);
  mix-blend-mode:screen;
  opacity:.18;
  animation: metalPulse 6s ease-in-out infinite;
}

/* ---------- IA (Oro vivo) ---------- */
.bm-actions .btn-ai{
  position:relative;
  background: linear-gradient(145deg, #c6a27d, #e7d2b6);
  box-shadow:
    0 6px 14px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.25);
}
.bm-actions .btn-ai::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,240,200,.28), transparent 70%),
    radial-gradient(circle at 50% 70%, rgba(255,225,170,.22), transparent 80%);
  mix-blend-mode:screen;
  opacity:.25;
  animation: goldPulse 5.5s ease-in-out infinite;
}

/* ---------- Comentarios (Cobre suave) ---------- */
.bm-actions .btn-comments{
  position:relative;
  background: linear-gradient(145deg, #b9916f, #e4c7a7);
}
.bm-actions .btn-comments::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,225,190,.25), transparent 70%),
    radial-gradient(circle at 50% 80%, rgba(200,150,100,.2), transparent 80%);
  mix-blend-mode:screen;
  opacity:.20;
  animation: copperPulse 6s ease-in-out infinite;
}

/* ---------- Hover ---------- */
.bm-actions button:hover{
  transform:translateY(-2px);
  filter:brightness(1.05);
}
.bm-actions button:active{ transform:translateY(0); filter:brightness(.98); }

/* ---------- Animaciones ---------- */
@keyframes goldPulse{
  0%,100%{ opacity:.18; filter:blur(.6px); transform:scale(.99); }
  50%     { opacity:.32; filter:blur(1.2px); transform:scale(1.02); }
}
@keyframes metalPulse{
  0%,100%{ opacity:.15; transform:scale(.99); }
  50%     { opacity:.25; transform:scale(1.01); }
}
@keyframes copperPulse{
  0%,100%{ opacity:.15; filter:blur(.5px); }
  50%     { opacity:.28; filter:blur(1px); }
}

/* ---------- Iconos ---------- */
.bm-actions img{
  width:20px;
  height:20px;
  object-fit:contain;
  filter:drop-shadow(0 0 3px rgba(240,210,140,.25));
}

/* ---------- Responsive ---------- */
@media (max-width:768px){
  .bm-actions{
    flex-direction:column;
    align-items:center;
    gap:10px;
  }
  .bm-actions button{
    width:100%;
    max-width:320px;
  }
}

/* Motion safe */
@media (prefers-reduced-motion: reduce){
  .bm-actions button::after{ animation:none; opacity:.22; }
}

/* ——— Gradientes diferenciados (manteniendo la misma estética) ——— */

/* Biblioteca: arena tostada */
.bm-actions .fav-btn{
  background: linear-gradient(145deg, #d4b797, #ebd7bd);
  color:#3a281c;
}

/* IA: oro vivo con reflejo suave */
.bm-actions .btn-ai{
  background: linear-gradient(145deg, #cfa971, #f1dcbb);
  color:#3a281c;
}
.bm-actions .btn-ai::after{
  background:
    radial-gradient(circle at 50% 25%, rgba(255,245,210,.35), transparent 70%),
    radial-gradient(circle at 50% 70%, rgba(255,225,170,.22), transparent 80%);
}

/* Comentarios: bronce rojizo */
.bm-actions .btn-comments{
  background: linear-gradient(145deg, #b78c66, #e3c3a2);
  color:#3a281c;
}
.bm-actions .btn-comments::after{
  background:
    radial-gradient(circle at 50% 35%, rgba(240,200,150,.25), transparent 70%),
    radial-gradient(circle at 50% 80%, rgba(180,110,60,.18), transparent 80%);
}

/* ✨ Reflejo diagonal animado en el botón IA */
.bm-actions .btn-ai::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    60deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 45%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.35) 55%,
    transparent 100%
  );
  opacity: 0;
  transform: translateX(-120%) rotate(10deg);
  animation: aiSheen 4s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Animación del brillo diagonal */
@keyframes aiSheen {
  0%, 60%, 100% {
    opacity: 0;
    transform: translateX(-120%) rotate(10deg);
  }
  70% {
    opacity: 0.3;
    transform: translateX(0%) rotate(10deg);
  }
  80% {
    opacity: 0;
    transform: translateX(120%) rotate(10deg);
  }
}


:root{
  --btn-h: 44px;
  --btn-w: 220px;
  --btn-r: 14px;
  --btn-font: 600 16px "Cormorant Garamond", serif;
  --btn-text: #3a281c;
}

/* Contenedor */
.bm-actions{
  display:flex; justify-content:center; align-items:center; gap:12px;
  flex-wrap:wrap; margin:18px 0 10px;
}
.bm-actions button{
  display:inline-flex; align-items:center; justify-content:center; gap:.6rem;
  height:var(--btn-h); width:var(--btn-w); padding:10px 18px;
  border:none; border-radius:var(--btn-r);
  font:var(--btn-font); color:var(--btn-text); letter-spacing:.15px; line-height:1;
  box-shadow:0 6px 14px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .08s ease, filter .25s ease, box-shadow .25s ease;
  overflow:hidden; isolation:isolate; cursor:pointer;
}
.bm-actions button:hover{ transform:translateY(-2px); filter:brightness(1.05); }
.bm-actions img{ width:20px; height:20px; object-fit:contain; filter:drop-shadow(0 0 3px rgba(240,210,140,.25)); }

/* 1) Biblioteca — bronce arena (sobrio) */
.fav-btn{
  background: linear-gradient(145deg, #d4b797, #ecd8bf);
}

/* 2) IA — oro vivo (prota) + sheen */
.btn-ai{
  position:relative;
  background: linear-gradient(145deg, #cfa971, #f1dcbb);
}
.btn-ai::before{
  /* brillo diagonal que pasa de vez en cuando */
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: linear-gradient(60deg, transparent 0%,
             rgba(255,255,255,.34) 45%, rgba(255,255,255,.45) 50%,
             rgba(255,255,255,.34) 55%, transparent 100%);
  opacity:0; transform: translateX(-120%) rotate(10deg);
  animation: aiSheen 7s ease-in-out infinite;
  mix-blend-mode:screen;
}
@keyframes aiSheen{
  0%,60%,100%{ opacity:0; transform:translateX(-120%) rotate(10deg); }
  70%{ opacity:.28; transform:translateX(0) rotate(10deg); }
  80%{ opacity:0; transform:translateX(120%) rotate(10deg); }
}

/* 3) Comentarios — cobre suave (social) */
.btn-comments{
  background: linear-gradient(145deg, #b78c66, #e3c3a2);
  box-shadow:0 6px 14px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.22);
}

/* Badge de comentarios más discreto */
.btn-comments .cta-badge{
  background:#a97a4a; color:#fff; font-size:12px; padding:3px 7px; border-radius:999px;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
}

/* Responsive */
@media (max-width:768px){
  .bm-actions{ flex-direction:column; gap:10px; }
  .bm-actions button{ width:100%; max-width:320px; }
}
@media (prefers-reduced-motion: reduce){
  .btn-ai::before{ animation:none; opacity:.18; }
}

/* IA — oro cálido y protagonista */
.bm-actions .btn-ai{
  background: linear-gradient(145deg, #E4B968, #F8E6BD);
  border: 1px solid #C99A4E;
  color: #332314;
  box-shadow: 0 10px 24px rgba(201,154,78,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
/* mantiene tu sheen si ya lo añadiste */

/* Biblioteca — arena neutra y discreta */
.bm-actions .fav-btn{
  background: linear-gradient(145deg, #E7D8C7, #F4EBDF);
  border: 1px solid #C3AD92;
  color: #3a281c;
  box-shadow: 0 8px 18px rgba(149,120,92,.18), inset 0 1px 0 rgba(255,255,255,.3);
}

/* Comentarios — cobre/terracota más cálido */
.bm-actions .btn-comments{
  background: linear-gradient(145deg, #B6713E, #E2B189);
  border: 1px solid #9C5325;
  color: #2f1f14;
  box-shadow: 0 10px 22px rgba(156,83,37,.28), inset 0 1px 0 rgba(255,235,220,.25);
}

/* ligero hover común (puedes mantener el tuyo) */
.bm-actions button:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* Oculta la cortina por defecto */
.trend-curtain[aria-hidden="true"] {
  display: none;
}

/* Muestra cuando está activa */
.trend-curtain.show {
  display: block;
  animation: fadeDown 0.4s ease forwards;
}

/* Pequeña animación opcional */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}



/* ======= Trend Header Premium (scoped) ======= */
.heroImg{
  --ink: #24160f;
  --muted: #8f7d69;
  --gold-1: #7b5234;
  --gold-2: #a97a55;
  --gold-3: #caa27a;
  --glass: rgba(255,255,255,.06);
  --line: rgba(36,22,15,.10);
  --radius-full: 999px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 24px rgba(0,0,0,.12);
  --ff-premium: "Cormorant Garamond", serif;
}

/* Header container con degradado sutil */
.heroImg .trend-header{
  display:flex; align-items:center; gap:16px;
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,250,243,.55));
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

/* Título sobrio y elegante */
.heroImg .trend-heading{
  margin:0;
  font-family: var(--ff-premium);
  font-weight: 600;
  letter-spacing:.2px;
  color: var(--ink);
  font-size: clamp(22px, 2.4vw, 30px);
}

/* Grupo de tabs */
.heroImg .trend-tabs{
  display:flex; gap:10px;
  margin-left: 6px;
}

/* Botón “píldora” premium */
.heroImg .trend-tab{
  appearance:none;
  border: none;
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-weight: 600;
  letter-spacing:.2px;
  cursor:pointer;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: none;
  background: #fff;
  color: var(--gold-1);
  border: 1px solid rgba(202,162,122,.38);
}

/* Tab activo: degradado bañado en oro */
.heroImg .trend-tab[aria-selected="true"]{
  background: linear-gradient(145deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  color: #fff8ea;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 18px rgba(169,122,85,.28);
  transform: translateY(-1px);
}

/* Hover/Focus accesibles */
.heroImg .trend-tab:hover{ filter: brightness(1.05); }
.heroImg .trend-tab:focus-visible{
  outline: 2px solid var(--gold-3);
  outline-offset: 2px;
}

/* Botón de cierre minimal */
.heroImg .trend-close{
  margin-left:auto;
  width:36px; height:36px;
  border-radius: var(--radius-full);
  display:grid; place-items:center;
  background:
    linear-gradient(180deg, #ffffff, #fff8ef) padding-box,
    linear-gradient(145deg, var(--gold-3), var(--gold-1)) border-box;
  border: 1px solid transparent;
  color: var(--gold-1);
  cursor:pointer;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  box-shadow: var(--shadow-soft);
}
.heroImg .trend-close:hover{ transform: translateY(-2px); filter: brightness(1.03); }

/* (Opcional) separador fino bajo el header */
.heroImg .trend-header::after{
  content:"";
  position:absolute; left:0; right:0;
  bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, rgba(202,162,122,.35), transparent);
}


/* Tokens metálicos */
:root{
  --metal-dk: #7b5234;  /* cobre oscuro */
  --metal-md: #a97a55;  /* cobre medio */
  --metal-lt: #caa27a;  /* cobre claro */
  --metal-hl: rgba(255,255,255,.25); /* brillo */
}

/* Contenedor tabs */
.trend-tabs{
  display:flex; gap:10px;
}

/* Botón base */
.trend-tab{
  appearance:none;
  border:none;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  position: relative;
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease, background-position .5s ease;
  /* metal suave apagado */
  background:
    linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  color: #fff8ea;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 8px 18px rgba(169,122,85,.28);
  border: 1px solid transparent;
}

/* Estado no seleccionado: versión blanca con borde cobre */
.trend-tab[aria-selected="false"]{
  background: #fff;
  color: var(--metal-dk);
  border: 1px solid rgba(202,162,122,.45);
  box-shadow: none;
}

/* Hover */
.trend-tab:hover{
  filter: brightness(1.06);
}

/* Active/Selected: levanta un pelín */
.trend-tab[aria-selected="true"]{
  transform: translateY(-1px);
}

/* Focus accesible */
.trend-tab:focus-visible{
  outline: 2px solid var(--metal-lt);
  outline-offset: 2px;
}

/* Brillo metálico sutil (shimmer) */
.trend-tab::after{
  content:"";
  position:absolute; inset:0;
  border-radius:999px;
  background:
    linear-gradient(120deg,
      transparent 0%,
      rgba(255,255,255,.18) 18%,
      transparent 38%);
  opacity:.0;
  transition: opacity .2s ease;
  pointer-events:none;
}
.trend-tab:hover::after{ opacity:.8; }

/* Reduce motion si el usuario lo pide */
@media (prefers-reduced-motion: reduce){
  .trend-tab{ transition: none; }
  .trend-tab::after{ transition: none; }
}

/* Tokens (si ya los tienes definidos, omite este bloque) */
.heroImg{
  --metal-dk:#7b5234; --metal-md:#a97a55; --metal-lt:#caa27a;
  --metal-hl:rgba(255,255,255,.22);
}

/* Badge premium (scope fuerte) */
.heroImg .trend-panel .trend-meta .badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: "Cormorant Garamond", serif !important;
  font-weight: 600;
  letter-spacing: .2px;
  font-size: 13.5px;
  line-height: 1;
  color: #fff7ea !important;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) !important;
  border: 1px solid transparent !important;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 8px 18px rgba(169,122,85,.28) !important;
  position: relative;
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease;
}

/* Hover/active */
.heroImg .trend-panel .trend-meta .badge:hover{ filter: brightness(1.06); }
.heroImg .trend-panel .trend-meta .badge:active{ transform: translateY(1px); }

/* Shimmer metálico */
.heroImg .trend-panel .trend-meta .badge::after{
  content:""; position:absolute; inset:0; border-radius:999px;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 18%, transparent 38%);
  opacity: 0; transition: opacity .2s ease; pointer-events:none;
}
.heroImg .trend-panel .trend-meta .badge:hover::after{ opacity:.8; }


.trend-curtain{ position:fixed; inset:0; display:none; background:rgba(0,0,0,.55); z-index:2147483647; }
.trend-curtain.show{ display:block; }
.trend-panel{
  position:fixed;
  left:var(--dock-left); top:var(--dock-top);
  width:var(--dock-width); height:var(--dock-height);
  background:#f5f1ec; border-radius:14px; display:flex; flex-direction:column; overflow:hidden;
}
.trend-scroll{
  flex:1 1 auto; min-height:0;
  height: calc(var(--dock-height) - var(--header-h, 56px));
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
}
body.no-scroll{ position:fixed; width:100%; overflow:hidden; }

/* ===== Desktop: mismo docking, pero scroll HORIZONTAL con barra premium ===== */
@media (min-width: 1024px){
  /* Cambiamos el eje de scroll */
  .trend-scroll{
    overflow-y: hidden;       /* no vertical */
    overflow-x: auto;         /* sí horizontal */
    padding: 12px 14px;       /* respiro lateral */
    scrollbar-gutter: stable both-edges; /* evita saltos al aparecer la barra */
    scroll-snap-type: x proximity;       /* snap suave entre cards */
    -webkit-overflow-scrolling: touch;   /* inercia agradable */
  }

  /* La lista se vuelve fila horizontal robusta */
  .trend-list{
    display: grid !important;
    grid-auto-flow: column;               /* elementos en columnas contiguas = fila */
    grid-auto-columns: minmax(260px, 300px); /* ancho consistente por card */
    gap: 14px;
  }

  /* Las cards encajan y hacen snap */
  .trend-card{
    scroll-snap-align: start;
    min-width: 260px;        /* doble cinturón por si hay estilos heredados */
    max-width: 300px;
  }
}

/* ===== Scrollbar premium (funciona para horizontal y vertical) ===== */
/* Firefox */
.trend-scroll{
  scrollbar-width: thin;
  scrollbar-color: rgba(90,63,41,.55) transparent;  /* thumb / track */
}

/* WebKit (Chrome/Edge/Safari) */
.trend-scroll::-webkit-scrollbar{
  height: 10px;   /* horizontal */
  width: 10px;    /* por si hay vertical en móvil */
}
.trend-scroll::-webkit-scrollbar-track{
  background: transparent;
  border-radius: 12px;
}
.trend-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg,#c9a57b,#b98c5f);
  border-radius: 999px;
  border: 2px solid rgba(245,241,236,.9);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.trend-scroll::-webkit-scrollbar-thumb:hover{
  filter: brightness(.95);
}


/* el panel es el ancla de la barra */
.trend-panel{ position: fixed; }

/* nuestra barra personalizada */
.trend-scrollbar{
  position: absolute;
  left: 14px; right: 14px; bottom: 10px;
  height: 8px;
  background: rgba(0,0,0,.08);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
  pointer-events: auto;           /* para arrastrar */
  z-index: 3;                     /* encima del contenido */
}

/* el “thumb” que se mueve */
.trend-scrollbar-thumb{
  position: absolute; left: 0; top: 0; height: 100%;
  width: 20%;                     /* se ajusta por JS */
  border-radius: inherit;
  background: linear-gradient(90deg,#c9a57b,#b98c5f);
  box-shadow: 0 1px 2px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.5);
  cursor: grab;
}
.trend-scrollbar-thumb:active{ cursor: grabbing; }

@media (max-width:1023px){
  .trend-scrollbar{ display:none; } /* solo desktop */
}

/* mantenemos tu barra nativa estilizada (aparece al scrollear) */
.trend-scroll{
  scrollbar-width: thin;
  scrollbar-color: rgba(90,63,41,.55) transparent;
}
.trend-scroll::-webkit-scrollbar{ height:10px; }
.trend-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg,#c9a57b,#b98c5f);
  border-radius: 999px;
  border: 2px solid rgba(245,241,236,.9);
}


/* Horizontal en escritorio (lo estás usando): más aire y ancho de card cómodo */
@media (min-width: 900px){
  .trend-scroll{
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 18px 28px;      /* deja sitio para la barra abajo */
    scrollbar-gutter: stable both-edges;
    scroll-snap-type: x proximity;
  }
  .trend-list{
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: clamp(280px, 30vw, 340px);  /* más ancho */
    gap: 18px;                                     /* más separación */
  }
  .trend-card{
    min-width: clamp(280px, 30vw, 340px);
    scroll-snap-align: start;
  }
}

/* Barra premium SIEMPRE por encima del contenido */
.trend-panel{ position: fixed; }
.trend-scrollbar{
  position: absolute;
  left: 18px; right: 18px; bottom: 10px;
  height: 8px; z-index: 5;                 /* por encima del scroller */
  background: rgba(0,0,0,.08);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
  pointer-events: auto;
}
.trend-scrollbar-thumb{
  position: absolute; left: 0; top: 0; height: 100%;
  width: 20%;
  border-radius: inherit;
  background: linear-gradient(90deg,#c9a57b,#b98c5f);
  box-shadow: 0 1px 2px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.5);
  cursor: grab;
}
.trend-scrollbar-thumb:active{ cursor: grabbing; }

/* (opcional) fade de bordes para sensación de carrusel */
@media (min-width: 900px){
  .trend-scroll{
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  }
}

/* Nativas (seguirán apareciendo al scroll; no dependemos de ellas) */
.trend-scroll{
  scrollbar-width: thin;
  scrollbar-color: rgba(90,63,41,.55) transparent;
}
.trend-scroll::-webkit-scrollbar{ height: 10px; }
.trend-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg,#c9a57b,#b98c5f);
  border-radius: 999px;
  border: 2px solid rgba(245,241,236,.9);
}

/* ==== Ajuste de versión escritorio: portadas completas y sin solaparse ==== */
@media (min-width: 1024px){

  /* Panel */
  .trend-panel{
    background: rgba(245,241,236,.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(185,140,95,.15);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
  }

  /* Scroll horizontal con respiración */
  .trend-scroll{
    overflow-x: auto;
    overflow-y: hidden;
    padding: 18px 28px 36px;
    mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  }

  /* Lista: más gap, columnas ajustadas y sin solape */
  .trend-list{
    display: grid !important;
    grid-auto-flow: column;
    /* Ajuste más estrecho para evitar solapamiento */
    grid-auto-columns: clamp(220px, 22vw, 260px);
    gap: 26px;
  }

  /* Tarjetas: más ligeras visualmente */
  .trend-card{
    background: #ffffffee;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: clamp(220px, 22vw, 260px);
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .trend-card:hover{
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
  }

  /* Portadas proporcionadas */
  .trend-cover-wrap{
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #f3ede8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  }
  .trend-cover{
    width: 100%; height: 100%; object-fit: cover;
    display: block;
  }

  /* Texto más equilibrado */
  .trend-title{
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.3;
    color: #3f2d1f;
    font-weight: 700;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
  }
  .trend-author{
    margin-top: 4px;
    font-size: 13px;
    color: #8a7463;
  }

  /* Badges */
  .trend-meta{ margin-top: 10px; }
  .badge{
    font-size: 12px;
    padding: 5px 10px;
    background: linear-gradient(180deg,#c9a57b,#b98c5f);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(0,0,0,.08) inset;
  }

  /* Barra premium más discreta */
  .trend-scrollbar{
    left: 28px; right: 28px; bottom: 14px;
    height: 6px;
    background: rgba(0,0,0,.08);
  }
  .trend-scrollbar-thumb{
    background: linear-gradient(90deg,#c9a57b,#b98c5f);
  }
}

/* ==== Ultra wide: aumenta solo si hay espacio de sobra ==== */
@media (min-width: 1440px){
  .trend-list{
    grid-auto-columns: clamp(240px, 20vw, 300px);
    gap: 30px;
  }
  .trend-card{
    min-width: clamp(240px, 20vw, 300px);
  }
}

/* Eliminar comillas automáticas en las citas de autores */
.quote-text::before,
.quote-text::after {
  content: none !important;
}


/* ==== Versión escritorio: portadas más pequeñas dentro de las tarjetas ==== */
@media (min-width: 1024px){

  /* Mantén ancho cómodo de card */
  .trend-card{
    width: clamp(220px, 22vw, 260px);
    min-width: clamp(220px, 22vw, 260px);
    padding: 12px;
    border-radius: 14px;
    background: #ffffffef;
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* 👇 Portada más pequeña dentro del card */
  .trend-cover-wrap{
    width: 80%;                /* antes 100% → ahora más pequeña */
    aspect-ratio: 2 / 3;       /* mantiene proporción */
    margin: 0 auto 10px auto;  /* centrada y con aire inferior */
    border-radius: 10px;
    overflow: hidden;
    background: #f3ede8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
    transition: transform .2s ease;
  }

  /* Portada con efecto hover elegante */
  .trend-cover{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
  }
  .trend-card:hover .trend-cover{
    transform: scale(1.04);
  }

  /* Texto más proporcionado */
  .trend-title{
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
    color: #3f2d1f;
    font-weight: 600;
    margin-top: 4px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
  }
  .trend-author{
    font-size: 13px;
    color: #8a7463;
    text-align: center;
  }

  .trend-meta{
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .badge{
    font-size: 11px;
    padding: 4px 10px;
    background: linear-gradient(180deg,#c9a57b,#b98c5f);
    color: #fff;
    border-radius: 999px;
  }
}


/* === Desktop: arregla apelmazado de las 3 primeras y reduce portada === */
@media (min-width:1024px){

  /* Aire al principio y al final del carrusel */
  .trend-scroll{
    padding-inline: 28px !important;
  }

  .trend-list{
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: clamp(220px, 22vw, 260px);
    gap: 28px !important;
    padding-inline: 4px;          /* microcolchón interno */
  }

  /* 🔧 Por si quedó algún margin de rules antiguas */
  .trend-list > .trend-card{
    margin: 0 !important;
    box-sizing: border-box;
    scroll-snap-align: start;
  }
  .trend-list > .trend-card + .trend-card{
    margin-left: 0 !important;
  }

  /* Portada más pequeña dentro del card (centrada) */
  .trend-cover-wrap{
    width: 68%;                   /* antes 80–100% → más respiro */
    aspect-ratio: 2 / 3;
    margin: 0 auto 10px auto;
    border-radius: 10px;
    overflow: hidden;
    background: #f3ede8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  }
  .trend-cover{ display:block; width:100%; height:100%; object-fit:cover; }

  /* Tipos y badges compactos y centrados */
  .trend-title{ font-size:15px; line-height:1.3; text-align:center;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .trend-author{ font-size:13px; color:#8a7463; text-align:center; }
  .trend-meta{ margin-top:auto; display:flex; justify-content:center; gap:8px; }
  .badge{ font-size:11px; padding:4px 10px; }
}


/* === Desktop: portadas más pequeñas, centradas y sin apelmazar al inicio === */
@media (min-width:1024px){

  /* Más aire al borde izquierdo/derecho del carrusel */
  .trend-scroll{
    padding-inline: 28px !important;
  }

  .trend-list{
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: clamp(220px, 22vw, 260px);
    gap: 24px !important;
    padding-inline: 12px;                 /* colchón interno */
  }

  /* Truco extra: separadores invisibles al inicio/fin por si un padding se pisa */
  .trend-list::before,
  .trend-list::after{
    content: "";
    width: 12px;                           /* aire adicional */
  }

  /* La tarjeta se queda del mismo tamaño, centra contenido */
  .trend-card{
    min-width: clamp(220px, 22vw, 260px);
    padding: 12px;
    display: flex; flex-direction: column; align-items: center;
    border-radius: 14px;
    background: #ffffffef;
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    scroll-snap-align: start;
  }

  /* 👇 Portada más pequeña y centrada dentro del card (no se come el ancho) */
  .trend-cover-wrap{
    width: clamp(120px, 68%, 170px);       /* reduce la portada, siempre centrada */
    aspect-ratio: 2 / 3;
    margin: 0 auto 10px auto;
    border-radius: 10px;
    overflow: hidden;
    background: #f3ede8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  }
  .trend-cover{ width:100%; height:100%; object-fit:cover; display:block; }

  /* Tipos compactos y centrados */
  .trend-title{
    margin-top: 4px;
    font-size: 15px; line-height: 1.3; text-align: center;
    color: #3f2d1f; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .trend-author{ font-size: 13px; color:#8a7463; text-align:center; }

  .trend-meta{ margin-top: 8px; display:flex; gap:8px; justify-content:center; }
  .badge{ font-size:11px; padding:4px 10px; }
}


/* === Fix final: aire entre la primera y segunda tarjeta === */
@media (min-width:1024px){

  /* Añadimos aire explícito antes de la primera card */
  .trend-list > .trend-card:first-child{
    margin-left: 20px; /* ajusta a gusto: 16–28px suele ir bien */
  }

  /* Opcional: un poquito al final también para simetría */
  .trend-list > .trend-card:last-child{
    margin-right: 20px;
  }
}


@media (min-width:1024px){
  .trend-list > .trend-card:first-child{
    margin-left: 32px; /* antes 20px — añade aire real de respiro */
  }
  .trend-list > .trend-card:last-child{
    margin-right: 24px; /* mantiene el equilibrio visual */
  }
}

@media (min-width:1024px){
  /* Forzamos un espacio real al inicio del carrusel */
  .trend-list::before{
    content: "";
    flex: 0 0 40px;   /* crea un bloque invisible de 40px antes de la primera card */
    display: block;
  }
}

/* ===== Trend card — premium & airy (desktop y tablet) ===== */
@media (min-width: 900px){
  .trend-card{
    --card-pad: 14px;            /* aire interior */
    --card-radius: 16px;
    --card-shadow: 0 10px 26px rgba(0,0,0,.12);
    --card-shadow-hover: 0 18px 42px rgba(0,0,0,.16);

    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto; /* portada · título · autor · spacer · badges */
    align-items: start;
    gap: 10px;

    padding: var(--card-pad) calc(var(--card-pad) + 2px) 16px;
    background: #fffdfb; /* cálido muy sutil */
    border: 1px solid rgba(0,0,0,.05);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .trend-card:hover{
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(0,0,0,.08);
  }

  /* Etiqueta de ranking: discreta, flotante */
  .trend-card .rank{
    position: absolute;
    top: 8px; left: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(47,35,24,.85);
    color: #fff;
    font: 700 11px/1.1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
    letter-spacing: .2px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    display: inline-block;
    transform: none;
  }

  /* Portada: más pequeña, con marco sutil y sombra suave */
  .trend-cover-wrap{
    width: 72%;
    aspect-ratio: 2 / 3;
    margin: 6px auto 6px;            /* aire arriba/abajo */
    border-radius: 12px;
    overflow: hidden;
    background: #f4eee8;
box-shadow:
  0 1px 0 rgba(255,255,255,.7) inset,
  0 0 0 1px rgba(185,140,95,.35),         /* filo bronce */
  0 10px 16px rgba(0,0,0,.08);

    transition: transform .22s ease;
  }
  .trend-card:hover .trend-cover-wrap{ transform: translateY(-1px); }

  .trend-cover{
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: translateZ(0);
  }

  /* Tipografía: ritmo sereno, centrada */
  .trend-title{
    margin-top: 2px;
    padding-inline: 6px;
    text-align: center;
    color: #3c2b1e;
    font-weight: 700;
    font-size: 15.5px;
    line-height: 1.28;
    letter-spacing: .1px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .trend-author{
    margin-top: -2px;
    text-align: center;
    color: #8c7664;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-inline: 8px;
  }

  /* Separador fantasma para bajar los badges sin meter líneas visibles */
  .trend-card::after{
    content: "";
    height: 2px;
    margin: 2px auto 0;
    width: 64%;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.06), transparent);
  }

  /* Badges: centrados, compactos, bien alineados */
  .trend-meta{
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  .badge{
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    color: #fff;
    background: linear-gradient(180deg,#c9a57b,#b98c5f);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(0,0,0,.08) inset, 0 6px 14px rgba(185,140,95,.18);
    white-space: nowrap;
  }
}

/* micro-ajuste también en móvil (opcional, conservador) */
@media (max-width: 899px){
  .trend-card{ gap: 10px; padding: 12px 12px 14px; }
  .trend-cover-wrap{ width: 78%; margin: 4px auto 6px; }
  .trend-title{ font-size: 15px; }
}


/* ===== Trend Cards — altura uniforme y equilibrio visual ===== */
@media (min-width: 900px){
  .trend-list {
    display: flex;
    align-items: stretch;         /* todas las tarjetas mismo alto */
    height: 100%;                 /* ocupa todo el contenedor visible */
  }

  .trend-card {
    flex: 0 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;  /* equilibra portada, texto y badges */
    padding: 16px 14px 20px;
  }

  .trend-cover-wrap {
    flex-shrink: 0;
    width: 85%;
    aspect-ratio: 2/3;
    margin: 0 auto 10px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f4ef;
    box-shadow:
      0 1px 0 rgba(255,255,255,.6) inset,
      0 0 0 1px rgba(0,0,0,.08),
      0 10px 18px rgba(0,0,0,.08);
  }

  .trend-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .trend-title {
    margin-top: 8px;
    font-size: 15.5px;
    font-weight: 700;
    text-align: center;
    color: #3a2a1c;
  }

  .trend-author {
    margin-top: 2px;
    font-size: 13px;
    color: #8d7763;
    text-align: center;
  }

  .trend-meta {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .badge {
    background: linear-gradient(180deg,#c9a57b,#b98c5f);
    color: #fff;
    border-radius: 999px;
    font-size: 11.5px;
    padding: 5px 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(185,140,95,.25);
  }
}


/* === Bronced Metalic Badges — coherente con botones === */
.trend-card .badge,
.btn-secondary.small .cta-badge {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: .2px;
  color: #fff8ea;
  cursor: pointer;
  position: relative;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  border: 1px solid transparent;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 6px 16px rgba(169, 122, 85, .25);
  transition:
    filter .15s ease,
    transform .12s ease,
    box-shadow .15s ease,
    background-position .5s ease;
}

/* Brillo metálico animado */
.trend-card .badge::before,
.btn-secondary.small .cta-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.35), rgba(255,255,255,0) 40%);
  mix-blend-mode: screen;
  opacity: .55;
  transform: translateY(-15%) skewX(-18deg);
  transition: transform .4s ease, opacity .3s ease;
  pointer-events: none;
}

.trend-card .badge:hover,
.btn-secondary.small .cta-badge:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 8px 20px rgba(169, 122, 85, .35);
}

.trend-card .badge:hover::before,
.btn-secondary.small .cta-badge:hover::before {
  transform: translateY(-3%) skewX(-18deg);
  opacity: .8;
}

/* Posicionamiento móvil */
@media (max-width: 899px) {
  .trend-card {
    position: relative;
    padding-bottom: 60px;
  }

  .trend-card .trend-meta {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: flex;
    gap: 10px;
    z-index: 2;
  }
}

/* Centrado en escritorio */
@media (min-width: 900px) {
  .trend-card .trend-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
  }
}


/* ========= Trend header: layout fluido ========= */
.trend-header{
  display:flex;
  align-items:center;
  gap: clamp(8px, 1.2vw, 16px);
  padding: clamp(10px, 2vw, 16px) clamp(12px, 2.4vw, 20px);
}

.trend-heading{
  flex:1 1 auto;
  margin:0;
  /* Título responsivo */
  font-size: clamp(18px, 2.2vw + 2px, 26px);
  line-height: 1.1;
}

/* Contenedor de tabs: fila flexible que puede envolver */
.trend-tabs{
  display:flex;
  align-items:center;
  gap: clamp(8px, 1.4vw, 14px);
  flex-wrap: wrap;                /* permite saltar de línea en pantallas estrechas */
  max-width: 70%;
}

/* Botón tab — base */
.trend-tab{
  appearance:none;
  border:1px solid transparent;
  border-radius:999px;
  /* Padding y tipografía fluidos */
  padding: clamp(6px, 1.2vw, 10px) clamp(12px, 2vw, 18px);
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(12px, 1.4vw, 15px);
  letter-spacing:.2px;
  line-height:1.1;
  white-space:nowrap;
  cursor:pointer;
  position:relative;
  color:#6b5442;
  background: rgba(255,255,255,.75);
  box-shadow:
    inset 0 0 0 1px rgba(120,85,55,.12),
    0 4px 10px rgba(0,0,0,.06);
  transition:
    filter .15s ease, transform .12s ease,
    box-shadow .15s ease, background-position .5s ease;
}

/* Hover/active liviano cuando NO está seleccionado */
.trend-tab:not([aria-selected="true"]):hover{
  filter:brightness(1.02);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(120,85,55,.18),
    0 6px 14px rgba(0,0,0,.08);
}

/* Tab seleccionado — acabado metálico coherente con tus botones */
:root{
  --metal-dk:#7a5532;
  --metal-md:#b4885e;
  --metal-lt:#e0b88c;
  --metal-hl:#f5d6ad;
}
.trend-tab[aria-selected="true"]{
  color:#fff8ea;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  border:1px solid transparent;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 8px 18px rgba(169,122,85,.26);
}
.trend-tab[aria-selected="true"]::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(120deg, rgba(255,255,255,.32), rgba(255,255,255,0) 45%);
  mix-blend-mode: screen;
  opacity:.6;
  transform: translateY(-18%) skewX(-18deg);
  transition: transform .4s ease, opacity .3s ease;
  pointer-events:none;
}
.trend-tab[aria-selected="true"]:hover::before{
  transform: translateY(-4%) skewX(-18deg);
  opacity:.82;
}

/* Botón cerrar: tamaño fluido */
.trend-close{
  margin-left: auto;
  flex:0 0 auto;
  width: clamp(28px, 3.2vw, 36px);
  height: clamp(28px, 3.2vw, 36px);
  border-radius: 999px;
  display:grid; place-items:center;
  font-size: clamp(14px, 1.6vw, 18px);
  color:#6b5442;
  background: rgba(255,255,255,.8);
  border:1px solid rgba(120,85,55,.12);
}

/* Accesibilidad: foco visible */
.trend-tab:focus-visible,
.trend-close:focus-visible{
  outline: 2px solid var(--metal-lt);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(224,184,140,.35);
}

/* Ajustes finos en pantallas muy estrechas */
@media (max-width: 420px){
  .trend-tabs{ max-width: 100%; }
  .trend-tab{ padding: 6px 12px; }
}

/* Si prefieres que en móvil se apilen ocupando todo el ancho */
@media (max-width: 340px){
  .trend-tabs{ width:100%; }
  .trend-tab{ flex:1 1 auto; text-align:center; }
}

/* Respeto a reduce-motion */
@media (prefers-reduced-motion: reduce){
  .trend-tab, .trend-tab::before{ transition: none; }
}

.trend-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  color: #6b543d; /* contraste cálido sobre el beige */
  cursor: pointer;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8f2e9 0%, #e4d2b9 45%, #d5bfa2 100%);
  box-shadow:
    inset 1px 1px 3px rgba(255,255,255,0.7),
    inset -2px -2px 3px rgba(0,0,0,0.15),
    0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.15s ease;
}

.trend-close:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, #fffaf4 0%, #e8d6b8 60%, #d5bfa2 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.6),
    inset -1px -1px 2px rgba(0,0,0,0.1),
    0 3px 8px rgba(0,0,0,0.25);
}

.trend-close:active {
  transform: translateY(1px) scale(0.95);
  background: linear-gradient(145deg, #e8d6b8 0%, #d5bfa2 100%);
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,0.25),
    0 1px 2px rgba(255,255,255,0.4);
}

.meta-icon {
  width: 33px;
  height: 33px;
  vertical-align: middle;
  margin-left: 3px;
  margin-right: 2px;
  opacity: 0.85;
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.4));
  transition: opacity 0.2s ease;
}

.meta-icon:hover {
  opacity: 1;
}

.cta-premium {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  padding: 8px 22px;
  font-size: 15px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: linear-gradient(270deg, #7b5b3f, #c8a77b, #9c7a55, #c8a77b, #7b5b3f);
  background-size: 600% 600%;
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(200, 167, 123, 0.25);
}

.cta-premium:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(200, 167, 123, 0.7);
}

/* 🔄 Movimiento del degradado */
@keyframes bronzeFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ✨ Brillo pulsante sincronizado */
@keyframes bronzeGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(200, 167, 123, 0.25); }
  50% { box-shadow: 0 0 24px rgba(200, 167, 123, 0.55); }
}

#btnLangToggle,
#userLangMenu {
  display: none !important;
}


.modal-title {
  position: relative;
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: #3e271a;
  letter-spacing: 0.3px;
}

.modal-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 120px;              /* largo de la línea */
  height: 1.5px;             /* grosor */
  background: linear-gradient(
    to right,
    transparent,
    rgba(62, 39, 26, 0.7),
    transparent
  );
  border-radius: 2px;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%); /* punta sutil */
  opacity: 0.85;
}

input::placeholder,
textarea::placeholder {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  color: rgba(62, 39, 26, 0.55);
  letter-spacing: 0.3px;
}

input:focus::placeholder {
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

label {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.3px;
  color: rgba(62, 39, 26, 0.85);
  display: block;
  margin-bottom: 4px;
}

label::after {
background: linear-gradient(
  to right,
  transparent,
  #c8a46b,
  #a8742f,
  transparent
);

}


input[type="email"],
input[type="password"],
textarea {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  font-weight: 500;
  color: #3e271a;
  letter-spacing: 0.3px;
}

input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: #b98b54;
  box-shadow: 0 0 4px rgba(185, 139, 84, 0.3);
  transition: all 0.2s ease-in-out;
}

/* --- Normaliza el estilo del autocompletado --- */
input:-webkit-autofill {
  font-family: "Cormorant Garamond", serif !important;
  font-size: 15px !important;
  font-weight: 500;
  color: #3e271a !important;
  -webkit-text-fill-color: #3e271a !important;
  box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.9) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

input:-webkit-autofill:focus {
  box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 1) inset !important;
  border-color: #b98b54;
}

:root{
  --bronze:#8f6b3b;
  --bronze-ink:#3e271a;
  --cream:#f7f3ee;
  --ink:#222;
  --shadow:0 10px 30px rgba(0,0,0,.12);
}

/* ============ Tipografía base ============ */
body, button, input, textarea, select, label, h1, h2, h3, h4, h5, h6, p {
  font-family:"Cormorant Garamond", serif;
  letter-spacing: .2px;
  color: var(--bronze-ink);
}

/* ============ Botón disparador ============ */
.btn-premium-trigger{
  appearance:none;
  border:none;
  border-radius:999px;
  padding:10px 18px;
  font-weight:600;
  cursor:pointer;
  background:linear-gradient(180deg,var(--bronze),#b78a4f);
  color:#fff;
  box-shadow:var(--shadow);
  transition:filter .2s ease, transform .1s ease;
}
.btn-premium-trigger:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
}

/* ============ Modal ============ */
.premium-modal{position:fixed;inset:0;display:none;z-index:1000;}
.premium-modal[aria-hidden="false"]{display:block;}
.pm-backdrop{
  position:absolute;inset:0;
  backdrop-filter:blur(8px);
  background:rgba(0,0,0,.35);
}
.pm-dialog{
  position:relative;
  margin:5vh auto;
  max-width:680px;
  background:linear-gradient(180deg, rgba(255,255,250,.96), rgba(250,245,238,.94));
  border:1px solid rgba(62,39,26,.25);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:20px 24px 28px;
}

/* ============ Cierre ============ */
.pm-close{
  position:absolute;
  top:10px;
  right:12px;
  border:none;
  background:transparent;
  font-size:20px;
  cursor:pointer;
  color:var(--bronze-ink);
  opacity:.8;
  transition:opacity .2s ease;
}
.pm-close:hover{opacity:1;}

/* ============ Cabecera ============ */
.pm-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:linear-gradient(180deg, #cbb89b 0%, #b59b76 100%);
  color:var(--bronze-ink);
  border-top-left-radius:16px;
  border-top-right-radius:16px;
  padding:12px 20px;
}
.pm-title{
  font-weight:700;
  font-size:26px;
  margin:0;
}
.pm-steps{display:flex;gap:6px;}
.pm-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d9c9b4;
  opacity:.7;
}
.pm-dot.is-active{
  background:var(--bronze);
  opacity:1;
  box-shadow:0 0 0 2px rgba(143,107,59,.15);
}

/* ============ Transición de entrada ============ */
.premium-modal[aria-hidden="false"] .pm-dialog {
  animation: modalFadeIn .5s ease forwards;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Contenido general ============ */
.pm-content{padding:12px 4px 0;}
.pm-step{animation:pmFade .3s ease;}
@keyframes pmFade{
  from{opacity:0;transform:translateY(4px)}
  to{opacity:1;transform:none}
}
.pm-lead{
  color:var(--ink);
  font-size:20px;
  line-height:1.4;
  margin:8px 0 16px;
}
.pm-lead.small{font-size:18px}
.pm-hint,.pm-subhint{
  color:#6b6156;
  font-size:13px;
  margin-top:10px;
}
.pm-details{color:#6b6156;font-size:14px}

/* ============ Botones principales ============ */
.pm-primary{
  width:100%;
  appearance:none;
  border:none;
  border-radius:12px;
  padding:12px 16px;
  cursor:pointer;
  font-weight:700;
  background:linear-gradient(180deg, #b8925b 0%, #9d7848 100%);
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.4), 0 4px 8px rgba(0,0,0,.15);
  transition:transform .08s ease, filter .25s ease;
    font-size: 13px;
  color: #7b6c5a;
  text-align: center;
  margin-top: 8px;
  letter-spacing: .1px;
}
.pm-primary:hover{
  filter:brightness(1.1);
}
.pm-primary:active{
  transform:translateY(1px);
}

/* ============ Comparación Gratis vs Premium ============ */
.pm-compare{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin:10px 0 20px;
}
.pm-compare h4{
  margin:0 0 8px;
  font-weight:600;
  font-size:20px;
  color:var(--bronze-ink);
}
.pm-compare ul{
  margin:0;
  padding-left:20px;
  color:#333;
  font-size:17px;
}
.pm-quote{
  margin:10px 0 16px;
  color:#4a3b2c;
  font-style:italic;
  font-size:18px;
}

/* ============ Formulario Stripe ============ */
.pm-form{
  display:grid;
  gap:14px;
  margin-top:10px;
}
.pm-label{
  display:grid;
  gap:6px;
  color:var(--bronze-ink);
  font-size:16px;
}
.pm-label input{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(62,39,26,.35);
  background:rgba(255,255,255,.9);
  font-size:17px;
}
.pm-card{
  padding:12px;
  border-radius:10px;
  border:1px solid rgba(62,39,26,.35);
  background:rgba(255,255,255,.92);
}
.pm-error{color:#a62424;font-size:14px;margin-top:2px}

/* ============ Confirmación ============ */
.pm-illustration{
  height:90px;
  border-radius:12px;
  margin:6px 0 10px;
  background:radial-gradient(60% 60% at 50% 20%, #fffdf8, #ece2d0 60%, #d9c6aa 100%);
  border:1px solid rgba(143,107,59,.25);
}
.pm-congrats,.pm-title-sec{
  margin:0 0 6px;
  font-weight:700;
  color:var(--bronze-ink);
  font-size:22px;
}
.pm-reward blockquote{
  margin:8px 0 14px;
  color:#2b2621;
  font-style:italic;
  font-size:18px;
}

/* ============ Responsive ============ */
@media (max-width: 720px){
  .pm-dialog{
    margin:0;
    min-height:100dvh;
    border-radius:0;
    padding:18px;
  }
  .pm-compare{grid-template-columns:1fr}
  .pm-title{font-size:24px;}
}


.pm-primary {
  position: relative;
  background: linear-gradient(270deg, #7b5b3f, #c8a77b, #9c7a55, #c8a77b, #7b5b3f);
  background-size: 600% 600%;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(200, 167, 123, 0.25);
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pm-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(200, 167, 123, 0.35);
}

/* 💫 Aparición suave y pulso sutil */
.pm-step[data-step="1"] .pm-primary {
  animation: fadePulse 3.5s ease-in-out infinite, bronzeFlow 20s ease-in-out infinite;
}

@keyframes fadePulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .9; transform: translateY(-1px); }
}


.pm-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 12px 0 22px;
  padding: 8px 0;
  border-top: 1px solid rgba(143,107,59,.15);
  border-bottom: 1px solid rgba(143,107,59,.15);
}

.pm-compare h4 {
  font-weight: 700;
  font-size: 21px;
  color: var(--bronze-ink);
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pm-compare ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 17px;
  color: #332a21;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-compare ul li::before {
  content: "•";
  color: var(--bronze);
  margin-right: 6px;
}


.pm-quote {
  margin-top: 18px;
  font-style: italic;
  color: #4a3b2c;
  font-size: 17px;
  text-align: center;
  letter-spacing: .2px;
  background: linear-gradient(to right, rgba(143,107,59,.05), rgba(143,107,59,.0) 20%, rgba(143,107,59,.05));
  padding: 10px 0;
  border-radius: 6px;
}


.pm-header {
  background: linear-gradient(180deg, #f7f5f2 0%, #ebe2d7 100%);
  border-bottom: 1px solid rgba(143,107,59,.2);
  color: var(--bronze-ink);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 16px 22px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  position: relative;
}

/* línea fina bronce justo debajo */
.pm-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(143,107,59,.3), rgba(143,107,59,0), rgba(143,107,59,.3));
  pointer-events: none;
}

.pm-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--bronze-ink);
  letter-spacing: .25px;
  text-align: left;
  text-shadow: none;
}

/* puntos de progreso más sobrios */
.pm-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(143,107,59,.25);
  opacity: 1;
  transition: background .3s ease;
}
.pm-dot.is-active {
  background: var(--bronze);
  box-shadow: 0 0 0 2px rgba(143,107,59,.15);
}

.pm-dialog {
  box-shadow:
    0 4px 18px rgba(0,0,0,.08),
    0 0 0 1px rgba(143,107,59,.08);
}

/* marco interior sutil */
.pm-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.4), rgba(255,255,255,0) 60%);
}

/* sombra lateral más real */
.pm-header {
  box-shadow:
    inset 0 -1px 0 rgba(143,107,59,.15),
    0 2px 6px rgba(0,0,0,.03);
}

/* Encabezado */
.pm-title {
  font-size: 24px;
  font-weight: 700;
  color: #3b2a1c; /* bronce oscuro, más contraste */
  letter-spacing: 0.25px;
  text-transform: none;
}

/* Subtítulos Gratis / Premium */
.pm-compare h4 {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.4px;
  color: #4a3423;
  text-transform: uppercase;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(143,107,59,.15);
  padding-bottom: 4px;
}

/* Listas */
.pm-compare ul {
  font-size: 16.5px;
  color: #2f251e;
  line-height: 1.5;
}

/* Cita final */
.pm-quote {
  font-style: italic;
  color: #5a4b3b;
  font-size: 16px;
  text-align: center;
  background: linear-gradient(to right, rgba(143,107,59,.05), rgba(143,107,59,0), rgba(143,107,59,.05));
  padding: 10px 0;
  border-radius: 4px;
  margin-top: 16px;
}

/* Botón */
.pm-primary {
  font-weight: 600;
  font-size: 15px;
  background: linear-gradient(180deg, #a7825a 0%, #8d6a46 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 8px rgba(0,0,0,.12);
  transition: all 0.25s ease;
}
.pm-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}


.pm-title {
  font-size: 24px;
  font-weight: 700;
  color: #5a3f2a; /* marrón bronceado más suave */
  letter-spacing: .25px;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}


.pm-header {
  background: linear-gradient(180deg, #f9f7f4 0%, #f1e8dd 100%);
  border-bottom: 1px solid rgba(143,107,59,.15);
  position: relative;
  padding: 16px 22px 14px;
}

/* Luz cálida difusa en el centro */
.pm-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255,240,210,.25), rgba(255,240,210,0) 70%);
  pointer-events: none;
}

/* Título con tono más integrado */
.pm-title {
  font-size: 24px;
  font-weight: 700;
  color: #5c402b; /* cálido, no oscuro */
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  letter-spacing: .25px;
}


/* Cabecera */
.pm-header {
  background: linear-gradient(180deg, #f9f7f4 0%, #f2ebe1 100%);
  border-bottom: 1px solid rgba(143,107,59,.15);
  position: relative;
  padding: 16px 22px 14px;
}

.pm-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(255,240,210,.25), rgba(255,240,210,0) 70%);
  pointer-events: none;
}

.pm-title {
  font-size: 23px;
  font-weight: 700;
  color: #5d412c;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  letter-spacing: .25px;
}

/* Inputs */
.pm-label input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(62,39,26,.25);
  background: linear-gradient(180deg, #fffdf9 0%, #f8f2eb 100%);
  font-size: 16px;
  font-family: "Cormorant Garamond", serif;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.pm-label input:focus {
  outline: none;
  border-color: rgba(143,107,59,.45);
  box-shadow: 0 0 0 3px rgba(143,107,59,.12);
}

/* Botón */
.pm-primary {
  font-weight: 600;
  background: linear-gradient(180deg, #a7825a 0%, #8d6a46 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 4px 10px rgba(0,0,0,.1);
  transition: all .25s ease;
}
.pm-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.pm-primary:active {
  transform: translateY(1px);
}

/* Pie */
.pm-hint {
  font-size: 13.5px;
  color: #7b6a5b;
  font-style: italic;
  text-align: left;
  margin-top: 8px;
}

/* Sello de seguridad sutil (Stripe) */
.pm-dialog::after {
  content: "Procesado de forma segura por Stripe";
  position: absolute;
  right: 20px;
  bottom: 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  color: rgba(90, 70, 50, 0.55);
  letter-spacing: 0.3px;
  font-style: italic;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.25),
    rgba(0,0,0,0.05)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.2));
  opacity: 0.8;
}

/* Relieve leve alrededor del pie */
.pm-dialog {
  position: relative;
  box-shadow:
    0 4px 18px rgba(0,0,0,.08),
    0 0 0 1px rgba(143,107,59,.08);
}

.pm-dialog::after {
  content: "Procesado de forma segura por Stripe";
  position: absolute;
  right: 22px;
  bottom: 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: 13.5px;
  font-style: italic;
  color: rgba(90, 70, 50, 0.65);
  letter-spacing: 0.25px;
  pointer-events: none;

  /* efecto grabado en papel */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.6),
    0 -1px 0 rgba(0,0,0,0.05),
    1px 0 0 rgba(255,255,255,0.3),
    -1px 0 0 rgba(0,0,0,0.05);

  opacity: 0.85;
}



.pm-nav-arrows {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.pm-arrow {
  background: none;
  border: 1px solid rgba(62,39,26,.25);
  border-radius: 8px;
  color: var(--bronze-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .2s ease;
}

.pm-arrow:hover {
  background: rgba(143,107,59,.12);
}


.pm-nav-arrows {
  position: absolute;
  bottom: 24px;           /* un poco más arriba del borde */
  right: 28px;            /* alineado visualmente con el padding del botón principal */
  display: flex;
  gap: 12px;
  pointer-events: auto;
  z-index: 10;
}

.pm-arrow {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(62, 39, 26, 0.25);
  border-radius: 8px;
  color: #5b4226;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 18px;
  padding: 4px 10px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.pm-arrow:hover {
  background: rgba(143, 107, 59, 0.15);
  transform: translateY(-1px);
}

.pm-arrow:active {
  transform: translateY(0);
  background: rgba(143, 107, 59, 0.25);
}


.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-family: "Cormorant Garamond", serif;
  border-bottom: 1px solid rgba(62, 39, 26, 0.15);
  background: linear-gradient(to bottom, #f7f3ef, #f0e9e1);
  position: relative;
}

/* Flechas de navegación en el header */
.pm-header-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  margin-right: 10px;
}

.pm-arrow {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(62, 39, 26, 0.25);
  border-radius: 8px;
  color: #5b4226;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.pm-arrow:hover {
  background: rgba(143, 107, 59, 0.15);
  transform: translateY(-1px);
}

.pm-arrow:active {
  transform: translateY(0);
  background: rgba(143, 107, 59, 0.25);
}

.pm-arrow {
  --size: 32px;
  inline-size: var(--size);
  block-size: var(--size);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  background: radial-gradient(
    120% 140% at 25% 20%,
    #ffe7a3,
    #d4aa3a 45%,
    #b8891c 72%,
    #8f6b3b 100%
  );
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  isolation: isolate;
}

.pm-arrow:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 6px rgba(0, 0, 0, 0.22);
}

.pm-arrow:active {
  transform: translateY(0);
  filter: brightness(0.95);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}

.pm-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}



.pm-arrow {
  --size: 32px;
  inline-size: var(--size);
  block-size: var(--size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  background: linear-gradient(
    270deg,
    #7b5b3f,
    #c8a77b,
    #9c7a55,
    #c8a77b,
    #7b5b3f
  );
  background-size: 600% 600%;
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease,
    background 0.25s ease;
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.pm-arrow:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.1);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 8px rgba(0, 0, 0, 0.25);
}

.pm-arrow:active {
  transform: translateY(0) scale(0.96);
  filter: brightness(0.95);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}

.pm-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}

/* === Animaciones compartidas con el resto del UI === */
@keyframes bronzeFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bronzeGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(200, 167, 123, 0.4)); }
  50% { filter: drop-shadow(0 0 6px rgba(200, 167, 123, 0.6)); }
}





/* ===========================
   Flechas de navegación Premium
   =========================== */
.pm-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
  position: relative;
  z-index: 10;
}

.pm-arrow {
  --size: 32px;
  inline-size: var(--size);
  block-size: var(--size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  background: linear-gradient(
    270deg,
    #7b5b3f,
    #c8a77b,
    #9c7a55,
    #c8a77b,
    #7b5b3f
  );
  background-size: 600% 600%;
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease,
    background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  isolation: isolate;
}

/* 💡 Bronce más claro al pasar el ratón */
.pm-arrow:hover {
  transform: translateY(-1px) scale(1.05);
  background: linear-gradient(
    270deg,
    #c8a77b,
    #e6c992,
    #f4e2b5,
    #e6c992,
    #c8a77b
  );
  filter: brightness(1.12);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 8px rgba(0, 0, 0, 0.25);
}

.pm-arrow:active {
  transform: translateY(0) scale(0.96);
  filter: brightness(0.95);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}

/* === Animaciones compartidas === */
@keyframes bronzeFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bronzeGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(200, 167, 123, 0.4)); }
  50% { filter: drop-shadow(0 0 6px rgba(200, 167, 123, 0.6)); }
}



.pm-arrow {
  --size: 30px; /* un poco más pequeño que antes */
  inline-size: var(--size);
  block-size: var(--size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-weight: 600;
  font-size: 13px; /* ↓ tamaño de flecha */
  line-height: 1;
  background: linear-gradient(
    270deg,
    #8f6b3b,
    #c8a77b,
    #b28b5b,
    #c8a77b,
    #8f6b3b
  );
  background-size: 600% 600%;
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease,
    background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  isolation: isolate;
}

.pm-arrow:hover {
  transform: translateY(-1px) scale(1.03);
  color: var(--bronze-1);
  background: linear-gradient(
    270deg,
    #c8a77b,
    #e7d1a2,
    #f3e2b8,
    #e7d1a2,
    #c8a77b
  );
  filter: brightness(1.1);
  box-shadow:
    0 7px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 6px rgba(0, 0, 0, 0.22);
}

.pm-arrow:active {
  transform: translateY(0) scale(0.95);
  filter: brightness(0.95);
}

/* Ajuste de separación con los puntos de paso */
.pm-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
}

/* Animaciones compartidas */
@keyframes bronzeFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bronzeGlow {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(200, 167, 123, 0.4)); }
  50% { filter: drop-shadow(0 0 4px rgba(200, 167, 123, 0.6)); }
}


.pm-illustration img {
    display: block;
    margin: 0 auto;
    max-width: 105px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(143, 107, 59, .25));
    animation: fadeIn 1s 
ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


.pm-logo-final {
  display: block;
  margin: 0 auto;
  max-width: 120px;       /* más contenida */
  height: auto;
  opacity: 0.95;
  filter:
    drop-shadow(0 6px 10px rgba(143, 107, 59, 0.25))
    drop-shadow(0 -2px 6px rgba(255, 240, 210, 0.15));
  transform: translateY(-6px);  /* sube un poco para armonizar */
  animation: fadeRise 1.6s ease-out;
}

@keyframes fadeRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 0.95; transform: translateY(-6px); }
}



.pm-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 110px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, #fdf8ef, #e7d7bf 70%, #d8c3a5 100%);
  overflow: hidden;
  padding: 6px 0; /* espacio interior para que la L respire */
}

.pm-illustration img {
  max-width: 95px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(143, 107, 59, 0.25));
  animation: fadeIn 1s ease;
  opacity: 0.95;
}



@media (min-width: 900px) {
  .pm-dialog {
    padding: 28px 32px 34px;
    max-width: 720px;
  }
  .pm-title {
    font-size: 26px;
  }
  .pm-lead {
    font-size: 19px;
  }
}


.pm-illustration::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,240,200,0.4) 50%, rgba(255,255,255,0) 100%);
  mix-blend-mode: soft-light;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: -100% 0; }
  50% { background-position: 200% 0; }
}


.pm-reward blockquote {
  margin: 18px auto 22px;
  padding: 14px 20px;
  max-width: 85%;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-style: italic;
  color: #4b3623;
  line-height: 1.5;
  letter-spacing: .3px;
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.85) 0%,
    rgba(247, 238, 223, 0.7) 100%
  );
  border-radius: 10px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

/* 🪶 detalles sutiles */
.pm-reward blockquote::before,
.pm-reward blockquote::after {
  content: "“";
  position: absolute;
  font-size: 42px;
  color: rgba(143, 107, 59, 0.25);
  font-weight: 700;
  font-family: "Georgia", serif;
  pointer-events: none;
}

.pm-reward blockquote::before {
  top: -10px;
  left: 12px;
}

.pm-reward blockquote::after {
  content: "”";
  bottom: -18px;
  right: 12px;
  transform: rotate(180deg);
}

/* ✨ efecto dorado al pasar el cursor */
.pm-reward blockquote:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 247, 233, 0.9) 0%,
    rgba(247, 233, 208, 0.85) 100%
  );
  color: #3a281a;
  transition: background 0.6s ease, color 0.6s ease;
}



.pm-reward blockquote::after {
  content: "”";
  position: absolute;
  bottom: -10px;
  right: 14px;
  font-size: 42px;
  color: rgba(143, 107, 59, 0.25);
  font-weight: 700;
  font-family: "Georgia", serif;

  pointer-events: none;
}


.pm-reward blockquote {
  margin: 18px auto 24px;
  padding: 16px 22px;
  max-width: 85%;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 18.5px;
  font-style: italic;
  color: #4b3623;
  line-height: 1.55;
  letter-spacing: 0.3px;
  position: relative;
  background: linear-gradient(180deg, #fdfaf5 0%, #f6efe5 100%);
  border-radius: 10px;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(143, 107, 59, 0.1);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

.pm-reward blockquote::before,
.pm-reward blockquote::after {
  position: absolute;
  font-family: "Georgia", serif;
  font-weight: 700;
  font-size: 34px;
  color: rgba(143, 107, 59, 0.25);
  pointer-events: none;
}

.pm-reward blockquote::before {
  content: "“";
  top: -6px;
  left: 10px;
}

.pm-reward blockquote::after {
  content: "”";
  bottom: -6px;
  right: 10px;
  transform: rotate(180deg);
}

/* ✨ efecto dorado al pasar el cursor */
.pm-reward blockquote:hover {
  background: linear-gradient(180deg, #fffdf8 0%, #f4e9d7 100%);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}


.pm-compare .premium-col {
  position: relative;
}
.pm-compare .premium-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, rgba(143,107,59,0), rgba(143,107,59,.25), rgba(143,107,59,0));
}


.pm-compare .premium-col {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(214, 190, 140, 0.15) 0%,
    rgba(193, 160, 112, 0.10) 45%,
    rgba(168, 132, 92, 0.08) 100%
  );
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45),
              inset 0 -1px 0 rgba(143,107,59,.1);
  transition: background .4s ease, box-shadow .4s ease;
}

/* línea dorada superior */
.pm-compare .premium-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(143,107,59,0),
    rgba(143,107,59,.25),
    rgba(143,107,59,0)
  );
}

/* brillo suave al pasar el cursor */
.pm-compare .premium-col:hover {
  background: linear-gradient(
    180deg,
    rgba(230, 200, 150, 0.20) 0%,
    rgba(200, 160, 100, 0.13) 50%,
    rgba(170, 130, 80, 0.10) 100%
  );
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5),
              0 2px 8px rgba(143,107,59,.06);
}


.pm-compare .premium-col h4 {
  position: relative;
}
.pm-compare .premium-col h4::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, rgba(143,107,59,0), rgba(143,107,59,.5), rgba(143,107,59,0));
  opacity: .6;
}


.pm-compare .premium-col h4 {
  position: relative;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.pm-compare .premium-col h4::after {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: -5px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(143,107,59,0),
    rgba(143,107,59,0.4),
    rgba(143,107,59,0)
  );
  opacity: .7;
}


.pm-price {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 600;
  color: #5a3c1e;
  text-align: center;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, rgba(143,107,59,.15), rgba(143,107,59,0), rgba(143,107,59,.15));
  padding: 6px 0;
  border-radius: 6px;
  font-family: "Cormorant Garamond", serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}


.pm-price-note {
  font-size: 13px;
  color: rgba(90, 70, 50, 0.65);
  font-style: italic;
  letter-spacing: 0.2px;
  margin-top: 2px;
  text-align: center;
}


/* ============================
   ✨ Aparición armónica fluida
   ============================ */
@keyframes smoothAppear {
  0% {
    opacity: 0;
    transform: translateY(6px);
    filter: drop-shadow(0 0 0 rgba(143,107,59,0));
  }
  70% {
    opacity: 1;
    transform: translateY(-1px);
    filter: drop-shadow(0 2px 4px rgba(143,107,59,.12));
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: drop-shadow(0 1px 2px rgba(143,107,59,.08));
  }
}

/* Aplica la animación general */
.pm-step > * {
  opacity: 0;
  animation: smoothAppear 0.6s cubic-bezier(.4,.1,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

/* Orden natural de aparición */
.pm-step h4        { --i: 1; }
.pm-step p         { --i: 2; }
.pm-step ul        { --i: 3; }
.pm-step form      { --i: 4; }
.pm-step .pm-price { --i: 5; }
.pm-step button    { --i: 6; }
.pm-step .pm-illustration { --i: 7; }
.pm-step blockquote { --i: 8; }

/* Inputs y botones: misma delicadeza al interactuar */
.pm-label input,
.pm-primary {
  animation: smoothAppear 0.7s cubic-bezier(.4,.1,.2,1) forwards;
  transition: all 0.22s ease, filter 0.22s ease;
}

/* Hover y focus coherentes con el brillo cálido */
.pm-label input:focus,
.pm-primary:hover {
  filter: brightness(1.08) drop-shadow(0 3px 6px rgba(143,107,59,.2));
  transform: translateY(-0.5px);
}

/* Cita, bloques y comparativas */
.pm-quote,
.pm-reward blockquote,
.pm-compare .premium-col {
  animation: smoothAppear 0.7s cubic-bezier(.4,.1,.2,1) forwards;
  transform-origin: center bottom;
}

/* Elementos visuales (logos, imágenes) */
.pm-illustration img,
.pm-logo-final {
  animation: smoothAppear 0.75s cubic-bezier(.4,.1,.2,1) forwards;
  filter: drop-shadow(0 3px 6px rgba(143,107,59,.2));
}


/* ============================
   ✨ Micro-interacciones Premium
   ============================ */

/* --- Botones principales: respiración sutil --- */
.pm-primary {
  transition: all 0.25s ease, box-shadow 0.3s ease;
}

.pm-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 10px rgba(143,107,59,.25),
    inset 0 1px 0 rgba(255,255,255,.4);
  transform: translateY(-1px);
}

/* --- Botón al tocar en móvil --- */
.pm-primary:active {
  transform: translateY(1px);
  filter: brightness(0.97);
  box-shadow: 0 0 4px rgba(143,107,59,.2);
}

/* --- Inputs: halo cálido al enfocar --- */
.pm-label input:focus {
  outline: none;
  border-color: rgba(143,107,59,.45);
  box-shadow:
    0 0 6px rgba(143,107,59,.18),
    inset 0 1px 2px rgba(143,107,59,.05);
  transition: box-shadow 0.25s ease;
}

/* --- “L” dorada en el paso final --- */
.pm-illustration img {
  animation: smoothAppear 0.75s ease forwards, glowL 4s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 8px rgba(143,107,59,.25));
}
@keyframes glowL {
  from { filter: drop-shadow(0 4px 8px rgba(143,107,59,.25)); opacity: 0.95; }
  to   { filter: drop-shadow(0 4px 14px rgba(200,167,123,.45)); opacity: 1; }
}

/* --- Blockquote: respiración y brillo literario --- */
.pm-reward blockquote {
  animation: smoothAppear 0.7s ease forwards, quoteGlow 5s ease-in-out infinite alternate;
}
@keyframes quoteGlow {
  from { text-shadow: 0 0 2px rgba(143,107,59,.25); }
  to   { text-shadow: 0 0 6px rgba(143,107,59,.35); }
}

/* --- Columna Premium: sombra interior viva --- */
.pm-compare .premium-col {
  box-shadow:
    inset 0 0 10px rgba(143,107,59,.05),
    inset 0 1px 0 rgba(255,255,255,.4);
  transition: all 0.4s ease;
}
.pm-compare .premium-col:hover {
  box-shadow:
    inset 0 0 12px rgba(143,107,59,.08),
    0 2px 8px rgba(143,107,59,.06);
}

/* --- Cita general del flujo (debajo de comparativa) --- */
.pm-quote {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.pm-quote:hover {
  color: #3c2a19;
  text-shadow: 0 0 4px rgba(143,107,59,.25);
}

/* --- Flechas de navegación: pulso metálico leve --- */
.pm-arrow {
  animation: bronzeFlow 20s ease-in-out infinite, bronzeGlow 4s ease-in-out infinite;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.pm-arrow:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.12);
}
.pm-arrow:active {
  transform: scale(0.96);
  filter: brightness(0.95);
}


.pm-card {
  border-radius: 10px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #fffdf9 0%, #f8f3eb 100%);
  border: 1px solid rgba(62, 39, 26, 0.25);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.pm-card.StripeElement--focus {
  border-color: rgba(143,107,59,.45);
  box-shadow: 0 0 0 3px rgba(143,107,59,.12);
}

:root {
  --metal-dk: #4b3521;
  --metal-md: #8f6b3b;
  --metal-lt: #cba772;
  --metal-hl: #e7cba2;

  --metal-dk-rgb: 75, 53, 33;
  --metal-md-rgb: 143, 107, 59;
  --metal-lt-rgb: 203, 167, 114;
}




/* ===============================
   Botones del flujo Premium (solo dentro del modal)
   =============================== */
#premiumModal .pm-primary,
#premiumModal .pm-step button[data-next],
#premiumModal #pm-pay {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff8ea;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  border: 1px solid transparent;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 6px 14px rgba(169, 122, 85, 0.26),
    0 0 10px rgba(255, 240, 220, 0.1);
  border-radius: 12px;
  padding: 9px 26px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 4px rgba(255, 240, 220, 0.25);
}

/* Compacto */
#premiumModal .pm-primary:active,
#premiumModal .pm-step button[data-next]:active {
  transform: scale(0.97);
}

/* ✨ Brillo metálico sutil */
#premiumModal .pm-primary::after,
#premiumModal .pm-step button[data-next]::after,
#premiumModal #pm-pay::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: skewX(-25deg);
  transition: left 0.6s ease;
}

#premiumModal .pm-primary:hover::after,
#premiumModal .pm-step button[data-next]:hover::after,
#premiumModal #pm-pay:hover::after {
  left: 130%;
}

/* ✨ Hover general */
#premiumModal .pm-primary:hover,
#premiumModal .pm-step button[data-next]:hover,
#premiumModal #pm-pay:hover {
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 10px 20px rgba(169, 122, 85, 0.35),
    0 0 18px rgba(255, 240, 220, 0.25);
  filter: brightness(1.08);
}


#premiumModal .pm-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  z-index: 9999;

  /* 🎨 Metal cálido translúcido */
  background: linear-gradient(145deg, rgba(214, 185, 151, 0.92), rgba(245, 233, 213, 0.9));
  backdrop-filter: blur(4px) saturate(120%);
  
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.25),
    0 0 8px rgba(223, 186, 143, 0.25);

  color: #5e4025;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.4s ease,
    background 0.4s ease,
    filter 0.4s ease;
}

/* ✨ Efecto hover */
#premiumModal .pm-close:hover {
  transform: scale(1.08);
  background: linear-gradient(145deg, rgba(229, 200, 168, 0.96), rgba(255, 243, 227, 0.95));
  box-shadow:
    inset 0 0 2px rgba(255, 255, 255, 0.7),
    0 6px 14px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(223, 186, 143, 0.3);
  filter: brightness(1.05);
}

/* 💫 Pulsado */
#premiumModal .pm-close:active {
  transform: scale(0.95);
  filter: brightness(0.95);
}


@keyframes goldShine {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}

#pm-pay::before {
  content: "";
  display: inline-block;
  width: 25px;
  height: 25px;
  margin-right: 8px;
  background: linear-gradient(145deg, #f6e7ca, #b38b52);
  mask: url('data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="black"><rect x="2" y="5" width="20" height="14" rx="2" ry="2"/><line x1="2" y1="10" x2="22" y2="10"/><line x1="6" y1="15" x2="10" y2="15"/></svg>') no-repeat center / contain;
  animation: goldShine 4s ease-in-out infinite;
}


#pm-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* espacio equilibrado entre icono y texto */
  vertical-align: middle;
  line-height: 1;
  text-align: center;
}

/* Si usas pseudoelemento para el icono */
#pm-pay::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #f6e7ca, #b38b52);
  mask: url('data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="black"><rect x="3" y="6" width="18" height="12" rx="2" ry="2"/><line x1="3" y1="10" x2="21" y2="10"/></svg>') no-repeat center / contain;
  vertical-align: middle;
  transform: translateY(1px); /* microajuste óptico */
}


/* ===============================
   STEP 1 — Tu rincón de lectura
   =============================== */
.pm-step[data-step="1"] {
  text-align: center;
  padding-top: 1.8rem; /* sube ligeramente el bloque */
}

.pm-step[data-step="1"] .pm-lead {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #3e271a;
  max-width: 85%;
  margin: 0 auto 2rem;
}

.pm-step[data-step="1"] .pm-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 30px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff8ea;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 6px 14px rgba(169, 122, 85, 0.26),
    0 0 10px rgba(255, 240, 220, 0.1);
  transition: all 0.3s ease;
}

.pm-step[data-step="1"] .pm-primary:hover {
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 10px 20px rgba(169, 122, 85, 0.35),
    0 0 18px rgba(255, 240, 220, 0.25);
  filter: brightness(1.08);
}

.pm-step[data-step="1"] .pm-hint {
  font-size: 0.9rem;
  color: rgba(62, 39, 26, 0.65);
  margin-top: 1.2rem;
  letter-spacing: 0.15px;
  font-style: italic;
}

#premiumModal .pm-close {
  position: fixed;
  top: 0.4rem;       /* 🔼 más arriba */
  right: 0.6rem;     /* 🔼 más pegado al borde derecho */
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  z-index: 9999;

  /* 🎨 Metal cálido translúcido */
  background: linear-gradient(
      145deg,
      rgba(214, 185, 151, 0.92),
      rgba(245, 233, 213, 0.9)
    );
  backdrop-filter: blur(5px) saturate(120%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.25),
    0 0 8px rgba(223, 186, 143, 0.25);

  color: #5e4025;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.4s ease,
    background 0.4s ease,
    filter 0.4s ease;
}

/* ✨ Hover refinado */
#premiumModal .pm-close:hover {
  transform: scale(1.1);
  background: linear-gradient(
      145deg,
      rgba(229, 200, 168, 0.96),
      rgba(255, 243, 227, 0.95)
    );
  box-shadow:
    inset 0 0 2px rgba(255, 255, 255, 0.7),
    0 6px 14px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(223, 186, 143, 0.3);
  filter: brightness(1.08);
}

#premiumModal .pm-close:active {
  transform: scale(0.95);
  filter: brightness(0.95);
}


/* ======= 1️⃣ Aire y ritmo visual ======= */
.pm-step[data-step="2"] {
  text-align: center;
  padding-top: 1.2rem;
  padding-bottom: 2.5rem;
}

.pm-step[data-step="2"] .pm-compare {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem; /* 🔼 más espacio antes de la cita final */
}

.pm-step[data-step="2"] .pm-quote {
  margin: 1.4rem auto 2rem;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(62, 39, 26, 0.75);
  max-width: 85%;
}

/* ======= 2️⃣ Bloque de precio con relieve metálico ======= */
.pm-step[data-step="2"] .pm-price {
  background: linear-gradient(
    145deg,
    rgba(245, 233, 213, 0.95),
    rgba(234, 208, 175, 0.9)
  );
  border: 1px solid rgba(199, 158, 110, 0.4);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(169, 122, 85, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #3e271a;
  font-weight: 600;
  margin-top: 0.8rem;
  font-family: "Cormorant Garamond", serif;
}

.pm-step[data-step="2"] .pm-price-note {
  font-weight: 400;
  font-size: 0.85rem;
  color: rgba(62, 39, 26, 0.65);
  margin-top: 0.25rem;
}

/* ======= 3️⃣ Botón flotante “Hazte Premium” ======= */
#btnPremium {
  opacity: 0.25;            /* 🔽 más discreto mientras el modal está abierto */
  pointer-events: none;     /* evita clics duplicados */
  transition: opacity 0.3s ease;
}

/* cuando el modal se cierra, recupera visibilidad */
#premiumModal[aria-hidden="true"] ~ #btnPremium {
  opacity: 1;
  pointer-events: auto;
}

/* Botón principal del modal (coherente con el resto) */
.pm-step[data-step="2"] .pm-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 30px;
  color: #fff8ea;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 6px 14px rgba(169, 122, 85, 0.26),
    0 0 10px rgba(255, 240, 220, 0.1);
  transition: all 0.3s ease;
}

.pm-step[data-step="2"] .pm-primary:hover {
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 10px 20px rgba(169, 122, 85, 0.35),
    0 0 18px rgba(255, 240, 220, 0.25);
  filter: brightness(1.08);
}



/* ====== Contenedor general ====== */
.pm-step[data-step="5"] {
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  animation: fadeInSoft 0.6s ease both; /* 💫 Entrada suave */
}

@keyframes fadeInSoft {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Bloque de cita ====== */
.pm-step[data-step="5"] blockquote {
  background: rgba(255, 250, 243, 0.8);
  border-radius: 10px;
  border: 0.5px solid rgba(180, 140, 90, 0.25); /* ✨ línea sutil */
  box-shadow:
    inset 0 0 12px rgba(255, 240, 210, 0.25),
    0 2px 6px rgba(169, 122, 85, 0.15);
  color: #3e271a;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.05rem;
  padding: 1.1rem 1.4rem;
  max-width: 85%;
  margin: 1.5rem auto 2rem;
  position: relative;
}

/* Cierre visual de las comillas */
.pm-step[data-step="5"] blockquote::before,
.pm-step[data-step="5"] blockquote::after {
  color: rgba(180, 140, 90, 0.45);
  font-size: 1.4rem;
  position: absolute;
  font-family: serif;
}

.pm-step[data-step="5"] blockquote::before {
  content: "“";
  top: 6px;
  left: 10px;
}

.pm-step[data-step="5"] blockquote::after {
  content: "”";
  bottom: 6px;
  right: 10px;
}

/* ====== Botón final “Explorar” ====== */
.pm-step[data-step="5"] .pm-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: #fff8ea;
  letter-spacing: 0.3px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(145deg, var(--metal-dk), var(--metal-md) 55%, var(--metal-lt)) border-box;
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 6px 14px rgba(169, 122, 85, 0.26),
    0 0 10px rgba(255, 240, 220, 0.1),
    0 6px 18px rgba(223, 186, 143, 0.15); /* ✨ halo inferior dorado */
  cursor: pointer;
  transition: all 0.35s ease;
}

.pm-step[data-step="5"] .pm-primary:hover {
  box-shadow:
    inset 0 0 0 1px var(--metal-hl),
    0 10px 20px rgba(169, 122, 85, 0.35),
    0 0 18px rgba(255, 240, 220, 0.25),
    0 8px 22px rgba(223, 186, 143, 0.25);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.pm-step[data-step="5"] .pm-primary:active {
  transform: scale(0.97);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* =============================
   🖋️ LOGO PRINCIPAL
   ============================= */
.brand-logo {
  height: 28px; /* ✅ tamaño base */
  width: auto;
  object-fit: contain;
  transform: translateY(-2px);
  filter:
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25))
    brightness(1.1)
    saturate(1.2);
  transition: transform 0.3s ease, filter 0.3s ease, height 0.3s ease;
}

/* ✨ Hover elegante */
.brand:hover .brand-logo {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.2) saturate(1.3);
}

/* 📱 Responsive refinado */
@media (max-width: 768px) {
  .brand-logo {
    height: 25px; /* 🔽 reduce 10% en tablets */
    transform: translateY(-1px);
    filter: brightness(1.08);
  }
}

@media (max-width: 480px) {
  .brand-logo {
    height: 23px; /* 🔽 tamaño compacto móvil */
    transform: translateY(0);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18)) brightness(1.08);
  }
}





#btnLoginModal {
  background: linear-gradient(
    135deg,
    #d4b47c 0%,
    #f5e3b5 20%,
    #b48b4e 40%,
    #f5e3b5 60%,
    #d4b47c 100%
  );
  background-size: 200% 200%;
  color: #3e261a;
  border: 1px solid rgba(62, 39, 26, 0.35);
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  border-radius: 12px;
  padding: 8px 20px;
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
}

#btnLoginModal:hover {
  background-position: 100% 0;
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.3);
}



/* Evita saltos del chat */
.chat-section {
  min-height: 400px; /* o el tamaño medio que ocupa al cargar */
  position: relative;
}

/* Asegura que los rivets y animaciones no empujen el layout */
.chat-rivets {
  min-height: 200px; /* deja espacio reservado */
  overflow: hidden;
  transition: none; /* desactiva animaciones en carga inicial */
}

/* Evita salto de chips */
.chip-group {
  min-height: 80px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}


.chip-group {
  min-height: 90px; /* mantiene el bloque estable */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
}

.chip {
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}


@media (max-width: 768px) {
  #recMount {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    contain: layout paint;
  }

  .section-subtitle {
    min-height: 50px;
  }

  .chip-group {
    min-height: 180px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    gap: 8px;
    transition: none !important;
  }

  .feel-form {
    min-height: 280px;
    width: 100%;
    overflow: hidden;
  }

  button.chip {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    line-height: 44px;
  }
}


@media (max-width: 768px) {
  /* --- bloque de recomendaciones --- */
  #recMount {
    min-height: 560px; /* reserva un poco más de espacio */
  }

  .section-subtitle {
    min-height: 56px;
  }

  .chip-group {
    min-height: 190px;
    width: 100%;
    justify-content: center;
    align-content: start;
  }

  button.chip {
    height: 46px;
    line-height: 46px;
    font-size: 0.95rem;
  }

  /* --- logo y auth --- */
  .brand-logo {
    width: 120px;
    height: auto;
    aspect-ratio: 3 / 1;
  }

  #userAuth {
    min-height: 40px;
  }
}


@media (max-width: 768px) {
  #recMount {
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    contain: layout paint;
  }

  .section-subtitle {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .chip-group {
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    gap: 8px;
    transition: none !important;
    visibility: visible;
  }

  .chip-group:empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 200px;
  }

  button.chip {
    flex: 0 0 auto;
    height: 44px;
    line-height: 44px;
  }
}


@media (max-width: 768px) {
  #recMount { min-height: 580px; contain: layout paint; }

  .section-subtitle { min-height: 60px; display: flex; align-items: center; justify-content: center; }

  .chip-group {
    min-height: 200px;
    display: flex; flex-wrap: wrap;
    justify-content: center; align-content: start;
    gap: 8px;
    transition: none !important;
  }

  /* Placeholder: reserva espacio mientras está vacío */
  .chip-group:empty::before {
    content: ""; display: block; width: 100%; height: 200px;
  }

  button.chip { height: 44px; line-height: 44px; flex: 0 0 auto; }
}


.section-subtitle,
.chip {
  font-display: swap;
  font-family: "Cormorant Garamond", serif;
}


.section-subtitle {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.section-subtitle::before {
  content: "";
  display: block;
  height: 1em; /* reserva altura equivalente a una línea */
  width: 100%;
  visibility: hidden;
}


.chip-group:empty::before {
  content: "";
  display: block;
  height: 200px;
}


/* Ajuste general */
#recMount {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 40vh; /* altura proporcional, no fija */
}

/* En móvil, menos reserva */
@media (max-width: 768px) {
  #recMount {
    min-height: 25vh; /* reduce el hueco en pantallas pequeñas */
  }

  .rec-empty {
    max-width: 85%;
    line-height: 1.4;
    font-size: 0.9rem;
    text-align: center;
  }
}

.librAI-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 35%, #f3e4ca 0%, #e7d1a8 45%, #d4b783 100%);
  box-shadow:
    0 0 18px rgba(230, 210, 160, 0.5),
    0 0 32px rgba(200, 170, 120, 0.25);
  border: none;
  overflow: hidden;
  cursor: pointer;
  z-index: 1000;
  animation: softPulse 7s ease-in-out infinite alternate;
  transition: transform 0.3s ease, filter 0.8s ease;
}

/* ✨ Luz ambiental */
.librAI-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(230, 200, 150, 0.05) 100%);
  mix-blend-mode: soft-light;
  animation: lightSweep 9s ease-in-out infinite alternate;
  opacity: 0.85;
  pointer-events: none;
}

/* Pulso de brillo */
@keyframes softPulse {
  0% { filter: brightness(0.98) saturate(0.95); }
  100% { filter: brightness(1.12) saturate(1.1); }
}

/* Luz móvil */
@keyframes lightSweep {
  0% { transform: translateX(-25%) rotate(12deg); }
  100% { transform: translateX(25%) rotate(12deg); }
}

/* Hover elegante */
.librAI-fab:hover {
  transform: scale(1.08);
  filter: brightness(1.15);
  box-shadow:
    0 0 22px rgba(245, 225, 180, 0.6),
    0 0 48px rgba(220, 190, 140, 0.35);
}

/* Logo */
.librAI-fab img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.6))
          drop-shadow(0 1px 3px rgba(0,0,0,0.08));
}


.librAI-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 35%, #f0dfba 0%, #e2c793 45%, #d1ae6f 100%);
  box-shadow:
    0 0 18px rgba(220, 180, 120, 0.45),
    0 0 32px rgba(180, 140, 80, 0.25);
  border: none;
  overflow: hidden;
  cursor: pointer;
  z-index: 1000;
  animation: softPulse 12s ease-in-out infinite alternate;
  transition: transform 0.3s ease, filter 0.8s ease;
}

/* ✨ Reflejo móvil */
.librAI-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.10) 45%,
    rgba(240, 200, 140, 0.08) 100%);
  mix-blend-mode: soft-light;
  animation: lightSweep 9s ease-in-out infinite alternate;
  opacity: 0.9;
  pointer-events: none;
}

/* ✨ Halo respirante cada 12 s */
@keyframes softPulse {
  0% {
    box-shadow:
      0 0 16px rgba(220, 180, 120, 0.4),
      0 0 36px rgba(200, 160, 100, 0.2);
    filter: brightness(0.98) saturate(0.95);
  }
  100% {
    box-shadow:
      0 0 24px rgba(240, 200, 140, 0.65),
      0 0 52px rgba(250, 220, 160, 0.35);
    filter: brightness(1.15) saturate(1.15);
  }
}

/* ✨ Movimiento del brillo */
@keyframes lightSweep {
  0% { transform: translateX(-25%) rotate(12deg); }
  100% { transform: translateX(25%) rotate(12deg); }
}

/* Hover */
.librAI-fab:hover {
  transform: scale(1.08);
  filter: brightness(1.2);
  box-shadow:
    0 0 28px rgba(250, 225, 170, 0.6),
    0 0 60px rgba(230, 190, 130, 0.4);
}

/* Logo */
.librAI-fab img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.6))
          drop-shadow(0 1px 3px rgba(0,0,0,0.08));
}


.librAI-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 35%, #f8e8c6 0%, #ecd1a3 45%, #d7b678 100%);
  box-shadow:
    0 0 18px rgba(230, 190, 120, 0.35),
    0 0 40px rgba(200, 160, 100, 0.25);
  border: none;
  cursor: pointer;
  z-index: 1000;
  overflow: hidden;
  animation: softPulse 12s ease-in-out infinite alternate;
  transition: transform 0.3s ease, filter 0.6s ease;
}

/* ✨ capa de reflejo móvil */
.librAI-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.05) 40%,
    rgba(250, 230, 180, 0.08) 100%);
  mix-blend-mode: soft-light;
  animation: lightSweep 9s ease-in-out infinite alternate;
  opacity: 0.9;
  pointer-events: none;
}

/* ✨ Halo respirante */
@keyframes softPulse {
  0% {
    box-shadow:
      0 0 16px rgba(230, 190, 120, 0.35),
      0 0 40px rgba(200, 160, 100, 0.25);
    filter: brightness(0.98) saturate(0.95);
  }
  100% {
    box-shadow:
      0 0 28px rgba(255, 220, 150, 0.55),
      0 0 70px rgba(255, 230, 180, 0.35);
    filter: brightness(1.15) saturate(1.15);
  }
}

/* ✨ Movimiento de reflejo */
@keyframes lightSweep {
  0% { transform: translateX(-20%) rotate(12deg); }
  100% { transform: translateX(20%) rotate(12deg); }
}

/* ✨ La “L” respira con el halo */
.librAI-fab img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: brightness(0.95)
          drop-shadow(0 1px 2px rgba(255,255,255,0.6))
          drop-shadow(0 2px 3px rgba(0,0,0,0.1));
  animation: letterGlow 12s ease-in-out infinite alternate;
  transition: filter 0.6s ease;
}

@keyframes letterGlow {
  0% {
    filter: brightness(0.95)
            drop-shadow(0 1px 2px rgba(255,255,255,0.4));
  }
  100% {
    filter: brightness(1.25)
            drop-shadow(0 0 4px rgba(255,240,200,0.6))
            drop-shadow(0 1px 4px rgba(255,220,160,0.3));
  }
}

/* Hover */
.librAI-fab:hover {
  transform: scale(1.08);
  filter: brightness(1.2);
  box-shadow:
    0 0 32px rgba(250, 225, 170, 0.55),
    0 0 72px rgba(230, 190, 130, 0.4);
}


/* === MODALES LEGALES (unificados y elegantes) === */
.modal-legal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 10, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-legal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: rgba(255, 248, 240, 0.95);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  text-align: center;
  color: #3b2615;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  font-family: 'Cormorant Garamond', serif;
}

.modal-content h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #7a5330;
}

.modal-content p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.close-modal {
  background: #b48a57;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.3s ease;
  font-family: 'Cormorant Garamond', serif;
}

.close-modal:hover {
  background: #a07645;
}

body.modal-open {
  overflow: hidden;
}


/* === MODALES LEGALES — versión centrada y fluida === */
.modal-legal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 10, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 9999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.modal-legal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: rgba(255, 248, 240, 0.96);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 600px;
  width: 90%;
  text-align: center;
  color: #3b2615;
  box-shadow: 0 6px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Cormorant Garamond', serif;
  overflow-y: auto;
  max-height: 80vh; /* <- clave para que no se salga de la pantalla */
}

.modal-content h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #7a5330;
}

.modal-content p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.close-modal {
  background: #b48a57;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: background 0.3s ease;
  font-family: 'Cormorant Garamond', serif;
}

.close-modal:hover {
  background: #a07645;
}

body.modal-open {
  overflow: hidden;
}


/* === MODALES LEGALES (centrados sobre el viewport) === */
.modal-legal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 10, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-legal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  position: relative;
  background: rgba(255, 248, 240, 0.96);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 600px;
  width: 90%;
  color: #3b2615;
  box-shadow: 0 6px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Cormorant Garamond', serif;
  overflow-y: auto;
  max-height: 80vh; /* scroll interno si el texto es largo */
  text-align: center;

  /* 👇 fuerza centrado absoluto en pantalla */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close-modal {
  background: #b48a57;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: background 0.3s ease;
  font-family: 'Cormorant Garamond', serif;
}

.close-modal:hover {
  background: #a07645;
}

body.modal-open {
  overflow: hidden;
}



.modal-content {
  /* ...todo lo actual... */
  animation: modalFadeUp 0.35s ease both;
}

@keyframes modalFadeUp {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
/* 💫 LibrAI — Animación de espera premium y coherente */
.ia-text {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #7b614e 0%, #bba07e 50%, #7b614e 100%);
  background-size: 200%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmerInk 3s ease-in-out infinite;
  transition: opacity .3s ease;
}

@keyframes shimmerInk {
  0% { background-position: 0% center; opacity: .85; }
  50% { background-position: 100% center; opacity: 1; }
  100% { background-position: 0% center; opacity: .85; }
}

/* Puntos en suspensión – sutiles y respirando */
.typing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 18px;
  margin-top: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #a88b6a;
  opacity: 0.25;
  transform: translateY(0);
  animation: floatDots 1.8s ease-in-out infinite;
}

.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: 0.25s; }
.typing span:nth-child(3) { animation-delay: 0.5s; }

@keyframes floatDots {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}


.chat-bubble.ia .ia-text + .typing {
  margin-top: 6px;
}


.chat-bubble {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInSoft 0.6s ease-out forwards;
}

@keyframes fadeInSoft {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Animación de entrada elegante */
.chat-bubble {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeInSoft 0.65s ease-out forwards;
}

@keyframes fadeInSoft {
  0% {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Animación más etérea para el estado “Pensando…” */
.chat-bubble.ia.thinking {
  animation: fadeInSoft 0.7s ease-out forwards, shimmerDelay 2s ease-in-out infinite;
}

@keyframes shimmerDelay {
  0%, 90% { opacity: 1; }
  100% { opacity: 0.9; }
}


.ia-text {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.ia-text.visible {
  opacity: 1;
  transform: translateY(0);
}


.ia-text p {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(6px);
  animation: lineFadeIn 0.8s ease-out forwards;
}

@keyframes lineFadeIn {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
