/* 1. Reset y Estilos Globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f3f3f3; /* Gris claro tipo Amazon */
    color: #111;
}

/* 2. Cabecera (Header) */
.header {
    background-color: #ffe600;
    padding: 10px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2d3277;
    cursor: pointer;
}

.search-bar {
    display: flex;
    width: 50%;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-left: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

/* 3. Botones de la Cabecera */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-auth {
    background: transparent;
    border: 1px solid #2d3277;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn-auth:hover {
    background: #2d3277;
    color: white;
}

.cart {
    font-weight: bold;
    cursor: pointer;
}

/* 4. MODAL DE AUTENTICACIÓN (Login/Registro) */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo oscuro */
    display: none; /* JS lo cambia a 'flex' */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
}

.cerrar:hover {
    background: #ddd;
}

/* 5. Estilos de Formulario (Labels e Inputs) */
.form-box {
    display: none;
}

.form-box.active {
    display: block;
}

.form-box h3 {
    margin-bottom: 20px;
    font-size: 22px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #a6a6a6;
    border-radius: 3px;
    outline: none;
}

.input-group input:focus {
    border-color: #e77600; /* Naranja Amazon */
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

/* 6. Botón Principal (Amazon Style) */
.btn-primary {
    width: 100%;
    padding: 10px;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    border: 1px solid #a88734;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    font-weight: bold;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #f5d78e, #eeb933);
}

/* 7. Mensajes de error/éxito y Enlaces */
#mensaje {
    margin-top: 15px;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.switch {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
}

.switch span {
    color: #0066c0;
    cursor: pointer;
    text-decoration: underline;
}

.switch span:hover {
    color: #c45500;
}

/* 8. Layout de Productos (Grid) */
.main-container {
    display: flex;
    max-width: 1300px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =========================================
   NUEVAS CLASES AGREGADAS PARA EL CÓDIGO 2 
   ========================================= */

/* 9. Barra Lateral (Filtros) */
.sidebar {
    width: 250px;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    height: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 12px;
}

.filter-list label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

/* 10. Elementos Internos de la Tarjeta de Producto */
.product-image {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px; /* Por si usan emojis temporalmente */
    margin-bottom: 15px;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-tag {
    background: #e3e6e8;
    color: #444;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    align-self: flex-start;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.product-title {
    font-size: 15px;
    color: #0F1111;
    margin-bottom: 8px;
    min-height: 40px; /* Mantiene alineación aunque el texto sea corto */
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #B12704; /* Rojo precio de Amazon */
    margin-bottom: 15px;
    margin-top: auto; /* Empuja el precio y el botón hacia abajo */
}

.btn-details {
    width: 100%;
    padding: 8px;
    background: #2d3277;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
}

.btn-details:hover {
    background: #1a1e54;
}