/* =====================================================
   1. ESTILOS GLOBALES
===================================================== */
:root {
  --primary: #1e88e5; /* Tu color primario */
  --dark: #0f172a;
  --navbar-height: 70px;
}

body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

/* =====================================================
   2. BARRA DE NAVEGACIÓN (NAVBAR)
===================================================== */
.navbar {
  transition: all 0.4s ease;
  background-color: var(--dark); /* Fondo oscuro por defecto */
  padding-top: 10px;
  padding-bottom: 10px;
  box-shadow: none;
}

/* --- ENLACES DEL MENU --- */
.navbar .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff; /* Blanco por defecto */
    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 .nav-link.active {
    color: #fff;
    background-color: var(--primary);
    box-shadow: 0 4px 10px rgba(30,136,229,0.4);
    transform: translateY(-2px);
}

/* Iconos y badges en el navbar */
.navbar .nav-link .fa-shopping-cart, 
.navbar .nav-link .fa-user {
    font-size: 1.1rem;
    color: #fff;
}
.cart-badge {
    position: absolute;
    top: -2px;
    right: -5px;
    font-size: 0.65rem;
    padding: 2px 5px;
}

/* =====================================================
   3. BUSCADOR INTELIGENTE (HEADER)
===================================================== */
/* Estilo Base del Input (Transparente sobre fondo oscuro) */
.search-input-style {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    border-radius: 20px;
    padding: 8px 35px 8px 35px;
    width: 100%;
    transition: all 0.3s;
}

.search-input-style::placeholder { color: rgba(255,255,255,0.7); }

.search-input-style:focus {
    background-color: #fff;
    color: #333 !important;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.search-input-style:focus::placeholder { color: #999; }

/* Iconos dentro del buscador */
.search-wrapper-relative { position: relative; width: 100%; }

.search-icon-pos {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.7); pointer-events: none;
    transition: color 0.3s;
}
.search-input-style:focus ~ .search-icon-pos { color: var(--primary); }

/* --- VERSIONES RESPONSIVE DEL BUSCADOR --- */
.desktop-search-container {
    max-width: 400px;
    width: 100%;
    display: none; 
}
@media (min-width: 992px) {
    .desktop-search-container { display: block; margin: 0 20px; }
}

.mobile-search-row {
    width: 100%;
    margin-top: 10px;
    padding-bottom: 5px;
    display: block;
}
@media (min-width: 992px) {
    .mobile-search-row { display: none; }
}

.mobile-icons-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 15px;
}
.nav-icon-link {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    position: relative;
    text-decoration: none;
}
@media (min-width: 992px) {
    .mobile-icons-container { display: none; }
}

/* =====================================================
   4. ESTADO "SCROLLED" (Modo Claro al bajar)
===================================================== */
.navbar.scrolled {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.navbar.scrolled .nav-link { color: #333; }
.navbar.scrolled .navbar-brand { color: #333 !important; }
.navbar.scrolled .nav-icon-link { color: #333; }
.navbar.scrolled .nav-link .fa-shopping-cart,
.navbar.scrolled .nav-link .fa-user { color: #333; }

/* CAMBIO DE COLOR DEL BUSCADOR EN SCROLL */
.navbar.scrolled .search-input-style {
    background-color: #f1f5f9 !important; /* Gris claro */
    border: 1px solid #e2e8f0;
    color: #1f2937 !important; /* Texto oscuro */
}
.navbar.scrolled .search-input-style::placeholder { color: #64748b; }
.navbar.scrolled .search-icon-pos { color: #64748b; }

.navbar.scrolled .search-input-style:focus {
    background-color: #fff !important;
    border-color: var(--primary);
}

/* =====================================================
   5. NUEVOS ESTILOS DEL MODAL (PRODUCTO + RELACIONADOS)
===================================================== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.modal-header .btn-close {
    background-color: #f1f3f5;
    border-radius: 50%;
    padding: 0.8rem;
    opacity: 1;
    transition: all 0.2s;
}
.modal-header .btn-close:hover {
    background-color: #e9ecef;
    transform: rotate(90deg);
}

/* Imagen Principal Modal */
.product-image-zoom-container {
    height: 400px;
    background: #fff;
    border: 1px solid #f1f3f5;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-image-zoom-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
}

/* Variaciones */
#productModalVariations {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.variation-thumbnail {
    width: 70px;
    height: 70px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 3px;
    background: #f8f9fa;
    cursor: pointer;
    overflow: hidden;
}
.variation-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.variation-thumbnail.active {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(30,136,229,0.2);
}

/* Detalles del Modal */
.modal-product-title {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #212529;
}
.price-tag-modal {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* --- SECCIÓN RELACIONADOS --- */
.related-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #495057;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.related-product-card {
    border: 1px solid #f1f3f5;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.related-product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateY(-5px);
}

.related-img-wrapper {
    height: 140px;
    padding: 15px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.related-img-wrapper img {
    max-height: 100%; max-width: 100%; object-fit: contain;
    transition: transform 0.3s;
}
.related-product-card:hover .related-img-wrapper img { transform: scale(1.08); }

.related-card-body {
    padding: 10px 15px 15px;
    text-align: center;
    border-top: 1px solid #f8f9fa;
    background: #fcfcfc;
}
.related-title {
    font-size: 0.85rem; font-weight: 600; margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333;
}
.related-price { font-size: 0.95rem; font-weight: 700; color: var(--primary); }

.loading-related { padding: 30px; background: #f8f9fa; border-radius: 10px; }

/* =====================================================
   6. OTROS ESTILOS (CARRITO, CARDS GRID PRINCIPAL, ETC)
===================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column; height: 100%;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }

.product-image-container { position: relative; padding-top: 100%; background: #fff; border-bottom: 1px solid #f0f0f0; }
.product-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 15px; }
.product-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 0.95rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; line-height: 1.3; }
.product-price { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

.product-card .add-to-cart-direct-btn {
    width: 100%; border: none; background: var(--primary); color: #fff;
    border-radius: 8px; padding: 8px; font-weight: 600; margin-top: auto;
    transition: background 0.2s;
}
.product-card .add-to-cart-direct-btn:hover { background: #1565c0; }

/* Mini Cart Styles (Conservados) */
#cart-dropdown-wrapper { position: relative; }
.mini-cart-dropdown {
    position: absolute; top: 100%; right: 0; width: 300px;
    background: #fff; border: 1px solid #ddd; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s;
}
#cart-dropdown-wrapper.show .mini-cart-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.mini-cart-header, .mini-cart-footer { padding: 15px; background: #f8f8f8; }
.mini-cart-body { padding: 15px; max-height: 300px; overflow-y: auto; }

