/*
 * Thunder Group - Wholesale Catalog Styles
 * Autor: [Tu Nombre/IA]
 * Descripción: Estilos personalizados para el catálogo al por mayor, AHORA IGUALANDO RETAIL.
 */

/* --- Variables CSS (Puedes ajustar estos colores si quieres alguna diferencia sutil, o igualarlos a retail) --- */
:root {
    --primary-color: #007bff;   /* IGUAL A RETAIL */
    --secondary-color: #6c757d; /* IGUAL A RETAIL */
    --accent-color: #ffc107;    /* IGUAL A RETAIL (para el carrito) */
    --dark-bg: #212529;         /* IGUAL A RETAIL */
    --light-bg: #f8f9fa;        /* IGUAL A RETAIL */
    --text-dark: #343a40;       /* IGUAL A RETAIL */
    --text-light: #f8f9fa;      /* IGUAL A RETAIL */
    --success-color: #198754;   /* IGUAL A RETAIL */
    --danger-color: #dc3545;    /* IGUAL A RETAIL */
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);       /* IGUAL A RETAIL */
    --card-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); /* IGUAL A RETAIL */
    --border-radius: 0.375rem;  /* IGUAL A RETAIL */
}

/* --- Estilos Globales (Igual a Retail) --- */
body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: darken(var(--primary-color), 10%);
}

h1, h2, h3, h4, h5, h6 { fontWeight: 600; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #f8f9fa;
    border-color: #d3d4d5;
    color: var(--text-dark);
}
.btn-accent {
    background-color: var(--accent-color); border-color: var(--accent-color); color: var(--text-dark);
}
.btn-accent:hover, .btn-accent:focus {
    background-color: darken(var(--accent-color), 10%); 
    border-color: darken(var(--accent-color), 10%); 
    color: var(--text-dark);
}

/* --- Header / Navbar (Igual a Retail) --- */
.navbar-brand img { max-height: 50px; transition: transform 0.3s ease; }
.navbar-brand img:hover { transform: scale(1.05); }
.navbar .form-control { border-radius: var(--border-radius); }
.navbar .btn-outline-primary { border-color: var(--primary-color); color: var(--primary-color); }
.navbar .btn-outline-primary:hover { background-color: var(--primary-color); color: white; }

