/* RESET SIMPLE / TIPOGRAFÍA */
body {
  background: #f8f9fa;
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
}

/* NAVBAR / HEADER */
.logo {
  font-size: 1.6rem;
  font-weight: bold;
}

.search-container {
  max-width: 500px;
}

.navbar {
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 64px;
}
/* Marca de la tienda */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Links del menú superior */
.navbar .nav-link {
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar .nav-link:hover {
  color: #0d6efd;
}

/* HERO */
header section {
  background: linear-gradient(180deg, #212529, #343a40);
  padding-top: 4rem;
  padding-bottom: 4rem;
  text-align: center;
}

header section h1 {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.03em;
}

header section p {
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* MENÚ VERTICAL IZQUIERDO */
.menu-left {
  width: 180px;
  min-height: calc(100vh - 70px);
  background-color: #ffffff;
  border-right: 1px solid #e5e5e5;
}

.menu-left button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  font-weight: 500;
  background-color: #f8f9fa;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-align: left;
  font-size: 1rem;
}

.menu-left button i {
  font-size: 1.1rem;
}

.menu-text {
  display: inline;
}

/* hover */
.menu-left button:hover {
  background-color: #e9ecef;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* estado activo */
.menu-left button.active {
  background-color: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(13, 110, 253, 0.4);
}

.menu-left button.active i {
  color: #ffd966;
}

/* Categorías */
#categoriesContainer {
  margin-left: 0;
}

.category-btn {
  font-size: 0.9rem !important;
  padding: 8px 12px !important;
  margin-left: 0;
}

/* PRODUCTOS (CARDS) */
#productsContainer .card {
  border: none;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

#productsContainer .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

#productsContainer img {
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

/* SIDEBAR DEL CARRITO */
.sidebar {
  position: fixed;
  top: 0;
  right: -380px;
  height: 100vh;
  width: 350px;
  background: #fff;
  padding: 20px;
  z-index: 5000;
  overflow-y: auto;
  transition: right 0.35s ease;
  border-left: 2px solid #0d6efd;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 0 12px;
}

.sidebar.open {
  right: 0;
}

/* Título del carrito */
#cartSidebar h4 {
  font-weight: 700;
  margin-bottom: 10px;
}

/* Cada ítem dentro del carrito */
#cartSidebarList .cart-item {
  padding: 14px 0;
  border-bottom: 1px solid #e3e3e3;
}

#cartSidebarList img {
  width: 65px;
  height: 65px;
  object-fit: contain;
  border-radius: 8px;
}

/* Botones de cantidad */
.cart-qty-btn {
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #888;
  background: #eee;
  cursor: pointer;
}

.cart-qty-btn:hover {
  background: #ddd;
}

/* Botón cerrar (la X del carrito) */
#closeSidebar {
  transform: scale(1);
  transition: transform 0.1s ease;
}

#closeSidebar:hover {
  transform: scale(1.2);
}

/* Total del carrito */
.cart-total {
  border: 1px solid #dee2e6;
}

.cart-total span:first-child {
  font-size: 1.1rem;
}

/* Botones finales del carrito */
.sidebar-footer .btn {
  border-radius: 16px;
  font-weight: 600;
  padding: 10px;
}

/* MODAL PRODUCTO */
#productModal .modal-content {
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  border: none;
}

#productModal .modal-header {
  border: none;
  text-align: center;
  padding-bottom: 0;
}

#modalTitle {
  font-size: 1.4rem;
  font-weight: 600;
}

#productModal .modal-body {
  padding-top: 0;
}

#modalImg {
  max-height: 260px;
  object-fit: contain;
  margin-bottom: 10px;
}

#modalPrice {
  font-size: 1.3rem;
  color: #0d6efd;
}

#modalDesc {
  font-size: 0.95rem;
  color: #555;
}

#addToCartBtn {
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 16px;
}

#quantityInput {
  border-radius: 8px;
  text-align: center;
  border: 1px solid #ddd;
  font-weight: 500;
}

#quantityInput:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
  outline: none;
}

#productModal .modal-footer {
  border-top: none;
  padding-top: 0;
}

/* BOTONES GENERALES */
button,
.btn {
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.12s ease,
    box-shadow 0.15s ease;
  font-weight: 500;
}

/* Hover general */
button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Botones principales (azules) */
.btn-primary {
  background-color: #0d6efd;
  border: none;
}

.btn-primary:hover {
  background-color: #0b5cd5;
}

/* Botones rojos (vaciar carrito) */
.btn-danger:hover {
  background-color: #c82333;
}

