@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --naranja: #E8521A;
  --naranja-oscuro: #C43D0D;
  --crema: #FDF6EC;
  --cafe: #2C1A0E;
  --cafe-medio: #5C3D2E;
  --dorado: #D4A017;
  --verde: #2D6A4F;
  --rojo: #C0392B;
  --gris: #F4F0EB;
  --blanco: #FFFFFF;
  --sombra: 0 4px 24px rgba(44,26,14,0.10);
  --sombra-fuerte: 0 8px 40px rgba(44,26,14,0.18);
  --radio: 16px;
  --radio-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--crema);
  color: var(--cafe);
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

a { text-decoration: none; color: inherit; }

/* ── NAVBAR ── */
nav {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  background: rgba(253,246,236,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(44,26,14,0.08);
  padding: 0 5%;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 900;
  color: var(--naranja);
  letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--cafe-medio);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--naranja); }

.nav-actions { display: flex; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--naranja); color: white; }
.btn-primary:hover { background: var(--naranja-oscuro); transform: translateY(-1px); box-shadow: var(--sombra); }
.btn-outline { background: transparent; color: var(--cafe); border: 1.5px solid rgba(44,26,14,0.2); }
.btn-outline:hover { border-color: var(--naranja); color: var(--naranja); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-verde { background: var(--verde); color: white; }
.btn-verde:hover { background: #1e4d38; transform: translateY(-1px); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 100px 5% 60px;
  background: var(--crema);
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; right: -100px; top: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,82,26,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content { max-width: 560px; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(232,82,26,0.1); color: var(--naranja);
  padding: 6px 14px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  line-height: 1.1; color: var(--cafe);
  margin-bottom: 20px;
}

.hero h1 span { color: var(--naranja); }

.hero p {
  font-size: 1.05rem; color: var(--cafe-medio);
  line-height: 1.7; margin-bottom: 36px;
}

.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-img {
  position: absolute; right: 5%; top: 50%;
  transform: translateY(-50%);
  width: 480px; height: 480px;
  background: rgba(232,82,26,0.06);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12rem;
}

/* ── SECCIONES ── */
section { padding: 80px 5%; }

.section-label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--naranja);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--cafe); margin-bottom: 48px;
}

/* ── PRODUCTOS GRID ── */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.producto-card {
  background: white; border-radius: var(--radio);
  overflow: hidden; box-shadow: var(--sombra);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.producto-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-fuerte); }

.producto-img {
  width: 100%; height: 200px; object-fit: cover;
  background: var(--gris);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
}

.producto-info { padding: 18px 20px; }

.producto-nombre {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--cafe); margin-bottom: 6px;
}

.producto-desc {
  font-size: 0.85rem; color: var(--cafe-medio);
  line-height: 1.5; margin-bottom: 14px;
}

.producto-footer {
  display: flex; align-items: center; justify-content: space-between;
}

.producto-precio {
  font-size: 1.2rem; font-weight: 700; color: var(--naranja);
}

.btn-add {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--naranja); color: white;
  border: none; font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-add:hover { background: var(--naranja-oscuro); transform: scale(1.1); }

/* ── CARRITO FLOTANTE ── */
.carrito-btn {
  position: fixed; bottom: 30px; right: 30px; z-index: 900;
  background: var(--naranja); color: white;
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,82,26,0.4);
  transition: all 0.2s; border: none;
}
.carrito-btn:hover { transform: scale(1.1); }

.carrito-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--cafe); color: white;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── MODAL CARRITO ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(44,26,14,0.5);
  display: none; align-items: flex-end; justify-content: flex-end;
}
.modal-overlay.active { display: flex; }

.carrito-panel {
  background: white; width: 420px; height: 100vh;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.carrito-header {
  padding: 24px; border-bottom: 1px solid var(--gris);
  display: flex; align-items: center; justify-content: space-between;
}

.carrito-header h2 { font-size: 1.3rem; }

.close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gris); border: none; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}

.carrito-items { flex: 1; overflow-y: auto; padding: 20px 24px; }

.carrito-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--gris);
}

.carrito-item-emoji { font-size: 2.5rem; }

.carrito-item-info { flex: 1; }
.carrito-item-nombre { font-weight: 600; font-size: 0.95rem; }
.carrito-item-precio { font-size: 0.85rem; color: var(--naranja); font-weight: 600; }

.qty-controls { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gris); border: none; cursor: pointer;
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.qty-num { font-weight: 600; min-width: 20px; text-align: center; }

.carrito-footer { padding: 20px 24px; border-top: 1px solid var(--gris); }

.carrito-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.carrito-total span:first-child { font-size: 0.95rem; color: var(--cafe-medio); }
.carrito-total span:last-child { font-size: 1.4rem; font-weight: 700; color: var(--cafe); }

/* ── CHECKOUT ── */
.checkout-container {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 400px; gap: 40px;
  padding: 100px 5% 60px;
}

.form-card {
  background: white; border-radius: var(--radio);
  padding: 32px; box-shadow: var(--sombra);
}

.form-card h2 { font-size: 1.5rem; margin-bottom: 28px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--cafe-medio); margin-bottom: 8px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid rgba(44,26,14,0.12);
  border-radius: var(--radio-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  color: var(--cafe); background: var(--crema);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--naranja);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.pago-metodos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

.pago-opcion {
  border: 2px solid rgba(44,26,14,0.12);
  border-radius: var(--radio-sm);
  padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all 0.2s; text-align: center;
}
.pago-opcion:hover { border-color: var(--naranja); }
.pago-opcion.activo { border-color: var(--naranja); background: rgba(232,82,26,0.05); }
.pago-opcion .icono { font-size: 2rem; }
.pago-opcion .nombre { font-size: 0.88rem; font-weight: 600; }

