/* ==============================================================
   NAVIGATION.CSS — TuEstilo
   Sidebar de Navegación, Header, Overlay, Botón Volver, Nav Items
   Extraído de sidebar.css (Fase 2.5 — Refinamiento CSS)
   ============================================================== */

/* ==============================================================
   SIDEBAR.CSS — TuEstilo
   Sidebar, Navegación, Modales, Booking, Slots, Calendar, Reviews
   Extraído de styles.css (Fase 2 — Refactorización CSS)
   ============================================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* Panel del menú lateral: por encima del overlay, deslizable y dismissible */
.sidebar-drawer {
  z-index: 1001;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
  .sidebar-drawer {
    width: 80%;
    max-width: 300px;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  }

  .sidebar-panel.mobile-sidebar-open {
    transform: translateX(0);
  }
}

.sidebar-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
}

/* Zona 1: Cabecera de Perfil (gradiente azul) */
.sidebar-profile-header {
  position: relative;
  background: linear-gradient(135deg, #1e40af 0%, var(--color-primary-light) 50%, #0ea5e9 100%);
  padding: 1.25rem 1rem 1.5rem;
  flex-shrink: 0;
}

.sidebar-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  transition: background 0.2s;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.sidebar-profile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2), 0 4px 15px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-name {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-surface);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-user-stars {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.35rem;
}

.sidebar-user-stars .text-amber-500 {
  color: #fcd34d !important;
}

.sidebar-user-stars .text-gray-500 {
  color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar-mi-perfil {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: background 0.2s, color 0.2s;
}

.sidebar-mi-perfil:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--color-surface);
}

/* Zona 2: Tarjeta de Tienda Activa + lista */
.sidebar-store-zone {
  padding: 0.85rem 1rem;
  flex-shrink: 0;
  border-bottom: none;
}

.sidebar-stores-list-wrap {
  background: #fff;
  border-radius: 1rem;
  padding: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-active-store-card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-active-store-card .store-card-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.sidebar-active-store-card .store-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-active-store-card .store-card-info {
  min-width: 0;
}

.sidebar-active-store-card .store-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-active-store-card .store-card-addr {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-placeholder);
  margin: 0 0 0.5rem 0;
  padding: 0 2px;
}

.sidebar-stores-list-wrap .sidebar-scroll {
  max-height: 140px;
}

/* Tarjetas de tienda en la lista (compactas, sin bordes tipo botón) */
#stores-list .sidebar-store-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

#stores-list .sidebar-store-item:hover {
  background: var(--color-border-light);
}

#stores-list .sidebar-store-item.sidebar-store-item--active {
  background: var(--color-primary-bg-light);
}

#stores-list .sidebar-store-item .store-item-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-2xs);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

#stores-list .sidebar-store-item.sidebar-store-item--active .store-item-logo {
  background: var(--color-primary);
  color: var(--color-surface);
}

#stores-list .sidebar-store-item .store-item-info {
  min-width: 0;
}

#stores-list .sidebar-store-item .store-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#stores-list .sidebar-store-item .store-item-addr {
  font-size: 0.6875rem;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zona 3: Navegación (lista limpia, sin bordes) */
.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 10px 14px;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  cursor: pointer;
  border-radius: 0.75rem;
  margin: 4px 8px;
}

.sidebar-nav-item:hover,
.sidebar-nav-item:active {
  background: #f8fafc;
  transform: translateX(2px);
}

.sidebar-nav-item:active .sidebar-nav-icon {
  transform: translateX(5px);
}

.sidebar-nav-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  border-radius: 0.75rem;
  padding: 7px;
}

/* Individual Premium Colors (Dribbble/iOS Style) */
#admin-dashboard-nav-item .sidebar-nav-icon {
  background: #e0e7ff; /* Indigo-100 */
  color: #4338ca; /* Indigo-700 */
}

#reservas-admin-container .sidebar-nav-icon {
  background: #dbeafe; /* Blue-100 */
  color: #1d4ed8; /* Blue-700 */
}

#estadisticas-nav-item .sidebar-nav-icon {
  background: #ecfdf5; /* Emerald-50 */
  color: #059669; /* Emerald-600 */
}

#staff-panel-container .sidebar-nav-icon {
  background: #fce7f3; /* Pink-100 */
  color: #be185d; /* Pink-700 */
}

.sidebar-nav-text {
  flex: 1;
  font-weight: 600;
  color: #1f2937;
  font-size: 0.875rem;
}

.sidebar-nav-chevron {
  color: var(--color-text-placeholder);
  font-size: 1.25rem;
  line-height: 1;
}

.sidebar-nav-item--admin .sidebar-nav-icon {
  color: #d97706; /* Amber-600 */
  background: #fef3c7; /* Amber-100 */
}

.sidebar-nav-item--admin:hover {
  background: #fffbeb;
}

.sidebar-nav-item--primary .sidebar-nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 0.75rem;
  background: #f3f4f6; /* Gray-100 */
  color: #374151; /* Gray-700 */
  font-size: 1rem;
  font-weight: 700;
}

/* Botón Volver al catálogo en el header (solo escritorio; móvil intacto) */
.header-back-to-catalog-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.header-back-to-catalog-btn:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.header-back-to-catalog-btn:active {
  background: var(--color-border);
}

.header-back-to-catalog-text {
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header-back-to-catalog-btn:not(.hidden) {
    display: inline-flex;
  }
}

/* Zona 4: Footer (Cerrar Sesión + Descargar) */
.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem 1.25rem;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Botón Descargar App */
.sidebar-install-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.sidebar-install-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-install-btn:hover::before {
  opacity: 1;
}

.sidebar-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.sidebar-install-btn:active {
  transform: translateY(0);
}

.sidebar-install-btn svg {
  animation: sidebar-install-bounce 2s ease-in-out infinite;
}

@keyframes sidebar-install-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* Ocultar cuando ya está instalada */
body.pwa-installed .sidebar-install-btn {
  display: none;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-text-light);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sidebar-logout-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ---------- PWA Install Modal ---------- */
.pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  animation: pwa-fade-in 0.2s ease;
}

@keyframes pwa-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-install-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: pwa-slide-up 0.3s ease;
}

@keyframes pwa-slide-up {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pwa-install-header {
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 50%, #0ea5e9 100%);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.pwa-install-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pwa-icon-float 3s ease-in-out infinite;
}

@keyframes pwa-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.pwa-install-header h3 {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.pwa-install-header p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  margin: 0;
}

.pwa-install-body {
  padding: 1.5rem;
}

.pwa-install-features {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pwa-install-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #374151;
}

.pwa-install-features li .pwa-feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pwa-install-features li:nth-child(1) .pwa-feat-icon { background: #eff6ff; }
.pwa-install-features li:nth-child(2) .pwa-feat-icon { background: #f0fdf4; }
.pwa-install-features li:nth-child(3) .pwa-feat-icon { background: #fef3c7; }

.pwa-install-cta {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.pwa-install-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.pwa-install-cta:active {
  transform: translateY(0);
}

.pwa-install-dismiss {
  width: 100%;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: color 0.2s;
}

.pwa-install-dismiss:hover {
  color: #6b7280;
}

.pwa-install-already {
  text-align: center;
  padding: 0.5rem 1.5rem 1.5rem;
  color: #16a34a;
  font-weight: 600;
  font-size: 0.9rem;
}

