:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Featured Categories */
.featured-categories {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
    color: var(--primary-color);
}

/* Featured Products */
.featured-products {
    padding: 4rem 0;
    background-color: white;
}

.product-slider {
    margin: 0 -15px;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    background-color: #f8f9fa;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-image img {
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.product-image img:not([loaded]) {
    opacity: 0;
}

.product-image img[loaded] {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
    line-height: 1.4;
}

.product-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: var(--secondary-color);
}

.product-meta {
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.product-actions {
    margin-top: auto;
}

/* Why Choose Us */
.why-choose-us {
    padding: 4rem 0;
    background-color: var(--background-color);
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: 100%;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card p {
    color: #666;
    margin-bottom: 0;
}

/* Buttons */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

/* Navbar */
.navbar {
    background-color: white !important;
    box-shadow: var(--box-shadow);
    padding: 1rem 0;
}

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

.nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .featured-categories {
        padding: 2rem 0;
    }

    .featured-products {
        padding: 2rem 0;
    }

    .why-choose-us {
        padding: 2rem 0;
    }
}

/* Utilities */
.badge {
    padding: 0.5em 1em;
    border-radius: 20px;
    font-weight: 500;
}

.bg-warning {
    background-color: #f1c40f !important;
    color: #000;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

/* Estilos adicionales para filtros y productos */

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-color);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 35px;
}

/* Price Range */
.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-separator {
    color: var(--text-color);
    font-weight: 500;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Product Meta */
.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.product-condition,
.product-category {
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 20px;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-to-cart {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-to-cart.success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Stock Badge */
.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 0.5em 1em;
    border-radius: 20px;
    z-index: 1;
}

/* Products Header */
.products-header {
    margin-bottom: 2rem;
}

.products-header h1 {
    margin: 0;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    border: none;
    margin: 0 2px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--secondary-color);
    color: white;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-section {
        margin-bottom: 2rem;
    }

    .product-card {
        margin-bottom: 1.5rem;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--secondary-color);
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Estilos para la página de detalles del producto */

.product-details {
    padding: 2rem 0;
}

.product-gallery {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.main-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.05);
}

.thumbnail-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail {
    flex: 0 0 80px;
    height: 80px;
    cursor: pointer;
    border-radius: var(--border-radius);
    overflow: hidden;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.product-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.product-price {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.old-price {
    font-size: 1.5rem;
    color: #6c757d;
    text-decoration: line-through;
}

.discount-badge {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.product-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.add-to-cart-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart {
    flex: 1;
}

.add-to-cart.success {
    background-color: #28a745;
    border-color: #28a745;
}

.add-to-cart.error {
    background-color: #dc3545;
    border-color: #dc3545;
}

.product-features {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.feature i {
    font-size: 1.5rem;
    color: var(--secondary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.feature-text h6 {
    margin: 0;
    font-weight: 600;
    color: var(--primary-color);
}

.feature-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .main-image {
        height: 300px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .current-price {
        font-size: 2rem;
    }

    .add-to-cart-section {
        flex-direction: column;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
}

.product-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
