/*
==========================================================
REINICIO Y ESTILOS GENERALES
==========================================================
*/
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; 
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/*
==========================================================
1. HEADER (Barra superior)
==========================================================
*/
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    background-color: white;
    border-bottom: 1px solid #ddd;
}

.navbar-logo{
    height: 50px;
    aspect-ratio: 1/1;
    border-radius: 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 15px;
    width: 350px;
}

.search-bar input {
    border: none;
    outline: none;
    padding-left: 10px;
    flex-grow: 1;
}

.search-bar i {
    color: #0400eb;
    font-size: 0.9em;
}

.cart {
    display: flex;
    align-items: center;
    color: #333;
    margin-left: 20px;
}

.cart i {
    font-size: 1.3em;
    margin-right: 5px;
}

/*
==========================================================
2. VISTA DE CATÁLOGO (GRID)
==========================================================
*/
.main-content-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
}

.sidebar {
    width: 250px;
    margin-right: 30px;
}

.category-section, .price-filter-section {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sidebar h2 {
    font-size: 1.1em;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9em;
}

.product-catalogue-main {
    flex-grow: 1;
}

.catalogue-header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.catalogue-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.product-count {
    font-size: 0.9em;
    color: #777;
    margin-right: auto;
    padding-left: 20px;
}

.sort-by select {
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.productos-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
}

.product-card-style {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    padding-bottom: 15px; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-card-style img {
    width: 100%;
    height: 150px;
    object-fit: cover; 
    display: block;
}

.product-info-wrapper {
    padding: 10px 15px;
}

.product-brand {
    font-size: 0.8em;
    color: #777;
    text-transform: uppercase;
    display: block;
}

.product-name {
    font-size: 0.95em;
    margin: 5px 0;
    font-weight: 500;
    line-height: 1.3;
    height: 2.6em; 
    overflow: hidden;
}

.product-pricing {
    padding: 0 15px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
}

.product-price-new {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
}

.add-to-cart-form {
    padding: 0 15px;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #007bff; 
    color: white;
    border: none;
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.mensaje-exito {
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/*
==========================================================
3. VISTA DE DETALLE DE PRODUCTO
==========================================================
*/
.breadcrumb-nav { 
    margin-bottom: 2rem; 
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.image-gallery .main-image img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}
.thumbnail-images { 
    display: flex; 
    gap: 10px; 
}
.thumbnail-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, border-color 0.2s;
}
.thumbnail-images img:hover, .thumbnail-images img.active {
    opacity: 1;
    border-color: #007bff;
}

.product-title { 
    font-size: 2.2em; 
    font-weight: bold; 
    margin: 5px 0 15px 0; 
}
.product-price { 
    font-size: 2em; 
    font-weight: bold; 
    color: #dc3545; 
    margin-bottom: 20px; 
}
.product-stock { 
    color: #28a745; 
    margin-bottom: 20px; 
}

.quantity-selector { 
    display: flex; 
    align-items: center; 
    margin-bottom: 20px; 
}
.quantity-selector label { 
    margin-right: 15px; 
    font-weight: bold; 
}
.quantity-selector button {
    width: 40px; 
    height: 40px; 
    border: 1px solid #ccc; 
    background: #f8f9fa; 
    font-size: 1.2em; 
    cursor: pointer;
}
.quantity-selector input {
    width: 50px; 
    height: 40px; 
    text-align: center; 
    border: 1px solid #ccc; 
    border-left: none; 
    border-right: none;
    -moz-appearance: textfield;
}
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.boton-agregar {
    width: 100%; 
    padding: 15px; 
    font-size: 1.1em; 
    background: #28a745; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    transition: background 0.2s;
}

.product-meta { 
    margin-top: 20px; 
    font-size: 0.9em; 
    color: #6c757d; 
}
.product-meta span { 
    display: block; 
    margin-bottom: 5px;
}

.full-description {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 30px;
}

.similares-container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px;
}

.similares-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
}

/*
==========================================================
4. REGLAS PARA QUITAR SUBRAYADO (TEXT-DECORATION)
==========================================================
*/
/* Regla general para los enlaces dentro de la barra lateral de categorías */
.category-list li a {
    text-decoration: none;
    color: #0d6efd;
}
.category-list li.active a {
    color: #333; /* Hereda el color normal cuando está activo */
    font-weight: bold;
}

/* Regla para el enlace del nombre del producto en la tarjeta */
.product-card-style a.product-link {
    text-decoration: none;
}

/* Regla para el enlace "Volver al Catálogo" */
.back-link {
    text-decoration: none;
    font-weight: 500;
    color: #007bff;
}

/* Regla para el enlace de categoría en los metadatos de la página de detalle */
.product-meta a {
    text-decoration: none;
    color: #007bff;
}

/* Opcional: Añadir subrayado solo al pasar el mouse (hover) */
.category-list li a:hover,
.product-card-style a.product-link:hover .product-name,
.back-link:hover,
.product-meta a:hover {
    text-decoration: underline;
}

/*
==========================================================
5. RESPONSIVE DESIGN
==========================================================
*/
@media (max-width: 768px) {
    .product-detail-layout { 
        grid-template-columns: 1fr; 
    }
    .productos-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        margin-right: 0;
    }
}

