/* ========================================
   LOCUIDAS · Sistema de diseño unificado
   ======================================== */

/* font-display: swap para evitar FOIT (flash invisible) */
@font-face {
  font-family: 'Cormorant Garamond';
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  font-display: swap;
}

:root{
  /* Paleta */
  --verde:        #2F3E34;
  --verde-dark:   #1e2a23;
  --musgo:        #5F7A6B;
  --arena:        #D6C3A3;
  --oro:          #C2A46F;
  --oro-claro:    #d4b57e;
  --marfil:       #FBF8F2;
  --marfil-2:     #f4efe6;
  --texto:        #2F3E34;
  --texto-suave:  #7A726A;
  --linea:        rgba(47, 62, 52, 0.10);
  --linea-fuerte: rgba(47, 62, 52, 0.20);
  --sombra-suave: 0 8px 24px rgba(47, 62, 52, 0.05);
  --sombra-media: 0 14px 36px rgba(47, 62, 52, 0.10);

  /* Tipografía */
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radios */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Acentos */
  --good: #4f6b5b;
  --good-bg: #e8f3ec;
  --warn: #a07a3c;
  --warn-bg: #faf1dd;
  --bad: #8b4b45;
  --bad-bg: #f8e9e7;
}

/* ========== RESET LIGERO ========== */
*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  background: var(--marfil-2);
  color: var(--texto);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

/* ========== TIPOGRAFÍA ========== */
h1, h2, h3, h4{
  font-family: var(--serif);
  font-weight: 500;
  color: var(--verde);
  line-height: 1.2;
  margin: 0;
}
em{ font-style: italic; color: var(--oro); }
.muted{ color: var(--texto-suave); }
.eyebrow{
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--musgo);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ========== LAYOUT ========== */
.wrap{
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.app-page{
  padding: 24px 16px 60px;
}

/* ========== TOPBAR / NAV ========== */
.topbar{
  background: var(--verde);
  color: var(--marfil);
  padding: 16px 0;
  border-bottom: 1px solid rgba(214, 195, 163, 0.10);
}
.topbar .inner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand{
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--arena);
  font-style: italic;
}
.nav{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a{
  color: rgba(244, 239, 230, 0.80);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.18s ease;
}
.nav a:hover{
  color: var(--marfil);
  background: rgba(214, 195, 163, 0.10);
}
.nav a.active{
  color: var(--arena);
  background: rgba(214, 195, 163, 0.14);
}

@media (max-width: 640px){
  .topbar .inner{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav{
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a{ flex-shrink: 0; padding: 6px 12px; font-size: 13px; }
}

/* ========== PANELS / CARDS ========== */
.panel{
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sombra-suave);
}
.panel + .panel{ margin-top: 16px; }

.card{
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--sombra-suave);
}

/* ========== BOTONES ========== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  background: var(--verde);
  color: var(--arena);
}
.btn:hover{
  background: var(--verde-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(47, 62, 52, 0.18);
}
.btn-primary{ background: var(--verde); color: var(--arena); }
.btn-primary:hover{ background: var(--verde-dark); }
.btn-gold{ background: var(--oro); color: var(--verde); }
.btn-gold:hover{ background: var(--oro-claro); }
.btn-secondary{
  background: var(--marfil);
  color: var(--verde);
  border: 1px solid var(--linea);
  box-shadow: none;
}
.btn-secondary:hover{
  background: #fff;
  border-color: var(--musgo);
}
.btn-ghost{
  background: transparent;
  color: var(--musgo);
  border: 1px solid var(--musgo);
  box-shadow: none;
}
.btn-ghost:hover{
  background: var(--musgo);
  color: #fff;
  border-color: var(--musgo);
}
.btn-small{
  min-height: 36px;
  padding: 8px 16px;
  font-size: 11px;
}

/* ========== FORMULARIOS ========== */
.form-grid{
  display: grid;
  gap: 16px;
}
.field label{
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--texto-suave);
  font-weight: 500;
}
.field input,
.field select,
.field textarea{
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--linea-fuerte);
  background: var(--marfil);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--texto);
  transition: all 0.18s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--musgo);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(95, 122, 107, 0.10);
}
.field textarea{
  font-family: 'Georgia', serif;
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
}

