/* REGLAS GENERALES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f7f9f8;
    color: #333;
}

/* HEADER Y NAVBAR */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
}

.cart-btn {
    background-color: #2e7d32;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

#cart-count {
    background-color: #ffffff;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 50%;
    font-size: 0.85rem;
}

/* HERO SECTION */
.hero {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin: 10px 0;
}

.btn-primary {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background-color: #2e7d32;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

.hero-image img {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
}

/* GRID DE PRODUCTOS */
.products-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.products-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 15px;
}

.add-to-cart-btn {
    margin-top: auto;
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #2e7d32;
}

/* FOOTER */
footer {
    background-color: #1a202c;
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.footer-column a {
    display: block;
    color: #a0aec0;
    text-decoration: none;
    margin-top: 8px;
}

/* PANEL DEL CARRITO (SIDEBAR) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 200;
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: white;
    z-index: 201;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
}

.cart-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.cart-item-details h4 {
    font-size: 0.95rem;
}

.cart-item-details p {
    color: #666;
    font-size: 0.85rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    background: #eee;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

/* NOTIFICACIÓN TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    z-index: 300;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}