/**
 * Estilos del Portal de Clientes
 */

/* Variables de colores (personalizar según tu marca) */
:root {
    --color-primary: #337ab7;
    --color-primary-dark: #286090;
    --color-secondary: #5cb85c;
    --color-accent: #f0ad4e;
    --color-dark: #333;
    --color-light: #f5f5f5;
    --color-gray: #777;
}

/* General */
body {
    padding-top: 70px;
    background-color: #f8f9fa;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px 15px;
}

/* Navbar */
.navbar-default {
    background-color: #fff;
    border-bottom: 1px solid #e7e7e7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    color: var(--color-primary) !important;
}

.badge-carrito {
    background-color: #d9534f;
    margin-left: 5px;
}

/* Footer */
.footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer h4 {
    color: #fff;
    margin-bottom: 15px;
}

.footer a {
    color: #aaa;
}

.footer a:hover {
    color: #fff;
    text-decoration: none;
}

.footer hr {
    border-color: #444;
}

/* Cards de Productos */
.producto-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.producto-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.producto-card .img-container {
    position: relative;
    padding-top: 100%; /* Aspect ratio 1:1 */
    overflow: hidden;
    background-color: #f5f5f5;
}

.producto-card .img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.producto-card:hover .img-container img {
    transform: scale(1.05);
}

.producto-card .card-body {
    padding: 15px;
}

.producto-card .producto-nombre {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.producto-card .producto-codigo {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.producto-card .producto-precio {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-primary);
}

.producto-card .producto-stock {
    font-size: 12px;
    margin-top: 5px;
}

.producto-card .stock-disponible {
    color: #5cb85c;
}

.producto-card .stock-agotado {
    color: #d9534f;
}

/* Badge de oferta/nuevo */
.producto-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

/* Filtros */
.filtros-sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 20px;
}

.filtros-sidebar h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filtros-sidebar .form-group {
    margin-bottom: 15px;
}

.filtros-sidebar label {
    font-weight: normal;
    font-size: 13px;
}

/* Detalle de Producto */
.producto-detalle {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.producto-detalle .galeria-principal img {
    width: 100%;
    border-radius: 4px;
}

.producto-detalle .galeria-thumbs {
    margin-top: 15px;
}

.producto-detalle .galeria-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.producto-detalle .galeria-thumbs img:hover,
.producto-detalle .galeria-thumbs img.active {
    border-color: var(--color-primary);
}

.producto-detalle h1 {
    font-size: 24px;
    margin-top: 0;
}

.producto-detalle .precio-grande {
    font-size: 32px;
    font-weight: bold;
    color: var(--color-primary);
    margin: 20px 0;
}

/* Tabla de Variantes (Grilla de Talles/Colores) */
.tabla-variantes {
    margin-top: 20px;
}

.tabla-variantes table {
    width: 100%;
}

.tabla-variantes th {
    background-color: #f5f5f5;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
}

.tabla-variantes td {
    padding: 5px;
    text-align: center;
}

.tabla-variantes .input-cantidad {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.tabla-variantes .input-cantidad:focus {
    border-color: var(--color-primary);
    outline: none;
}

.tabla-variantes .sin-stock {
    background-color: #f2dede;
}

.tabla-variantes .stock-info {
    font-size: 10px;
    color: #999;
    display: block;
}

/* Carrito */
.carrito-tabla {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.carrito-tabla .producto-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.carrito-tabla .producto-info {
    padding-left: 15px;
}

.carrito-tabla .cantidad-control {
    display: flex;
    align-items: center;
}

.carrito-tabla .cantidad-control input {
    width: 60px;
    text-align: center;
    margin: 0 5px;
}

.carrito-resumen {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.carrito-resumen .total {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
}

/* Pedidos */
.tabla-pedidos {
    background: #fff;
}

.tabla-pedidos .estado-pendiente {
    color: #f0ad4e;
}

.tabla-pedidos .estado-remitido {
    color: #5cb85c;
}

.tabla-pedidos .estado-anulado {
    color: #d9534f;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-primary);
}

.login-box .btn-login {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Alertas */
.alert-floating {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Paginación */
.paginacion {
    text-align: center;
    margin: 30px 0;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .producto-card .producto-nombre {
        font-size: 13px;
        height: 36px;
    }
    
    .producto-card .producto-precio {
        font-size: 16px;
    }
    
    .filtros-sidebar {
        margin-bottom: 20px;
    }
    
    .producto-detalle {
        padding: 15px;
    }
    
    .producto-detalle .precio-grande {
        font-size: 24px;
    }
    
    .tabla-variantes .input-cantidad {
        width: 45px;
    }
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading spinner */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
