/* Marketplace Generalista - Estilos Principales */

:root {
    --primary-color: #02101f;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    font-size: 0.875rem;
}

.main-header {
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand img {
    max-height: 70px;
}

.search-form .input-group {
    max-width: 500px;
}

/* Menú multinivel de categorías */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    min-width: 200px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-submenu > .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Responsive: en móvil el submenú se muestra debajo */
@media (max-width: 992px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-left: 1rem;
        border: none;
        box-shadow: none;
    }
    
    .dropdown-submenu > .dropdown-item i {
        transform: rotate(90deg);
    }
}

/* Product Cards */
.product-card {
    transition: var(--transition);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-actions {
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
}

.price {
    font-weight: 600;
}

/* Category Cards */
.category-card {
    transition: var(--transition);
    background: white;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-pattern.png') repeat;
    opacity: 0.1;
}

/* Features Section */
.feature-card {
    text-align: center;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.feature-card i {
    color: var(--primary-color);
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.newsletter-form .input-group {
    max-width: 400px;
}

/* Stats Section */
.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Footer */
.footer {
    margin-top: auto;
}

.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

/* Loading Spinner */
.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); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .search-form {
        margin-top: 1rem;
    }
    
    .product-card .card-img-top {
        height: 150px;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .top-bar {
        display: none;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.shadow-sm { box-shadow: var(--box-shadow) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: 0.5rem !important; }

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}
