/* Estilos generales */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --text-color: #333;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--dark-color);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Header y navegación */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--dark-color);
    transition: var(--transition);
}

.cart-icon:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carrito lateral */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    padding: 20px;
    overflow-y: auto;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 5px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 500;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    background-color: #eee;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-number {
    margin: 0 10px;
    font-weight: 500;
}

.cart-item-remove {
    color: var(--danger-color);
    cursor: pointer;
    margin-left: 15px;
    font-size: 1.1rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 500;
}

.checkout-btn {
    width: 100%;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

/* Hero section */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1580522154071-c6ca47a859ad?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80');
    background-size: cover;
    background-position: center;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Categorías */
.categories {
    padding: 60px 0;
    background-color: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.category {
    text-align: center;
    transition: var(--transition);
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background-color: white;
}

.category:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Productos */
.products {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.product-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: none;
    padding: 8px 15px;
    margin: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: var(--transition);
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 500;
}

.product-title {
    margin: 10px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-color);
}

.product-price {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.add-to-cart:hover {
    background-color: #2980b9;
}

.product-rating {
    color: #ffc107;
}

.product-rating i {
    font-size: 0.7rem; /* Ajusta este valor según necesites */
}

/* Características */
.features {
    padding: 60px 0;
    background-color: white;
}

.features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

.feature p {
    font-size: 0.9rem;
    color: #666;
}

/* Newsletter */
.newsletter {
    background-color: var(--primary-color);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.newsletter h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.newsletter p {
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    min-width: 200px;
    font-size: 1rem;
}

.newsletter-form .btn {
    border-radius: 0 5px 5px 0;
    background-color: var(--dark-color);
    padding: 12px 20px;
}

.newsletter-form .btn:hover {
    background-color: #1a252f;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 500;
}

.footer-section p {
    margin-bottom: 15px;
    color: #bdc3c7;
}

.social {
    display: flex;
    margin-top: 20px;
}

.social a {
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: var(--transition);
}

.social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-section i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Responsive */
@media screen and (max-width: 991px) {
    .hero-content h2 {
        font-size: 2.5rem;
    }

    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }

    .newsletter-form input {
        width: 100%;
        border-radius: 5px;
        margin-bottom: 10px;
    }

    .newsletter-form .btn {
        border-radius: 5px;
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-200%);
        opacity: 0;
        transition: var(--transition);
        z-index: 50;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .cart-sidebar {
        width: 300px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social {
        justify-content: center;
    }

    .footer-section i {
        margin-right: 5px;
    }
}

@media screen and (max-width: 480px) {
    .hero {
        height: 60vh;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cart-sidebar {
        width: 100%;
    }
}

/*lazy-loading*/

.product-img-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0; /* Color de fondo mientras carga */
}

.product-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img-placeholder:after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.lazy-image.loaded {
    opacity: 1;
}

/*Nuevos cambios*/

/* Estilos para el botón de cargar más */
#load-more-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.load-more-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background-color: var(--primary-color-dark);
}

.no-products {
    width: 100%;
    text-align: center;
    padding: 50px 0;
    font-size: 1.2em;
    color: #666;
}