:root {
  /* Default Admin Theme: STRICTLY MINIMAL B/W */
  --bg-primary: #fdfdfd;
  --bg-secondary: #ffffff;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  
  --primary-color: #000000;
  --primary-hover: #333333;
  --primary-glow: rgba(0, 0, 0, 0.05); /* Minimal glow/shadow */
  
  --accent-color: #222222;
  --danger: #dc2626;
  
  --glass-bg: rgba(255, 255, 255, 1);
  --glass-border: rgba(0, 0, 0, 0.08); /* crisp subtle border */
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03); /* minimal shadow */
  
  --font-family: 'Outfit', sans-serif;
  --transition: 0.2s ease;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px; /* reduced roundness for admin */
  --radius-full: 9999px;

  /* Admin Card Variables */
  --card-bg: var(--bg-secondary);
  --card-radius: var(--radius-lg);
  --card-shadow: none;
  --card-border: 1px solid rgba(0,0,0,0.1);
  --card-padding: 1.5rem;
  --price-color: var(--primary-color);
}

/* ==================== THEMES ==================== */

/* Theme: PedidosYa (Food) */
.theme-pedidosya {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --primary-color: #ea044e; /* PedidosYa Red */
  --primary-glow: rgba(234, 4, 78, 0.15);
  --text-primary: #333333;
  --text-secondary: #666666;
  --card-radius: 16px;
  --card-shadow: 0 4px 15px rgba(0,0,0,0.05);
  --card-border: none;
  --price-color: #ea044e;
  /* Specific Friendly Font for food */
  font-family: 'Nunito', sans-serif;
}

/* Theme: Zara/Walmart (Catalog) */
.theme-zara {
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --primary-color: #000000;
  --primary-glow: rgba(0, 0, 0, 0.05);
  --text-primary: #000000;
  --text-secondary: #555555;
  --card-radius: 0px;
  --card-shadow: none;
  --card-border: 1px solid #eeeeee;
  --price-color: #000000;
  /* Very clean, elegant, slightly taller font for fashion/inventory */
  font-family: 'Jost', sans-serif;
}

/* Base override helper */
.theme-pedidosya *, .theme-zara * {
  font-family: inherit;
}

/* Theme specific overrides for public catalog */
.theme-zara .public-hero {
  background: #ffffff !important;
  border-bottom: 1px solid #eeeeee;
  border-radius: 0;
  padding: 4rem 1rem 3rem 1rem;
}
.theme-zara .card:hover { transform: none; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.theme-zara .card-img-top { border-radius: 0; height: 280px; }
.theme-zara .price-tag {
  background: transparent;
  padding: 0; margin-top: 0.5rem;
  font-weight: 600; font-size: 1.1rem;
}

.theme-pedidosya .public-hero {
  background: linear-gradient(135deg, #ea044e, #ff3366) !important;
  color: white !important;
  border-radius: 0 0 2rem 2rem;
}
.theme-pedidosya .public-hero h1, .theme-pedidosya .public-hero p { color: white !important; }
.theme-pedidosya .card-img-top { border-radius: 16px 16px 0 0; }
.theme-pedidosya .price-tag {
  color: #ea044e;
  background: rgba(234, 4, 78, 0.1);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
}
.theme-pedidosya .badge { background: #f0f0f0; color: #444; }

/* ==================== GLOBAL STYLES ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button { font-family: inherit; font-size: 1rem; }
button { cursor: pointer; border: none; background: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease forwards; }

.glass-panel {
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-cols-1-md-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (min-width: 768px) { .grid-cols-1-md-2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-cols-3 { grid-template-columns: 1fr; } }
.display-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }

/* Buttons Minimalist Approach */
.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);  /* More square, minimalist */
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.full-width { width: 100%; }

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: 1px solid rgba(0,0,0,0.15);
  transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-secondary:hover { background: rgba(0,0,0,0.03); }

.btn-whatsapp {
  background: #25D366; color: white; padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-secondary); border-radius: var(--radius-sm); width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,0.15); transition: var(--transition); font-size: 1.2rem;
}
.btn-icon:hover { background: rgba(0,0,0,0.03); }
.btn-icon-danger { color: var(--danger); border-color: rgba(220, 38, 38, 0.3); }
.btn-icon-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Inputs Minimalist */
.input-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.input-group label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon-wrapper input { padding-left: 2.5rem; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  padding: 0.75rem 1rem; border-radius: var(--radius-md); border: 1px solid rgba(0,0,0,0.15);
  background: var(--bg-secondary); color: var(--text-primary); outline: none; width: 100%; transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); }

/* File Input */
.file-input-wrapper {
  position: relative; border: 1px dashed rgba(0,0,0,0.25); border-radius: var(--radius-md);
  height: 200px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: hidden; background: #fafafa; width: 100%; transition: background var(--transition);
}
.file-input-wrapper:hover { background: #f0f0f0; }
.file-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.file-placeholder i { font-size: 2rem; color: var(--text-muted); }
#item-image-preview { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Layout specific */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; background: #fdfdfd; }
.auth-box { width: 100%; max-width: 420px; padding: 2.5rem 2rem; border-radius: var(--radius-lg); border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.03); }
.icon-circle { width: 64px; height: 64px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; color: var(--primary-color); font-size: 1.8rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }

.navbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.95); padding: 1rem 0; border-bottom: 1px solid rgba(0,0,0,0.08); }
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.nav-user { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; font-size: 0.9rem;}
.dashboard-content { padding: 2rem 1.5rem; }

