/* ==========================================================================
   Sección: Productos Relacionados (Single Product)
   ========================================================================== */
.related-section {
    padding: 20px 0 60px 0;
    background-color: #f4f6f9; /* Se fusiona con el fondo de la página */
    width: 100%;
    box-sizing: border-box;
}

.related-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 50px;
    box-sizing: border-box;
}

/* Encabezado */
.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.related-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin: 0;
    letter-spacing: -0.5px;
}

.related-title .highlight { color: #00b912; }

.btn-outline-catalog {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background-color: #fff;
    transition: all 0.3s ease;
}

.btn-outline-catalog:hover { background-color: #f0f0f0; color: #111; }

/* Contenedor del Slider y Flechas */
.slider-wrapper {
    position: relative;
    margin: 0 -20px; 
    padding: 0 20px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.slider-arrow i { font-size: 24px; width: 24px; height: 24px; }
.slider-arrow:hover { color: #111; }
.arrow-prev { left: -15px; }
.arrow-next { right: -15px; }

/* El Slider (La pista) */
.related-slider {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.related-slider.active {
    cursor: grabbing;
    scroll-snap-type: none;
}

.related-slider::-webkit-scrollbar { display: none; }

/* Tarjeta de Producto */
.product-card {
    flex: 0 0 calc(20% - 16px);
    max-width: 229px;
    display: flex;
    flex-direction: column;
    background: transparent;
    scroll-snap-align: start;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Imagen y Etiquetas */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.product-img-link { display: block; width: 100%; height: 100%; }
.product-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

/* Badges */
.product-badges {
    position: absolute;
    top: 15px; left: 15px; right: 15px;
    display: flex;
    flex-wrap: wrap; 
    gap: 6px;
    z-index: 2;
}

.badge {
    padding: 4px 10px; border-radius: 12px; font-size: 11px;
    font-weight: 600; color: #ffffff; display: inline-flex; align-items: center;
}
.badge i { font-size: 12px; width: 12px; height: 12px; margin-right: 4px; }
.badge-nuevo { background-color: #d32f2f; }
.badge-darc { background-color: #333; }
.badge-personalizable { background-color: #ba58f6; }

/* Contenido de la Tarjeta */
.product-content { display: flex; flex-direction: column; flex: 1; }
.product-meta { font-size: 11px; color: #888; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.meta-separator { color: #ccc; }
.product-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 15px 0; }
.product-title a { color: #222; text-decoration: none; }
.product-title a:hover { color: #00b912; }

/* Botones Inferiores */
.product-actions { margin-top: auto; display: flex; gap: 10px; align-items: center; }
.product-card a, .product-img { -webkit-user-drag: none; user-drag: none; }

.btn-add-quote {
    flex: 1; background-color: #00b912; color: #ffffff; text-align: center;
    padding: 10px 15px; border-radius: 25px; font-size: 12px; font-weight: 500;
    text-decoration: none; transition: background-color 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-add-quote:hover { background-color: #009d0f; color: #fff; }

.btn-wishlist {
    background-color: #eaf4ea; color: #00b912; border: none; width: 38px; height: 38px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}

/* Barra de Progreso Inferior */
.slider-scrollbar { margin-top: 20px; width: 100%; }
.scrollbar-track { width: 100%; height: 4px; background-color: #ddd; border-radius: 2px; position: relative; overflow: hidden; }
.scrollbar-thumb { position: absolute; top: 0; left: 0; height: 100%; background-color: #00b912; border-radius: 2px; width: 20%; transition: left 0.1s ease; }

/* ==========================================================================
   Responsive (Mobile)
   ========================================================================== */
@media screen and (max-width: 991px) {
    .related-section { padding: 40px 0; }
    .related-container { padding: 0 20px; }
    .related-header { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
    .slider-arrow { display: none; } 
    .slider-wrapper { margin: 0; padding: 0; }
    .related-slider { gap: 15px; }

    .product-card {
        flex: 0 0 calc(50% - 7.5px); 
        min-width: 0; 
    }

    .product-image-wrapper { height: 160px; padding: 10px; }
    .product-title { font-size: 13px; margin-bottom: 10px; }
    .product-actions { gap: 5px; }

    .btn-add-quote {
        padding: 8px 5px; font-size: 10.5px; white-space: nowrap;
        gap: 4px; overflow: hidden; text-overflow: ellipsis;
    }
    .btn-add-quote i { font-size: 13px; width: 13px; height: 13px; }
    .btn-wishlist { width: 32px; height: 32px; }
    .btn-wishlist i { font-size: 14px; width: 14px; height: 14px; }
}