/* Perfil: cuenta, pedidos, direcciones, amigos, inicio de sesión */

.container{ max-width:600px; }
.state-loading{ padding-block:80px; color:var(--text-muted); font-size:14px; text-align:center; }
.state-loading .btn{ width:auto; margin:12px auto 0; }
.page-header{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding-block:14px 4px; }
.back-button{ font-size:17px; }
.page-header .logo svg{ height:22px; }
.group-label{ display:block; padding-block:20px 10px; color:var(--text-muted); font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; }
.profile-main{ padding-block:8px 48px; }
.profile-view{ display:flex; flex-direction:column; gap:10px; }
.view-title{ margin-bottom:6px; font-size:26px; font-weight:700; line-height:1.15; letter-spacing:-.02em; }
.stack > * + *{ margin-top:10px; }
.hint{ color:var(--text-muted); font-size:13px; line-height:1.5; }
.hint b{ color:var(--text); font-weight:600; }
.link{ font-weight:600; text-decoration:underline; }

/* Tarjeta del perfil */
.profile-card{ display:flex; flex-direction:column; align-items:center; padding-block:20px 24px; text-align:center; }
.profile-avatar{
    position:relative; display:flex; align-items:center; justify-content:center;
    width:104px; height:104px; margin-bottom:14px; overflow:hidden; border-radius:50%;
    color:#FFFFFF; background:linear-gradient(135deg, #2a1f3a, #131017);
}
.profile-avatar img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.profile-avatar.has-photo .profile-avatar__icon{ display:none; }
.profile-avatar__icon{ width:52px; height:52px; }
.profile-avatar__edit{
    position:absolute; right:-2px; bottom:-2px; display:flex; align-items:center; justify-content:center;
    width:32px; height:32px; border-radius:50%; color:var(--text); background:var(--bg); box-shadow:0 0 0 1px var(--divider);
}
.profile-avatar__edit svg{ width:16px; height:16px; }
.profile-name{ font-size:26px; font-weight:700; letter-spacing:-.02em; }
.profile-meta{ margin-top:2px; color:var(--text-muted); font-size:14px; }
.profile-edit-btn{ margin-block:14px 20px; }
.profile-stats{ display:flex; width:100%; overflow:hidden; border:1px solid var(--divider); border-radius:var(--radius-lg); }
.profile-stat{ display:flex; flex:1; flex-direction:column; align-items:center; gap:2px; padding-block:14px 12px; transition:background-color .2s ease; }
.profile-stat + .profile-stat{ border-left:1px solid var(--divider); }
.profile-stat:hover{ background:var(--hover); }
.profile-stat__value{ font-size:20px; font-weight:600; }
.profile-stat__label{ color:var(--text-muted); font-size:12px; }

/* Menú */
.menu-list{ display:flex; flex-direction:column; gap:8px; }
.menu-item{
    display:flex; align-items:center; gap:14px; width:100%; padding:14px 16px;
    border:1px solid var(--divider); border-radius:14px; color:var(--text); font-size:15px; font-weight:500; text-align:left;
    transition:background-color .2s ease, border-color .2s ease;
}
button.menu-item:hover{ background:var(--hover); border-color:var(--hover); }
.menu-item--static{ cursor:default; }
.menu-item__icon{ flex-shrink:0; width:20px; height:20px; color:var(--text-muted); }
.menu-item__label{ flex:1; min-width:0; }
.menu-item__chevron{ flex-shrink:0; width:18px; height:18px; opacity:.4; }
.logout-btn{
    display:flex; align-items:center; justify-content:center; gap:10px; width:100%; margin-top:28px; padding:14px 16px;
    border:1px solid var(--divider); border-radius:14px; color:var(--danger-fg); font-size:15px; font-weight:600; transition:background-color .2s ease;
}
.logout-btn:hover{ background:rgba(229,72,77,.1); }
.logout-btn svg{ width:18px; height:18px; }
.app-version{ margin-top:16px; color:var(--text-muted); font-size:12px; text-align:center; }

