* {
    box-sizing: border-box;
}

/* =========================================
   SECCIÓN DE FONDOS - TONOS DE GRIS
   ========================================= */
/* Slider - Sin fondo (mantiene imagen) */

/* Opciones - Gris muy claro */
.pager__opciones {
    background-color: #f8f9fa;
    padding: 0;
}

/* Nosotros - Blanco */
#nosotros {
    background-color: #ffffff;
    padding: 60px 0;
}

/* Productos - Gris claro */
#productos {
    background-color: #f3f4f6;
    padding: 60px 0;
}

/* Videos - Gris medio claro */
.videos {
    background-color: #e5e7eb;
    padding: 60px 0;
}

/* Botón Catálogo - Blanco */
.catalogo-section {
    background-color: #ffffff;
    padding: 40px 0;
}

/* Clientes - Gris claro */
#clientes {
    background-color: #f9fafb;
    padding: 60px 0;
}

/* Cotiza - Gris medio */
#cotiza {
    background-color: #e9ecef;
    padding: 50px 0;
}

/* Mapa - Gris oscuro claro */
#mapa {
    background-color: #dee2e6;
    padding: 0;
}


/* Social Media Icon Colors (Header) */
.pager__icon-sociales .youtube {
    color: #FF0000 !important;
}

.pager__icon-sociales .tiktok {
    color: #000000 !important;
    text-shadow: none !important;
}


body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Prevent global horizontal scrollbar */
    width: 100%;
}

.pager__contenedor {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* ==========================================================================
   GLOBAL STYLES & LAYOUT
   ========================================================================== */

.pager__opciones-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0 !important;
    width: 100%;
    padding: 0;
    margin: 0;
}

.pager__opciones-a {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.pager__opciones-grid-5 {
    background-color: #1a202c;
    display: flex;
    flex-direction: column;
}

.pager__opciones-grid-5 a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: white;
    padding: 0 10px;
}

.pager__opciones-grid-5 .pager__opciones-titulo {
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.upcycling-icon {
    color: #39ff14;
    font-size: 16px;
    margin-right: 8px;
}

/* =========================================
   1. CONTENEDOR PRINCIPAL (WRAPPER)
   ========================================= */
.carrusel-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 60px;
    /* Reduced side padding slightly */
    box-sizing: border-box;
    overflow: hidden;
    /* Crucial: kills ghost items outside the container */
}

/* =========================================
   2. PISTA DE LA GALERÍA (TRACK)
   ========================================= */
/* Old carousel rules removed to fix conflict with new grid layout below */

/* =========================================
   4. BOTONES DE NAVEGACIÓN (FLECHAS)
   ========================================= */
.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.carrusel-btn:hover {
    background-color: #D2691E;
    transform: translateY(-50%) scale(1.1);
}

.btn-prev {
    left: 10px;
}

.btn-next {
    right: 10px;
}

/* =========================================
   5. MODO GRID (AL PULSAR VER MÁS)
   ========================================= */
/* Old grid mode rules removed - handled by new block below */


/* =========================================
   6. BOTÓN VER MÁS
   ========================================= */