/* Business Info */
#biz-logo-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(0,0,0,0.1); background: white; }
.btn-upload-logo { position: absolute; bottom: 0; right: 0; background: var(--primary-color); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid white; transition: var(--transition); }
.btn-upload-logo:hover { transform: scale(1.1); }
.biz-details input { font-size: 1.25rem; font-weight: 600; border: none; background: transparent; padding: 0; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.biz-details input:focus { border-bottom: 1px solid black; }

/* QR Code Section */
.qr-info h3 { margin-bottom: 0.3rem; font-size: 1.1rem;}
.qr-info p { color: var(--text-secondary); margin-bottom: 1.2rem; font-size: 0.85rem; }
.qr-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.qr-code-box { background: white; padding: 0.75rem; border-radius: var(--radius-md); border: 1px solid rgba(0,0,0,0.1); }
.qr-code-box img { display: block; border-radius: 2px; }

/* Tabs Header */
.tabs-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(0,0,0,0.08); padding-bottom: 1rem;}
.tabs-wrapper { display: inline-flex; gap: 1rem; }
.tab { padding: 0.5rem 0; font-weight: 500; color: var(--text-secondary); transition: var(--transition); border-bottom: 2px solid transparent; border-radius: 0; }
.tab.active { color: var(--text-primary); border-bottom: 2px solid var(--primary-color); }
.tab:hover:not(.active) { color: var(--text-primary); }

/* Dashboard Cards - Minimal B/W */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: rgba(0,0,0,0.3); }

.card-img-top {
  width: calc(100% + (var(--card-padding) * 2));
  margin: calc(var(--card-padding) * -1) calc(var(--card-padding) * -1) 1rem calc(var(--card-padding) * -1);
  height: 200px;
  object-fit: cover;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  display: block;
}

.public-hero .card-img-top { height: 200px; }

.card-img-placeholder {
  width: calc(100% + (var(--card-padding) * 2));
  margin: calc(var(--card-padding) * -1) calc(var(--card-padding) * -1) 1.25rem calc(var(--card-padding) * -1);
  height: 200px;
  background: #f7f7f7;
  display: flex; align-items: center; justify-content: center;
  color: #dddddd; font-size: 3rem;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card h3 { font-size: 1.1rem; color: var(--text-primary); font-weight: 600; margin-bottom: 0.5rem;}
.price-tag { font-size: 1.15rem; font-weight: 600; color: var(--price-color); }

.badge {
  display: inline-block; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm);
  font-size: 0.7rem; font-weight: 600; background: #f0f0f0; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}

.card-desc {
  color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-code { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; }

.card-actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,0.08); }

.empty-state { text-align: center; padding: 4rem 2rem; background: #fafafa; border-radius: var(--radius-lg); border: 1px dashed rgba(0,0,0,0.15); }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 1.5rem; background: #f0f0f0; color: var(--text-muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-content { background: var(--bg-secondary); border-radius: var(--radius-lg); width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 15px 35px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.1); }
.modal-header { padding: 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg-secondary); z-index: 10; }
.modal-header h2 { font-size: 1.25rem; font-weight: 600;}
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; gap: 1rem; margin-top: 2rem; }

