/* ============================================
   Products Section — UX/UI moderno Bootstrap 5
   ============================================ */

/* Sección completa */
.products-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
}

/* ---- Encabezado de sección ---- */
.section-header {
    margin-bottom: 1.5rem;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, #5a88ca 0%, #4a78ba 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-badge i {
    margin-right: 4px;
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}

.section-subtext {
    color: #777;
    font-size: 1rem;
    margin-bottom: 0;
}

/* ---- Product Card ---- */
.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eef0f3;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    margin: 8px 4px 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Forzar que OwlCarousel iguale alturas */
.product-carousel .owl-item {
    display: flex;
}

.product-carousel .owl-item > .product-card {
    width: 100%;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(90, 136, 202, 0.18);
}

/* Imagen del producto — altura fija para igualar todas las tarjetas */
.product-card__image {
    position: relative;
    overflow: hidden;
    background: #f5f7fa;
    height: 200px;
    flex-shrink: 0;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s ease;
    display: block;
    padding: 8px;
}

.product-card:hover .product-card__image img {
    transform: scale(1.06);
}

/* Botones de acción sobre la imagen */
.product-card__actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.35));
    transition: bottom 0.35s ease;
}

.product-card:hover .product-card__actions {
    bottom: 0;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.action-btn:hover {
    background: #5a88ca;
    color: #fff;
    transform: scale(1.12);
}

.action-btn--primary {
    background: #5a88ca;
    color: #fff;
}

.action-btn--primary:hover {
    background: #4a78ba;
    color: #fff;
}

/* Cuerpo de la tarjeta — ocupa el espacio restante */
.product-card__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    color: #333;
    margin: 0 0 8px;
    height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card__title a:hover {
    color: #5a88ca;
}

/* Precios — empujados al fondo */
.product-card__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1bd172;
}

.price-old {
    font-size: 0.82rem;
    color: #aaa;
    text-decoration: line-through;
}

/* ---- Botón "Ver todos" ---- */
.btn-view-all {
    display: inline-flex;
    align-items: center;
    padding: 10px 28px;
    border: 2px solid #5a88ca;
    color: #5a88ca;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    background: #5a88ca;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(90, 136, 202, 0.35);
}

/* ============ OwlCarousel — Navegación ============ */

/* Wrapper para posicionar flechas sobre el carrusel */
.products-carousel-wrapper {
    position: relative;
}

/* Flechas prev/next sobre el carrusel, centradas verticalmente */
.products-carousel-wrapper .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-80%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
    padding: 0 0;
}

.products-carousel-wrapper .owl-nav button {
    pointer-events: all;
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    background: rgba(90, 136, 202, 0.9) !important;
    color: #fff !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.products-carousel-wrapper .owl-nav button:hover {
    background: #4a78ba !important;
    transform: scale(1.1);
    box-shadow: 0 5px 18px rgba(90, 136, 202, 0.4);
}

.products-carousel-wrapper .owl-nav button i {
    font-size: 16px !important;
    display: block;
}

.products-carousel-wrapper .owl-nav .owl-prev {
    margin-left: -14px;
}

.products-carousel-wrapper .owl-nav .owl-next {
    margin-right: -14px;
}

.products-carousel-wrapper .owl-nav .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Dots / indicadores */
.products-carousel-wrapper .owl-dots {
    text-align: center;
    margin-top: 20px;
}

.products-carousel-wrapper .owl-dots .owl-dot {
    display: inline-block;
}

.products-carousel-wrapper .owl-dots .owl-dot span {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: #d0d6e0;
    border-radius: 50%;
    display: block;
    transition: all 0.3s ease;
}

.products-carousel-wrapper .owl-dots .owl-dot.active span,
.products-carousel-wrapper .owl-dots .owl-dot:hover span {
    background: #5a88ca;
    transform: scale(1.3);
}

/* ============ Responsive ============ */

/* Tablets */
@media (max-width: 991px) {
    .section-heading {
        font-size: 1.6rem;
    }
    .product-card__image {
        height: 180px;
    }
    .products-carousel-wrapper .owl-nav .owl-prev {
        margin-left: -6px;
    }
    .products-carousel-wrapper .owl-nav .owl-next {
        margin-right: -6px;
    }
}

/* Móviles */
@media (max-width: 575px) {
    .products-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .section-heading {
        font-size: 1.35rem;
    }
    .section-subtext {
        font-size: 0.88rem;
    }
    .product-card__image {
        height: 180px;
    }
    /* En móvil, acciones siempre visibles */
    .product-card__actions {
        bottom: 0;
        background: linear-gradient(transparent, rgba(0,0,0,0.20));
    }
    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .product-card__body {
        padding: 10px 12px 14px;
    }
    .product-card__title {
        font-size: 0.8rem;
    }
    .price-current {
        font-size: 1rem;
    }
    .btn-view-all {
        padding: 8px 22px;
        font-size: 0.88rem;
    }
    /* Flechas más pequeñas y pegadas al borde */
    .products-carousel-wrapper .owl-nav button {
        width: 34px;
        height: 34px;
    }
    .products-carousel-wrapper .owl-nav .owl-prev {
        margin-left: -4px;
    }
    .products-carousel-wrapper .owl-nav .owl-next {
        margin-right: -4px;
    }
    .products-carousel-wrapper .owl-nav button i {
        font-size: 14px !important;
    }
}
