/* =====================================================
   ESTILOS GLOBALES
===================================================== */

:root{
  --primary:#1e88e5;
  --dark:#0f172a;
  --navbar-height: 70px; /* Altura estimada del navbar */
}
body{
  font-family:'Poppins',sans-serif;
  overflow-x:hidden;
}

/*--------------------------------------------------
  BARRA DE NAVEGACIÓN
---------------------------------------------------*/
.navbar {
  transition:.4s;
  background-color: transparent; /* Fondo transparente por defecto */
  box-shadow: none;
}
.navbar.scrolled {
  background:#ffffff !important; /* Blanco puro cuando se hace scroll */
  box-shadow:0 10px 30px rgba(0,0,0,.1); /* Sombra ajustada para el fondo claro */
}
.navbar .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff; /* Color de texto blanco por defecto */
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); /* Sombra para legibilidad sobre imágenes */
    transition: all 0.3s ease;
    border-radius: 20px;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}
.navbar.scrolled .nav-link {
    color: #343a40; /* Color de texto oscuro para fondo blanco */
    text-shadow: none; /* Sin sombra de texto en fondo blanco */
}
.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link:focus {
    color: #000;
    background-color: rgba(0, 0, 0, 0.05);
}
.navbar .nav-link.active {
    color: #fff;
    background-color: var(--primary);
    box-shadow: 0 4px 10px rgba(30,136,229,0.4);
    transform: translateY(-2px);
}
/* El color del enlace activo también debe cambiar en scroll */
.navbar.scrolled .nav-link.active {
    color: #fff; /* Mantener color blanco si el fondo es --primary */
}
.navbar .nav-link .fa-shopping-cart {
    font-size: 1.1rem;
    color: #fff; /* Icono del carrito blanco por defecto */
}
.navbar.scrolled .nav-link .fa-shopping-cart {
    color: #343a40; /* Icono del carrito oscuro en fondo blanco */
}
.navbar .nav-link .badge {
    position: relative;
    top: -10px;
    left: -2px;
    font-size: 0.6em;
    padding: 0.3em 0.5em;
}

/*--------------------------------------------------
  BOTÓN DE AÑADIR AL CARRITO (GENÉRICO)
---------------------------------------------------*/
.product-card .add-to-cart-direct-btn {
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border-radius: 20px;
    padding: 0.4rem 0;
}
.product-card .add-to-cart-direct-btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.product-card .add-to-cart-direct-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/*--------------------------------------------------
  CARRITO DE COMPRAS
---------------------------------------------------*/
.cart-item.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
}

.cart-item.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.cart-item .card-body {
    padding: 1.25rem;
}

.cart-item img {
    border-radius: 0.5rem;
    width: 80px; /* Tamaño fijo para la imagen */
    height: 80px; /* Tamaño fijo para la imagen */
    object-fit: cover;
}

.cart-item h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item .text-muted {
    font-size: 0.85rem;
}

.cart-item .quantity-input {
    width: 70px;
    text-align: center;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    padding: 0.375rem 0.5rem;
}

.cart-item .remove-item-btn {
    border-radius: 0.5rem;
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

.cart-item .item-subtotal {
    font-size: 1.15rem;
    color: var(--bs-primary); /* Color primario de Bootstrap */
}

/* Estilo para el resumen del pedido */
.card.shadow {
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.card.shadow .list-group-item {
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
}

.card.shadow .list-group-item.fw-bold.h5 {
    font-size: 1.3rem !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
    background-color: #f8f9fa; /* Un fondo ligeramente diferente para el total */
}

/* Estilo para el estado de carrito vacío */
.empty-cart-message {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed #ced4da;
    border-radius: 0.75rem;
    background-color: #fdfdfd;
}

.empty-cart-message .icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-cart-message h3 {
    color: #343a40;
    margin-bottom: 1rem;
}

.empty-cart-message p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.empty-cart-message .btn {
    border-radius: 2rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

#preloader{
    position:fixed;
    inset:0;
    background:#fff;
    z-index:99999;
    display:flex;
    justify-content:center;
    align-items:center;
}


.tachometer{
    width:220px;
}

#needle{
    transform-origin:150px 160px;
    animation:rev 1.2s cubic-bezier(.6,0,.4,1) infinite;
}

@keyframes rev{
    0%{transform:rotate(-60deg)}
    40%{transform:rotate(20deg)}
    60%{transform:rotate(70deg)}
    100%{transform:rotate(-60deg)}
}

/* Mini-Cart Dropdown Styling */
#cart-dropdown-wrapper {
    position: relative;
}

.mini-cart-dropdown {
    position: absolute;
    top: 100%; /* Position below the cart icon */
    right: 0; /* Align to the right of the icon */
    width: 300px; /* Fixed width for the dropdown */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000; /* Ensure it's above other content */
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Hidden by default */
    transform: translateY(10px); /* Slightly offset */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#cart-dropdown-wrapper.show .mini-cart-dropdown {
    opacity: 1; /* Show on hover (via JS adding 'show' class) */
    visibility: visible;
    transform: translateY(0);
}

.mini-cart-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.mini-cart-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.mini-cart-body {
    padding: 15px;
    max-height: 300px; /* Scrollable if many items */
    overflow-y: auto;
}

.mini-cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.mini-cart-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mini-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.mini-cart-item-details {
    flex-grow: 1;
}

.mini-cart-item-details h6 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.3;
}

.mini-cart-item-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.mini-cart-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #f8f8f8;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.mini-cart-total {
    font-size: 1.2rem;
    color: var(--primary);
}