/* Botón del carrito en navbar */
#cartBtn {
  position: relative;
  overflow: visible;
  padding: 8px 12px;
}

#cartBtn:hover {
  transform: scale(1.08);
}

/* Badge del carrito en esquina superior derecha */
#cartBtn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.65rem;
  padding: 3px 6px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

/* FAVORITOS (ICONO ESTRELLA/CORAZÓN) */
.favorite-icon {
  color: #f6c400;
  transition: transform 0.2s ease;
}

.favorite-icon:hover {
  transform: scale(1.2);
}

/* BUSCADOR (searchInput) */
#searchInput {
  border-radius: 14px;
  padding: 8px 16px;
  border: 1px solid #dcdcdc;
  background-color: #ffffff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  font-size: 0.95rem;
}

#searchInput::placeholder {
  color: #a0a0a0;
}

#searchInput:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* SWEETALERT2 */
.swal2-popup {
  font-size: 0.9rem !important;
}

/* MEDIA QUERIES */
@media (max-width: 768px) {
  .menu-left {
    width: 70px;
    padding: 10px 5px !important;
  }

  .menu-left button {
    justify-content: center;
    padding: 12px;
  }

  .menu-left button i {
    margin: 0;
  }

  .menu-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .search-container {
    max-width: 200px;
  }
}

/* BOTÓN VOLVER ARRIBA */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #0d6efd;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.8);
}

.scroll-to-top.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.scroll-to-top:hover {
  background-color: #0b5cd5;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

/* IMÁGENES Y TARJETAS DE PRODUCTO */
/* Imagen principal dentro de las cards */
#productsContainer .card img,
#productsContainer .card-img-top {
  max-height: 190px;
  object-fit: contain;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

/* Cuerpo de la card organizado en columna */
#productsContainer .card .card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Título del producto */
#productsContainer .card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.5em;
}

/* Descripción corta (si la hay) */
#productsContainer .card .card-text {
  font-size: 0.85rem;
  color: #666;
}

/* Precio (si usan una clase price o similar) */
#productsContainer .card .price,
#productsContainer .card .product-price {
  font-size: 1rem;
  font-weight: 700;
  color: #0d6efd;
}

/* Botón dentro de la card */
#productsContainer .card .btn {
  margin-top: 4px;
}

/* RATING DE PRODUCTOS */
.product-rating {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.product-rating .rating-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: #333;
}

.product-rating i {
  font-size: 0.7rem;
}

.product-rating small {
  font-size: 0.7rem;
}

#modalRating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#modalRating i {
  font-size: 1.1rem;
}

#modalRating .rating-value {
  font-size: 1rem;
}
/* LOADER DE CARGA DE PRODUCTOS  */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 249, 250, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

/* MODO OSCURO */

.dark-mode {
  background-color: #121212;
  color: #f1f1f1;
}

/* Transición suave */
body,
.dark-mode {
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Navbar */
.dark-mode .navbar {
  background-color: #1f1f1f !important;
  color: #fff;
}

/* Hero */
.dark-mode .bg-dark {
  background-color: #000 !important;
}

/* Sidebar izquierda */
.dark-mode .menu-left {
  background-color: #1b1b1b !important;
  border-color: #333 !important;
}

/* Sidebar carrito */
.dark-mode .sidebar {
  background-color: #1f1f1f !important;
  color: #fff;
}

/* Tarjetas de producto */
.dark-mode .card {
  background-color: #1e1e1e !important;
  border-color: #333 !important;
  color: #fff;
}

/* Contenedor total carrito */
.dark-mode .cart-total {
  background-color: #262626 !important;
}

/* Inputs */
.dark-mode input.form-control {
  background-color: #222;
  color: #fff;
  border-color: #555;
}

/* Botones */
.dark-mode .btn-light {
  background-color: #2a2a2a;
  color: #fff;
}

.dark-mode .btn-outline-primary {
  color: #fff;
  border-color: #fff;
}

.dark-mode .btn-outline-secondary {
  color: #fff;
  border-color: #888;
}

/* Modal */
.dark-mode .modal-content {
  background-color: #1e1e1e;
  color: #fff;
}

/* Botón scroll top */
.dark-mode .scroll-to-top {
  color: #fff;
}

/* Mensajes vacíos  */
.dark-mode .empty-message {
  color: #ddd;
}

/* Rating en modo oscuro */
.dark-mode .product-rating .rating-value {
  color: #f1f1f1;
}

.dark-mode .product-rating small {
  color: #bbb;
}

.dark-mode #modalRating .rating-value {
  color: #f1f1f1;
}

.dark-mode #modalRating small {
  color: #bbb;
}