/* Public Screen Specifics */
.public-hero {
  text-align: center;
  padding: 4rem 1rem 5rem 1rem;
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
.hero-container .logo-container img {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(0,0,0,0.1); margin-bottom: 1rem; background: white;
}
.public-content { margin-top: -2rem; position: relative; z-index: 10; }

.search-bar { display: flex; align-items: center; padding: 0.5rem 1rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; border: 1px solid rgba(0,0,0,0.1);}
.search-bar input { border: none; background: transparent; padding: 0.5rem 0; box-shadow: none; border-radius: 0; }
.search-bar input:focus { border: none; box-shadow: none; }

/* ==================== EXACT PUBLIC CARD STYLES (REACT INSPIRATION) ==================== */

/* 1. THEME MINIMALISTA (El Menú) */
.theme-pedidosya {
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --primary-color: #111827; 
  --text-primary: #111827;
  --text-secondary: #6b7280;
}
.theme-pedidosya .public-hero {
  background: #ffffff !important;
  color: #111827 !important;
  border-bottom: 0;
  padding: 3rem 1rem 2rem 1rem;
  position: relative;
}
.theme-pedidosya .public-hero::after {
  content: ''; display: block; width: 32px; height: 1px; background: #d1d5db; margin: 1rem auto 0;
}
.theme-pedidosya .public-hero h1 { text-transform: uppercase; font-weight: 300; letter-spacing: 0.1em; }
.theme-pedidosya .public-hero p { display: none; }
.theme-pedidosya .hero-container .logo-container { display: none; }

.theme-pedidosya .public-card-food {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}
.theme-pedidosya .grid-cols-2 { grid-template-columns: 1fr; gap: 1.5rem; max-width: 700px; margin: 0 auto; }
.theme-pedidosya .menu-category-header {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #6b7280;
  text-transform: uppercase;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  width: 100%;
}
.theme-pedidosya .menu-category-header:first-child { margin-top: 0; }
.theme-pedidosya .public-card-food:hover { transform: none; box-shadow: none; }
.theme-pedidosya .minimalista-img-wrap {
  width: 90px; height: 90px; border-radius: 14px; overflow: hidden; background: #f3f4f6; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.05);
}
.theme-pedidosya .minimalista-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.theme-pedidosya .minimalista-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.theme-pedidosya .minimalista-header { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.3rem; width: 100%; }
.theme-pedidosya .minimalista-header h3 { font-size: 1.1rem; font-weight: 600; margin: 0; white-space: nowrap; color: #111827; }
.theme-pedidosya .dots-spacer { flex-grow: 1; border-bottom: 1px dotted #cbd5e1; position: relative; top: -4px; opacity: 0.7; }
.theme-pedidosya .price-tag { font-size: 1.05rem; font-weight: 700; color: #111827; background: transparent; padding: 0; white-space: nowrap; }
.theme-pedidosya .desc { font-size: 0.85rem; color: #9ca3af; font-weight: 400; padding-right: 1rem; margin: 0; }
.theme-pedidosya .mini-wa-btn { color: #25D366; font-size: 1.4rem; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; transform: translateY(2px); margin-left: 0.35rem; }
.theme-pedidosya .mini-wa-btn:hover { color: #16a34a; transform: scale(1.15) translateY(2px); }

/* 2. THEME TIENDITA (Catálogo Tienda - Estilo App Móvil) */
.theme-zara {
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --primary-color: #0d9488; /* teal-600 */
  --price-color: #0d9488;
}

/* Header pegajoso estilo app */
.theme-zara .public-hero {
  background: #ffffff !important;
  color: #111827 !important;
  padding: 0.75rem 1rem;
  border-bottom: none;
  text-align: left;
  position: sticky;
  top: 0; z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.theme-zara .hero-container {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.theme-zara .hero-container .logo-container { order: -1; }
.theme-zara .hero-container .logo-container img { width: 36px; height: 36px; margin: 0; border: none; border-radius: 8px; }
.theme-zara .public-hero h1 { font-size: 1.1rem; font-weight: 700; margin: 0; letter-spacing: -0.3px; flex: 1; text-align: center; }
.theme-zara .public-hero p { display: none; }

/* Barra de búsqueda limpia */
.theme-zara .search-bar { border: none; background: transparent; padding: 0.25rem 0; box-shadow: none; margin-bottom: 0.5rem; }
.theme-zara .public-content { margin-top: 0; padding: 1rem; }

/* Cuadrícula SIEMPRE 2 columnas en móvil */
.theme-zara .grid-cols-2 { 
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Encabezados de categoría para productos */
.theme-zara .menu-category-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: none;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  width: 100%;
  grid-column: 1 / -1;
}
.theme-zara .menu-category-header:first-child { margin-top: 0; }

/* Tarjetas de producto estilo app */
.theme-zara .public-card-product {
  background: #ffffff;
  border: none;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.theme-zara .public-card-product:active {
  transform: scale(0.97);
}

/* Imagen cuadrada con esquinas */
.theme-zara .product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  position: relative;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}
.theme-zara .product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Botón flotante WhatsApp estilo verde */
.theme-zara .floating-wa {
  position: absolute; bottom: 8px; right: 8px;
  background: #25D366;
  color: #ffffff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
  transition: 0.2s;
  font-size: 1.2rem;
  text-decoration: none;
}
.theme-zara .floating-wa:hover { background: #16a34a; transform: scale(1.08); }

/* Información del producto */
.theme-zara .product-info { 
  padding: 0.6rem 0.75rem 0.75rem; 
  display: flex; flex-direction: column; flex: 1; 
}
.theme-zara .product-info h3 { 
  font-size: 0.85rem; font-weight: 600; color: #111827; 
  margin-bottom: 0.15rem; line-height: 1.3; 
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; 
}
.theme-zara .product-desc { 
  font-size: 0.7rem; color: #9ca3af; 
  margin-bottom: 0.4rem; 
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; 
}
.theme-zara .product-price-row { margin-top: auto; }
.theme-zara .price-tag { 
  font-size: 0.95rem; font-weight: 700; color: #0d9488; 
  background: transparent; padding: 0;
}

/* Placeholder si no hay imagen */
.theme-zara .product-placeholder {
  width: 100%; height: 100%; 
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #d1d5db; font-size: 2.5rem;
}

/* Desktop: limitar ancho y centrar */
@media (min-width: 600px) {
  .theme-zara .grid-cols-2 { max-width: 440px; }
}
