/*  Productos Relacionados*/

/* CONTENEDOR PRINCIPAL */
.related-products-wrapper {
    background-color: #ffffff;
    padding: 3rem 1rem;
}

.related-products-wrapper .related-title {
    color: #121a77;
    font-weight: 700;
    font-size: 2rem;
}

.related-products-wrapper .related-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* TARJETA DEL PRODUCTO – altura uniforme */
.related-products-wrapper .related-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.related-products-wrapper .related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(18, 26, 119, 0.1);
}

/*  IMAGEN */
.related-products-wrapper .related-product-card .img-box {
    background-color: #f9fafb;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-products-wrapper .related-product-card img {
    max-height: 180px;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.related-products-wrapper .related-product-card:hover img {
    transform: scale(1.05);
}

/*  NOMBRE DEL PRODUCTO – truncado con puntos suspensivos */
.related-products-wrapper .product-name-link {
    text-decoration: none;
}

.related-products-wrapper .product-name-link .product-name {
    color: #121a77;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.8rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* máximo 2 líneas nombres de productos */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    min-height: 45px;
    /* asegura altura pareja del texto */
    transition: color 0.3s ease;
}

.related-products-wrapper .product-name-link:hover .product-name {
    color: #f97316;
    /* acento naranja institucional */
}

/* CUERPO DE LA CARD */
.related-products-wrapper .card-body {
    flex-grow: 1;
    text-align: center;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/*  PRECIO + BOTONES */
.related-products-wrapper .price-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 0.6rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.related-products-wrapper .product-price {
    color: #121a77;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0;
}

/* BOTONES ESTILO WHATSAPP / PAGAR */

/* Botón base */
.related-products-wrapper .btn-add-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 135px;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: #121a77;
    background-color: #ffffff;
    border: 1.5px solid #e0e4ff;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(18, 26, 119, 0.1);
}

.related-products-wrapper .btn-add-inline:hover {
    background-color: rgba(18, 26, 119, 0.08);
    border-color: #121a77;
    color: #121a77;
    transform: translateY(-2px);
}

/* Ícono del carrito */
.related-products-wrapper .btn-add-inline i {
    font-size: 15px;
}

/* BOTÓN "VER MÁS PRODUCTOS" */
.related-products-wrapper .btn-see-more {
    background-color: #f9fafb;
    /* Gris muy suave */
    color: #374151;
    border: 1.5px solid #d1d5db;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 125px;
    height: 42px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .related-products-wrapper .btn-see-more:hover:not(:disabled) {
        background-color: #2434b3;
        color: #f97316;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(18, 26, 119, 0.3);
    }

    .related-products-wrapper .btn-see-more:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #9ca3af !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /*  ANIMACIONES Y SPINNER */
    .related-products-wrapper .fade-in-related {
        opacity: 0;
        transform: translateY(10px);
        animation: fadeInUp 0.5s ease-out forwards;
    }

    @keyframes fadeInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .related-products-wrapper .omega-spinner {
        display: inline-block;
        margin-left: 10px;
        vertical-align: middle;
    }

    .related-products-wrapper .btn-disabled {
        background-color: #9ca3af !important;
        cursor: not-allowed;
        transform: none !important;
    }

    /* COLUMNAS IGUALES Y RESPONSIVE */
    .related-products-wrapper .col-lg-3,
    .related-products-wrapper .col-md-4,
    .related-products-wrapper .col-sm-6 {
        display: flex;
    }

    .related-products-wrapper .related-product-card {
        flex-grow: 1;
    }

    /*  Responsive: ajustar imagen y texto en móviles */
    @media (max-width: 768px) {
        .related-products-wrapper .related-product-card .img-box {
            height: 160px;
        }

        .related-products-wrapper .product-name-link .product-name {
            font-size: 0.9rem;
            min-height: 40px;
        }

        .related-products-wrapper .btn-add-inline {
            min-width: 120px;
            padding: 0.4rem 0.8rem;
        }
    }

    /* Animación de aparición de productos relacionados */

.fade-in-related {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Keyframes para el efecto */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/*  Efecto escalonado (productos que entran uno tras otro) */
.fade-in-related:nth-child(1) { animation-delay: 0s; }
.fade-in-related:nth-child(2) { animation-delay: 0.1s; }
.fade-in-related:nth-child(3) { animation-delay: 0.2s; }
.fade-in-related:nth-child(4) { animation-delay: 0.3s; }
