:root {
    --primary-color: #2563eb;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --whatsapp-color: #25d366;
    --whatsapp-hover: #128c7e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.search-bar {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    width: 100%;
    max-width: 400px;
    outline: none;
}

.btn-toggle-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layout-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

main {
    flex: 1;
}

.catalog-title {
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.product-image-container {
    width: 100%;
    height: 180px;
    background-color: #f3f4f6;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 1rem;
}

.btn-add-cart {
    width: 100%;
    padding: 0.6rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add-cart:hover {
    background-color: #1d4ed8;
}

/* Estilos del Carrito Lateral */
.cart-sidebar {
    width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.cart-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.cart-item-details {
    max-width: 70%;
}

.cart-item-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
}

.cart-footer {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.btn-send-order {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--whatsapp-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-send-order:hover:not(:disabled) {
    background-color: var(--whatsapp-hover);
}

.btn-send-order:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsivo para celulares */
@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    .cart-sidebar {
        width: 100%;
        position: static;
    }
}


/* ... Mantené todo lo anterior de estilos.css y agregá esto abajo: ... */

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.btn-qty {
    background-color: var(--border-color);
    border: none;
    color: var(--text-color);
    width: 24px;
    height: 24px;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s;
}

.btn-qty:hover {
    background-color: #cbd5e1; /* Gris un poco más oscuro al pasar el mouse */
}

.qty-number {
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.item-subtotal {
    color: #6b7280;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* ... Mantené todo lo de estilos.css y agregá esto al final ... */
.btn-send-order {
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-send-order.disabled {
    background-color: #d1d5db !important;
    color: #9ca3af !important;
    pointer-events: none; /* Deshabilita por completo los clicks del navegador */
    cursor: not-allowed;
}

