/* ================================================================
   profile.css — Jama App  v2
   Perfil usuario: layout Instagram/TikTok + utilidad
   ================================================================ */

/* ── VARIABLES ── */
:root {
  --profile-sidebar-w: 240px;
  --profile-header-h:  56px;
}

/* ── RESET ── */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif); background: var(--color-bg, #f5f5f5); color: var(--color-dark, #1a1a1a); -webkit-font-smoothing: antialiased; }

/* ================================================================
   NAVBAR
   ================================================================ */
.pf-navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-bg-strong, rgba(255,255,255,.85)); border-bottom: 1px solid var(--glass-border, #e5e5e5);
  -webkit-backdrop-filter: var(--glass-blur, saturate(180%) blur(20px));
  backdrop-filter: var(--glass-blur, saturate(180%) blur(20px));
  height: var(--profile-header-h);
  display: flex; align-items: center;
  padding: 0 1.25rem; gap: 1rem;
}
.pf-navbar-title { flex: 1; font-weight: 700; font-size: 0.95rem; color: #1a1a1a; text-align: center; }
.pf-navbar-spacer { width: 36px; flex-shrink: 0; }
.pf-navbar-home {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: #332b27;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pf-navbar-home [data-icon] { width: 18px; height: 18px; display: inline-flex; flex: 0 0 18px; }
.pf-navbar-home [data-icon] svg { width: 100%; height: 100%; display: block; }
.pf-navbar-home:hover { background: #f0ece8; color: var(--color-red, #FF3D2E); }
.pf-navbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.pf-navbar-btn { width: 44px; height: 44px; border-radius: 50%; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #444; transition: background 0.15s; }
.pf-navbar-btn span { width: 19px; height: 19px; display: flex; }
.pf-navbar-btn svg { width: 100%; height: 100%; }
.pf-navbar-btn:hover { background: #f0f0f0; }

/* ================================================================
   LAYOUT DESKTOP: SIDEBAR + CONTENT
   ================================================================ */
.pf-layout {
  display: flex;
  min-height: calc(100vh - var(--profile-header-h));
  min-height: calc(100dvh - var(--profile-header-h));
  max-width: 100%;
  margin: 0;
}

/* ── SIDEBAR DESKTOP ── */
.pf-sidebar {
  width: var(--profile-sidebar-w);
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  position: sticky;
  top: var(--profile-header-h);
  height: calc(100vh - var(--profile-header-h));
  height: calc(100dvh - var(--profile-header-h));
  overflow-y: auto;
  border-right: 1px solid #e5e5e5;
  background: #fff;
}

.pf-sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 1.5rem; }

.pf-sidebar-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem; border-radius: 12px;
  cursor: pointer; border: none; background: none;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  color: #555; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.pf-sidebar-item:hover { background: #f5f5f5; color: #1a1a1a; }
.pf-sidebar-item.active { background: rgba(255,61,46,0.08); color: var(--color-red, #FF3D2E); }
.pf-sidebar-item.active .pf-sidebar-icon { filter: none; }
.pf-sidebar-item--danger { color: #b42318; }
.pf-sidebar-icon {
  width: 19px; height: 19px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pf-sidebar-icon svg { width: 100%; height: 100%; }

.pf-sidebar-divider { height: 1px; background: #e5e5e5; margin: 0.75rem 0; }

.pf-sidebar-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.75rem; margin-top: 0.5rem;
  background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D)); color: #fff;
  border: none; border-radius: 99px; font-family: inherit;
  font-size: 0.875rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(255,61,46,0.3);
}
.pf-sidebar-upload-btn:hover { background: #e02a1c; transform: scale(1.02); }

/* ── MAIN CONTENT ── */
.pf-main { flex: 1; min-width: 0; padding-bottom: 2rem; }
.pf-section-title { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 800; color: #1a1a1a; }

/* ================================================================
   PROFILE HEADER (dentro del main)
   ================================================================ */
.pf-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1f1f 100%);
  padding: 2rem 1.5rem 1.5rem;
  position: relative; overflow: hidden;
}
.pf-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,61,46,0.2) 0%, transparent 60%);
  pointer-events: none;
}

.pf-header-inner { position: relative; z-index: 1; }

/* Avatar + info */
.pf-identity { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }

.pf-avatar-wrap { position: relative; flex-shrink: 0; }
.pf-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-red, #FF3D2E) 0%, #c0392b 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display, sans-serif); font-size: 1.8rem; color: #fff;
  border: 3px solid rgba(255,255,255,0.2); overflow: hidden; cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
}
.pf-avatar:hover { opacity: 0.85; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pf-identity-info { flex: 1; min-width: 0; }
.pf-display-name {
  font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px;
}
.pf-name-edit {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: color 0.15s;
  flex-shrink: 0;
}
.pf-name-edit:hover { color: #fff; }
.pf-name-edit span { width: 16px; height: 16px; display: flex; }
.pf-username { font-size: 0.85rem; color: rgba(255,255,255,0.55); margin-bottom: 4px; }
.pf-bio { font-size: 0.82rem; color: rgba(255,255,255,0.7); line-height: 1.4; }

/* Stats */
.pf-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem; margin-bottom: 1rem;
}
.pf-stat { text-align: center; }
.pf-stat-num { font-family: var(--font-display, sans-serif); font-size: 1.4rem; color: #FBBF24; line-height: 1; margin-bottom: 2px; }
.pf-stat-label { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 600; }

/* ================================================================
   TABS MÓVIL (bajo el header)
   ================================================================ */
.pf-tabs {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: visible;
  background: #fff; border-bottom: 1px solid #e5e5e5;
  position: sticky; top: var(--profile-header-h); z-index: 90;
}
.pf-tabs::-webkit-scrollbar { display: none; }

.pf-tab {
  min-width: 0; min-height: 58px; padding: 0.5rem 0.15rem 0.4rem;
  border: none; background: none; border-bottom: 2.5px solid transparent;
  font-family: inherit; font-size: 0.68rem; font-weight: 700; color: #888;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem; white-space: nowrap;
}
.pf-tab.active { color: var(--color-red, #FF3D2E); border-bottom-color: var(--color-red, #FF3D2E); }
.pf-tab:hover:not(.active) { color: #333; }
.pf-tab-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pf-tab-icon svg { width: 100%; height: 100%; }

/* ================================================================
   TAB PANELS
   ================================================================ */
.pf-panel { display: none; padding: 1rem; }
.pf-panel.active { display: block; }

/* ================================================================
   VIDEOS GRID (TikTok style)
   ================================================================ */
.pf-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.pf-video-card {
  position: relative; aspect-ratio: 9/16;
  background: #111; overflow: hidden; cursor: pointer;
  border-radius: 4px;
  border: 0; padding: 0; text-align: initial; font: inherit;
}
.pf-video-card video {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.pf-video-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  pointer-events: none;
}
.pf-video-card-info {
  position: absolute; bottom: 0.5rem; left: 0.5rem; right: 0.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.pf-video-card-views { font-size: 11px; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.pf-video-card-likes { font-size: 11px; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.pf-video-card-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.25); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; opacity: 0; transition: opacity 0.2s;
}
.pf-video-card:hover .pf-video-card-play { opacity: 1; }

.pf-video-upload-card {
  position: relative; aspect-ratio: 9/16;
  border-radius: 4px;
  background: #fafafa;
  border: 1.5px dashed #d5d5d5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pf-video-upload-card:hover { background: rgba(255,61,46,0.05); border-color: var(--color-red, #FF3D2E); }
.pf-video-upload-plus {
  font-size: 1.6rem; font-weight: 300; line-height: 1;
  color: var(--color-red, #FF3D2E);
}
.pf-video-upload-label { font-size: 11px; font-weight: 700; color: #888; text-align: center; padding: 0 4px; }
.pf-video-upload-card:hover .pf-video-upload-label { color: var(--color-red, #FF3D2E); }

/* Botón subir video (primera celda del grid cuando no hay videos) */
.pf-video-upload-cell {
  aspect-ratio: 9/16; border: 2px dashed #ddd; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  color: #aaa; font-size: 0.78rem; font-weight: 600; text-align: center; padding: 1rem;
}
.pf-video-upload-cell:hover { border-color: var(--color-red, #FF3D2E); color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.03); }
.pf-video-upload-cell-icon { font-size: 1.8rem; }

/* Empty state */
.pf-empty {
  text-align: center; padding: 3rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.pf-empty-icon { font-size: 3rem; }
.pf-empty-icon[data-icon] { width: 48px; height: 48px; color: var(--color-gray-3, #ABA29A); }
.pf-empty-icon[data-icon] svg { width: 100%; height: 100%; }
.pf-empty--compact { padding: 1.5rem 0; }
.pf-empty-btn { min-height: 46px; }
.pf-empty-title { font-weight: 800; font-size: 1rem; color: #1a1a1a; }
.pf-empty-text { font-size: 0.85rem; color: #888; max-width: 260px; line-height: 1.5; }
.pf-inline-icon { display: inline-flex; width: 13px; height: 13px; vertical-align: -2px; color: var(--color-red, #FF3D2E); }
.pf-empty-btn {
  margin-top: 0.5rem; padding: 0.75rem 1.5rem;
  background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D)); color: #fff;
  border: none; border-radius: 99px; font-family: inherit;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.pf-empty-btn:hover { background: #e02a1c; transform: scale(1.03); }

/* ================================================================
   SECTION CARDS (Pedidos, Favoritos, etc.)
   ================================================================ */
.pf-section-card {
  background: #fff; border-radius: 18px; overflow: hidden;
  border: 1px solid #F0ECE7; margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(25,19,15,.04), 0 2px 6px rgba(25,19,15,.06);
  transition: box-shadow .28s cubic-bezier(0.16,1,0.3,1);
}
.pf-section-card:hover { box-shadow: 0 2px 4px rgba(25,19,15,.04), 0 8px 20px rgba(25,19,15,.08); }
.pf-section-card--spaced { margin-bottom: 0.75rem; }
.pf-section-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid #f0f0f0;
}
.pf-section-card-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.95rem; font-weight: 800; color: #1a1a1a;
}
.pf-section-card-title span[data-icon] { width: 18px; height: 18px; display: flex; }
.pf-section-card-title span[data-icon] svg { width: 100%; height: 100%; }
.pf-section-card-action {
  font-size: 0.82rem; font-weight: 700; color: var(--color-red, #FF3D2E);
  background: none; border: none; cursor: pointer; font-family: inherit;
  min-height: 44px; padding: 0.25rem 0.5rem; border-radius: 6px; transition: background 0.15s;
}
.pf-section-card-body--flush { padding: 0 1.25rem; }
.pf-section-card-action:hover { background: rgba(255,61,46,0.08); }
.pf-section-card-body { padding: 0.75rem 1.25rem; }

/* Address items */
.pf-addr-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid #f5f5f5;
}
.pf-addr-item:last-child { border-bottom: none; }
.pf-addr-icon { width: 36px; height: 36px; border-radius: 10px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #555; }
.pf-addr-icon span { width: 18px; height: 18px; display: flex; }
.pf-addr-icon svg { width: 100%; height: 100%; }
.pf-addr-info { flex: 1; min-width: 0; }
.pf-addr-label { font-size: 0.82rem; font-weight: 700; color: #1a1a1a; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2px; }
.pf-addr-default { font-size: 10px; font-weight: 700; color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.1); padding: 1px 6px; border-radius: 99px; }
.pf-addr-text { font-size: 0.78rem; color: #666; }
.pf-addr-ref { font-size: 0.72rem; color: #aaa; margin-top: 1px; }
.pf-addr-actions { display: flex; gap: 4px; }
.pf-addr-btn { width: 44px; height: 44px; border-radius: 10px; border: none; background: #f5f5f5; color: #666; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.pf-addr-btn span[data-icon] { width: 14px; height: 14px; display: flex; }
.pf-addr-btn span[data-icon] svg { width: 100%; height: 100%; }
.pf-addr-btn:hover { background: var(--color-red, #FF3D2E); color: #fff; }

.pf-add-addr-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: 44px; padding: 0.75rem; border: 2px dashed #e0e0e0; border-radius: 12px;
  background: none; font-family: inherit; font-size: 0.85rem; font-weight: 600;
  color: #aaa; cursor: pointer; margin-top: 0.5rem; transition: all 0.15s;
}
.pf-add-addr-btn:hover { border-color: var(--color-red, #FF3D2E); color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.03); }
.pf-add-addr-btn span[data-icon], .pf-addr-ref span[data-icon] { width: 17px; height: 17px; display: inline-flex; flex-shrink: 0; }
.pf-addr-ref { display: flex; align-items: center; gap: 0.35rem; }

/* Orders */
.pf-order-item {
  border: 1.5px solid #f0f0f0; border-radius: 14px; overflow: hidden;
  margin-bottom: 0.75rem; transition: box-shadow 0.15s, transform .15s; cursor: pointer;
}
.pf-order-item:hover { box-shadow: 0 4px 8px rgba(25,19,15,.05), 0 16px 36px rgba(25,19,15,.10); transform: translateY(-2px); }
.pf-order-item:focus-visible { outline: 3px solid rgba(255,61,46,.28); outline-offset: 2px; }
.pf-order-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
.pf-order-restaurant { font-weight: 700; font-size: 0.88rem; color: #1a1a1a; }
.pf-order-date { font-size: 11px; color: #aaa; margin-top: 1px; }
.pf-order-status {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; background: transparent; border: 1.5px solid currentColor;
}
.pf-order-status.entregado { color: #16a34a; }
.pf-order-status.pendiente { color: #dc2626; animation: statusPulse 1.8s ease-in-out infinite; }
.pf-order-status.proceso   { color: #b45309; }
.pf-order-status.cancelado { color: #6b7280; }
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.pf-order-body { padding: 0.75rem 1rem; }
.pf-order-items { font-size: 0.82rem; color: #555; margin-bottom: 0.6rem; }
.pf-order-footer { display: flex; align-items: center; justify-content: space-between; }
.pf-order-actions { display: flex; align-items: center; gap: .65rem; }
.pf-order-open-label { color: var(--color-red, #FF3D2E); font-size: .72rem; font-weight: 700; }
.pf-orders-state { min-height: 180px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.75rem; color:#777; text-align:center; }
.pf-orders-state p { margin:0; max-width:280px; font-size:.86rem; line-height:1.45; }
.pf-orders-state [data-icon] { width:26px; height:26px; color:#c24135; }
.pf-orders-state button,.pf-orders-inline-error button { min-height:44px; padding:.55rem 1rem; border:0; border-radius:99px; background:#ff3d2e; color:#fff; font:700 .78rem inherit; cursor:pointer; }
.pf-orders-inline-error { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-top:.75rem; padding:.75rem; border-radius:12px; background:#fff0ee; color:#9f2e26; font-size:.76rem; }
.pf-profile-inline-error { display:flex; align-items:center; justify-content:space-between; gap:.75rem; max-width:1100px; margin:.75rem auto 0; padding:.75rem 1rem; border-radius:12px; background:#fff0ee; color:#9f2e26; font-size:.78rem; }
.pf-profile-inline-error button { flex:0 0 auto; min-height:44px; padding:.55rem 1rem; border:0; border-radius:99px; background:#ff3d2e; color:#fff; font:700 .78rem inherit; cursor:pointer; }
.pf-address-location-status { margin:.45rem 0 0; color:#7c685f; font-size:.75rem; line-height:1.4; }
.pf-address-location-status.is-confirmed { color:#18794e; }
.pf-address-location-status.is-error { color:#b42318; }
.pf-address-location-btn { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-height:44px; margin-top:.5rem; padding:.55rem .8rem; border:1px solid #ded7d2; border-radius:10px; background:#fff; color:#332b27; font:700 .78rem inherit; cursor:pointer; }
.pf-address-location-btn span,.pf-address-location-btn svg { width:17px; height:17px; }
.pf-addr-location-warning { margin-top:.25rem; color:#b54708; font-size:.72rem; font-weight:600; }
.pf-orders-more { width:100%; min-height:46px; margin-top:.65rem; padding:.75rem; border:0; border-radius:12px; background:#f3f3f3; color:#555; font:700 .82rem inherit; cursor:pointer; }
.pf-orders-more:disabled { opacity:.65; cursor:wait; }
.pf-order-total { font-weight: 800; font-size: 0.95rem; color: #1a1a1a; }
.pf-repeat-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.9rem; background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D));
  color: #fff; border: none; border-radius: 99px;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
  box-shadow: 0 3px 10px rgba(255,61,46,0.3);
}
.pf-repeat-btn:hover { background: #e02a1c; transform: scale(1.04); }

/* Favorites */
.pf-fav-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.pf-fav-tab { flex: 1; padding: 0.6rem; border: 1.5px solid #e5e5e5; border-radius: 99px; background: none; font-family: inherit; font-size: 0.82rem; font-weight: 700; color: #888; cursor: pointer; transition: all 0.15s; text-align: center; }
.pf-fav-tab.active { border-color: var(--color-red, #FF3D2E); color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.05); }

.pf-fav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid #f5f5f5; }
.pf-fav-item:last-child { border-bottom: none; }
.pf-fav-img { width: 52px; height: 52px; border-radius: 12px; background: #f5f5f5; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.pf-fav-img img { width: 100%; height: 100%; object-fit: cover; }
.pf-fav-img [data-icon] { width: 23px; height: 23px; color: #8a817d; }
.pf-fav-info { flex: 1; min-width: 0; }
.pf-fav-name { font-size: 0.88rem; font-weight: 700; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-fav-sub { font-size: 0.75rem; color: #888; margin-top: 1px; }
.pf-fav-btn { min-height: 44px; padding: 0.35rem 0.85rem; background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D)); color: #fff; border: none; border-radius: 99px; font-family: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.pf-fav-btn:hover { background: #e02a1c; }
.pf-fav-btn:disabled { opacity: 0.65; cursor: wait; }
.pf-fav-item.is-unavailable .pf-fav-img { opacity: 0.45; filter: grayscale(1); }
.pf-fav-item.is-unavailable .pf-fav-name { color: #777; }
.pf-fav-remove { background: #f1f1f1; color: #555; }
.pf-fav-remove:hover { background: #e5e5e5; }

/* Payment methods */
.pf-payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.pf-payment-opt { min-height: 44px; width: 100%; font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1rem; border: 1.5px solid #EAE6E1; border-radius: 14px; cursor: pointer; transition: transform .18s cubic-bezier(0.16,1,0.3,1), border-color .18s, background .18s, box-shadow .18s; background: #fafafa; }
.pf-payment-opt.selected { border-color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.05); box-shadow: 0 0 0 4px rgba(255,61,46,.10); }
.pf-payment-opt:hover { border-color: var(--color-gray-3, #ABA29A); transform: translateY(-2px); }
.pf-payment-icon { width: 32px; height: 32px; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: #555; }
.pf-payment-icon span { width: 100%; height: 100%; display: flex; }
.pf-payment-opt.selected .pf-payment-icon { color: var(--color-red, #FF3D2E); }
.pf-payment-label { font-size: 0.78rem; font-weight: 700; color: #555; }
.pf-payment-opt.selected .pf-payment-label { color: var(--color-red, #FF3D2E); }

/* Notification toggles */
.pf-notif-item { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; border-bottom: 1px solid #f5f5f5; }
.pf-notif-item:last-child { border-bottom: none; }
.pf-notif-label { font-size: 0.88rem; font-weight: 700; color: #1a1a1a; }
.pf-notif-desc  { font-size: 0.75rem; color: #888; margin-top: 2px; }
.pf-toggle { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.pf-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.pf-toggle-track { position: absolute; inset: 10px 0; background: #e0e0e0; border-radius: 99px; cursor: pointer; transition: background 0.2s; }
.pf-toggle-track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.pf-toggle input:checked + .pf-toggle-track { background: var(--color-red, #FF3D2E); }
.pf-toggle input:checked + .pf-toggle-track::before { transform: translateX(20px); }
.pf-toggle input:disabled + .pf-toggle-track { opacity: .55; cursor: wait; }

.pf-push-permission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .9rem 0 .25rem;
  padding: 1rem;
  border: 1px solid #ece7e3;
  border-radius: 16px;
  background: #faf8f6;
}
.pf-push-permission-copy { min-width: 0; }
.pf-push-permission-title { color: #1a1715; font-size: .86rem; font-weight: 800; }
.pf-push-permission-desc { margin-top: .25rem; color: #746d68; font-size: .73rem; line-height: 1.45; }
.pf-push-permission-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .55rem;
  color: #746d68;
  font-size: .68rem;
  font-weight: 700;
}
.pf-push-permission-status span { width: 7px; height: 7px; border-radius: 50%; background: #9b938e; }
.pf-push-permission--granted .pf-push-permission-status { color: #197548; }
.pf-push-permission--granted .pf-push-permission-status span { background: #24a365; }
.pf-push-permission--denied .pf-push-permission-status { color: #a83b32; }
.pf-push-permission--denied .pf-push-permission-status span { background: #d74b3f; }
.pf-push-permission-btn {
  min-height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  padding: .7rem .9rem;
  background: #ff3d2e;
  color: #fff;
  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}
.pf-push-permission-btn:disabled { opacity: .65; cursor: wait; }

@media (max-width: 520px) {
  .pf-push-permission { align-items: stretch; flex-direction: column; }
  .pf-push-permission-btn { width: 100%; }
}

/* Settings list */
.pf-settings-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 0; border-bottom: 1px solid #f5f5f5; cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; font-family: inherit; text-decoration: none; }
.pf-settings-item:last-child { border-bottom: none; }
.pf-settings-item:hover { opacity: 0.75; }
.pf-settings-icon { width: 36px; height: 36px; border-radius: 10px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #555; }
.pf-settings-icon span { width: 18px; height: 18px; display: flex; }
.pf-settings-label { font-size: 0.88rem; font-weight: 700; color: #1a1a1a; flex: 1; }
.pf-settings-chevron { color: #bbb; font-size: 1rem; }
.pf-settings-item.danger .pf-settings-label { color: #dc2626; }
.pf-settings-item.danger .pf-settings-icon { background: #fee2e2; color: #dc2626; }

/* ================================================================
   VIDEO UPLOAD MODAL
   ================================================================ */
.pf-upload-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.pf-upload-overlay.open { opacity: 1; pointer-events: all; }
.pf-upload-modal {
  background: #fff; border-radius: 24px 24px 0 0; width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.pf-upload-overlay.open .pf-upload-modal { transform: translateY(0); }
.pf-upload-handle { width: 40px; height: 4px; background: #e0e0e0; border-radius: 99px; margin: 12px auto 1.25rem; }
.pf-upload-title { font-family: var(--font-display, sans-serif); font-size: 1.3rem; color: #1a1a1a; padding: 0 1.5rem; margin-bottom: 1.25rem; letter-spacing: 0.5px; text-align: center; }

/* Upload steps */
.pf-upload-step { padding: 0 1.5rem; }
.pf-upload-label { font-size: 0.85rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.5rem; display: block; }
.pf-upload-input { width: 100%; padding: 0.85rem 1rem; border: 1.5px solid #e5e5e5; border-radius: 14px; font-family: inherit; font-size: 0.88rem; outline: none; transition: border-color 0.15s; box-sizing: border-box; color: #1a1a1a; background: #fafafa; }
.pf-upload-input:focus { border-color: var(--color-red, #FF3D2E); background: #fff; }
.pf-upload-input::placeholder { color: #bbb; }

.pf-upload-video-drop {
  aspect-ratio: 9/16; max-height: 320px;
  width: min(210px, 100%); margin: 0 auto;
  border: 2px dashed #e0e0e0; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; cursor: pointer; transition: all 0.15s;
  background: #fafafa; overflow: hidden; position: relative;
}
.pf-upload-video-drop:hover { border-color: var(--color-red, #FF3D2E); background: rgba(255,61,46,0.02); }
.pf-upload-video-drop.has-video { border: none; }
.pf-upload-video-drop video { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.pf-upload-video-drop-icon { width: 44px; height: 44px; color: #bbb; }
.pf-upload-video-drop-label { font-size: 0.85rem; font-weight: 700; color: #888; text-align: center; }
.pf-upload-video-drop-sub { font-size: 0.75rem; color: #bbb; }
.pf-upload-video-remove {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

.pf-upload-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pf-upload-field { margin-top: 0.75rem; }
.pf-upload-field--first { margin-top: 1rem; }
.pf-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.pf-upload-preview { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

.pf-upload-actions { padding: 1rem 1.5rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.pf-upload-publish {
  width: 100%; padding: 1rem; background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D)); color: #fff;
  border: none; border-radius: 99px; font-family: inherit; font-size: 1rem;
  font-weight: 700; cursor: pointer; transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(255,61,46,0.3);
}
.pf-upload-publish:hover:not(:disabled) { background: #e02a1c; transform: scale(1.01); }
.pf-upload-publish:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pf-upload-cancel { width: 100%; padding: 0.85rem; background: transparent; border: 1.5px solid #e5e5e5; border-radius: 99px; font-family: inherit; font-size: 0.9rem; font-weight: 600; color: #888; cursor: pointer; }

/* Progress bar */
.pf-upload-status { min-height: 18px; margin-top: .75rem; color: #6f6863; font-size: .76rem; font-weight: 700; }
.pf-upload-progress { height: 4px; background: #f0f0f0; border-radius: 99px; margin: 0.75rem 0; overflow: hidden; }
.pf-upload-progress.is-hidden, .pf-player-menu.is-hidden, .pf-initially-hidden { display: none; }
.pf-upload-progress-bar { height: 100%; background: var(--color-red, #FF3D2E); border-radius: 99px; width: 0%; transition: width 0.3s; }

/* ================================================================
   VIDEO PLAYER MODAL (fullscreen)
   ================================================================ */
.pf-player-overlay {
  position: fixed; inset: 0; background: #000; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.pf-player-overlay.open { opacity: 1; pointer-events: all; }
.pf-player-wrap {
  position: relative; width: 100%; max-width: 400px;
  height: 100vh; max-height: 100vh;
  height: 100dvh; max-height: 100dvh;
}
.pf-player-wrap video { width: 100%; height: 100%; object-fit: contain; }
/* ── PLAYER CLOSE ── */
.pf-player-close {
  position: absolute; top: max(1rem, env(safe-area-inset-top) + 0.5rem); left: 1rem;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.pf-player-close svg { width: 18px; height: 18px; }

/* ── THREE-DOTS MENU ── */
.pf-player-menu-btn {
  position: absolute; top: max(1rem, env(safe-area-inset-top) + 0.5rem); right: 1rem;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.pf-player-menu-btn svg { width: 18px; height: 18px; }
.pf-player-video { width: 100%; height: 100%; object-fit: contain; }

.pf-player-menu {
  position: absolute; top: calc(max(1rem, env(safe-area-inset-top)) + 3rem); right: 1rem;
  background: rgba(20,20,20,0.92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  overflow: hidden; z-index: 20; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pf-player-menu-item {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.85rem 1rem; background: none; border: none;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; color: #fff; transition: background 0.15s;
}
.pf-player-menu-item:hover { background: rgba(255,255,255,0.1); }
.pf-player-menu-item.danger { color: #ff6b6b; }
.pf-player-menu-item.danger:hover { background: rgba(255,107,107,0.15); }

/* ── PLAYER ACTIONS (bottom) ── */
.pf-player-actions {
  position: absolute; bottom: calc(2rem + env(safe-area-inset-bottom));
  left: 1rem; right: 1rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.pf-player-order-btn {
  width: 100%; padding: 1rem; background: var(--gradient-brand, linear-gradient(135deg,#FF3D2E,#FF7A3D)); color: #fff;
  border: none; border-radius: 99px; font-family: inherit; font-size: 0.95rem;
  font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: background 0.15s, transform 0.15s;
}
.pf-player-order-btn span[data-icon] { width: 18px; height: 18px; display: inline-flex; vertical-align: middle; margin-right: 6px; }
.pf-video-card-play[data-icon] svg { width: 100%; height: 100%; }
.pf-video-card-info span[data-icon] { width: 13px; height: 13px; display: inline-flex; vertical-align: -2px; margin-right: 3px; }
.pf-player-order-btn:hover { background: #e02a1c; transform: scale(1.02); }
.pf-player-info {
  color: rgba(255,255,255,0.85); font-size: 0.85rem;
  text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ================================================================
   LOADING + TOAST
   ================================================================ */
.pf-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 1rem; gap: 1rem; }
.pf-spinner { width: 36px; height: 36px; border: 3px solid #e5e5e5; border-top-color: var(--color-red, #FF3D2E); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pf-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(80px); background: #1a1a1a; color: #fff; padding: 0.75rem 1.5rem; border-radius: 99px; font-size: 0.875rem; font-weight: 700; z-index: 9999; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.25); transition: transform 0.3s; }
.pf-toast.show { transform: translateX(-50%) translateY(0); }

/* ================================================================
   GUEST VIEW
   ================================================================ */
.pf-guest-banner { background: linear-gradient(135deg, var(--color-red, #FF3D2E) 0%, #c0392b 100%); border-radius: 20px; padding: 2rem 1.5rem; text-align: center; margin: 1rem; }
.pf-guest-wrap { padding: 1rem; }
.pf-guest-icon { width: 48px; height: 48px; margin: 0 auto 0.75rem; color: #fff; }
.pf-guest-icon svg { width: 100%; height: 100%; }
.pf-guest-title { font-family: var(--font-display, sans-serif); font-size: 1.5rem; color: #fff; margin-bottom: 0.5rem; letter-spacing: 0.5px; }
.pf-guest-text { font-size: 0.88rem; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 1.25rem; }
.pf-guest-btn { background: #fff; color: var(--color-red, #FF3D2E); border: none; border-radius: 99px; padding: 0.85rem 2rem; font-family: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.2); transition: transform 0.15s; }
.pf-guest-btn:hover { transform: scale(1.03); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
/* Desktop: sidebar visible, tabs ocultos */
@media (min-width: 769px) {
  .pf-navbar { grid-template-columns: 1fr auto 1fr; display: grid; }
  .pf-navbar-home { display: inline-flex; justify-self: start; }
  .pf-navbar-spacer { display: none; }
  .pf-navbar-title { grid-column: 2; }
  .pf-navbar-actions { grid-column: 3; justify-self: end; }
  .pf-tabs { display: none; }
  .pf-video-grid { grid-template-columns: repeat(4, 1fr); }
  .pf-panel { padding: 1.5rem; }
  .pf-upload-modal { border-radius: 20px; margin: auto; transform: scale(0.95); }
  .pf-upload-overlay { align-items: center; }
  .pf-upload-overlay.open .pf-upload-modal { transform: scale(1); }
}

/* Mobile: sidebar oculto, tabs visibles */
@media (max-width: 768px) {
  .pf-sidebar { display: none; }
  .pf-layout { display: block; }
  .pf-main { min-height: 100vh; min-height: 100dvh; }
  .pf-video-grid { grid-template-columns: repeat(3, 1fr); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .pf-header { padding: 1.5rem 1rem 1.25rem; }
  .pf-avatar { width: 68px; height: 68px; font-size: 1.5rem; }
  .pf-display-name { font-size: 1.1rem; }
  .pf-upload-form-row { grid-template-columns: 1fr; }
}

/* ================================================================
   MODAL OVERLAY UNIVERSAL (editar perfil, direcciones, etc.)
   ================================================================ */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.profile-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.profile-modal {
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.profile-modal-overlay.open .profile-modal {
  transform: translateY(0);
}
.pf-modal-handle { width: 40px; height: 4px; background: #e0e0e0; border-radius: 99px; margin: 12px auto 1.25rem; }
.pf-modal-title { font-family: var(--font-display, sans-serif); font-size: 1.3rem; color: #1a1a1a; padding: 0 1.5rem; margin-bottom: 1.25rem; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.pf-modal-title span[data-icon] { width: 18px; height: 18px; display: inline-flex; flex-shrink: 0; }
.pf-modal-form { padding: 0 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.pf-modal-label { font-size: 0.85rem; font-weight: 700; color: #1a1a1a; display: block; margin-bottom: 0.4rem; }
.pf-input--disabled { opacity: 0.5; cursor: not-allowed; }
.pf-modal-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.pf-modal-btn { min-height: 44px; padding: 0.85rem 1.25rem; border: 0; border-radius: 99px; font-family: inherit; font-size: 0.9rem; line-height: 1; font-weight: 600; cursor: pointer; }
.pf-modal-btn--secondary { flex: 0 0 auto; background: #f0f0f0; color: #1a1a1a; }
.pf-modal-btn--primary { flex: 1; background: var(--color-red, #FF3D2E); color: #fff; font-weight: 700; }
.pf-modal-btn:disabled { opacity: 0.6; cursor: wait; }
.pf-address-label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pf-address-label-btn { min-height: 44px; padding: 0.6rem; border: 2px solid #e5e5e5; border-radius: 12px; background: #fafafa; color: #888; font-family: inherit; font-size: 0.82rem; line-height: 1; font-weight: 700; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pf-address-label-btn.is-selected { border-color: #FF3D2E; color: #FF3D2E; background: rgba(255,61,46,0.06); }
.pf-address-label-btn span[data-icon] { width: 16px; height: 16px; display: flex; flex-shrink: 0; }
.pf-modal-toggle-row { min-height: 44px; display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; font-weight: 600; color: #1a1a1a; }
.pf-loading-label { color: #888; font-size: 0.85rem; }
.auth-modal-close, .auth-modal-tab, .auth-forgot-link, .auth-submit-btn, .auth-google-btn { min-height: 44px; }
.auth-modal-close { width: 44px; height: 44px; }
.auth-pass-toggle { width: 44px; height: 44px; right: 2px; display: flex; align-items: center; justify-content: center; }
.auth-pass-toggle span[data-icon] { width: 20px; height: 20px; display: flex; }
.auth-modal-logo-mark span[data-icon] { width: 22px; height: 22px; display: flex; color: #fff; }
.auth-link { min-height: 44px; display: inline-flex; align-items: center; }
.pf-navbar-btn:focus-visible, .pf-name-edit:focus-visible, .pf-tab:focus-visible,
.pf-sidebar-item:focus-visible, .pf-video-card:focus-visible, .pf-fav-btn:focus-visible,
.pf-addr-btn:focus-visible, .pf-add-addr-btn:focus-visible, .pf-payment-opt:focus-visible,
.pf-settings-item:focus-visible, .pf-modal-btn:focus-visible, .pf-address-label-btn:focus-visible {
  outline: 3px solid rgba(255,61,46,0.35); outline-offset: 2px;
}
@media (min-width: 769px) {
  .profile-modal-overlay { align-items: center; }
  .profile-modal { border-radius: 20px; transform: scale(0.95); opacity: 0; transition: transform 0.3s, opacity 0.3s; }
  .profile-modal-overlay.open .profile-modal { transform: scale(1); opacity: 1; }
}