/* --- ESTILOS PARA EL BOTÓN DE WISHLIST --- */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #eee;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.wishlist-btn i {
    font-size: 1.1em;
    color: #ccc;
    transition: color 0.2s, transform 0.2s;
}
.wishlist-btn:hover i { color: #dc3545; }
.wishlist-btn.active i { color: #dc3545; }
.wishlist-btn .fa-spinner { color: #007bff; }

/* Estilo para el botón en la página de detalle */
.product-main-info .wishlist-btn {
    position: static;
    width: auto;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 20px;
    background: #f8f9fa;
}
.product-main-info .wishlist-btn i { margin-right: 8px; }

/* --- ESTILOS PARA LA NUEVA SECCIÓN DE RESEÑAS --- */
.reviews-section {
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.stars-big { font-size: 1.8em; color: #ffc107; } /* Color estrellas: amarillo */
.reviews-summary span { font-weight: bold; font-size: 1.2em; }
.reviews-summary small { color: #6c757d; } /* Color texto 'Basado en...' */

.review-list { margin-bottom: 30px; } /* Espacio antes del formulario */

.review-item {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.review-item:last-child {
    border-bottom: none; /* No poner línea en la última reseña */
    margin-bottom: 0;
}

.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.review-header .stars-small { font-size: 1em; color: #ffc107; } /* Color estrellas: amarillo */
.review-header .author { font-weight: bold; }
.review-header .date { font-size: 0.8em; color: #6c757d; margin-left: auto; }
.review-item h4 { margin: 0 0 10px 0; font-size: 1.1em; font-weight: 600; color: #333; }
.review-item p { line-height: 1.6; color: #555; } /* Párrafo del comentario */

/* --- Formulario para dejar reseña --- */
.review-form-container {
    background: #f8f9fa; /* Fondo gris suave */
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #eee;
}
.review-form-container h3 { margin-top: 0; margin-bottom: 20px; font-weight: 600; }
.form-group { margin-bottom: 15px; } /* Espacio entre campos del form */
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9em; }

/* Estrellas interactivas */
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 5px; }
.star-rating input { display: none; } /* Oculta los radio buttons */
.star-rating label { font-size: 2em; color: #ccc; cursor: pointer; transition: color 0.2s; }
/* Lógica de color de estrellas */
.star-rating input:checked ~ label, /* Estrellas seleccionadas y las anteriores */
.star-rating label:hover,          /* Estrella sobre la que está el mouse */
.star-rating label:hover ~ label { /* Estrellas anteriores a la que está el mouse */
    color: #ffc107;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Importante */
}
.form-group textarea {
    min-height: 100px;
    resize: vertical; /* Permite redimensionar verticalmente */
}

.btn-submit-review {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #007bff; /* Azul primario */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.2s;
}
.btn-submit-review:hover {
    background-color: #0056b3; /* Azul más oscuro al pasar el mouse */
}

/* Mensajes dentro del formulario */
.review-form-container p[style*="color:green"] { /* Mensaje de éxito */
    font-weight: bold;
    margin-bottom: 15px;
}

.wishlist-btn{position:absolute;top:10px;right:10px;background:rgba(255,255,255,.8);border:1px solid #eee;border-radius:50%;width:35px;height:35px;cursor:pointer;display:flex;justify-content:center;align-items:center;z-index:10}.wishlist-btn i{font-size:1.1em;color:#ccc;transition:color .2s,transform .2s}.wishlist-btn:hover i{color:#dc3545}.wishlist-btn.active i{color:#dc3545}.wishlist-btn .fa-spinner{color:#007bff}.product-main-info .wishlist-btn{position:static;width:auto;border-radius:5px;padding:10px 15px;margin-bottom:20px;background:#f8f9fa}.product-main-info .wishlist-btn i{margin-right:8px}
.header-icons { display: flex; align-items: center; gap: 20px; } /* Estilo para alinear los íconos */
.header-icons .user-icon, .header-icons .cart-icon { font-size: 1.3em; color: #333; position: relative; }
.cart-icon .cart-count { position: absolute; top: -8px; right: -12px; background: #dc3545; color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 0.7em; display: flex; justify-content: center; align-items: center; font-weight: bold; }