/* ================================================
   VARIABLES DE IDENTIDAD VISUAL - SMASH BURGER
   ================================================ */
:root {
  --color-primary: #5C1A1A;
  --color-primary-dark: #3B0F0F;
  --color-primary-light: #7A2525;
  --color-gold: #D4A017;
  --color-gold-light: #FEF3CD;
  --color-gold-dark: #7A5C00;
  --color-bg-page: #F2EDE6;
  --color-bg-card: #FFFDF9;
  --color-bg-input: #F5EFE6;
  --color-border: #E8DCCC;
  --color-border-input: #E0D0BC;
  --color-text-main: #3B0F0F;
  --color-text-secondary: #9C7B5E;
  --color-text-muted: #BFA080;
  --color-cream: #F2EDE6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--color-text-main);
  background: var(--color-bg-page);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================================
   HEADER Y NAVEGACIÓN
   ================================================ */
header {
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(92, 26, 26, 0.3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: bold;
}

.logo img {
  height: 70px;
  width: auto;
}

.nav-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin-left: 1rem;
  margin-right: 1rem;
  min-height: 70px;
}

.hamburger {
  display: block;
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.nav-list {
  list-style: none;
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  background: var(--color-primary-dark);
  margin: 0;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.nav-list.active {
  display: flex;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-list li {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-list a {
  color: #D4B896;
  padding: 2rem 1.5rem;
  text-decoration: none;
  display: block;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--color-gold);
  transition: width 0.3s ease;
  z-index: -1;
}

.nav-list a:hover::before {
  width: 100%;
}

.nav-list a:hover {
  color: var(--color-primary-dark);
  padding-left: 2.5rem;
  transform: translateX(5px);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
  }

  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
  }
}

@media (min-width: 768px) {
  .nav-mobile {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 70px;
    align-items: center;
  }

  .hamburger {
    display: none;
  }

  .nav-list {
    position: static !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: auto !important;
    flex-direction: row !important;
    display: flex !important;
    animation: none !important;
  }

  .nav-list li {
    border-bottom: none !important;
  }

  .nav-list a {
    color: #D4B896 !important;
    padding: 10px 18px !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    border-radius: 25px;
    margin: 0 3px;
    position: relative;
    overflow: visible;
    min-width: auto;
  }

  .nav-list a::before {
    border-radius: 25px;
    height: 100%;
    top: 0;
    left: 0;
  }

  .nav-list a:hover {
    color: var(--color-primary-dark) !important;
    padding-left: 18px !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.4);
  }

  .nav-link.active {
    background: var(--color-gold) !important;
    color: var(--color-primary-dark) !important;
    font-weight: 600 !important;
  }
}

/* ================================================
   LAYOUT GENERAL
   ================================================ */
main {
  margin-top: 80px;
  background: var(--color-bg-page);
}

.section {
  padding: 3rem 0;
  background: var(--color-bg-page);
  animation: fadeIn 0.6s ease-out;
  margin: 0;
}

.section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-text-main);
}

/* ================================================
   HERO
   ================================================ */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../img/banner.webp') center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-content {
  background: rgba(59, 15, 15, 0.55);
  backdrop-filter: blur(10px);
  padding: 3rem 2rem;
  border-radius: 20px;
  max-width: 700px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 160, 23, 0.2);
  animation: fadeInUp 1s ease-out;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  font-family: 'Poppins', sans-serif;
}

.hero h2 {
  font-size: clamp(1.3rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
  opacity: 0.95;
  font-weight: 400;
}

.hero p {
  font-size: clamp(1rem, 3vw, 1.3rem);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.btn-hero {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-primary-dark);
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(212, 160, 23, 0.4);
}

.btn-hero:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(212, 160, 23, 0.6);
  background: #e8b520;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .hero-content {
    margin: 0 1rem;
    padding: 2rem 1.5rem;
  }

  .btn-hero {
    padding: 12px 30px;
  }
}

/* ================================================
   FORMULARIOS Y CARDS
   ================================================ */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 0.5px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(92, 26, 26, 0.06);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text-main);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--color-border-input);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: var(--color-bg-input);
  color: var(--color-text-main);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  background: #FFFDF9;
}

.error {
  color: #B91C1C;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error.show {
  display: block;
}

/* ================================================
   BOTONES
   ================================================ */
.btn {
  background: var(--color-primary);
  color: var(--color-cream);
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(92, 26, 26, 0.25);
}

.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.form-actions .btn {
  width: auto;
  flex: 1;
  min-width: 180px;
}

