/* Paleta de colores moderna y variables */
:root {
    --primary: #023e8a;
    --primary-hover: #0077b6;
    --secondary: #00b4d8;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-dark: #0f1111; 
    --text-muted: #565959;
    --success: #007185; 
    --danger: #B12704; 
    --border-radius: 8px;
    --border-color: #d5d9d9;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.1);
    --amazon-yellow: #ffd814;
    --amazon-yellow-hover: #f7ca00;
}

body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: var(--bg-body); 
    color: var(--text-dark); 
}

/* Encabezado */
header { 
    background-color: var(--primary); 
    color: white; 
    padding: 1rem 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: 1px; }
nav { display: flex; gap: 10px; }
nav button { 
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); 
    color: white; padding: 0.6rem 1.2rem; cursor: pointer; border-radius: 6px; 
    font-weight: 600; transition: all 0.3s ease;
}
nav button:hover { background: white; color: var(--primary); }

/* Contenedor Principal */
.container { max-width: 1200px; margin: 3rem auto; padding: 0 1.5rem; }
.section { display: none; animation: fadeIn 0.4s ease; }
.section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title { text-align: center; color: var(--primary); margin-bottom: 2.5rem; font-size: 2rem; }

/* Grid de Productos */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.card { 
    background: var(--bg-card); border-radius: var(--border-radius); 
    box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card img { width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid #eee; }
.card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.card h3 { color: var(--primary); margin: 0 0 0.5rem 0; font-size: 1.2rem; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 1.5rem; flex-grow: 1; }
.card .price { font-size: 1.5rem; font-weight: 800; color: var(--success); margin-bottom: 1rem; }

/* Botones Generales */
.btn { 
    background: var(--primary-hover); color: white; border: none; padding: 0.8rem 1.5rem; 
    cursor: pointer; border-radius: 6px; width: 100%; font-size: 1rem; font-weight: bold; 
    transition: background 0.3s ease;
}
.btn:hover { background: var(--primary); }
.btn-danger { background: #e63946; }
.btn-danger:hover { background: #d62828; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #005a6a; }

.btn-amazon {
    background-color: var(--amazon-yellow);
    color: var(--text-dark);
    border: 1px solid #fcd200;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
    padding: 0.8rem;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-amazon:hover { background-color: var(--amazon-yellow-hover); }

/* Carrito y Formularios */
.cart-wrapper, .form-container {
    background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); padding: 2rem;
}
.form-container { max-width: 600px; margin: 0 auto; }
.cart-item { 
    display: grid; grid-template-columns: 80px 1fr auto auto; align-items: center; 
    gap: 1.5rem; padding: 1.2rem 0; border-bottom: 1px solid #eaeaea;
}
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-item-details h4 { margin: 0 0 0.4rem 0; color: var(--primary); font-size: 1.1rem; }
.cart-item-details p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.cart-item-price { font-weight: bold; font-size: 1.2rem; color: var(--text-dark); min-width: 100px; text-align: right; }
.cart-total-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px dashed #ccc; display: flex; flex-direction: column; align-items: flex-end; }
.cart-total { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: var(--text-dark); font-size: 0.95rem; }
.form-group input, .form-group textarea, .form-group select { 
    width: 100%; padding: 0.7rem; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; font-family: inherit; transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--success); box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.2); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* Diseño Checkout */
.checkout-layout {
    display: flex; gap: 2rem; align-items: flex-start; max-width: 1100px; margin: 0 auto;
}
.checkout-main { flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
.checkout-block { border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; background: var(--bg-card); }
.checkout-block h3 {
    margin-top: 0; font-size: 1.3rem; color: var(--text-dark); border-bottom: 1px solid #e7e7e7;
    padding-bottom: 0.8rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem;
}

.checkout-sidebar { width: 320px; position: sticky; top: 90px; }
.summary-box { border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; background: var(--bg-body); }
.summary-box .terms { font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem; text-align: center; line-height: 1.4; }
.summary-box hr { border: 0; border-top: 1px solid var(--border-color); margin: 1rem 0; }
.summary-box h4 { margin: 0 0 1rem 0; font-size: 1.1rem; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 0.6rem; font-size: 0.95rem; }
.summary-row.total {
    font-weight: 800; font-size: 1.3rem; color: var(--danger); border-top: 1px solid var(--border-color);
    padding-top: 1rem; margin-top: 0.5rem;
}

.payment-methods { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.5rem; }
.payment-method-label {
    border: 1px solid var(--border-color); border-radius: 6px; padding: 1rem;
    display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: all 0.2s ease; background: #fff; font-weight: 600;
}
.payment-method-label:hover { background-color: #f7fafa; }
.payment-method-label:has(input:checked) { border-color: var(--success); background-color: #f0f8f8; }
.payment-method-label input[type="radio"] { accent-color: var(--success); width: 1.2rem; height: 1.2rem; }

.payment-details-box { background: #fff; padding: 1.5rem; border-radius: 6px; border: 1px solid var(--border-color); margin-top: -0.5rem; margin-bottom: 1.5rem; display: none; }
.payment-details-box.active { display: block; }

.review-item { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.review-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }
.review-item-details h5 { margin: 0 0 0.3rem 0; font-size: 1rem; color: var(--text-dark); }
.review-item-details .price { color: var(--danger); font-weight: bold; margin: 0; font-size: 1.1rem; }
.review-item-details .delivery { color: var(--success); font-size: 0.9rem; font-weight: 600; margin-top: 0.3rem; }

/* Responsive */
@media (max-width: 900px) {
    .checkout-layout { flex-direction: column-reverse; }
    .checkout-sidebar { width: 100%; position: static; }
}
@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .cart-item { grid-template-columns: 60px 1fr auto; grid-template-areas: "img info delete" "img price delete"; gap: 0.5rem 1rem; }
    .cart-item img { grid-area: img; width: 60px; height: 60px; }
    .cart-item-details { grid-area: info; }
    .cart-item-price { grid-area: price; text-align: left; }
    .cart-item button { grid-area: delete; }
}