.resumen-card {
  background: white; border-radius: var(--radio);
  padding: 28px; box-shadow: var(--sombra);
  position: sticky; top: 90px; height: fit-content;
}

.resumen-card h3 { font-size: 1.2rem; margin-bottom: 20px; }

.resumen-item {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--gris);
  font-size: 0.9rem;
}
.resumen-item:last-of-type { border-bottom: none; }

.resumen-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 16px;
  border-top: 2px solid var(--cafe);
}
.resumen-total span:first-child { font-weight: 700; }
.resumen-total span:last-child { font-size: 1.5rem; font-weight: 700; color: var(--naranja); }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--cafe);
  padding: 20px;
}

.login-card {
  background: white; border-radius: 24px;
  padding: 48px 40px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo h1 { color: var(--naranja); font-size: 1.8rem; }
.login-logo p { color: var(--cafe-medio); font-size: 0.9rem; margin-top: 4px; }

.role-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 28px;
}

.role-tab {
  padding: 8px 4px; border-radius: 8px;
  background: var(--gris); border: 2px solid transparent;
  cursor: pointer; text-align: center; font-size: 0.72rem;
  font-weight: 600; color: var(--cafe-medio); transition: all 0.2s;
}
.role-tab .role-icon { font-size: 1.4rem; display: block; margin-bottom: 3px; }
.role-tab.activo { border-color: var(--naranja); background: rgba(232,82,26,0.07); color: var(--naranja); }

/* ── DASHBOARD ADMIN ── */
.dashboard {
  display: flex; min-height: 100vh;
}

.sidebar {
  width: 260px; background: var(--cafe);
  padding: 24px 0; flex-shrink: 0;
  display: flex; flex-direction: column;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; color: white; font-weight: 900;
}
.sidebar-logo span { color: var(--naranja); }

.sidebar-menu { padding: 20px 0; flex: 1; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; color: rgba(255,255,255,0.6);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-item:hover { color: white; background: rgba(255,255,255,0.05); }
.sidebar-item.activo { color: white; border-left-color: var(--naranja); background: rgba(232,82,26,0.1); }
.sidebar-item .icon { font-size: 1.1rem; width: 20px; }

.sidebar-role {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-size: 0.8rem;
}
.sidebar-role strong { color: white; display: block; margin-bottom: 2px; }

.main-content { flex: 1; background: var(--gris); overflow-y: auto; }

.main-header {
  background: white; padding: 20px 32px;
  border-bottom: 1px solid rgba(44,26,14,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.main-header h1 { font-size: 1.4rem; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; padding: 28px 32px 0;
}

.stat-card {
  background: white; border-radius: var(--radio);
  padding: 22px 24px; box-shadow: var(--sombra);
}
.stat-label { font-size: 0.8rem; color: var(--cafe-medio); font-weight: 500; margin-bottom: 8px; }
.stat-valor { font-size: 2rem; font-weight: 700; color: var(--cafe); }
.stat-sub { font-size: 0.78rem; color: var(--verde); margin-top: 4px; }

.pedidos-section { padding: 28px 32px; }
.pedidos-section h2 { font-size: 1.2rem; margin-bottom: 20px; }

.pedido-card {
  background: white; border-radius: var(--radio);
  padding: 20px 24px; margin-bottom: 14px;
  box-shadow: var(--sombra);
  display: flex; align-items: center; gap: 20px;
  transition: box-shadow 0.2s;
}
.pedido-card:hover { box-shadow: var(--sombra-fuerte); }

.pedido-num { font-size: 0.8rem; color: var(--cafe-medio); }
.pedido-nombre { font-weight: 700; font-size: 1rem; }
.pedido-items { font-size: 0.85rem; color: var(--cafe-medio); margin-top: 2px; }

.pedido-info { flex: 1; }
.pedido-monto { font-size: 1.1rem; font-weight: 700; color: var(--naranja); }
.pedido-pago { font-size: 0.78rem; color: var(--cafe-medio); }

.badge {
  padding: 5px 12px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-nuevo { background: rgba(232,82,26,0.1); color: var(--naranja); }
.badge-cocinando { background: rgba(212,160,23,0.15); color: #A07010; }
.badge-listo { background: rgba(45,106,79,0.1); color: var(--verde); }
.badge-camino { background: rgba(41,128,185,0.1); color: #2980B9; }
.badge-entregado { background: rgba(44,26,14,0.08); color: var(--cafe-medio); }
.badge-pendiente { background: rgba(41,128,185,0.15); color: #2980B9; }

.pedido-acciones { display: flex; gap: 8px; }

/* ── NOTIFICACION ── */
.notif {
  position: fixed; top: 80px; right: 20px; z-index: 3000;
  background: var(--cafe); color: white;
  padding: 14px 20px; border-radius: 12px;
  font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--sombra-fuerte);
  transform: translateX(120%); transition: transform 0.3s;
  max-width: 300px;
}
.notif.show { transform: translateX(0); }

/* ── FOOTER ── */
footer {
  background: var(--cafe); color: rgba(255,255,255,0.7);
  padding: 48px 5% 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-brand h3 { color: var(--naranja); font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; }
.footer-col h4 { color: white; font-size: 0.9rem; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 0.85rem; margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--naranja); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.82rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-img { display: none; }
  .checkout-container { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .sidebar { width: 200px; }
}

@media (max-width: 600px) {
  .carrito-panel { width: 100vw; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .role-tabs { grid-template-columns: repeat(2,1fr); }
  .dashboard { flex-direction: column; }
  .sidebar { width: 100%; height: auto; }
}