/* Tarjetas de lista: pedidos, direcciones, favoritos */
.list-card{
    position:relative; display:block; padding:16px; border:1px solid var(--divider); border-radius:14px; color:var(--text);
    transition:border-color .2s ease, background-color .2s ease;
}
a.list-card:hover{ background:var(--hover); }
.list-card h3{ padding-right:96px; font-size:16px; font-weight:600; }
.list-card p{ color:var(--text-muted); font-size:13px; }
.list-card .badge{ position:absolute; top:16px; right:16px; }
.list-card--row{ display:flex; align-items:center; gap:12px; }
.list-card__body{ flex:1; min-width:0; }
.list-card__body h3{ padding-right:0; }
.icon-button.danger{ color:var(--danger-fg); }
.fav-logo{
    display:flex; flex-shrink:0; align-items:center; justify-content:center; width:48px; height:48px; border-radius:12px;
    background:var(--hover) center / cover no-repeat; font-size:18px; font-weight:600;
}

/* Cajas informativas */
.info-box{ padding:20px; border-radius:14px; background:var(--hover); text-align:center; }
.info-box p{ margin-bottom:12px; color:var(--text-muted); font-size:14px; line-height:1.5; }
.info-box p:last-of-type{ margin-bottom:16px; }
.share-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.btn .wa{ color:#25D366; }
.invite-link{ margin-top:12px; font-size:14px; text-align:center; }
.danger-zone{ margin-top:8px; padding:18px; border:1px solid rgba(229,72,77,.4); border-radius:14px; }
.danger-zone h3{ margin-bottom:8px; color:var(--danger-fg); font-size:14px; font-weight:600; }
.danger-zone p{ margin-bottom:14px; color:var(--text-muted); font-size:13px; line-height:1.5; }

/* Amigos */
.segmented{ display:flex; gap:4px; padding:4px; border-radius:14px; background:var(--hover); }
.segmented__btn{ flex:1; padding:9px 4px; border-radius:10px; color:var(--text-muted); font-size:13px; font-weight:600; transition:background-color .2s ease, color .2s ease; }
.segmented__btn.is-active{ background:var(--bg); color:var(--text); box-shadow:0 1px 4px var(--shadow-color); }
.friend-row{ display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--divider); border-radius:14px; }
.friend-avatar{ display:flex; flex-shrink:0; align-items:center; justify-content:center; width:44px; height:44px; border-radius:50%; background:var(--cimil-1); color:#fff; font-weight:600; }
.friend-info{ flex:1; min-width:0; }
.friend-info h3{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:14px; font-weight:600; }
.friend-info p{ color:var(--text-muted); font-size:12px; }
.friend-actions{ display:flex; flex-shrink:0; gap:6px; }
.id-box{ display:flex; align-items:center; gap:8px; padding:6px 6px 6px 12px; border-radius:12px; background:var(--hover); }
.id-box code{ flex:1; min-width:0; color:var(--text-muted); font-size:11px; word-break:break-all; user-select:all; }

/* Chat entre amigos */
.chat-msgs{ display:flex; flex-direction:column; gap:8px; min-height:240px; max-height:46vh; overflow-y:auto; padding:14px; border-radius:14px; background:var(--hover); scrollbar-width:none; }
.chat-msgs::-webkit-scrollbar{ display:none; }
.msg{ max-width:80%; padding:8px 12px; border-radius:14px; font-size:13.5px; line-height:1.4; word-break:break-word; }
.msg.me{ align-self:flex-end; border-bottom-right-radius:4px; background:var(--cimil-1); color:#fff; }
.msg.them{ align-self:flex-start; border:1px solid var(--divider); border-bottom-left-radius:4px; background:var(--bg); }
.msg time{ display:block; margin-top:3px; font-size:9px; opacity:.65; }
.chat-input-row{ display:flex; gap:8px; }
.chat-input{ border-radius:999px; }
.chat-send{ display:flex; flex-shrink:0; align-items:center; justify-content:center; width:48px; height:48px; border-radius:50%; background:var(--cimil-1); color:#fff; }
.chat-send:disabled{ opacity:.35; }
.chat-send svg{ width:20px; height:20px; }

/* Inicio de sesión: titular grande en Bold + texto pequeño en Light, centrado */
.auth-view{ display:flex; flex-direction:column; justify-content:center; align-items:center; max-width:800px; min-height:100dvh; padding-block:32px; text-align:center; }
.auth-card{ display:flex; flex-direction:column; align-items:center; gap:16px; width:100%; animation:cimil-rise .5s var(--ease) both; }
.auth-card:not([data-step="welcome"]){ max-width:440px; }
.auth-brand{ display:flex; justify-content:center; margin-bottom:6px; animation:cimil-rise .5s var(--ease) both; }
.auth-brand svg{ height:52px; }
.auth-title{ font-size:clamp(34px, 9.2vw, 60px); font-weight:700; line-height:1.04; letter-spacing:-.035em; text-wrap:balance; animation:cimil-rise .55s var(--ease) .06s both; }
.auth-card:not([data-step="welcome"]) .auth-title{ font-size:clamp(26px, 7vw, 36px); letter-spacing:-.025em; line-height:1.1; }
.auth-subtitle{ max-width:540px; color:var(--text-muted); font-size:clamp(15px, 3.8vw, 17px); font-weight:300; line-height:1.5; text-wrap:balance; animation:cimil-rise .55s var(--ease) .14s both; }
.auth-subtitle strong{ font-weight:600; color:var(--text); }
/* Los dos botones de entrada, lado a lado */
.auth-actions{ display:flex; flex-wrap:wrap; justify-content:center; gap:14px; width:100%; max-width:440px; margin-top:16px; animation:cimil-rise .55s var(--ease) .22s both; }
.auth-actions .btn{ flex:1 1 190px; min-height:50px; padding-inline:22px; border-radius:12px; font-size:16px; font-weight:600; }
.auth-actions .btn--outline{ background:var(--bg); border-color:var(--divider); box-shadow:0 4px 14px var(--shadow-color); }
.auth-card > .btn{ min-height:50px; border-radius:12px; font-size:16px; font-weight:600; }
.auth-phone-field{ border-radius:14px; }
.auth-phone-field input{ font-weight:600; letter-spacing:.02em; }
.auth-error{ min-height:20px; }
.auth-step{ color:var(--text-muted); font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; }
.auth-back{
    display:inline-flex; align-items:center; align-self:flex-start; gap:4px; margin:-6px 0 -6px -6px; padding:6px; border-radius:8px;
    color:var(--text-muted); font-size:13px; font-weight:500; transition:background-color .2s ease;
}
.auth-back:hover{ background:var(--hover); }
.auth-back svg{ width:16px; height:16px; }
.auth-phone-field{ display:flex; align-items:center; gap:10px; width:100%; padding:12px 14px; border:1px solid transparent; border-radius:var(--radius-md); background:var(--hover); transition:border-color .2s ease; }
.auth-phone-field:focus-within{ border-color:var(--brand-fg); }
.auth-phone-field span{ color:var(--text-muted); font-weight:600; }
.auth-phone-field input{ flex:1; min-width:0; border:0; background:none; color:var(--text); font:inherit; font-size:16px; font-weight:500; outline:none; }
.auth-error{ min-height:18px; color:var(--danger-fg); font-size:13px; }
.auth-link{ padding:6px; color:var(--text-muted); font-size:13px; font-weight:500; }
.auth-link:disabled{ cursor:default; opacity:.6; }
.auth-options{ display:flex; flex-direction:column; gap:10px; width:100%; }
.role-option{
    width:100%; padding:14px 16px; border:1px solid var(--divider); border-radius:14px;
    color:var(--text); font-size:15px; font-weight:500; text-align:left; transition:border-color .2s ease, background-color .2s ease;
}
.role-option:hover{ border-color:var(--text-muted); }
.role-option.is-selected{ border-color:var(--brand-fg); background:rgba(54,191,177,.1); }
/* La tarjeta es una columna centrada: las filas necesitan ancho completo para no encogerse a su contenido */
.otp-inputs{ display:flex; gap:8px; width:100%; }
.otp-box{
    flex:1; min-width:0; aspect-ratio:1; border:1px solid var(--divider); border-radius:12px; background:none;
    color:var(--text); font:inherit; font-size:22px; font-weight:600; text-align:center; transition:border-color .2s ease;
}
.otp-box:focus{ outline:none; border-color:var(--brand-fg); }