/* --- Barra de Categorías (Igual a Retail) --- */
.category-bar {
    background-color: #e9ecef; padding: 0.8rem 0; margin-bottom: 25px;
    border-bottom: 1px solid #dee2e6; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.category-bar .nav-pills .nav-link {
    color: var(--text-dark); font-weight: 500; padding: 0.5rem 1rem;
    border-radius: var(--border-radius); margin: 0 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.category-bar .nav-pills .nav-link:hover { background-color: rgba(0,0,0,0.05); }
.category-bar .nav-pills .nav-link.active {
    background-color: var(--primary-color); color: var(--text-light);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

/* --- Tarjeta de Producto (Product Card) - AHORA IGUAL A RETAIL --- */
.product-card {
    background-color: #fff; border: 1px solid #e0e0e0; border-radius: var(--border-radius);
    box-shadow: var(--card-shadow); transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    margin-bottom: 20px; overflow: hidden;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--card-hover-shadow); }
.product-card .card-img-top {
    width: 100%; height: 220px; object-fit: cover; /* Usando 'cover' */
    border-bottom: 1px solid #eee; transition: transform 0.3s ease;
}
.product-card:hover .card-img-top { transform: scale(1.03); }
.product-card .card-body {
    padding: 1rem; display: flex; flex-direction: column;
    justify-content: space-between; min-height: 180px;
}
.product-card .card-title {
    font-size: 1.05rem; font-weight: 600; color: var(--text-dark);
    margin-bottom: 0.5rem; min-height: 44px; line-height: 1.3;
}
.product-card .card-title a { color: inherit; }
.product-card .card-title a:hover { color: var(--primary-color); }

/* El precio en wholesale aún puede mostrar el texto "Mayor:" desde el PHP, pero el estilo CSS será el mismo */
.product-card .price {
    font-size: 1.3rem; font-weight: 700; color: var(--success-color); margin-bottom: 0.5rem;
}
/* Si quieres que el precio en wholesale también sea verde y llamativo, y no quieres "Mayor:",
   asegúrate que el PHP de wholesale/includes/product_card.php no añada texto extra al precio.
   Si quieres el texto "Mayor:" pero con el estilo visual de retail, puedes añadir un :before específico aquí:
.product-card .price::before {
    content: "Mayor: ";
    font-size: 0.8em;
    color: var(--secondary-color);
    font-weight: 400;
    margin-right: 4px;
}
*/


.product-card .stock {
    font-size: 0.85rem; color: var(--secondary-color); margin-bottom: 0.75rem;
}
.product-card .stock.out-of-stock { color: var(--danger-color); font-weight: 500; }
.product-card .quantity-input {
    width: 70px; text-align: center; border-radius: var(--border-radius); border: 1px solid #ced4da;
}
.product-card .add-to-cart-btn {
    font-size: 0.9rem; padding: 0.5rem 0.75rem; white-space: nowrap;
}

/* --- Página de Detalle del Producto (Igual a Retail) --- */
.product-gallery .carousel-item img { max-height: 450px; object-fit: cover; border-radius: var(--border-radius); border: 1px solid #eee; }
.product-gallery .carousel-control-prev-icon, .product-gallery .carousel-control-next-icon {
    background-color: rgba(0,0,0,0.3); border-radius: 50%; padding: 10px;
}
.product-details h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.product-details .price { font-size: 2rem; color: var(--success-color); font-weight: bold; margin-bottom: 1rem; }
/* Para el precio en detalle wholesale, similar a la tarjeta:
.product-details .price::before {
    content: "Precio Mayorista: ";
    font-size: 0.8em;
    color: var(--secondary-color);
    font-weight: 400;
}
*/
.product-details .stock { font-size: 1rem; color: var(--secondary-color); margin-bottom: 1rem; }
.product-details .stock.out-of-stock { color: var(--danger-color); font-weight: 500; }
.product-details .description { font-size: 1rem; line-height: 1.7; color: #555; margin-bottom: 1.5rem; }
.product-details .quantity-input { width: 80px; }
.product-details .add-to-cart-btn { font-size: 1rem; padding: 0.6rem 1.2rem; }

/* --- Carrito Flotante (Igual a Retail) --- */
.cart-icon {
    position: fixed; bottom: 25px; right: 25px; width: 60px; height: 60px;
    background-color: var(--accent-color); color: var(--text-dark); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); cursor: pointer; z-index: 1050;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease;
}
.cart-icon:hover {
    transform: scale(1.1);
    background-color: var(--text-dark); /* O un color oscuro específico de tu paleta */
    color: var(--accent-color);     /* Ícono toma el color de acento original */
    /* o color: white; o color: var(--text-light); para ícono blanco */
}
.cart-count {
    position: absolute; top: -8px; right: -8px; 
    background-color: var(--danger-color);
    color: white; font-size: 0.75rem; font-weight: bold; padding: 3px 7px;
    border-radius: 50%; line-height: 1; border: 2px solid white;
}

/* --- Modal del Carrito (Igual a Retail) --- */
.modal-content { border-radius: var(--border-radius); box-shadow: 0 5px 20px rgba(0,0,0,0.15); }
.modal-header {
    background-color: var(--primary-color); color: var(--text-light);
    border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius);
}
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-title { font-weight: 600; }
#cartModalBody table img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; margin-right: 10px; }
#cartModalBody .cart-item-quantity { width: 70px; }
#cartTotal { font-weight: bold; font-size: 1.2em; }
.modal-footer .btn-success { background-color: var(--success-color); border-color: var(--success-color); }
.modal-footer .btn-success:hover { background-color: darken(var(--success-color), 10%); border-color: darken(var(--success-color), 10%); }

/* --- Footer (Igual a Retail) --- */
.footer {
    background-color: var(--dark-bg); color: #adb5bd; padding-top: 3rem; padding-bottom: 1rem; font-size: 0.9rem;
}
.footer h5 { color: var(--accent-color); margin-bottom: 1.2rem; font-weight: 600; }
.footer p { margin-bottom: 0.5rem; }
.footer a { color: #dee2e6; text-decoration: none; }
.footer a:hover { color: var(--text-light); text-decoration: underline; }
.footer .bottom-bar { border-top: 1px solid #495057; padding-top: 1.5rem; margin-top: 1.5rem; }
.footer .bottom-bar p { margin-bottom: 0; }

/* --- Responsive Adjustments (Igual a Retail) --- */
@media (max-width: 768px) {
    .product-card .card-title { font-size: 0.95rem; min-height: 40px; }
    .product-card .price { font-size: 1.1rem; }
    .product-details h1 { font-size: 1.8rem; }
    .product-details .price { font-size: 1.6rem; }
    .category-bar .nav-pills .nav-link { font-size: 0.9rem; padding: 0.4rem 0.8rem; }
    .cart-icon { width: 50px; height: 50px; font-size: 1.3rem; bottom: 15px; right: 15px; }
    .cart-count { top: -5px; right: -5px; font-size: 0.7rem; padding: 2px 5px; }
}
@media (max-width: 576px) {
    .product-card .card-body { padding: 0.75rem; min-height: auto; }
    .product-card .add-to-cart-btn, .product-card .quantity-input { font-size: 0.8rem; padding: 0.4rem; }
    .product-card .quantity-input { width: 55px; }
}