.btn-cancel {
  background: #9C7B5E;
  color: white;
}

.btn-cancel:hover {
  background: #7A5C3E;
  transform: translateY(-2px);
}

.edit-mode {
  background: var(--color-gold-light);
  color: var(--color-gold-dark);
  border: 1px solid #e8c84a;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: row;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ================================================
   TABLAS
   ================================================ */
.table-container {
  margin-top: 2rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(92, 26, 26, 0.08);
  border: 0.5px solid var(--color-border);
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-primary-dark);
  color: var(--color-cream);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

tr:hover {
  background: var(--color-bg-input);
}

/* ================================================
   FOOTER
   ================================================ */
footer {
  background: var(--color-primary-dark);
  color: var(--color-cream);
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* ================================================
   GRILLA DE PRODUCTOS Y CARDS
   ================================================ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.producto-card {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(92, 26, 26, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.producto-card input {
  margin: 0.75rem 0;
}

.producto-card h3 {
  font-size: 13px;
  margin: 0;
  color: var(--color-text-main);
  font-weight: 700;
}

.producto-card p {
  font-size: 13px;
  margin: 0;
  color: var(--color-text-secondary);
}

.producto-card .btn {
  width: 100%;
  margin-top: auto;
}

@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .producto-card {
    padding: 10px 12px;
  }

  .producto-card input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    margin: 4px 0;
  }

  .producto-card .btn {
    padding: 8px !important;
    font-size: 12px !important;
  }
}

/* ================================================
   PEDIDO Y CARRITO
   ================================================ */
.pedido-form {
  margin-top: 2rem;
}

.carrito-box {
  margin-top: 2rem;
  background: var(--color-bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 0.5px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(92, 26, 26, 0.06);
}

.carrito-box ul {
  list-style: none;
  margin: 1rem 0;
}

.carrito-box li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.carrito-box li button {
  width: auto;
  padding: 8px 12px;
}

.stock-verde {
  color: #27500A;
  font-weight: 600;
}

.stock-rojo {
  color: #B91C1C;
  font-weight: 600;
}

.sin-stock {
  opacity: 0.6;
}

.btn-confirmar {
  margin-top: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.checkbox-group input {
  width: auto;
}

/* ================================================
   LOGIN
   ================================================ */
body.login-body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(212, 160, 23, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 1s ease-out;
}

.login-container h1 {
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
  color: var(--color-cream);
  text-align: center;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #D4B896;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(212, 160, 23, 0.3);
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--color-gold);
}

.login-form button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: var(--color-gold);
  cursor: pointer;
  transition: background 0.2s;
}

.login-form button:hover {
  background: #e8b520;
}

.error-message {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: #B91C1C;
  color: white;
  text-align: center;
  display: none;
}

.error-message.active {
  display: block;
}

/* ================================================
   IMPRESIÓN
   ================================================ */
.print-only {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #informeCierre,
  #informeCierre * {
    visibility: visible;
  }

  #informeCierre {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
    background: white;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #000;
  }

  .report-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
  }

  .report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
  }

  .report-table th,
  .report-table td {
    border: 1px solid #333;
    padding: 10px;
    text-align: left;
  }

  .report-table th {
    background-color: #f4f4f4;
  }

  .report-footer {
    margin-top: 30px;
    border-top: 1px solid #ccc;
    padding-top: 15px;
  }

  .signature-line {
    margin-top: 40px;
    font-style: italic;
  }

  header,
  nav,
  footer,
  form,
  .btn,
  select,
  textarea,
  .no-print {
    display: none !important;
  }
}

/* ================================================
   BOTONES COMPACTOS PARA TABLAS
   ================================================ */
.btn-sm {
  padding: 4px 10px !important;
  font-size: 0.75rem !important;
  width: auto !important;
  min-width: auto !important;
  line-height: 1.3;
  border-radius: 5px;
  white-space: nowrap;
}

.btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  background: #9C7B5E !important;
}

/* ================================================
   BOTONES DE ACCIÓN ESPECÍFICOS
   ================================================ */
.btn-agregar {
  background: #EAF3DE !important;
  border: 0.5px solid #3B6D11 !important;
  color: #27500A !important;
}

.btn-agregar:hover {
  background: #C0DD97 !important;
  transform: translateY(-1px);
}

.btn-quitar {
  background: #FDECEA !important;
  border: 0.5px solid #B91C1C !important;
  color: #7F1D1D !important;
}

