/* ═══════════════════════════════════════════
   GRUPO CV LOGISTICS — CUSTOM OVERRIDES
   Overrides Dewi template defaults with our brand
═══════════════════════════════════════════ */

:root {
    --primary: #f88136;
    --primary-hover: #ff9854;
    --secondary: #5F656F;
    --light: #F5F5F5;
    --dark: #04252b;
    --dark-2: #062f37;
}

/* Bootstrap class color overrides */
.bg-primary { background-color: var(--primary) !important; }
.bg-dark { background-color: var(--dark) !important; }
.text-primary { color: var(--primary) !important; }
.text-dark { color: var(--dark) !important; }
.border-primary { border-color: var(--primary) !important; }

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #FFFFFF !important;
}

/* ── NAVBAR LOGO ─────────────────────────── */
.navbar-logo {
    height: 75px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .2s, transform .2s;
}
.navbar-logo:hover {
    opacity: .85;
}
/* Selectores con MAYOR especificidad para vencer a style.css del template,
   que pinta el contenedor del logo con fondo naranja y una lengüeta inclinada. */
.navbar .navbar-brand,
nav.navbar .navbar-brand {
    background: transparent !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    height: auto;
}
/* Apaga el paralelogramo naranja inclinado a la derecha del logo */
.navbar .navbar-brand::after,
nav.navbar .navbar-brand::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
}
@media (max-width: 991.98px) {
    .navbar-logo { height: 55px; }
    .navbar .navbar-brand {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
}

/* ── NAV LINKS ───────────────────────────── */
.navbar-light .navbar-nav .nav-link {
    color: var(--dark);
    font-weight: 600;
    padding: 30px 15px;
    transition: color .3s;
}
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary);
}

/* ── CAROUSEL CAPTION GRADIENT ───────────── */
.carousel-caption {
    background: linear-gradient(to right, rgba(4, 37, 43, .95) 0%, rgba(4, 37, 43, .65) 60%, rgba(4, 37, 43, 0) 100%) !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* ── PAGE HEADER (if used) ───────────────── */
.page-header {
    background: linear-gradient(to right, rgba(4, 37, 43, 1) 0%, rgba(4, 37, 43, 0) 100%), url(../img/carousel-2.jpg) center center no-repeat !important;
    background-size: cover !important;
}

/* ── TOPBAR ──────────────────────────────── */
.topbar-right {
    background: var(--primary) !important;
}
.topbar-right::before {
    border-color: transparent var(--primary) transparent transparent !important;
}

#langSwitcher {
    border-left: 1px solid rgba(255,255,255,.2);
    padding-left: 12px;
    transition: color .2s;
}
#langSwitcher:hover {
    color: var(--primary) !important;
}

/* ── HERO HEADINGS — INDUSTRIAL FEEL ─────── */
.carousel-caption h1.display-1 {
    font-weight: 800 !important;
    letter-spacing: -1px;
    text-shadow: 0 4px 24px rgba(0,0,0,.3);
}

/* ── SERVICE CARDS ───────────────────────── */
.service-item {
    overflow: visible; /* permite que el badge circular sobresalga por arriba */
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(4, 37, 43, .08);
    margin: 75px 0 25px 0;
}
/* Imagen de fondo (la grande): contenida con su propio overflow.
   Incluye el caso <picture> (imágenes WebP con fallback JPG). */
.service-item > img:first-of-type,
.service-item > picture:first-of-type img {
    display: block;
    height: 320px;
    object-fit: cover;
    width: 100%;
    transition: transform .6s ease;
}
.service-item:hover > img:first-of-type,
.service-item:hover > picture:first-of-type img {
    transform: scale(1.04);
}

/* Badge circular SUPERPUESTO arriba del card */
.service-item .service-img {
    position: absolute;
    padding: 8px;
    width: 130px;
    height: 130px;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    border-radius: 50%; /* círculo */
    box-shadow: 0 6px 20px rgba(4, 37, 43, .15);
    z-index: 3;
    overflow: hidden;   /* recorta la imagen dentro al círculo */
    border: 3px solid var(--primary);
}
.service-item .service-img img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Overlay oscuro en hover */
.service-item .service-detail {
    background: rgba(4, 37, 43, 0);
    transition: background .4s;
    overflow: hidden;
    border-radius: 4px;
}
.service-item:hover .service-detail {
    background: rgba(4, 37, 43, .94);
}
.service-item .service-title,
.service-item .service-text {
    opacity: 0;
    transition: opacity .4s, transform .4s;
}
.service-item:hover .service-title,
.service-item:hover .service-text {
    opacity: 1;
}
.service-item .service-title hr {
    color: var(--primary);
    opacity: 1;
}

