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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
}

.btn-carrito {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-carrito:hover {
    transform: scale(1.05);
}

/* Filtros */
.filtros {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filtros select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-left: 10px;
}

/* Layout Principal */
.contenido-principal {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin: 20px 0;
}

/* Productos */
.productos-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.producto-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.producto-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.producto-info {
    padding: 15px;
}

.producto-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.categoria {
    color: #667eea;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.descripcion {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.precio {
    font-size: 24px;
    font-weight: bold;
    color: #2ecc71;
    margin: 10px 0;
}

.stock {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.btn-agregar {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-agregar:hover {
    background: #5568d3;
}

.btn-sin-stock {
    width: 100%;
    padding: 12px;
    background: #ddd;
    color: #999;
    border: none;
    border-radius: 5px;
    cursor: not-allowed;
}

/* Carrito Sidebar */
.carrito-sidebar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.carrito-sidebar h2 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.carrito-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.item-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.item-precio {
    color: #666;
    font-size: 14px;
}

.item-cantidad {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-cantidad button {
    width: 30px;
    height: 30px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.item-cantidad button:hover {
    background: #667eea;
    color: white;
}

.btn-eliminar {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
}

.item-subtotal {
    text-align: right;
    font-weight: bold;
    color: #2ecc71;
    margin-top: 5px;
}

.carrito-vacio {
    text-align: center;
    color: #999;
    padding: 20px;
}

.carrito-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
}

.btn-finalizar {
    width: 100%;
    padding: 15px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn-finalizar:hover {
    background: #27ae60;
}

/* Checkout */
.btn-volver {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin: 20px 0;
}

.checkout-form,
.checkout-resumen {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-pagar {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-pagar:hover {
    transform: translateY(-2px);
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.resumen-totales {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.resumen-totales > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.resumen-totales .total {
    font-size: 20px;
    font-weight: bold;
    color: #2ecc71;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #f0f0f0;
}

.info-pago {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.tarjetas {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tarjetas span {
    padding: 5px 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

/* Mensajes */
.mensaje {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.mensaje.show {
    opacity: 1;
    transform: translateX(0);
}

.mensaje-success { background: #2ecc71; }
.mensaje-error { background: #e74c3c; }
.mensaje-warning { background: #f39c12; }
.mensaje-info { background: #3498db; }

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 1024px) {
    .contenido-principal {
        grid-template-columns: 1fr;
    }
    
    .carrito-sidebar {
        position: static;
        max-height: none;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
}
