/* assets/css/home.css */

/* Hero Banner */
.hero-banner {
    position: relative;
    height: 100vh;
    max-height: 800px;
    overflow: hidden;
}

.banner-slider {
    position: relative;
    height: 100%;
}

.banner-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.banner-slider .slide.active {
    opacity: 1;
}

.banner-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    width: 90%;
    max-width: 800px;
    background-color: rgba(32, 83, 152, 0.8);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.slide-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.slide-content p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.slider-prev,
.slider-next {
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    color: var(--primary-blue);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    margin: 0 1rem;
    transition: var(--transition);
}

.slider-prev:hover,
.slider-next:hover {
    background-color: var(--white);
}

.slider-dots {
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background-color: var(--white);
}

/* Product Lines */
.product-lines {
    padding: 4rem 0;
    background-color: var(--light-gray);
}

.lines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.line-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.line-card:hover {
    transform: translateY(-5px);
}

.line-icon {
    margin-bottom: 1rem;
}

.line-icon img {
    margin: 0 auto;
}

.line-card h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

/* Featured News */
.featured-news {
    padding: 4rem 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
}

.news-content time {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.news-content h3 {
    margin: 0.5rem 0;
}

.news-content h3 a {
    color: var(--dark-gray);
}

.news-content p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-blue);
    font-weight: 500;
    display: inline-block;
}

.section-footer {
    margin-top: 3rem;
    text-align: center;
}

/* Limitar el ancho del slider en desktop y centrarlo */
.slider-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.hero-carousel, .mid-carousel {
    width: 100%;
}

.hero-carousel .carousel-item img.hero-img,
.mid-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border-radius: 0;
}

