/* Fast Orden - Estilos principales */

/* Importar fuentes */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ==================================================
   VARIABLES CSS - Tema Fast Orden
   ================================================== */
:root {
  /* Colores Fast Orden */
  --fo-bg: #0a0a0a;
  --fo-surface: #141414;
  --fo-surface-2: #1f1f1f;
  --fo-primary: #f97316;       /* Naranja Fast Orden */
  --fo-accent: #facc15;          /* Amarillo dorado */
  --fo-text: #f5f5f5;
  --fo-text-muted: #9ca3af;
  --fo-border: #2a2a2a;
  --fo-success: #22c55e;
  --fo-danger: #ef4444;
  --fo-warning: #f59e0b;
  --fo-info: #3b82f6;

  /* Variables dinámicas del tenant (sobreescribibles) */
  --color-primary: #f97316;
  --color-accent: #facc15;

  /* Tipografía */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Bordes */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* ==================================================
   RESET Y BASE
   ================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--fo-bg);
  color: var(--fo-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==================================================
   TIPOGRAFÍA
   ================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.text-display {
  font-family: var(--font-display);
}

.text-body {
  font-family: var(--font-body);
}

/* ==================================================
   COLORES UTILITARIOS
   ================================================== */
.bg-fo {
  background-color: var(--fo-bg);
}

.bg-surface {
  background-color: var(--fo-surface);
}

.bg-surface-2 {
  background-color: var(--fo-surface-2);
}

.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--fo-text-muted);
}

.border-fo {
  border-color: var(--fo-border);
}

/* ==================================================
   COMPONENTES - BOTONES
   ================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #ea580c);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background-color: var(--fo-surface-2);
  color: var(--fo-text);
  border: 1px solid var(--fo-border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #2a2a2a;
  border-color: var(--color-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--fo-text);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: white;
}

.btn-ghost {
  background-color: transparent;
  color: var(--fo-text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--fo-text);
  background-color: var(--fo-surface-2);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ==================================================
   COMPONENTES - INPUTS
   ================================================== */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--radius-lg);
  color: var(--fo-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.form-input::placeholder {
  color: var(--fo-text-muted);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--fo-text);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

/* ==================================================
   COMPONENTES - CARDS
   ================================================== */
.card {
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--fo-border);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--fo-border);
}

/* ==================================================
   COMPONENTES - NAVBAR
   ================================================== */
.navbar {
  background-color: var(--fo-surface);
  border-bottom: 1px solid var(--fo-border);
  padding: var(--spacing-md) var(--spacing-xl);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--fo-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.navbar-brand span {
  color: var(--color-primary);
}

/* ==================================================
   COMPONENTES - SIDEBAR ADMIN
   ================================================== */
.sidebar {
  width: 260px;
  height: 100vh;
  background-color: var(--fo-surface);
  border-right: 1px solid var(--fo-border);
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  z-index: 90;
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--fo-border);
}

.sidebar-nav {
  padding: var(--spacing-md);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  color: var(--fo-text-muted);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  margin-bottom: var(--spacing-xs);
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: var(--fo-surface-2);
  color: var(--color-primary);
}

.sidebar-link i {
  width: 20px;
  height: 20px;
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  padding: var(--spacing-xl);
}

/* ==================================================
   UTILIDADES
   ================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.container-narrow {
  max-width: 600px;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================
   ANIMACIONES
   ================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-up {
  animation: slideInUp 0.4s ease;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==================================================
   SCROLLBAR PERSONALIZADA
   ================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--fo-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--fo-surface-2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fo-border);
}

/* ==================================================
   ESTILOS PARA PRODUCT CARDS (MENÚ)
   ================================================== */
.product-card {
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--color-primary);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--fo-surface-2);
}

.product-content {
  padding: var(--spacing-lg);
}

.product-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--fo-text);
  margin-bottom: var(--spacing-xs);
}

.product-description {
  color: var(--fo-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* ==================================================
   TABS PARA CATEGORÍAS
   ================================================== */
.tabs {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding-bottom: var(--spacing-sm);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex-shrink: 0;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--radius-full);
  color: var(--fo-text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  border-color: var(--color-primary);
  color: var(--fo-text);
}

.tab.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ==================================================
   CARRITO LATERAL
   ================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background-color: var(--fo-surface);
  border-left: 1px solid var(--fo-border);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--fo-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

.cart-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--fo-border);
}

/* ==================================================
   BADGE Y NOTIFICACIONES
   ================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--fo-warning);
  color: var(--fo-warning);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--fo-danger);
  color: var(--fo-danger);
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--fo-success);
  color: var(--fo-success);
}

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }

  .cart-sidebar {
    max-width: 100%;
  }
}

/* ==================================================
   LOADING SKELETON
   ================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--fo-surface) 25%,
    var(--fo-surface-2) 50%,
    var(--fo-surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