.btn-quitar:hover {
  background: #FBBCB8 !important;
}

.btn-edit {
  background: var(--color-gold-light) !important;
  border: 0.5px solid var(--color-gold) !important;
  color: var(--color-gold-dark) !important;
}

.btn-edit:hover {
  background: #f9e49a !important;
}

.btn-delete {
  background: #FDECEA !important;
  border: 0.5px solid #B91C1C !important;
  color: #7F1D1D !important;
}

.btn-delete:hover {
  background: #FBBCB8 !important;
}

/* ================================================
   COLORES DE ESTADO EN HISTORIAL - DESKTOP
   ================================================ */
tr.estado-pendiente {
  background-color: rgba(212, 160, 23, 0.08) !important;
}

tr.estado-listo {
  background-color: rgba(40, 167, 69, 0.10) !important;
}

tr.estado-cancelado {
  background-color: rgba(156, 123, 94, 0.08) !important;
}

tr.estado-entregado {
  background-color: rgba(52, 152, 219, 0.06) !important;
}

tr.estado-preparacion {
  background-color: rgba(92, 26, 26, 0.05) !important;
}

/* ================================================
   TARJETAS DE HISTORIAL EN MÓVIL
   ================================================ */
.historial-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.historial-card {
  background: var(--color-bg-card);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(92, 26, 26, 0.08);
  border-left: 4px solid var(--color-border);
}

.historial-card.estado-pendiente {
  border-left-color: #D4A017;
  background-color: rgba(212, 160, 23, 0.06);
}

.historial-card.estado-listo {
  border-left-color: #3B6D11;
  background-color: rgba(40, 167, 69, 0.06);
}

.historial-card.estado-cancelado {
  border-left-color: #9C7B5E;
  background-color: rgba(156, 123, 94, 0.06);
}

.historial-card.estado-entregado {
  border-left-color: #185FA5;
  background-color: rgba(52, 152, 219, 0.05);
}

.historial-card.estado-preparacion {
  border-left-color: var(--color-primary);
  background-color: rgba(92, 26, 26, 0.04);
}

.historial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.historial-card-numero {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-main);
}

.historial-card-estado {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(92, 26, 26, 0.08);
  color: var(--color-primary);
}

.historial-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.historial-card-body span strong {
  color: var(--color-text-main);
}

.historial-card-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.75rem;
}

.historial-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.historial-card-actions .btn {
  flex: 1;
  min-width: 70px;
  padding: 8px 10px !important;
  font-size: 0.8rem !important;
  text-align: center;
}

/* ================================================
   RESPONSIVE MÓVIL - PEDIDOS E HISTORIAL
   ================================================ */
@media (max-width: 768px) {

  .table-historial-desktop {
    display: none;
  }

  .historial-cards {
    display: flex;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .producto-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 10px 12px;
  }

  .producto-card h3 {
    font-size: 13px;
    margin: 0;
  }

  .producto-card input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    margin: 4px 0;
  }

  .producto-card .btn {
    width: 100%;
    padding: 8px !important;
    font-size: 12px !important;
  }

  .carrito-box li {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 0.75rem 0;
  }

  .carrito-box li button {
    width: 100%;
  }

  #btnConfirmarPedido {
    padding: 16px !important;
    font-size: 1.1rem !important;
    margin-top: 1rem;
  }

  #resumenCierre p {
    font-size: 1rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
  }
}

@media (min-width: 769px) {
  .table-historial-desktop {
    display: block;
  }

  .historial-cards {
    display: none !important;
  }
}

/* ================================================
   BOTÓN FLOTANTE CARRITO - SOLO MÓVIL
   ================================================ */
.btn-flotante-carrito {
  display: none;
}

@media (max-width: 768px) {
  .btn-flotante-carrito {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-gold);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(92, 26, 26, 0.3);
    transition: transform 0.2s ease;
  }

  .btn-flotante-carrito:active {
    transform: scale(0.93);
  }

  .btn-flotante-carrito i {
    font-size: 22px;
    color: var(--color-cream);
  }

  .carrito-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--color-gold);
    color: var(--color-primary-dark);
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .carrito-badge.oculto {
    display: none;
  }
}

/* ================================================
   FIX LÍNEAS BLANCAS ENTRE SECCIONES
   ================================================ */
.hero {
  margin-top: 0;
  display: flex;
}

body {
  background: var(--color-primary-dark);
}

.hero + * {
  margin-top: 0;
}

footer {
  margin-top: 0;
}