@media (min-width: 1400px) {
    .slider-wrapper {
        max-width: 1400px;
    }
}
@media (max-width: 1399px) {
    .slider-wrapper {
        max-width: 100vw;
    }
}
@media (max-width: 768px) {
    .slider-wrapper {
        max-width: 100vw;
    }
    .hero-carousel, .mid-carousel {
        min-height: 140px;
        height: 140px;
        max-height: 140px;
    }
    .hero-carousel .carousel-item img.hero-img,
    .mid-carousel .carousel-item img {
        height: 140px;
        max-width: 100vw;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .slide-content {
        padding: 1.5rem;
    }
    
    .slide-content h1 {
        font-size: 2rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .lines-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero Carousel */
.hero-carousel {
    height: calc(100vh - 80px);
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
    width: 100%;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-carousel .carousel-caption {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(32, 83, 152, 0.85);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
}

/* Second Carousel (Mid-page) */
.mid-carousel-container {
    width: 100%;
    margin: 60px 0;
    padding: 0;
    overflow: hidden;
}

.mid-carousel {
    height: 400px;
    width: 100%;
    margin: 0 auto;
}

.mid-carousel .carousel-inner,
.mid-carousel .carousel-item {
    height: 100%;
    width: 100%;
}

.mid-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mid-carousel .carousel-caption {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
}

.mid-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.mid-subtitle {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Product Lines */
.product-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.section-title {
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 50px;
    position: relative;
    text-align: center;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
    margin: 15px auto 0;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    height: 100%;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

/* Brands Carousel */
.brands-carousel-section {
    padding: 60px 0;
    background: white;
}

.brands-carousel {
    margin: 40px 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    min-width: 120px;
    max-width: 180px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0 10px;
    padding: 0 20px;
    transition: none;
}

.brand-logo img {
    max-height: 80px;
    max-width: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: filter 0.3s, opacity 0.3s, transform 0.3s;
    padding: 0;
}

.brand-logo:hover img {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .brands-carousel-section {
        padding: 30px 0 10px 0;
    }
    .brands-carousel-section .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    .brands-carousel {
        margin: 10px 0 0 0;
    }
    .brand-logo {
        height: 70px;
        min-width: 80px;
        max-width: 120px;
        padding: 0 6px;
    }
    .brand-logo img {
        max-height: 48px;
        max-width: 90px;
    }
}

/* News Section */
.news-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.news-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    height: 100%;
    margin-bottom: 30px;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.news-img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.news-body {
    padding: 20px;
}

.news-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.news-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.news-text {
    color: #6c757d;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    background-color: var(--secondary-blue);
    color: white;
    padding: 3rem 0;
}

.social-icons a {
    color: white;
    font-size: 1.2rem;
    margin-right: 15px;
    transition: opacity 0.3s;
}

.social-icons a:hover {
    opacity: 0.8;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-contact i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .mid-title {
        font-size: 1.8rem;
    }
    
    .mid-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-carousel {
        min-height: 140px;
        height: 140px;
        max-height: 140px;
    }
    .hero-carousel .carousel-item img.hero-img {
        height: 140px;
        min-height: 140px;
        max-height: 140px;
        width: 100vw;
        max-width: 100vw;
        object-fit: cover;
        object-position: center top;
        border-radius: 0;
    }
    .mid-carousel {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }
    .mid-carousel .carousel-item img {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        width: 100vw;
        max-width: 100vw;
        object-fit: cover;
        object-position: center center;
        border-radius: 0;
    }
}

@media (max-width: 576px) {
    #mainCarousel {
        min-height: 180px;
        height: 180px !important;
        max-height: 180px;
        width: 100vw;
        overflow: hidden;
        position: relative;
    }
    .slider-wrapper {
        max-width: 100vw;
    }
    .hero-carousel {
        min-height: 180px;
        height: 180px;
        max-height: 180px;
    }
    /* Eliminar display y align-items que rompen Bootstrap */
    .hero-carousel .carousel-inner,
    .hero-carousel .carousel-item {
        /* Solo altura, sin display ni align-items */
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        width: 100vw;
    }
    .hero-carousel .carousel-item img.hero-img {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        width: 100vw;
        max-width: 100vw;
        object-fit: cover;
        object-position: center center;
        border-radius: 0;
        display: block;
    }
    .hero-carousel .carousel-caption {
        position: absolute;
        left: 50%;
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        padding: 0.5rem 0.3rem;
        max-width: 95vw;
        width: 95vw;
        font-size: 0.95rem;
        background: rgba(32, 83, 152, 0.7);
        border-radius: 8px;
    }
    .hero-title {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    .btn-polynac.btn-lg {
        font-size: 0.95rem;
        padding: 0.4rem 1rem;
    }
}

/* --- Ajustes generales para versión móvil (todas las secciones) --- */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.3rem;
    }
    .product-section {
        padding: 18px 0 5px 0;
    }
    .product-card {
        padding: 10px 5px;
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    .product-icon {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    .product-card h3 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    .product-card p {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    .btn,
    .btn-lg,
    .btn-outline-primary {
        font-size: 0.95rem;
        padding: 0.3rem 0.7rem;
    }
    .news-section {
        padding: 18px 0 5px 0;
    }
    .news-card {
        margin-bottom: 10px;
    }
    .news-img {
        height: 90px;
    }
    .news-body {
        padding: 6px;
    }
    .news-title {
        font-size: 0.97rem;
        margin-bottom: 4px;
    }
    .news-text {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    .read-more {
        font-size: 0.95rem;
    }
    .section-footer {
        margin-top: 1rem;
    }
}

/* --- REVERTIR y MEJORAR aliados comerciales (brands-carousel-section) --- */
.brands-carousel-section {
    padding: 60px 0;
    background: white;
}
.brands-carousel-section .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}
.brands-carousel {
    margin: 40px 0;
}
.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    min-width: 120px;
    max-width: 180px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0 10px;
    padding: 0 20px;
    transition: none;
}
.brand-logo img {
    max-height: 80px;
    max-width: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: filter 0.3s, opacity 0.3s, transform 0.3s;
    padding: 0;
}
.brand-logo:hover img {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.08);
}
@media (max-width: 768px) {
    .brands-carousel-section {
        padding: 30px 0 10px 0;
    }
    .brands-carousel-section .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    .brands-carousel {
        margin: 10px 0 0 0;
    }
    .brand-logo {
        height: 70px;
        min-width: 80px;
        max-width: 120px;
        padding: 0 6px;
    }
    .brand-logo img {
        max-height: 48px;
        max-width: 90px;
    }
}

/* --- AJUSTES GENERALES MOVIL: distribución y espaciado --- */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.3rem;
    }
    .product-section {
        padding: 18px 0 5px 0;
    }
    .product-card {
        padding: 10px 5px;
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    .product-icon {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    .product-card h3 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    .product-card p {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    .btn,
    .btn-lg,
    .btn-outline-primary {
        font-size: 0.95rem;
        padding: 0.3rem 0.7rem;
    }
    .news-section {
        padding: 18px 0 5px 0;
    }
    .news-card {
        margin-bottom: 10px;
    }
    .news-img {
        height: 90px;
    }
    .news-body {
        padding: 6px;
    }
    .news-title {
        font-size: 0.97rem;
        margin-bottom: 4px;
    }
    .news-text {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    .read-more {
        font-size: 0.95rem;
    }
    .section-footer {
        margin-top: 1rem;
    }
    /* Oculta los hero-subtitle solo en móvil */
    .hero-subtitle {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .product-section .row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 8px;
    }
    .product-section .col-md-4 {
        width: 100%;
        max-width: 100%;
        flex: unset;
        padding-left: 0;
        padding-right: 0;
    }
    .product-card {
        margin-bottom: 0;
        padding: 8px 4px;
        font-size: 0.93rem;
    }
    .product-icon {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    .product-card h3 {
        font-size: 0.97rem;
        margin-bottom: 3px;
    }
    .product-card p {
        font-size: 0.93rem;
        margin-bottom: 4px;
    }
    .btn,
    .btn-lg,
    .btn-outline-primary {
        font-size: 0.93rem;
        padding: 0.3rem 0.6rem;
    }
}