/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
header {
    background-color: #4CAF50;
    color: #fff;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.header-container h1 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #e0e0e0;
}

/* Main layout */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Products Grid */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.producto {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.producto img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.producto h3 {
    margin: 0.5rem 0;
    color: #333;
}

.precio {
    font-size: 1.25rem;
    color: #4CAF50;
    font-weight: bold;
    margin: 0.5rem 0;
}

/* Buttons */
button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.3s;
}

button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

/* Cart styles */
#lista-carrito {
    list-style: none;
    padding: 0;
}

#lista-carrito li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#total {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: right;
    margin-top: 1rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

/* Dark mode toggle */
#dark-mode-toggle {
    padding: 0.5rem 1rem;
    background-color: #333;
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .productos-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
}