.pager__productos-vermas {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-desplegar {
    background-color: #D2691E;
    color: white;
    padding: 12px 40px;
    border-radius: 4px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-desplegar:hover {
    background-color: #e68900;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* =========================================
   SECCIÓN COTIZA
   ========================================= */
#cotiza {
    width: 100%;
    margin-bottom: 0;
}

.cotiza-split-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: stretch;
    background-color: #fff;
}

.cotiza-col-imagen {
    flex: 1;
    min-width: 300px;
    position: relative;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cotiza-img-referencia {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cotiza-texto-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #333;
}

.cotiza-texto-overlay h3 {
    color: #D2691E;
    font-weight: 900;
    font-size: 2rem;
    margin: 0;
    text-transform: uppercase;
}

.cotiza-col-form {
    flex: 1;
    min-width: 350px;
    background-color: #f9f9f9;
    padding: 40px;
}

.cotiza-mapa-full {
    width: 100%;
    margin-top: 0;
    line-height: 0;
    font-size: 0;
}

@media (max-width: 900px) {
    .cotiza-split-container {
        flex-direction: column;
    }

    .cotiza-col-branding {
        padding: 40px;
    }

    .branding-titulo {
        font-size: 2.5rem;
    }

    .branding-img-flotante {
        width: 150px;
        right: 3%;
        opacity: 0.8;
    }

    .branding-desc {
        max-width: 70%;
    }
}

/* =========================================
   FOOTER REFINEMENT (MATCHING REFERENCE IMAGE)
   ========================================= */

/* 1. SOCIAL BAR (GAPLESS & ALIGNED) */
.pager__container-footer-redes {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    border: none !important;
    outline: none !important;
    overflow: hidden;
}

.pager__redes {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
}

.pager__redes:nth-child(1) {
    background-color: #0d47a1;
}

.pager__redes:nth-child(2) {
    background-color: #79339C;
}

.pager__redes:nth-child(3) {
    background-color: #006064;
}

.pager__redes:nth-child(4) {
    background-color: #e60000;
}

.pager__redes:nth-child(5) {
    background-color: #000000;
}

.pager__redes a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    font-family: 'Arial', sans-serif;
    color: #fff !important;
    gap: 12px;
    transition: background 0.3s;
}

.pager__redes:nth-child(5) a {
    color: #fff !important;
}

.pager__redes i {
    font-size: 20px;
    color: #fff !important;
}

.pager__redes:nth-child(5) i {
    color: #fff !important;
}

/* FOOTER - RESTORED ORIGINAL STRUCTURE */

.pager__footer-redes .pager__container-fluid {
    padding: 0 !important;
    margin: 0 !important;
}

.pager__contacto-footer {
    padding: 60px 30px;
    background: #2C353F;
    margin-left: -15px;
    margin-right: -15px;
}

/* COPYRIGHT SECTION - CENTERED */
.pager__copyright-footer {
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 30px 15px !important;
}

.pager__copyright-footer .pager__container-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px;
    width: 100%;
}

.pager__footer-logo {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.pager__footer-texto p {
    text-align: center !important;
    margin: 0;
}

.pager__contacto-footer-item {
    display: grid;
    grid-template-columns: auto;
    grid-gap: 2rem;
    text-align: center;
}

/* Footer card styles moved to brand_colors.css for brand consistency */
/*
.pager__contacto-footer-item .pager__card {
    background: #000;
    border: 1px solid rgba(0, 0, 0, 0.363);
    box-shadow: 0px 3px 6px 1px rgba(255, 253, 253, 0.233);
}

.pager__contacto-footer-item .pager__card-header i {
    font-size: 1.7rem;
}

.pager__contacto-footer-item .pager__card-body {
    color: #FFF;
    line-height: 1.5;
}
*/

.pager__copyright-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: -15px;
    margin-left: -15px;
    background: #171F27;
    padding: 35px 30px;
}

.pager__footer-texto {
    color: #FFF;
}

/* Removed - handled in brand_colors.css
.pager__contacto-footer-item .pager__card:last-child .pager__card-body p {
    padding: 0px 50px;
}
*/

.pager__footer-texto p span {
    display: inline-block;
    line-height: 1.5;
    font-size: 1rem;
}

.pager__footer-texto p a {
    color: #FFF;
}


@media (max-width: 900px) {
    .pager__container-footer-redes {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pager__redes:nth-child(5) {
        grid-column: span 2;
    }

    .pager__copyright-footer .pager__container-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .pager__footer-texto p {
        text-align: center;
    }
}

/* =========================================
   SLIDER (HOME) CAPTIONS
   ========================================= */
.caption-moderno {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-align: left;
    border-radius: 4px;
}

.caption-content .subtag {
    display: block;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-weight: 600;
}

.caption-content .subtag b {
    color: #ff6d00;
}

.caption-content h1 {
    font-family: 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: 40px;
    line-height: 1.1;
    color: #222;
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

.caption-content h1 span {
    color: #ff6d00;
    display: block;
    font-size: 55px;
}

.caption-content p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    max-width: 90%;
}

/* =========================================
   WHATSAPP FLOAT
   ========================================= */
.btn-whatsapp-flotante {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 90px;
    /* Adjusted to avoid overlap with sticky bar */
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    /* Higher than sticky bar */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-whatsapp-flotante:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    color: white;
}

/* =========================================
   BRANDING SECTION
   ========================================= */
.cotiza-col-branding {
    flex: 1;
    padding: 60px 40px;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 350px;
    overflow: visible;
}

/* Ensure navigation buttons are hidden when controls are disabled via JS */
.carrusel-wrapper.hide-controls .carrusel-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.branding-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.branding-sub {
    font-size: 14px;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.branding-sub span {
    color: #e65100;
}

.branding-titulo {
    font-family: 'Arial Black', sans-serif;
    font-size: 3.5rem;
    line-height: 1;
    color: #222;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.branding-titulo span {
    color: #e65100;
}

.branding-desc {
    color: #777;
    font-size: 16px;
    max-width: 55%;
    margin-bottom: 30px;
    line-height: 1.5;
}

.branding-img-flotante {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    height: auto;
    z-index: 1;
    filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.15));
    opacity: 0.95;
}

