:root {
    --primary-color: #008744; /* Verde característico */
    --accent-red: #e50914;   /* Rojo de ofertas */
    --dark-grey: #2a2a2a;
    --light-bg: #f4f6f8;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-grey);
}

/* HEADER */
.header {
    background-color: var(--primary-color);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 5%;
    gap: 20px;
}

.logo {
    display: flex;
    flex-direction: column;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 1px;
}

.sub-text {
    font-size: 12px;
    color: #ffeb3b;
    margin-top: -5px;
    text-transform: uppercase;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 600px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 15px;
    outline: none;
}

.search-bar button {
    background: var(--dark-grey);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.delivery-type {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.cart-btn {
    position: relative;
    font-size: 22px;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* NAV CATEGORÍAS */
.nav-categories {
    background: #006e37;
    padding: 0 5%;
}

.nav-categories ul {
    display: flex;
    list-style: none;
    gap: 15px;
    overflow-x: auto;
}

.nav-categories a {
    color: white;
    text-decoration: none;
    padding: 12px 10px;
    display: block;
    font-size: 14px;
    white-space: nowrap;
}

.nav-categories a:hover, .nav-categories a.active {
    border-bottom: 3px solid #ffeb3b;
}

/* BANNERS */
.banner-promos {
    display: flex;
    gap: 20px;
    padding: 20px 5%;
}

.banner-card {
    flex: 1;
    padding: 30px;
    border-radius: 12px;
    color: white;
}

.banner-card.red { background: linear-gradient(135deg, #e50914, #900c3f); }
.banner-card.green { background: linear-gradient(135deg, #008744, #11998e); }

/* GRID DE PRODUCTOS */
.main-content {
    padding: 20px 5%;
}

.section-title {
    margin-bottom: 20px;
    font-size: 22px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-red);
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-title {
    font-size: 14px;
    margin-bottom: 8px;
    color: #444;
}

.prices {
    margin-bottom: 12px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-red);
}

.old-price {
    font-size: 13px;
    text-decoration: line-through;
    color: #888;
    margin-left: 6px;
}

.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #006e37;
}

/* CARRITO SIDEBAR */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    font-size: 24px;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

.overlay {
    position: fixed;
    top:0; left:0; width:100vw; height:100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}