/* styles.css */

/* ---------- Base ---------- */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #212529;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 600;
}

a {
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero-section {
  background: url("../images/banner-bodega.jpg") center center/cover no-repeat;
  color: #fff;
  padding: 100px 0;
  text-align: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: bold;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

/* ---------- CategorÃ­as ---------- */
.category-card {
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  transition: none;
}

.category-card:hover {
  transform: none;
}

.category-overlay {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-overlay h3 {
  font-size: 1.5rem;
  font-weight: bold;
}

/* ---------- Carrito ---------- */
#cart-count {
  font-size: 0.8rem;
  padding: 3px 7px;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 60px;
}

/* ---------- Buscador ---------- */
.search-box {
  position: relative;
}

.search-box .form-control {
  padding-right: 40px;
  border-radius: 20px;
}

.search-box .btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff; /* mismo color que navbar */
  border: none;
  color: #212529;
}

/* Evitar â€œbrincosâ€ cuando aparece/desaparece el scrollbar */
html {
  overflow-y: scroll; /* siempre reserva espacio vertical */
}

/* â”€â”€â”€â”€â”€ Sugerencias de bÃºsqueda â”€â”€â”€â”€â”€ */
.suggestions-dropdown {
  z-index: 1050; /* sobre la navbar */
  top: 100%; /* justo debajo del input */
  border-radius: 0 0 0.5rem 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.suggestions-dropdown img {
  object-fit: contain;
}

/* â”€â”€ Ajuste de resaltado en sugerencias â”€â”€ */
#search-suggestions mark {
  background-color: var(--accent-color, #ffc107); /* el que ya usas */
  padding: 0; /* â† elimina el espacio extra */
  margin: 0; /* seguridad extra */
  border-radius: 2px; /* opcional: esquinas suaves */
}

/* â”€â”€â”€â”€â”€â”€ Avatar circular usuario menÃº â”€â”€â”€â”€â”€â”€ */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  background: var(--secondary-color, #343a40);
  color: #fff;
  font-size: 1rem;
  letter-spacing: 1px;
  box-shadow: 0 2px 4px rgba(44, 44, 44, 0.1);
}

/* --- Checkout: fila 'EnvÃ­o' bonita --- */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  background-color: var(--bs-light-bg-subtle, #f8f9fa);
}
.summary-row .badge {
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* --- Fila 'EnvÃ­o' del resumen --- */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  background: var(--bs-light-bg-subtle, #f8f9fa);
}
.summary-row .badge {
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* --- Tarjeta 'Recojo en tienda' --- */
.pickup-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.75rem;
  padding: 1rem;
  background: #fff;
}
.pickup-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f5;
  color: #0d6efd;
  font-size: 1.1rem;
}
.pickup-card .title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.pickup-card .item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.15rem 0;
}
.pickup-card .item i {
  color: #6c757d;
}

/* ===== Sticky footer global (todas las pÃ¡ginas) ===== */
html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
}

/* En React, el contenido vive dentro de #root. */
#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* El main debe crecer para empujar el footer al final sin superponer contenido. */
#root > main {
  flex: 1 0 auto;
}

/* Asegura que el footer no meta espacio extra arriba */
footer {
  margin-top: 0 !important; /* sobreescribe la regla previa de 60px */
}

/* ===== Estilos legacy de la Home ===== */
:root {
  --primary-color: #dc3545;
  --secondary-color: #343a40;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --accent-color: #ffc107;
}

.hero-section {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(/assets/images/banner-bodega.jpg);
  background-size: cover;
  background-position: center;
  min-height: 400px;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.text-overlay {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.category-card {
  transition: none;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  background: #fff;
}

.category-card:hover {
  transform: none;
}

.category-icon {
  font-size: 2.25rem;
  line-height: 1;
  color: var(--primary-color);
}

.product-card {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 20px;
  height: 100%;
}

.product-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.product-img {
  height: 100%;
  object-fit: contain;
  width: 100%;
  padding: 16px;
}

/* Evita que títulos largos rompan la grilla */
.product-title {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-primary-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary-custom:hover {
  background-color: var(--primary-color-hover);
  border-color: var(--primary-color-border-hover);
}

.bg-primary-custom {
  background-color: var(--primary-color);
  color: #fff;
}

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

.badge-custom {
  background-color: var(--primary-color);
}

/* ===== Carrito (paridad con versión anterior) ===== */
.cart-table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  min-width: 900px;
}

.cart-table thead {
  background-color: var(--secondary-color);
  color: #fff;
}

.cart-item-img {
  max-width: 80px;
  height: auto;
  object-fit: contain;
}

.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.quantity-input {
  width: 60px;
  text-align: center;
  margin: 0 5px;
}

.empty-cart-icon {
  font-size: 5rem;
  color: #ddd;
  margin-bottom: 1rem;
}

.cart-summary {
  background-color: var(--light-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  min-width: 340px;
  max-width: 400px;
}

@media (min-width: 1200px) {
  .cart-list-container {
    width: 1000px;
    max-width: 1100px;
  }
}

@media (max-width: 1199.98px) {
  .cart-list-container {
    width: 100%;
    min-width: 100%;
  }
  .cart-summary {
    max-width: 100%;
    min-width: 0;
  }
}

.feature-box {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  transition: none;
}

.feature-box:hover {
  transform: none;
}

.feature-icon {
  font-size: 2.25rem;
  line-height: 1;
  color: var(--primary-color);
}