/* =========================================
   PRODUCTS GALLERY (CARRUSEL & GRID)
   ========================================= */
.pager__productos-galeria {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    /* Exact calculation: (100% width - (3 gaps * 20px)) / 4 items */
    grid-auto-columns: calc((100% - 60px) / 4);
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0 30px 0;
    height: 860px;

    /* Scroll Snapping for perfect alignment */
    scroll-snap-type: x mandatory;

    /* Hide scrollbar completely */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pager__productos-galeria::-webkit-scrollbar {
    display: none;
}

.pager__productos-galeria .pager__card {
    scroll-snap-align: start;
    /* Align card to start of viewer on scroll */
    width: 100%;
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 !important;
    /* Reset any legacy margins */
}

.pager__card a.pager__galeria-item {
    flex: 0 0 70%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background-color: #fff;
    overflow: hidden;
}

.pager__card img.pager__galeria-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s ease;
}

.pager__card:hover img.pager__galeria-img {
    transform: scale(1.05);
}

.pager__galeria-description {
    flex: 0 0 30%;
    height: 30%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 15px 10px 15px;
    text-align: center;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.pager__galeria-titulo h1 {
    font-size: 15px;
    margin: 0 0 5px 0;
    font-weight: 800;
    text-transform: uppercase;
    color: #222;
    line-height: 1.1;
}

.pager__galeria-textos p {
    font-size: 12px;
    color: #777;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pager__productos-galeria.modo-grid {
    height: auto;
    grid-template-rows: auto !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(4, 1fr) !important;
    padding-bottom: 40px;
}

.pager__productos-galeria.modo-grid .pager__card {
    height: 400px;
}

/* --- MÓVIL (Gallery) --- */
@media (max-width: 768px) {
    .pager__productos-galeria {
        height: 420px;
        grid-template-rows: 1fr;
        grid-auto-columns: 85%;
    }


    .pager__productos-galeria.modo-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* FOOTER MEDIA QUERIES */
@media only screen and (min-width:1300px) {
    .pager__contacto-footer-item {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media only screen and (min-width:992px) and (max-width:1299px) {
    .pager__contacto-footer-item {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media only screen and (max-width:767px) and (min-width:600px) {
    .pager__contacto-footer-item {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width:598px) {
    .pager__contacto-footer-item {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* =========================================
   ANIMACIONES PARA EL SLIDER
   ========================================= */

/* 1. Definición de los movimientos (Keyframes) */
@keyframes entradaTriunfal {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes caerDesdeArriba {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subirDesdeAbajo {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.pager__slide li .caption-moderno {
    opacity: 0;
    animation: entradaTriunfal 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    animation-delay: 0.3s;
}

.pager__slide li .caption-content .subtag {
    opacity: 0;
    animation: caerDesdeArriba 0.6s ease-out forwards;
    animation-delay: 0.6s;
}

.pager__slide li .caption-content h1 {
    opacity: 0;
    animation: subirDesdeAbajo 0.6s ease-out forwards;
    animation-delay: 0.8s;
}

.pager__slide li .caption-content p {
    opacity: 0;
    animation: subirDesdeAbajo 0.6s ease-out forwards;
    animation-delay: 1s;
}


.pager__slide li img {
    animation: zoomSuave 4s ease-out forwards;
}

@keyframes zoomSuave {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* --- CENTRADO DEL CUADRO Y ANIMACIÓN --- */
.pager__slide li {
    position: relative;
}

.pager__slide li .caption-moderno {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;

    width: fit-content;
    max-width: 800px;
    height: fit-content;
    text-align: center;
    z-index: 10;


    opacity: 0;
    animation: entradaTriunfal 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    animation-delay: 0.3s;
}