* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

header {
    background-color: #fff;
    color: #333;
    padding: 1rem;
}

header a {
    text-decoration: none;
    color: #333;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product {
    background-color: #fff;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.product a {
    text-decoration: none;
    color: #333;
}

.product a:hover {
    text-decoration: underline;
}

.product-image {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    margin-bottom: 1rem;
}

.product-image:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease-in-out;
}

.product-title {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: normal;
    text-align: center;
}

.product-price {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.product-add {
    padding: 0.5rem 1rem;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.product-add:hover {
    background-color: #0056b3;
    transition: background-color 0.3s ease-in-out;
}

.product-add img {
    width: 20px;
    height: 20px;
}

footer {
    background-color: #fff;
    color: #333;
    padding: 1rem;
    text-align: center;
}

.product-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6rem;
}

.product-info-image {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    cursor: pointer;
    margin-bottom: 1rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    gap: 1rem;
}

.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #666;
}

.product-rating-rate {
    font-size: 1.2rem;
    font-weight: bold;
}

.product-rating-count {
    font-size: 1rem;
    font-weight: normal;
}

.product-rating-star {
    width: 20px;
    height: 20px;
    color: #ffd700;
    fill: #ffd700;
}

.product-category {
    font-size: 1rem;
    font-weight: normal;
    color: #666;
}

.product-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.product-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Estilos para el carrito */
.cart {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #fff;
    border-radius: 10px;
    margin: 2rem 0;
}

.cart-empty h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.cart-empty p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.continue-shopping {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: #fff;
    color: #000;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #000;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: center;
}

.continue-shopping:hover {
    background-color: #333;
    color: #fff;
    transition: background-color 0.3s ease;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.cart-header h1 {
    color: #333;
    font-size: 2.5rem;
}

.cart-count {
    color: #666;
    font-size: 1.1rem;
}

.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    gap: 1rem;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.cart-item-category {
    color: #666;
    font-size: 0.9rem;
    text-transform: capitalize;
    margin: 0;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
    margin: 0;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.quantity-btn:hover {
    background-color: #f5f5f5;
    border-color: #000;
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.cart-item-subtotal {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    margin: 0;
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.remove-btn:hover {
    background-color: #ffebee;
}

.remove-icon {
    width: 20px;
    height: 20px;
    filter: invert(0.5);
}

.remove-btn:hover .remove-icon {
    filter: invert(0.2) sepia(1) saturate(5) hue-rotate(0deg);
}

.cart-summary {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.summary-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.summary-line.total {
    border-top: 2px solid #eee;
    padding-top: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 1rem 0;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: #333;
}

.cart-count {
    color: #fff;
    font-size: 1.1rem;
    background-color: #e20f0f;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.loader {
    width: 50px;
    height: 50px;
    animation: rotate 1s linear infinite;
}

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

/* Responsive design para el carrito */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-actions {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .cart-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

