* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --fondo: #0f0e13;
    --negro: #151419;
    --negro-2: #1c1920;
    --panel: #1f1c25;
    --texto-suave: rgba(255,255,255,.66);
    --dorado: #d4af6a;
    --dorado-2: #e8c989;
    --menta: #232029;
    --claro: #f6efe5;
    --linea: rgba(255,255,255,.08);
    --sombra: 0 20px 40px rgba(0,0,0,.4);
    --ok: #4ad97f;
    --warn: #ffb74d;
    --err: #ff5d52;
}

html, body { width: 100%; min-height: 100%; font-family: 'Segoe UI', Arial, sans-serif; background: var(--fondo); overflow: hidden; }
body { color: #fff; }

.app { width: 100vw; height: 100vh; height: 100dvh; position: relative; overflow: hidden; background: var(--fondo); }

.pantalla { position: absolute; inset: 0; width: 100%; height: 100%; display: none; overflow: hidden; }
.pantalla.activa { display: block !important; }

.isla { display: none; }

/* SCROLL helper */
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll-y::-webkit-scrollbar { width: 0; }

/* ───────── BOTONES BASE ───────── */
.btn-dorado { border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--dorado), var(--dorado-2)); color: #1a1208; font-weight: 700; cursor: pointer; transition: transform .12s, filter .12s; }
.btn-dorado:active { transform: scale(.97); }
.btn-dorado:disabled { opacity: .5; pointer-events: none; }
.btn-ghost { background: rgba(255,255,255,.06); border: 0; color: #fff; border-radius: 999px; cursor: pointer; }
.btn-icono { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ───────── LOGIN / REGISTRO ───────── */
.pantalla-auth { background: var(--negro); padding: calc(env(safe-area-inset-top) + 50px) 22px calc(env(safe-area-inset-bottom) + 40px); overflow-y: auto; }
.auth-hero { text-align: center; margin-bottom: 28px; }
.auth-hero .logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(135deg, var(--dorado), var(--dorado-2)); display: grid; place-items: center; font-size: 38px; margin: 0 auto 16px; }
.auth-hero h1 { font-size: 30px; font-weight: 300; letter-spacing: .5px; }
.auth-hero p { color: var(--texto-suave); font-size: 13px; margin-top: 6px; }

.tabs-auth { display: flex; background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.tab-auth { flex: 1; border: 0; padding: 11px; border-radius: 999px; background: transparent; color: var(--texto-suave); font-size: 13px; font-weight: 600; cursor: pointer; }
.tab-auth.activo { background: var(--dorado); color: #1a1208; }

.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 12px; color: var(--texto-suave); margin-bottom: 6px; padding-left: 4px; }
.campo input, .campo select, .campo textarea { width: 100%; height: 50px; border: 1px solid var(--linea); border-radius: 14px; background: rgba(255,255,255,.04); color: #fff; padding: 0 16px; font-size: 14px; outline: none; transition: border-color .15s; }
.campo textarea { height: auto; padding: 12px 16px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--dorado); }
.campo select option { background: var(--negro-2); }

.auth-submit { width: 100%; height: 52px; font-size: 15px; margin-top: 8px; }
.auth-error { background: rgba(255,93,82,.12); border: 1px solid rgba(255,93,82,.3); color: #ff8a82; font-size: 12px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; display: none; }
.auth-error.visible { display: block; }
.auth-cambiar-rol { text-align: center; margin-top: 18px; font-size: 12px; color: var(--texto-suave); }
.auth-cambiar-rol a { color: var(--dorado); text-decoration: none; cursor: pointer; }

/* ───────── INICIO (cliente) ───────── */
.pantalla-inicio { background: var(--negro); color: #fff; padding: calc(env(safe-area-inset-top) + 60px) 16px calc(env(safe-area-inset-bottom) + 104px); }
.encabezado-app { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.usuario { display: flex; gap: 10px; align-items: center; }
.usuario img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--dorado); }
.usuario small { display: block; color: var(--texto-suave); margin-bottom: 2px; font-size: 12px; }
.usuario strong { font-size: 14px; }
.carrito-trigger { width: auto; min-width: 60px; border-radius: 999px; padding: 0 14px; height: 38px; display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,.08); border: 0; color: #fff; cursor: pointer; }
.carrito-trigger b { color: var(--dorado); }

.buscador { display: flex; align-items: center; gap: 8px; height: 46px; background: rgba(255,255,255,.06); border-radius: 999px; padding: 0 16px; margin-bottom: 20px; }
.buscador input { flex: 1; height: 100%; border: 0; outline: none; background: transparent; color: #fff; font-size: 14px; }
.buscador input::placeholder { color: rgba(255,255,255,.4); }

.bloque-titulo { margin-bottom: 16px; }
.bloque-titulo h2 { font-size: 30px; line-height: 1; font-weight: 300; margin-bottom: 8px; }
.bloque-titulo h2 b { color: var(--dorado); font-weight: 600; }
.bloque-titulo p { color: var(--texto-suave); font-size: 13px; }

.seccion-label { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; }
.seccion-label h3 { font-size: 16px; font-weight: 600; }
.seccion-label a { color: var(--dorado); font-size: 12px; text-decoration: none; }

/* Barberos horizontal */
.barberos-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.barberos-scroll::-webkit-scrollbar { display: none; }
.barbero-card { min-width: 120px; background: var(--panel); border-radius: 20px; padding: 14px; text-align: center; cursor: pointer; border: 1px solid transparent; transition: border-color .15s; }
.barbero-card.sel { border-color: var(--dorado); }
.barbero-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.barbero-card strong { display: block; font-size: 13px; margin-bottom: 2px; }
.barbero-card small { color: var(--texto-suave); font-size: 10px; }
.barbero-card .rating { color: var(--dorado); font-size: 11px; margin-top: 4px; }

.categorias { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.categorias::-webkit-scrollbar { display: none; }
.categoria { border: 0; padding: 11px 16px; border-radius: 999px; white-space: nowrap; background: rgba(255,255,255,.07); color: rgba(255,255,255,.84); font-size: 12px; cursor: pointer; }
.categoria.activa { background: var(--dorado); color: #1a1208; font-weight: 700; }

.lista-productos { display: flex; flex-direction: column; gap: 16px; }
.tarjeta-producto { background: var(--menta); border-radius: 24px; padding: 16px 14px; display: grid; grid-template-columns: 1fr 116px; min-height: 170px; color: #fff; overflow: hidden; position: relative; border: 1px solid var(--linea); }
.tarjeta-info h3 { font-size: 20px; line-height: 1.05; font-weight: 600; margin-bottom: 8px; }
.tarjeta-info .meta { font-size: 11px; color: var(--texto-suave); margin-bottom: 10px; }
.tarjeta-precio { font-size: 30px; line-height: 1; margin-bottom: 12px; color: var(--dorado); font-weight: 600; }
.tarjeta-btn { border: 0; border-radius: 999px; background: var(--dorado); color: #1a1208; font-weight: 700; font-size: 12px; padding: 10px 16px; cursor: pointer; }
.tarjeta-visual { position: relative; display: flex; align-items: center; justify-content: center; }
.tarjeta-visual img { width: 130px; height: 130px; object-fit: cover; border-radius: 18px; filter: drop-shadow(0 12px 16px rgba(0,0,0,.4)); }
.favorito-mini { position: absolute; top: 0; right: 0; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 15px; }
.favorito-mini.activo { color: var(--dorado); }

/* Barra inferior */
.barra-inferior { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px); background: rgba(21,20,25,.97); backdrop-filter: blur(14px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; z-index: 40; border-top: 1px solid var(--linea); }
.barra-inferior.oculta { display: none; }
.nav-btn { border: 0; height: 48px; border-radius: 14px; background: rgba(255,255,255,.05); color: rgba(255,255,255,.7); font-size: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; } .nav-btn svg { display:block; }

.nav-btn.activo { background: var(--dorado); color: #1a1208; font-weight: 700; }

/* ───────── DETALLE ───────── */
.pantalla-detalle { background: var(--negro-2); overflow: hidden; color: #fff; padding-top: calc(env(safe-area-inset-top) + 56px); }
.detalle-top { padding: 0 16px; }
.acciones-detalle { display: flex; justify-content: space-between; margin-bottom: 18px; }
.imagen-detalle-wrap { position: relative; min-height: 230px; display: flex; align-items: center; justify-content: center; }
.imagen-detalle-wrap img { width: 230px; height: 230px; max-width: 80%; object-fit: cover; border-radius: 26px; filter: drop-shadow(0 18px 22px rgba(0,0,0,.5)); }
.badge { position: absolute; border-radius: 999px; padding: 8px 14px; font-size: 11px; background: var(--dorado); color: #1a1208; font-weight: 700; }
.badge-top { top: 10px; right: 8px; }

.detalle-bottom { position: absolute; left: 0; right: 0; bottom: 0; top: 52%; background: var(--negro); border-radius: 28px 28px 0 0; padding: 22px 18px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; }
.detalle-bottom h2 { font-size: 26px; font-weight: 600; margin-bottom: 4px; }
.detalle-bottom .sub { color: var(--texto-suave); font-size: 12px; margin-bottom: 14px; }
.precio-linea { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.precio-linea strong { font-size: 36px; font-weight: 600; color: var(--dorado); }
.precio-linea span { color: var(--texto-suave); font-size: 13px; }
.descripcion p { color: rgba(255,255,255,.74); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }

.fila-compra { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cantidad-box { background: rgba(255,255,255,.06); border-radius: 999px; min-width: 110px; display: flex; align-items: center; justify-content: space-between; padding: 4px; }
.cantidad-box button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 18px; cursor: pointer; }
.cantidad-box span { font-weight: 700; }
.btn-agregar { flex: 1; height: 50px; font-size: 14px; }
.btn-agendar { width: 100%; height: 52px; font-size: 15px; margin-top: 4px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--dorado); border-radius: 999px; cursor: pointer; font-weight: 600; }

/* ───────── MODAL GENÉRICO (citas, perfil, agenda) ───────── */
.panel-sheet { position: absolute; left: 0; right: 0; bottom: -100%; max-height: 88vh; background: var(--negro); border-radius: 26px 26px 0 0; z-index: 80; transition: bottom .3s ease; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; }
.panel-sheet.abierto { bottom: 0; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-header h3 { font-size: 18px; }
.sheet-body { overflow-y: auto; }

/* Slots de hora */
.slots-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 16px; }
.slot { border: 1px solid var(--linea); background: rgba(255,255,255,.04); color: #fff; border-radius: 12px; padding: 10px 0; font-size: 13px; cursor: pointer; text-align: center; }
.slot.libre:active { background: rgba(212,175,106,.2); }
.slot.sel { background: var(--dorado); color: #1a1208; font-weight: 700; border-color: var(--dorado); }
.slot.ocupado { opacity: .3; pointer-events: none; text-decoration: line-through; }

/* ───────── CARRITO ───────── */
.carrito-items { overflow-y: auto; max-height: 48vh; }
.item-carrito { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.item-carrito img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; }
.item-carrito strong { font-size: 14px; }
.item-carrito small { display: block; color: var(--texto-suave); margin: 4px 0 6px; }
.controles-mini { display: flex; gap: 8px; align-items: center; }
.controles-mini button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.fila-total { display: flex; justify-content: space-between; margin: 14px 0 12px; font-size: 16px; }
.fila-total strong { color: var(--dorado); }
.btn-finalizar { width: 100%; height: 50px; font-size: 15px; }

/* ───────── PERFIL / LISTAS ───────── */
.perfil-head { text-align: center; padding: 10px 0 18px; }
.perfil-head img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--dorado); margin-bottom: 12px; }
.perfil-head h3 { font-size: 20px; }
.perfil-head small { color: var(--texto-suave); }
.lista-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--panel); border-radius: 16px; margin-bottom: 10px; }
.lista-item .ed { color: var(--texto-suave); font-size: 12px; }
.chip-estado { font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.chip-pendiente { background: rgba(255,183,77,.16); color: var(--warn); }
.chip-confirmada { background: rgba(74,217,127,.16); color: var(--ok); }
.chip-completada { background: rgba(255,255,255,.1); color: var(--texto-suave); }
.chip-cancelada { background: rgba(255,93,82,.16); color: var(--err); }

/* Overlay + toast */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: .25s; z-index: 70; }
.overlay.visible { opacity: 1; visibility: visible; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--negro-2); border: 1px solid var(--linea); color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 13px; z-index: 200; opacity: 0; transition: .25s; box-shadow: var(--sombra); pointer-events: none; max-width: 90%; text-align: center; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--err); }

.vacio { text-align: center; color: var(--texto-suave); padding: 30px 10px; font-size: 13px; }

.avatar-iniciales { width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--dorado),var(--dorado-2)); color:#1a1208; font-weight:800; font-size:15px; display:grid; place-items:center; border:2px solid var(--dorado); }
.avatar-iniciales.grande { width:84px; height:84px; font-size:30px; border-width:3px; margin:0 auto 12px; }

/* ───────── ESCRITORIO ───────── */
@media (min-width: 768px) {
  body { display: grid; place-items: center; background: #08070b; }
  .pantalla-auth { padding-bottom: 60px; }
  #formBarberia { padding-bottom: 20px; }
  .app { width: 430px; height: 920px; max-height: 96vh; border-radius: 38px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.08); }
  /* Todo es absolute respecto a .app, así que ya queda dentro del marco. */
  .barra-inferior { border-radius: 0 0 38px 38px; }
  .pantalla { border-radius: 38px; }
}

/* ───────── GRILLA 2x2 de cortes ───────── */
.lista-productos.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lista-productos.grid2 .tarjeta-producto { grid-template-columns: 1fr; min-height: 0; padding: 10px; }
.lista-productos.grid2 .tarjeta-visual { order: -1; margin-bottom: 8px; }
.lista-productos.grid2 .tarjeta-visual img { width: 100%; height: 110px; }
.lista-productos.grid2 .tarjeta-info h3 { font-size: 15px; }
.lista-productos.grid2 .tarjeta-precio { font-size: 22px; }
.lista-productos.grid2 .meta { font-size: 10px; }
.lista-productos.grid2 .tarjeta-btn { width: 100%; padding: 9px; }

/* ───────── SECCIONES informativas (por qué elegirnos / testimonios) ───────── */
.seccion-info { margin: 24px 0 8px; }
.seccion-info h3 { font-size: 18px; margin-bottom: 14px; }
.seccion-info h3 b { color: var(--dorado); }
.razones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.razon { background: var(--panel); border-radius: 16px; padding: 14px; text-align: center; border: 1px solid var(--linea); }
.razon .ric { width: 42px; height: 42px; margin: 0 auto 8px; display: grid; place-items: center; background: rgba(212,175,106,.12); border-radius: 12px; color: var(--dorado); }
.razon strong { display: block; font-size: 13px; margin-bottom: 4px; }
.razon small { color: var(--texto-suave); font-size: 11px; line-height: 1.4; }
.testimonios { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.testimonios::-webkit-scrollbar { display: none; }
.testi { min-width: 240px; background: var(--panel); border-radius: 16px; padding: 16px; border: 1px solid var(--linea); }
.testi p { font-size: 12px; color: rgba(255,255,255,.82); line-height: 1.5; margin-bottom: 12px; font-style: italic; }
.testi .autor { display: flex; gap: 10px; align-items: center; }
.testi .autor img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.testi .autor strong { font-size: 12px; display: block; }
.testi .autor span { font-size: 10px; color: var(--dorado); }

/* ───────── FONDO de login con imagen ───────── */
.pantalla-auth { position: relative; }
.auth-fondo { position: absolute; inset: 0; background: url('https://images.unsplash.com/photo-1503951914875-452162b0f3f1?auto=format&fit=crop&w=900&q=80') center/cover no-repeat; z-index: 0; }
.auth-fondo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(15,14,19,.82), rgba(15,14,19,.96)); }
.pantalla-auth > *:not(.auth-fondo) { position: relative; z-index: 1; }

/* ───────── SPLASH / BIENVENIDA tipo app nativa ───────── */
.pantalla-splash { background: #0a0a0d; }
.splash-fondo { position: absolute; inset: 0; background: url('https://images.unsplash.com/photo-1585747860715-2ba37e788b70?auto=format&fit=crop&w=900&q=80') center/cover no-repeat; transform: scale(1.05); }
.splash-capa { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(10,10,13,.96) 8%, rgba(10,10,13,.55) 55%, rgba(10,10,13,.35) 100%); }
.contenido-splash { position: relative; z-index: 2; height: 100%; padding: calc(env(safe-area-inset-top) + 80px) 28px calc(env(safe-area-inset-bottom) + 40px); display: flex; flex-direction: column; justify-content: space-between; }
.splash-logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(135deg, var(--dorado), var(--dorado-2)); display: grid; place-items: center; margin-bottom: 26px; box-shadow: 0 12px 30px rgba(212,175,106,.3); }
.splash-top h1 { font-size: 46px; line-height: 1.02; font-weight: 300; color: #fff; margin-bottom: 16px; letter-spacing: .5px; }
.splash-top p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.78); width: 88%; }
.acciones-splash { display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; z-index: 3; }
.acciones-splash .btn-dorado { width: 100%; height: 56px; font-size: 16px; border-radius: 18px; }
.splash-hint { font-size: 12px; color: rgba(255,255,255,.5); }