/* Botón "Más Info" centrado abajo del card en hover */
.service-item > .btn {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .4s, bottom .4s;
    z-index: 4;
}
.service-item:hover > .btn {
    opacity: 1;
    bottom: 35px;
}

/* ── PROJECT (Operations) CAROUSEL ───────── */
.project-item img {
    height: 500px;
    object-fit: cover;
}

/* PLAN B de la galería: si Owl Carousel no logra inicializar (fallo de JS,
   CDN o Rocket Loader), main.js añade .owl-fallback y la galería se muestra
   como fila deslizable en vez de quedar oculta. */
.project-carousel.owl-fallback {
    display: flex !important;
    overflow-x: auto;
    gap: 12px;
    padding: 0 12px 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.project-carousel.owl-fallback .project-item {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: center;
}
.project-carousel.owl-fallback .project-item img {
    height: 340px;
    width: 100%;
}

.project-carousel .owl-nav .owl-prev,
.project-carousel .owl-nav .owl-next {
    background: var(--primary) !important;
    color: #FFFFFF !important;
}

/* ── ABOUT IMAGES ────────────────────────── */
#about .col-6 img {
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(4, 37, 43, .12);
}

/* ── FACTS / COUNTERS ────────────────────── */
.facts {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%) !important;
    border-radius: 0;
}
.facts .border {
    border-color: rgba(248, 129, 54, .25) !important;
    transition: border-color .3s, transform .3s, background .3s;
    border-radius: 4px;
}
.facts .border:hover {
    border-color: var(--primary) !important;
    transform: translateY(-5px);
    background: rgba(248, 129, 54, .05);
}

/* ── FEATURE/VIDEO ─────────────────────── */
#about + .container-fluid + .container-xxl .position-relative img {
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(4, 37, 43, .15);
}

/* ── CONTACT FORM ──────────────────────── */
.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .25rem rgba(248, 129, 54, .15);
}
.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: 6px;
}

/* ── FOOTER ──────────────────────────────── */
.footer {
    background: var(--dark) !important;
}
.footer .btn.btn-link:hover {
    color: var(--primary) !important;
}
.copyright a {
    color: var(--primary);
    text-decoration: none;
}
.copyright a:hover {
    color: var(--primary-hover);
}

/* ── BANNER DE COTIZACIÓN (sección Contacto) ── */
.quote-banner {
    min-height: 420px;
    background: var(--dark);
    box-shadow: 0 20px 50px rgba(4, 37, 43, .15);
}
.quote-banner .quote-banner-bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.quote-banner:hover .quote-banner-bg img {
    transform: scale(1.04);
}
/* Degradado corporativo, mismo estilo del carrusel */
.quote-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(4, 37, 43, .96) 0%, rgba(4, 37, 43, .82) 55%, rgba(4, 37, 43, .45) 100%);
}
.quote-banner-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
}
@media (max-width: 768px) {
    .quote-banner { min-height: 340px; }
}

/* ── BACK TO TOP ─────────────────────────── */
.back-to-top {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 6px 20px rgba(248, 129, 54, .4);
    transition: transform .2s, background .2s;
}
.back-to-top:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-3px) scale(1.05);
}

/* ── SPINNER ─────────────────────────────── */
#spinner .spinner-border {
    color: var(--primary) !important;
}
/* Failsafe: si el JS tarda o falla, el spinner se oculta solo a los 2,5 s
   y nunca deja la página bloqueada en blanco. */
@keyframes spinnerFailsafe {
    to { opacity: 0; visibility: hidden; }
}
#spinner.show {
    animation: spinnerFailsafe .4s ease 2.5s forwards;
}

/* ── BUTTONS REFINEMENT ──────────────────── */
.btn-primary {
    transition: background .25s, transform .15s, box-shadow .25s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(248, 129, 54, .35);
}

/* ── SECTION TITLES (industrial) ─────────── */
h1.display-5 {
    font-weight: 700 !important;
    color: var(--dark);
    letter-spacing: -.5px;
}

/* ── ANIMATIONS — INDUSTRIAL TOUCH ───────── */
@keyframes slideInRightSubtle {
    0% { opacity: 0; transform: translateX(40px); }
    100% { opacity: 1; transform: translateX(0); }
}
.animated.slideInRight {
    animation: slideInRightSubtle .8s ease forwards;
}

/* Stagger hero text animations */
.carousel-caption p.fs-5 { animation-delay: .2s; }
.carousel-caption h1     { animation-delay: .5s; }
.carousel-caption .btn   { animation-delay: .8s; }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
    #header-carousel .carousel-item { min-height: 500px; }
    #header-carousel .carousel-item img { height: 500px; object-fit: cover; }
    .carousel-caption h1.display-1 { font-size: 2.5rem !important; }
    .carousel-caption p.fs-5 { font-size: .95rem !important; }
}

/* ── SCROLLBAR ───────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }
