/* ========================================
   CATÁLOGO ONLINE - ESTILOS PRINCIPALES
   ======================================== */

/* Variables CSS */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
}

/* Reset y base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6;
    color: var(--dark);
    background: #ffffff;
    margin: 0;
    padding: 0;
}

/* Layout principal */
.catalogo-main {
    background: #ffffff;
    min-height: calc(100vh - 200px);
    position: relative;
}

/* Contenedor del contenido */
.catalogo-content-wrapper {
    padding: 0 1rem 1rem 1rem;
    min-height: calc(100vh - 300px);
}

/* Header del catálogo - SIMPLIFICADO */
.catalogo-header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
}

.header-top {
    height: 60px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.header-logo {
    flex-shrink: 0;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.header-search .btn-search {
    background-color: var(--secondary-color, #764ba2);
    border-color: var(--secondary-color, #764ba2);
    color: var(--button-text-color, #ffffff);
    transition: background-color 0.2s ease, filter 0.2s ease;
}

.header-search .btn-search:hover,
.header-search .btn-search:focus {
    filter: brightness(0.9);
    color: var(--button-text-color, #ffffff);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-actions .sucursal-selector {
    min-width: 120px;
}

.header-actions .dropdown {
    flex-shrink: 0;
}

.header-actions #cart-btn {
    flex-shrink: 0;
}

.header-menu {
    height: 40px;
    background: var(--primary);
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

.header-menu .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.header-menu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    align-items: center;
}

.header-menu .nav-link:hover,
.header-menu .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown de categorías con scroll */
.header-menu .dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
}

/* Fila superior del header (logo, búsqueda, etc.) */
.catalogo-header .row {
    height: 60px; /* Altura fija de 60px */
    margin: 0; /* Sin margen */
    padding: 0; /* Sin padding */
    align-items: center;
}

.catalogo-header h1 {
    color: var(--dark);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

/* Barra de búsqueda */
.search-form .form-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-form .btn-search,
.header-search .btn-search {
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background-color: var(--primary-color, #0d6efd);
    border-color: var(--primary-color, #0d6efd);
    color: var(--button-text-color, #ffffff);
    transition: background-color 0.2s ease, filter 0.2s ease;
}

.search-form .btn-search:hover,
.search-form .btn-search:focus,
.header-search .btn-search:hover,
.header-search .btn-search:focus {
    filter: brightness(0.92);
    color: var(--button-text-color, #ffffff);
}

/* Selector de sucursal */
.sucursal-selector {
    min-width: 150px;
}

.sucursal-selector .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: #ffffff;
}

.sucursal-selector .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Sidebar */
.catalogo-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    width: 280px;
    flex-shrink: 0;
    display: none;
    max-height: calc(100vh - 0px);
    overflow-y: auto;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.catalogo-sidebar.show {
    display: block;
}

.sidebar-header {
    background: var(--primary);
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h5 {
    color: white;
    font-weight: 600;
    margin: 0;
    font-size: 1.125rem;
}

.catalogo-sidebar .list-group-item {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
    text-decoration: none;
}

.catalogo-sidebar .list-group-item:hover {
    background: var(--gray-50);
    color: var(--primary);
    padding-left: 1.25rem;
}

.catalogo-sidebar .list-group-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Overlay para sidebar - solo móviles */
.sidebar-overlay {
    display: none;
}

/* Tarjetas de productos */
.card,
.producto-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    overflow: hidden;
    background: #ffffff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover,
.producto-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-img-top,
.producto-imagen img {
    height: 180px;
    object-fit: cover;
    transition: transform 0.2s ease;
    width: 100%;
}

.card:hover .card-img-top,
.producto-card:hover .producto-imagen img {
    transform: scale(1.05);
}

.card-title,
.producto-nombre {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-nombre a {
    color: inherit;
    text-decoration: none;
}

.producto-nombre a:hover {
    color: var(--primary);
}

.card-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.precio-actual,
.producto-precio .precio-actual {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.producto-precio {
    margin-bottom: 1rem;
}

.precio-original,
.producto-precio .precio-original {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* Controles de cantidad */
.cantidad-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-cantidad-minus,
.btn-cantidad-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-cantidad-minus:hover,
.btn-cantidad-plus:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.cantidad-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.unidad-medida {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Botones */
.btn {
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-agregar-carrito {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: auto;
}

.btn-agregar-carrito:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-agregar-carrito:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Badges de productos */
.producto-badges {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.producto-imagen {
    position: relative;
}

.producto-cintilla {
    position: absolute;
    top: 12px;
    left: -8px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.oferta-cintilla {
    background: linear-gradient(135deg, var(--secondary-color, #ff6b6b), var(--primary-color, #f06595));
}

.badge-stock,
.badge-oferta {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-stock {
    background: var(--success);
    color: #ffffff;
}

.badge-stock.badge-agotado {
    background: var(--danger);
    color: #ffffff;
}

.badge-oferta {
    background: var(--warning);
    color: #ffffff;
}

/* Grid de productos */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas por defecto (móvil) */
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 5 columnas en escritorio */
@media (min-width: 992px) {
    .productos-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

.producto-info {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

/* Animación fade-in */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Controles de cantidad */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 0.25rem;
    border: 1px solid var(--border);
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary-dark);
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Dropdown del usuario */
#userDropdown {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Menú horizontal - SIMPLIFICADO */
.header-menu .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

/* Botón sidebar-toggle en menú horizontal (ahora es el dropdown de categorías) */
.header-menu #sidebar-toggle {
    margin: 0;
    padding: 0.5rem 0.8rem;
    height: auto;
    font-size: inherit;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
}

.header-menu #sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.header-menu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    align-items: center;
}

.header-menu .nav-link:hover,
.header-menu .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.header-navbar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.8rem; /* Ajustado para altura de 40px */
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    height: 100%; /* Usar toda la altura disponible */
    display: flex;
    align-items: center;
}

.header-navbar .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.header-navbar .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.header-navbar .dropdown-menu {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.header-navbar .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.header-navbar .dropdown-item:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

/* Badge del carrito en header */
/* Uniformar tamaños de botones del header */
.header-actions .form-select-sm {
    height: 32px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.header-actions .btn-sm {
    height: 32px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Asegurar que el carrito tenga el mismo tamaño */
#cart-btn {
    height: 32px;
    min-width: 32px;
    padding: 0.375rem;
}

/* Contenedor de acciones del header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .sucursal-selector {
    min-width: 140px;
}

.header-actions .dropdown {
    min-width: auto;
}

/* Responsive para botones del header */
@media (max-width: 768px) {
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .sucursal-selector {
        min-width: 120px;
    }
    
    .header-actions .form-select-sm,
    .header-actions .btn-sm {
        height: 30px;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    #cart-btn {
        height: 30px;
        min-width: 30px;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 0.25rem;
    }
    
    .header-actions .sucursal-selector {
        min-width: 100px;
    }
    
    .header-actions .form-select-sm,
    .header-actions .btn-sm {
        height: 28px;
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    #cart-btn {
        height: 28px;
        min-width: 28px;
        padding: 0.2rem;
    }
}

#carrito-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    font-size: 0.7em;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    font-weight: 600;
}

/* Botón flotante del carrito */
.floating-cart-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 1000;
}

.floating-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Badges */
.badge {
    border-radius: 9999px;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

/* Botón toggle del sidebar */
.sidebar-toggle {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
}

/* Logotipo del negocio */
.logo-negocio {
    transition: all 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
}

.logo-negocio:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Responsive */
@media (min-width: 992px) {
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .logo-negocio {
        max-height: 40px !important;
        max-width: 120px !important;
    }
    
    .header-full-width {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .catalogo-main {
        min-height: 100vh;
    }
    
    /* Menú horizontal en móviles */
    .header-navbar {
        height: 40px; /* Mantener altura fija */
        padding: 0; /* Sin padding */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header-top {
        padding: 0 0.5rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .header-search {
        display: none; /* Ocultar búsqueda en móviles */
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .sucursal-selector {
        min-width: 100px;
    }
    
    .header-actions .sucursal-selector .form-select {
        font-size: 0.8rem;
    }
    
    .header-actions .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .header-menu {
        padding: 0 0.5rem;
    }
    
    .header-menu .navbar-nav {
        gap: 0.5rem;
    }
    
    .header-menu .nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .header-menu .nav-link i {
        display: none;
    }
    
    /* Responsive para filtros de categoría */
    .categoria-header .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categoria-header .col-md-3 {
        text-align: center !important;
    }
    
    .filtros-categoria .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .filtros-categoria .btn {
        margin-bottom: 0.25rem;
    }
    
    .catalogo-container {
        flex-direction: column;
    }
    
    .catalogo-sidebar {
        width: 100%;
    }
    
    .sidebar-overlay {
        display: block !important;
    }
    
    .catalogo-content-wrapper {
        padding: 0;
    }
    
    .floating-cart-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
    }
}

/* Footer */
/* Footer mejorado */
.catalogo-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-title {
    color: #ecf0f1;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-title i {
    color: #3498db;
}

.footer-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #bdc3c7;
    font-size: 0.9rem;
}

.footer-info i {
    color: #3498db;
    width: 20px;
    text-align: center;
}

.footer-info a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-info a:hover {
    color: #3498db;
}

.horarios-text {
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.footer-bottom p {
    color: #95a5a6;
    font-size: 0.85rem;
    margin: 0;
}

.footer-bottom .text-light {
    color: #ecf0f1 !important;
}

/* Responsive para el footer */
@media (max-width: 768px) {
    .catalogo-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-info {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-bottom .row {
        text-align: center;
    }
    
    .footer-bottom .col-md-6:last-child {
        margin-top: 0.5rem;
    }
}

/* Solución para elementos sticky que se superponen al footer */
.sticky-top {
    position: sticky !important;
    top: 100px !important;
    z-index: 10 !important;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Asegurar que el contenido tenga suficiente espacio antes del footer */
.container-fluid {
    padding-bottom: 2rem;
}

/* En páginas específicas como carrito, agregar más espacio */
.carrito-page {
    padding-bottom: 2rem;
    min-height: calc(100vh - 400px);
}

/* Utilidades */
.text-muted {
    color: var(--gray-500) !important;
}

.bg-light {
    background: var(--gray-50) !important;
}

.border-light {
    border-color: var(--border) !important;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modales */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

/* Tablas */
.table {
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Formularios */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Alertas */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

/* ========================================
   ESTILOS DE AUTENTICACIÓN
   ======================================== */

/* Formularios de autenticación */
.auth-form {
    max-width: 500px;
    margin: 0 auto;
}

.auth-form .card {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
}

.auth-form .card-header {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    padding: 2rem 2rem 1rem;
}

.auth-form .card-body {
    padding: 1rem 2rem 2rem;
}

.auth-form .form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.auth-form .form-control.is-invalid {
    border-color: var(--danger);
}

.auth-form .form-control.is-valid {
    border-color: var(--success);
}

.auth-form .input-group .btn {
    border: 2px solid var(--gray-200);
    border-left: none;
}

.auth-form .input-group .form-control:focus + .btn {
    border-color: var(--primary);
}

/* Botones de autenticación */
.auth-btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.auth-btn:active {
    transform: translateY(0);
}

/* Dropdown de usuario autenticado */
.user-dropdown .dropdown-toggle {
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-toggle:hover {
    background: var(--primary);
    color: white;
}

.user-dropdown .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.user-dropdown .dropdown-item {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Botones de login/registro en header */
.header-auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-auth-buttons .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-auth-buttons .btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.header-auth-buttons .btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.header-auth-buttons .btn-primary {
    background: var(--primary);
    border: 2px solid var(--primary);
}

.header-auth-buttons .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Formulario de búsqueda en header */
.search-form {
    max-width: 100%;
}

.search-form .input-group {
    height: 2.5rem;
}

.search-form .form-control {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius) 0 0 var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.search-form .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-left: none;
    background: var(--light);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.search-form .btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Modales de autenticación rápida */
.quick-auth-modal .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.quick-auth-modal .modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.quick-auth-modal .modal-body {
    padding: 1.5rem;
}

.quick-auth-modal .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* Modal de autenticación requerida */
.auth-required-modal .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-required-modal .modal-header {
    background: var(--warning);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
}

.auth-required-modal .modal-body {
    text-align: center;
    padding: 2rem;
}

.auth-required-modal .display-1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Estados de validación */
.form-validation {
    position: relative;
}

.form-validation .invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.form-validation .valid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--success);
    margin-top: 0.25rem;
}

/* Campos anti-bot (ocultos) */
.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Indicadores de carga */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive para móviles */
@media (max-width: 768px) {
    .auth-form .card-header,
    .auth-form .card-body {
        padding: 1.5rem;
    }
    
    .header-auth-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .header-auth-buttons .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .user-dropdown .dropdown-toggle {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .auth-required-modal .display-1 {
        font-size: 3rem;
    }
}

/* Animaciones de entrada */
.auth-form .card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para toast notifications */
.toast-container {
    z-index: 1055;
}

.toast {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.toast-body {
    padding: 1rem;
    font-weight: 500;
}

/* Estilos para página de perfil */
.profile-card {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
}

.profile-card .card-header {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
}

.profile-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.profile-info .form-label {
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.profile-info .form-control-plaintext {
    color: var(--gray-800);
    font-weight: 500;
}

/* Estilos para página de pedidos */
.pedidos-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.pedidos-empty-state .display-1 {
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.pedidos-empty-state h5 {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.pedidos-empty-state p {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.pedidos-features {
    margin-top: 3rem;
}

.pedidos-features .card {
    border: none;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.pedidos-features .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pedidos-features .card-body {
    text-align: center;
    padding: 2rem 1rem;
}

.pedidos-features .card-title {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

/* ========================================
   LAYOUT DE AUTENTICACIÓN MINIMALISTA
   ======================================== */

.auth-body {
    background: linear-gradient(135deg, var(--catalogo-bg-primary) 0%, var(--catalogo-bg-secondary) 100%);
    min-height: 100vh;
    font-family: var(--catalogo-font-primary);
}

.auth-header {
    padding: 2rem 0 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-logo-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.auth-logo-link:hover {
    transform: translateY(-2px);
    color: var(--catalogo-primary);
}

.auth-logo {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.auth-business-name {
    font-family: var(--catalogo-font-secondary);
    font-size: 2rem;
    font-weight: 600;
    color: var(--catalogo-text-primary);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-main {
    padding: 1rem 0 3rem;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.auth-footer {
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Formularios de autenticación minimalistas */
.auth-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.25rem 2.5rem 2.5rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

.auth-form .form-title {
    font-family: var(--catalogo-font-secondary);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--catalogo-text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-form .form-subtitle {
    color: var(--catalogo-text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-form .form-floating {
    margin-bottom: 1.25rem;
}

.auth-form .form-floating > .form-control {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1rem 0.75rem 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.auth-form .form-floating > .form-control:focus {
    border-color: var(--catalogo-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--catalogo-primary-rgb), 0.15);
    background: rgba(255, 255, 255, 1);
}

.auth-form .form-floating > label {
    color: var(--catalogo-text-secondary);
    font-weight: 500;
    padding: 1rem 0.75rem 0.5rem;
}

.auth-form .btn-primary {
    background: linear-gradient(135deg, var(--catalogo-primary) 0%, var(--catalogo-secondary) 100%);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--catalogo-primary-rgb), 0.3);
    width: 100%;
    color: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--catalogo-primary-rgb), 0.4);
}

.auth-form .btn-outline-primary {
    border: 2px solid var(--catalogo-primary);
    color: var(--catalogo-primary);
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.auth-form .btn-outline-primary:hover {
    background: var(--catalogo-primary);
    border-color: var(--catalogo-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--catalogo-primary-rgb), 0.3);
}

.auth-form .form-check-input:checked {
    background-color: var(--catalogo-primary);
    border-color: var(--catalogo-primary);
}

.auth-form .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--catalogo-primary-rgb), 0.15);
}

.auth-form .form-check-label {
    color: var(--catalogo-text-secondary);
    font-size: 0.9rem;
}

.auth-form .auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-form .auth-links a {
    color: var(--catalogo-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-form .auth-links a:hover {
    color: var(--catalogo-secondary);
    text-decoration: underline;
}

.auth-form .password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--catalogo-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-form .password-toggle:hover {
    color: var(--catalogo-primary);
    background: rgba(var(--catalogo-primary-rgb), 0.1);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .auth-header {
        padding: 1.5rem 0 1rem;
    }
    
    .auth-business-name {
        font-size: 1.5rem;
    }
    
    .auth-main {
        padding: 0.5rem 0 2rem;
    }
    
    .auth-form {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .auth-form .form-title {
        font-size: 1.5rem;
    }
}

.pedidos-features .card-text {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Estilos para secciones del catálogo */
.seccion-titulo {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seccion-titulo i {
    font-size: 1.25rem;
}

/* Sección de productos destacados */
.destacados-section .seccion-titulo {
    color: var(--primary);
}

/* Sección de productos recientemente agregados */
.recientes-section .seccion-titulo {
    color: var(--success);
}

/* Sección de ofertas */
.ofertas-section .seccion-titulo {
    color: var(--danger);
}

/* Secciones de categorías destacadas */
.categoria-destacada-section {
    background: linear-gradient(135deg, var(--bs-light) 0%, rgba(255,255,255,0.8) 100%);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.categoria-destacada-section .seccion-titulo {
    color: var(--bs-primary);
    font-weight: 600;
    font-size: 1.5rem;
}

.categoria-destacada-section .btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.categoria-destacada-section .btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Responsive para categorías destacadas */
@media (max-width: 768px) {
    .categoria-destacada-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .categoria-destacada-section .seccion-titulo {
        font-size: 1.3rem;
    }
    
    .categoria-destacada-section .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .categoria-destacada-section .btn-outline-primary {
        align-self: flex-end;
    }
}

/* Mejoras para toasts */
.toast-container {
    z-index: 9999;
}

.toast {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease-out;
}

.toast.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%) !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

.toast.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%) !important;
}

.toast-body {
    font-weight: 500;
    font-size: 0.95rem;
}

.toast-body i {
    font-size: 1.1rem;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}