/* =========================
   FastFood Express - style.css
   Reescrito completo
   ========================= */

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}

/* FUENTES */
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f5f5f5;
  color: #222;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* ========== VARIABLES (fácil ajuste) ========== */
:root {
  --nav-height: 72px;
  --nav-h-padding: 30px;
  --card-radius: 14px;
  --accent: #ff9800;
  --accent-dark: #e67a00;
  --surface: #f0f0f3;
  --surface-2: #ffffff;
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-soft: 4px 6px 18px rgba(0, 0, 0, 0.06);
}

/* MODO OSCURO */
body.dark {
  background: #121212;
  color: #eaeaea;
}

/* ========== NAVBAR FIJA ========== */
.navbar,
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(var(--nav-h-padding));
  background: var(--surface-2);
  box-shadow: var(--shadow-soft);
  z-index: 9999;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.navbar.fixed-nav {
  position: fixed;
}

body.dark .navbar {
  background: #1f1f1f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* logo */
.navbar .logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
  color: var(--accent-dark);
}

/* right side */
.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* btn-icon */
.btn-icon {
  --size: 44px;
  display: inline-grid;
  place-items: center;
  min-width: var(--size);
  height: var(--size);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  padding: 0 12px;
  background: var(--surface);
  box-shadow: 6px 6px 14px rgba(0, 0, 0, 0.06),
    -6px -6px 14px rgba(255, 255, 255, 0.9);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  color: inherit;
}
.btn-main{
    color: #121212;
}
.btn-icon:hover {
  transform: translateY(-3px);
}

body.dark .btn-icon {
  background: #2a2a2a;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.6),
    -6px -6px 12px rgba(60, 60, 60, 0.1);
}

.btn-icon i {
  font-size: 18px;
}
body:not(.dark) .btn-icon i {
  color: #222;
}
body.dark .btn-icon i {
  color: #eee;
}

/* ========== CART BADGE ========== */
.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

body:not(.dark) .cart-count {
  background: var(--accent);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

body.dark .cart-count {
  background: #ffffff;
  color: #1a1a1a;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.06);
}

/* padding body */
body {
  padding-top: var(--nav-height);
}

/* HERO */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  padding: 40px 20px;
}

.hero.parallax {
  background-image: url("https://images.unsplash.com/photo-1568901346375-23c9450c58cd?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 1;
}

.hero .content,
.hero .col-12 {
  position: relative;
  z-index: 2;
}
.hero h2 {
  font-size: 2.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 8px;
}

/* MAIN LAYOUT */
.main-container {
  display: flex;
  gap: 28px;
  padding: 32px;
  max-width: 100%;
  margin: 0 auto 60px;
}

.filter {
  width: 230px;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

body.dark .filter {
  background: #222;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  color: #eee;
}
.filter h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.filter select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.dark .filter select {
  background: #2b2b2b;
  color: #fff;
}

/* GRID PRODUCTOS */
.products,
#productsContainer,
.productos-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

/* TARJETA */
.card,
.product-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;

  /* ===== Corrección para que TODAS tengan misma altura ===== */
  min-height: 360px;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
body.dark .card {
  background: #1e1e1e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.card img,
.product-card img {
  width: 100%;
  max-width: 420px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
}

.card h3,
.product-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: inherit;
  text-align: center;
}
.card .price,
.product-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.05rem;
}

/* CANTIDAD */
.quantity-control,
.qty-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.quantity-control .label {
  font-size: 0.9rem;
  color: #666;
}
body.dark .quantity-control .label {
  color: #cfcfcf;
}

.quantity-control .minus,
.quantity-control .plus,
.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #f1f1f1;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.06),
    -3px -3px 8px rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.quantity-control .minus:hover,
.quantity-control .plus:hover {
  transform: translateY(-2px);
}

body.dark .quantity-control .minus,
body.dark .quantity-control .plus,
body.dark .qty-btn {
  background: #2a2a2a;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.6),
    -3px -3px 8px rgba(60, 60, 60, 0.2);
  color: #fff;
}

.quantity-control .qty,
.qty-number {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* AGREGAR */
.btn-add,
.add-btn {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(230, 120, 0, 0.18);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn-add:hover {
  transform: translateY(-3px);
  opacity: 0.98;
}

/* CARRITO POPUP */
.cart-popup,
#cartPopup {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface-2);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 10050;
}

body.dark .cart-popup,
body.dark #cartPopup {
  background: #171717;
  color: #eee;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
}

#cartItems {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
body.dark .cart-item {
  background: rgba(255, 255, 255, 0.02);
}

.cart-item .remove-item {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

#customerForm input,
#customerForm select,
#customerForm textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  margin-top: 8px;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.dark #customerForm input,
body.dark #customerForm select,
body.dark #customerForm textarea {
  background: #252525;
  color: #fff;
}

.btn-close {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #777;
  color: #fff;
}

footer {
  text-align: center;
  padding: 26px 10px;
  background: transparent;
  color: inherit;
  margin-top: 40px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .main-container {
    padding: 20px;
    gap: 20px;
  }
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter {
    width: 100%; /* filtro crece en tablet */
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h-padding: 18px;
    --nav-height: 64px;
  }
  body {
    padding-top: var(--nav-height);
  }
  .navbar {
    padding: 0 calc(var(--nav-h-padding));
  }

  /* ===== Filtro arriba en mobile ===== */
  .main-container {
    flex-direction: column;
    padding: 16px;
  }

  .filter {
    width: 100%;
    order: -1; /* forza filtro arriba */
  }

  /* ===== Tarjetas una debajo de otra ===== */
  .products {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* altura mayor para móvil */
  .card {
    min-height: 420px;
  }

  .card img {
    height: 220px;
  }

  .btn-icon {
    min-width: 40px;
    height: 40px;
  }
}

.hidden {
  display: none !important;
}
.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

#closeCart {
  color: #cfcfcf;
  margin-left: 0px;
}
.card h3,span {
    color: #e67a00;
}
/*.filter {
    height: 60%;
}*/