/* ========== CHIPS / BADGES ========== */
.chip{
  display: inline-block;
  padding: 4px 12px;
  background: var(--marfil);
  border: 1px solid var(--linea);
  border-radius: var(--r-pill);
  font-size: 11px;
  letter-spacing: 0.3px;
  font-weight: 500;
  color: var(--texto-suave);
}
.chip-ok{ background: var(--good-bg); color: var(--good); border-color: rgba(79, 107, 91, 0.20); }
.chip-warn{ background: var(--warn-bg); color: var(--warn); border-color: rgba(160, 122, 60, 0.25); }
.chip-bad{ background: var(--bad-bg); color: var(--bad); border-color: rgba(139, 75, 69, 0.20); }

.badge{
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
}
.badge-free{ background: var(--good-bg); color: var(--good); }
.badge-premium{ background: var(--warn-bg); color: var(--warn); }
.badge-locked{ background: #eee; color: #777; }
.badge-active{ background: var(--verde); color: var(--arena); }

/* ========== ALERTAS ========== */
.notice,
.error{
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.notice{ background: var(--good-bg); color: var(--good); border: 1px solid rgba(79, 107, 91, 0.20); }
.error{ background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(139, 75, 69, 0.20); }

/* ========== SECCIONES ========== */
.section-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-head h2{
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 0 0 4px;
}

/* ========== FOOTER ========== */
.footer{
  padding: 32px 0;
  color: var(--texto-suave);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--linea);
  margin-top: 40px;
}

/* ========== ADMIN (mantenemos lo que ya estaba pero con tokens) ========== */
.admin-page{ display: grid; gap: 24px; }
.admin-hero{
  background: linear-gradient(135deg, var(--verde), #263229);
  color: var(--marfil);
  border-radius: var(--r-xl);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 24px;
  align-items: center;
  box-shadow: 0 18px 48px rgba(47, 62, 52, 0.16);
}
.admin-hero h1{
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 0.2rem 0 0.7rem;
  color: var(--arena);
}
.admin-hero .eyebrow{ color: rgba(214, 195, 163, 0.85); }
.admin-hero .muted{ color: rgba(244, 239, 230, 0.74); }
.admin-mail-card{
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(214, 195, 163, 0.22);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  gap: 12px;
}
.admin-mail-card strong{ color: var(--arena); }
.admin-section{ display: grid; gap: 18px; }

.request-list,
.users-admin-list{ display: grid; gap: 14px; }
.request-card{
  border: 1px solid var(--linea);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  background: #fff;
}
.request-card.is-pending{
  border-color: rgba(194, 164, 111, 0.40);
  box-shadow: 0 10px 30px rgba(194, 164, 111, 0.08);
}
.request-topline{
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.request-message{
  background: var(--marfil);
  border: 1px solid rgba(194, 164, 111, 0.22);
  padding: 12px;
  border-radius: var(--r-sm);
  margin-top: 8px;
}
.request-actions{
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: center;
}

.user-admin-card{
  border: 1px solid var(--linea);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 22px;
  box-shadow: var(--sombra-suave);
}
.user-admin-header{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--linea);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.user-flags{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.admin-product-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.admin-product-check{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--linea);
  border-radius: var(--r-sm);
  background: var(--marfil);
  cursor: pointer;
  transition: all 0.18s ease;
}
.admin-product-check:hover{
  border-color: var(--linea-fuerte);
  transform: translateY(-1px);
  box-shadow: var(--sombra-suave);
}
.admin-product-check.checked{
  border-color: rgba(95, 122, 107, 0.45);
  background: var(--good-bg);
}
.admin-product-check input{
  margin-top: 3px;
  accent-color: var(--verde);
}
.admin-product-check strong{
  display: block;
  font-size: 14px;
  color: var(--texto);
  font-weight: 500;
}
.admin-product-check small{
  display: block;
  color: var(--texto-suave);
  margin-top: 2px;
  font-size: 12px;
}
.save-row{
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 760px){
  .admin-hero,
  .request-card{ grid-template-columns: 1fr; }
  .user-admin-header{ flex-direction: column; }
  .request-actions{ align-items: stretch; }
  .admin-page{ gap: 16px; }
  .admin-hero{ padding: 24px; }
  .panel{ padding: 22px; }
  .admin-product-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .wrap{ width: min(100% - 20px, 1180px); }
  .app-page{ padding: 16px 0 40px; }
  .panel{ padding: 18px; border-radius: var(--r-md); }
  .btn{ padding: 10px 18px; }
}

/* ========== MODAL DE COMPARTIR ========== */
.share-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(47, 62, 52, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.share-modal-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}
.share-modal{
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(47, 62, 52, 0.30);
  transform: translateY(10px);
  transition: transform 0.22s ease;
}
.share-modal-backdrop.is-open .share-modal{
  transform: translateY(0);
}
.share-modal-eyebrow{
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 8px;
  font-weight: 500;
}
.share-modal h2{
  font-size: 1.6rem;
  margin: 0 0 12px;
  color: var(--verde);
}
.share-modal p{
  color: var(--texto-suave);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 20px;
}
.share-link-box{
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--marfil);
  border: 1px solid var(--linea);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 18px;
}
.share-link-input{
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--texto);
  outline: none;
  min-width: 0;
}
.share-copy-btn{
  background: var(--oro);
  color: var(--verde);
  border: none;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.share-copy-btn:hover{ background: var(--oro-claro); }
.share-copy-btn.copied{
  background: var(--good);
  color: #fff;
}
.share-modal-close{
  background: transparent;
  color: var(--musgo);
  border: 1px solid var(--linea);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  width: 100%;
  transition: all 0.18s ease;
}
.share-modal-close:hover{
  background: var(--marfil);
  color: var(--verde);
}

/* ========================================
   LOCUIDAS · FASE A · Consolidación Premium
   ======================================== */
:root{
  --lc-paper: #FBF8F2;
  --lc-paper-soft: #F4EFE6;
  --lc-green: #2F3E34;
  --lc-green-2: #5F7A6B;
  --lc-gold: #C2A46F;
  --lc-ink: #3A342D;
  --lc-muted: #766D64;
  --lc-line: rgba(47,62,52,.13);
  --lc-shadow: 0 18px 54px rgba(47,62,52,.10);
  --lc-shadow-soft: 0 10px 28px rgba(47,62,52,.07);
}
img{max-width:100%}
.tool-cover img,
.family-cover img,
.feat-cover img,
.ms-portada-banner img,
.hero-cover img,
.test-cover img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}
.tool-cover,.family-cover,.feat-cover,.ms-portada-banner,.hero-cover,.test-cover{
  background:linear-gradient(135deg,#F4EFE6,#FBF8F2);
}
.lc-premium-frame,
.family-card,
.tool-card,
.feat-card,
.food-card,
.hist-item{
  background:rgba(255,253,248,.78);
  border:1px solid var(--lc-line);
  box-shadow:var(--lc-shadow-soft);
}
.family-card:hover,.tool-card:hover,.feat-card:hover,.food-card:hover{
  border-color:rgba(194,164,111,.34);
  box-shadow:var(--lc-shadow);
}
.badge-active,.badge-free{letter-spacing:.08em;text-transform:uppercase}
.family-card.family-active{background:linear-gradient(135deg,rgba(255,253,248,.88),rgba(244,239,230,.72))}
.family-card.family-locked{background:linear-gradient(135deg,rgba(255,253,248,.78),rgba(214,195,163,.16))}
.nav a.active{box-shadow:inset 0 0 0 1px rgba(214,195,163,.12)}
.food-art.is-missing,
.food-art:not(:has(img[src])){
  background:radial-gradient(circle at 50% 25%,rgba(194,164,111,.18),transparent 42%),linear-gradient(145deg,#fbf8f2,#f4efe6);
}
.food-art.is-missing:before{
  content:attr(data-food);
  display:grid;
  place-items:center;
  min-height:120px;
  padding:18px;
  font-family:var(--serif);
  color:var(--verde);
  font-size:1.25rem;
  text-align:center;
}
.lc-ecosystem-strip{
  margin:22px 0;
  padding:18px;
  border-radius:24px;
  border:1px solid var(--lc-line);
  background:linear-gradient(135deg,rgba(255,253,248,.80),rgba(244,239,230,.64));
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.lc-ecosystem-strip span{font-family:var(--serif);font-size:1.15rem;color:var(--lc-green);margin-right:6px}
.lc-ecosystem-strip a{border:1px solid var(--lc-line);border-radius:999px;padding:8px 12px;background:white;color:var(--lc-green);font-size:.86rem}
.lc-ecosystem-strip a:hover{background:var(--lc-green);color:var(--lc-paper)}
@media(max-width:720px){
  .tool-cover,.family-cover,.feat-cover{height:180px!important}
  .ms-portada-banner img,.hero-cover img,.test-cover img{max-height:260px!important}
}

/* ========================================
   LOCUIDAS · Fase B sensorial suave
   Transiciones, tinta, sonido opcional y scroll estable
   ======================================== */
html{ scroll-behavior:smooth; }
body.lc-page-enter{ opacity:0; transform:translateY(8px); }
body.lc-ready{ opacity:1; transform:none; transition:opacity .55s ease, transform .55s ease; }
body.lc-modal-open{ overflow:hidden; touch-action:none; }

.lc-reveal{ opacity:0; transform:translateY(18px); transition:opacity .65s ease, transform .65s ease; }
.lc-reveal.lc-visible{ opacity:1; transform:none; }

.lc-sound-toggle{
  position:fixed; right:16px; bottom:16px; z-index:9998;
  width:46px; height:46px; border-radius:999px; border:1px solid rgba(194,164,111,.45);
  background:rgba(47,62,52,.92); color:#F4EFE6; box-shadow:0 14px 34px rgba(47,62,52,.22);
  display:grid; place-items:center; cursor:pointer; font-size:18px;
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  transition:transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.lc-sound-toggle:hover{ transform:translateY(-2px); box-shadow:0 18px 44px rgba(47,62,52,.28); }
.lc-sound-toggle[aria-pressed="true"]{ background:#C2A46F; color:#2F3E34; }
.lc-sound-toggle span{ font-size:0; }
.lc-sound-toggle::before{ content:'◌'; font-size:24px; line-height:1; }
.lc-sound-toggle[aria-pressed="true"]::before{ content:'♪'; font-size:18px; }

.lc-ink-transition{ position:fixed; inset:0; z-index:9997; pointer-events:none; opacity:0; }
.lc-ink-transition::before{
  content:""; position:absolute; left:50%; top:50%; width:36vmax; height:36vmax; border-radius:50%;
  background:radial-gradient(circle, rgba(47,62,52,.16), rgba(194,164,111,.09) 42%, transparent 70%);
  transform:translate(-50%,-50%) scale(.18); filter:blur(2px);
}
.lc-ink-transition.active{ opacity:1; }
.lc-ink-transition.active::before{ animation:lcInk .72s ease both; }
@keyframes lcInk{ 0%{transform:translate(-50%,-50%) scale(.16);opacity:.05} 55%{opacity:.9} 100%{transform:translate(-50%,-50%) scale(2.9);opacity:0} }

.lc-sensory-card,
.ms-portada-banner,
.ts-portada-banner,
.msp-portada-banner,
.hero-cover,
.cal26-cover,
.hist-hero{
  position:relative;
}
.ms-portada-banner::after,
.ts-portada-banner::after,
.msp-portada-banner::after,
.hero-cover::after,
.cal26-cover::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg, rgba(244,239,230,0) 55%, rgba(244,239,230,.24));
  mix-blend-mode:multiply;
}
.ms-portada-banner img,
.ts-portada-banner img,
.msp-portada-banner img,
.hero-cover img,
.cal26-cover img{
  transform-origin:center top;
  transition:transform 1.4s cubic-bezier(.22,1,.36,1), filter .8s ease;
}
.ms-portada-banner:hover img,
.ts-portada-banner:hover img,
.msp-portada-banner:hover img,
.hero-cover:hover img,
.cal26-cover:hover img{ transform:scale(1.018); filter:saturate(1.02) contrast(1.01); }

/* Portadas verticales: mostrar la cabecera arriba y mantener lectura editorial */
.ms-portada-banner img,
.ts-portada-banner img{
  max-height:520px !important;
  object-fit:cover !important;
  object-position:center top !important;
}
@media (max-width:640px){
  .ms-portada-banner img,
  .ts-portada-banner img{ max-height:430px !important; }
  .lc-sound-toggle{ right:12px; bottom:12px; width:42px; height:42px; }
}

/* Modal fichas: estabilidad iOS / Safari */
.food-modal{ overscroll-behavior:contain; touch-action:none; }
.food-modal-content{ overscroll-behavior:contain; touch-action:auto; }
.food-modal-body{ overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.food-modal-body img{ -webkit-user-drag:none; user-select:none; }

/* Respeto a usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  body.lc-ready, .lc-reveal, .ms-portada-banner img, .ts-portada-banner img, .msp-portada-banner img, .hero-cover img, .cal26-cover img{ transition:none !important; animation:none !important; transform:none !important; opacity:1 !important; }
  .lc-ink-transition{ display:none !important; }
}
.cal-portada-banner img{ max-height:520px !important; object-fit:cover !important; object-position:center top !important; }
@media(max-width:640px){ .cal-portada-banner img{ max-height:430px !important; } }

/* ============================================================
   V35.4 - FIX ADMIN MOVIL DEFINITIVO
   Reemplaza V35.3. Anadido al final, sin tocar nada anterior.

   PROBLEMAS QUE RESUELVE:
   1. La seccion "Usuarias / Productos por persona" no se veia
      en movil (peso DOM excesivo con 27 productos x N usuarias
      en columna unica). Ahora es colapsable con <details>.
   2. Hero admin, stats, buscador, botones rotos en pantallas
      estrechas <=640px.
   3. Defensivos contra cortes de scroll vertical en movil.

   DECISIONES TECNICAS:
   - Cada user-admin-card lleva <details> nativo (sin JS).
   - Productos en 2 columnas en movil (no 1) cuando se despliegan.
   - SIN overflow-x:hidden en .admin-page (puede romper scroll).
   - min-height en main para evitar que se "trunque" visualmente.
   ASCII puro. Sin smart quotes ni en-dashes.
   ============================================================ */

/* Defensivo global: asegurar que el main del admin se renderiza completo */
.admin-page{
  min-height: 100vh;
}

/* CHIP PRODUCTS: badge dorado para "N productos" */
.chip-products{
  background: rgba(194, 164, 111, 0.18);
  color: #8b6f37;
  border: 1px solid rgba(194, 164, 111, 0.32);
  font-weight: 600;
}

/* DETAILS / SUMMARY del card de usuaria */
.user-products-details{
  border-top: 1px solid rgba(47, 62, 52, 0.08);
  margin-top: 14px;
  padding-top: 14px;
}
.user-products-details > summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(47, 62, 52, 0.04);
  border: 1px solid rgba(47, 62, 52, 0.10);
  border-radius: 10px;
  font-size: 13px;
  color: #2F3E34;
  font-weight: 500;
  transition: background 0.18s ease;
  user-select: none;
}
.user-products-details > summary::-webkit-details-marker{ display: none; }
.user-products-details > summary:hover{
  background: rgba(47, 62, 52, 0.07);
}
.summary-text{ flex: 1; }
.summary-count{
  font-size: 11px;
  color: #7A726A;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.summary-arrow{
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  line-height: 1;
  color: #5F7A6B;
  font-weight: 400;
  width: 22px;
  text-align: center;
  transition: transform 0.22s ease;
}
.user-products-details[open] > summary{
  background: rgba(95, 122, 107, 0.10);
  border-color: rgba(95, 122, 107, 0.28);
}
.user-products-details[open] .summary-arrow{
  transform: rotate(45deg);
}
.user-products-details .admin-product-form{
  margin-top: 14px;
}

/* DESKTOP: details abierto por defecto, summary discreto */
@media (min-width: 901px){
  .user-products-details{
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }
  .user-products-details > summary{
    display: none;
  }
  .user-products-details .admin-product-form{
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(47, 62, 52, 0.08);
  }
}
/* Forzar abierto en desktop sin JS */
@media (min-width: 901px){
  .user-products-details{ display: block; }
  .user-products-details > *:not(summary){ display: block !important; }
}

/* TABLET / IPAD: comportamiento intermedio */
@media (min-width: 641px) and (max-width: 900px){
  .user-products-details > summary{
    background: transparent;
    border-color: rgba(47, 62, 52, 0.08);
  }
}

/* ============================================================
   MOVIL <=640px: stack vertical y ajustes finos
   ============================================================ */
@media (max-width: 640px){

  /* HERO ADMIN */
  .admin-hero{
    grid-template-columns: 1fr;
    padding: 22px 20px;
    gap: 18px;
  }
  .admin-hero h1{
    font-size: 1.85rem;
    line-height: 1.1;
  }
  .admin-mail-card{
    padding: 14px 16px;
  }

  /* BUSCADOR */
  .admin-search{
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
  }
  .admin-search input{
    flex: 1 1 100%;
    min-width: 0;
    font-size: 16px;
  }
  .admin-search button{ flex: 0 0 auto; }
  .search-clear{ flex: 0 0 32px; }

  /* STATS */
  .admin-stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card{ padding: 16px 14px; }
  .stat-num{ font-size: 28px; }
  .stat-label{ font-size: 10px; letter-spacing: 1.2px; }
  .stat-extra{ font-size: 11px; }

  /* BANNER PENDIENTES */
  .pending-banner{
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
    gap: 12px;
  }
  .pending-banner-icon{ font-size: 24px; }
  .pending-banner-text{ min-width: 0; width: 100%; }
  .pending-banner .btn{ width: 100%; text-align: center; }

  /* USER CARD: header en columna */
  .user-admin-card{
    padding: 18px 16px;
    /* Defensivo: garantizar que cada card es un bloque independiente */
    contain: layout;
  }
  .user-admin-header{
    flex-direction: column;
    gap: 14px;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .user-admin-header-info,
  .user-admin-header > div:first-child{
    min-width: 0;
    width: 100%;
  }
  .user-admin-header h3{
    font-size: 1.3rem;
    word-break: break-word;
  }
  .user-admin-header p.muted{
    word-break: break-all;
    font-size: 13px;
  }
  .user-flags{
    flex-wrap: wrap;
    gap: 5px;
  }
  .user-actions-top{
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .user-actions-top .btn,
  .user-actions-top form,
  .user-actions-top form button{
    width: 100%;
  }

  /* PRODUCTOS: 2 columnas en movil (clave para reducir altura) */
  .admin-product-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .admin-product-check{
    padding: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .admin-product-check input{
    margin-top: 0;
  }
  .admin-product-check strong{
    font-size: 12.5px;
    line-height: 1.2;
  }
  .admin-product-check small{
    font-size: 10.5px;
  }
  .save-row{ justify-content: stretch; }
  .save-row .btn{ width: 100%; }

  /* REQUEST CARD */
  .request-card{
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }
  .request-actions{
    flex-direction: column;
    width: 100%;
  }
  .request-actions .btn,
  .request-actions form,
  .request-actions form button{
    width: 100%;
  }

  /* MINI GRID */
  .admin-mini-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .admin-mini-card{
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .admin-mini-card strong{ font-size: 15px; }
  .admin-mini-card span{ font-size: 11px; }

  /* HISTORIAL */
  .admin-history-row{
    padding: 12px;
    gap: 6px;
  }
  .admin-history-row strong{
    font-size: 14px;
    word-break: break-word;
  }
  .admin-history-row small{ font-size: 12px; }
  .admin-history-row span{ font-size: 11px; color: #7A726A; }

  /* SECTION HEAD */
  .admin-section .section-head{
    flex-wrap: wrap;
    gap: 8px;
  }
  .admin-section .section-head h2{
    font-size: 1.4rem;
    line-height: 1.15;
    word-break: break-word;
  }

  /* Defensivo: separar visualmente cada section */
  .admin-page > .admin-section{
    clear: both;
    width: 100%;
  }
}

/* MOVIL PEQUENO <=380px */
@media (max-width: 380px){
  .admin-stats{ grid-template-columns: 1fr; }
  .admin-mini-grid{ grid-template-columns: 1fr; }
  .admin-product-grid{ grid-template-columns: 1fr; }
  .stat-num{ font-size: 26px; }
  .admin-hero{ padding: 18px 16px; }
  .admin-hero h1{ font-size: 1.6rem; }
  .panel{ padding: 16px; }
}

/* ============================================================
   MAPA DE TI · Estilos compartidos
   ============================================================ */

/* -- Shared hero pattern (used in signo, kua, elemento, combinacion, etc.) -- */
.mdt-hero-shared {
  text-align: center; padding: 0 0 32px; position: relative;
}
.mdt-hero-img {
  width: calc(100% + 40px); margin: 0 -20px;
  height: 220px; object-fit: cover;
  object-position: center 30%; display: block;
  border-radius: 0 0 20px 20px;
}
@media(min-width:640px){ .mdt-hero-img { height: 280px; } }
.mdt-hero-content { padding: 24px 0 0; }

/* -- Shared detail page layout -- */
.detail-wrap { max-width: 680px; margin: 0 auto; padding: 0 20px 80px; }
.detail-hero {
  background: #2F3E34; margin: 0 -20px;
  padding: 48px 40px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.detail-hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(194,164,111,0.08);
}
.detail-back {
  position: absolute; top: 20px; left: 20px;
  font-family: var(--sans); font-size: 12px; color: #7A9A8A;
  text-decoration: none; letter-spacing: 1px;
}
.detail-back:hover { color: #C2A46F; }
.detail-eyebrow {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase;
  color: #7A9A8A; margin-bottom: 12px;
  position: relative; z-index: 1;
}
.detail-icono { font-size: 3.5rem; margin-bottom: 10px; position: relative; z-index: 1; }
.detail-nombre {
  font-family: var(--serif); font-size: 2.6rem;
  font-weight: 400; color: #F4EFE6; margin: 0 0 6px;
  position: relative; z-index: 1;
}
.detail-arquetipo {
  font-family: var(--sans); font-size: 13px;
  color: #C2A46F; letter-spacing: 1px;
  position: relative; z-index: 1;
}
.detail-body { padding-top: 32px; }
.detail-section { margin-bottom: 28px; }
.detail-section-label {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase; color: #9A9389;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(47,62,52,0.09);
}

/* -- Shared card patterns -- */
.detail-card { border-radius: 14px; padding: 22px 20px; margin-bottom: 12px; }
.detail-card-luz { background: #FAFAF7; border: 1px solid rgba(47,62,52,0.09); }
.detail-card-sombra { background: #2F3E34; }
.detail-card-title {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 14px;
}
.detail-card-luz .detail-card-title { color: #5F7A6B; }
.detail-card-sombra .detail-card-title { color: #7A9A8A; }
.detail-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.detail-list li {
  font-family: var(--serif); font-size: 1.1rem;
  line-height: 1.5; display: flex; gap: 10px; align-items: flex-start;
}
.detail-list-mark { flex-shrink: 0; font-size: 0.85rem; margin-top: 3px; }
.detail-card-luz .detail-list li { color: #2F3E34; }
.detail-card-luz .detail-list-mark { color: #5F7A6B; }
.detail-card-sombra .detail-list li { color: #E8DDD0; }
.detail-card-sombra .detail-list-mark { color: #7A9A8A; }

/* -- Shared blocks (mecanismo, integracion) -- */
.detail-bloque { border-radius: 12px; padding: 20px 18px; margin-bottom: 12px; }
.detail-bloque-mec { background: #FFF8F0; border: 1px solid rgba(194,164,111,0.25); }
.detail-bloque-int { background: #EEF4F0; border: 1px solid rgba(47,62,52,0.12); }
.detail-bloque-label {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 10px; display: block;
}
.detail-bloque-mec .detail-bloque-label { color: #B08A4A; }
.detail-bloque-int .detail-bloque-label { color: #4A7A5A; }
.detail-bloque-text {
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; margin: 0;
}
.detail-bloque-mec .detail-bloque-text { color: #6A4A2A; }
.detail-bloque-int .detail-bloque-text { color: #1E3A28; }

/* -- Shared CTA button -- */
.detail-cta {
  display: block; text-align: center; margin-top: 32px;
  padding: 14px 28px; background: #2F3E34; color: #C2A46F;
  border-radius: 99px; font-family: var(--sans);
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  text-decoration: none; transition: background 0.2s;
}
.detail-cta:hover { background: #1E2A22; }
