/* ==========================================================
   TRANSPORTE MULTICARGAS — GALERÍA
   Archivo independiente: css/gallery.css

   Todo queda limitado a body.mc-gallery-page para evitar
   cambios accidentales en la home o las páginas de servicios.
   ========================================================== */


/* ==========================================================
   1. AJUSTES GENERALES
   ========================================================== */

body.mc-gallery-page {
    background:
        radial-gradient(
            circle at 82% 14%,
            rgba(0, 47, 98, 0.045),
            transparent 28%
        ),
        #f5f7fa;
}

body.mc-gallery-page.mc-lightbox-open {
    overflow: hidden;
}

body.mc-gallery-page img {
    display: block;
    max-width: 100%;
}

body.mc-gallery-page button {
    font: inherit;
}


/* ==========================================================
   2. CABECERA DE LA GALERÍA
   ========================================================== */

body.mc-gallery-page .mc-gallery-hero {
    padding: 36px 0 42px;
    border-bottom: 1px solid rgba(0, 47, 98, 0.09);
    background:
        radial-gradient(
            circle at 88% 25%,
            rgba(10, 76, 141, 0.08),
            transparent 27%
        ),
        #ffffff;
}

body.mc-gallery-page .mc-gallery-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    margin: 0 0 30px;
    color: #66758a;
    font-size: 13px;
    line-height: 1.5;
}

body.mc-gallery-page .mc-gallery-breadcrumb a {
    color: #174f84;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.mc-gallery-page .mc-gallery-breadcrumb a:hover,
body.mc-gallery-page .mc-gallery-breadcrumb a:focus-visible {
    color: var(--mc-red, #d7192d);
    outline: none;
}

body.mc-gallery-page .mc-gallery-hero__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
    align-items: end;
    gap: 42px;
}

body.mc-gallery-page .mc-gallery-hero__eyebrow {
    margin: 0 0 8px;
    color: #607087;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.4;
    text-transform: uppercase;
}

body.mc-gallery-page .mc-gallery-hero h1 {
    float: none;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #082f5c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.08;
    text-align: left;
    text-transform: uppercase;
}

body.mc-gallery-page .mc-gallery-hero__line {
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 18px;
    border-radius: 999px;
    background: var(--mc-red, #d7192d);
}

body.mc-gallery-page .mc-gallery-hero__description {
    margin: 0;
    color: #526078;
    font-size: 16px;
    line-height: 1.8;
}


/* ==========================================================
   3. CONTENIDO Y CUADRÍCULA
   ========================================================== */

body.mc-gallery-page .mc-gallery-section {
    padding: 48px 0 72px;
}

body.mc-gallery-page .mc-gallery-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

body.mc-gallery-page .mc-gallery-toolbar h2 {
    float: none;
    width: auto;
    height: auto;
    margin: 0 0 6px;
    padding: 0;
    color: #073665;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
}

body.mc-gallery-page .mc-gallery-toolbar p {
    margin: 0;
    color: #66758a;
    font-size: 14px;
    line-height: 1.6;
}

body.mc-gallery-page .mc-gallery-count {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid rgba(0, 47, 98, 0.10);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(15, 43, 76, 0.06);
}

body.mc-gallery-page .mc-gallery-count strong {
    color: #073665;
}

body.mc-gallery-page .mc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

body.mc-gallery-page .mc-gallery-card {
    min-width: 0;
    margin: 0;
}

body.mc-gallery-page .mc-gallery-card__button {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 47, 98, 0.08);
    border-radius: 14px;
    background: #ffffff;
    color: #172033;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(16, 39, 68, 0.09);
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

body.mc-gallery-page .mc-gallery-card__button:hover,
body.mc-gallery-page .mc-gallery-card__button:focus-visible {
    border-color: rgba(0, 71, 135, 0.24);
    box-shadow: 0 15px 34px rgba(16, 39, 68, 0.15);
    transform: translateY(-5px);
    outline: none;
}

body.mc-gallery-page .mc-gallery-card__button:focus-visible {
    box-shadow:
        0 0 0 4px rgba(10, 76, 141, 0.16),
        0 15px 34px rgba(16, 39, 68, 0.15);
}

body.mc-gallery-page .mc-gallery-card__media {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 1.55 / 1;
    background: #dfe6ed;
}

body.mc-gallery-page .mc-gallery-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        filter 0.35s ease,
        transform 0.5s ease;
}

body.mc-gallery-page .mc-gallery-card__button:hover img,
body.mc-gallery-page .mc-gallery-card__button:focus-visible img {
    filter: saturate(1.05);
    transform: scale(1.055);
}

body.mc-gallery-page .mc-gallery-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            180deg,
            rgba(0, 32, 62, 0.02),
            rgba(0, 32, 62, 0.44)
        );
    opacity: 0;
    transition: opacity 0.25s ease;
}

body.mc-gallery-page .mc-gallery-card__button:hover
.mc-gallery-card__overlay,
body.mc-gallery-page .mc-gallery-card__button:focus-visible
.mc-gallery-card__overlay {
    opacity: 1;
}

body.mc-gallery-page .mc-gallery-card__zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(0, 47, 98, 0.78);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 22, 45, 0.25);
    transform: translateY(8px) scale(0.92);
    transition: transform 0.25s ease;
}

body.mc-gallery-page .mc-gallery-card__button:hover
.mc-gallery-card__zoom,
body.mc-gallery-page .mc-gallery-card__button:focus-visible
.mc-gallery-card__zoom {
    transform: translateY(0) scale(1);
}

body.mc-gallery-page .mc-gallery-card__zoom svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.mc-gallery-page .mc-gallery-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    width: 100%;
    min-height: 60px;
    padding: 14px 17px;
    gap: 14px;
    color: #17324f;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

body.mc-gallery-page .mc-gallery-card__footer svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: #0a4c8d;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
        stroke 0.2s ease,
        transform 0.2s ease;
}

body.mc-gallery-page .mc-gallery-card__button:hover
.mc-gallery-card__footer svg,
body.mc-gallery-page .mc-gallery-card__button:focus-visible
.mc-gallery-card__footer svg {
    stroke: var(--mc-red, #d7192d);
    transform: translateX(3px);
}

body.mc-gallery-page .mc-gallery-empty {
    padding: 52px 30px;
    border: 1px dashed #bec9d6;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

body.mc-gallery-page .mc-gallery-empty h2 {
    margin: 0 0 8px;
    color: #073665;
}

body.mc-gallery-page .mc-gallery-empty p {
    margin: 0;
    color: #66758a;
}


/* ==========================================================
   4. VISOR / LIGHTBOX
   ========================================================== */

body.mc-gallery-page .mc-lightbox[hidden] {
    display: none !important;
}

body.mc-gallery-page .mc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    font-family: Arial, Helvetica, sans-serif;
}

body.mc-gallery-page .mc-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 18, 36, 0.91);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
    animation: mc-gallery-fade-in 0.2s ease;
}

body.mc-gallery-page .mc-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    align-items: center;
    width: min(1180px, calc(100vw - 64px));
    max-height: calc(100vh - 60px);
    gap: 18px;
    animation: mc-gallery-dialog-in 0.24s ease;
}

body.mc-gallery-page .mc-lightbox__figure {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: #041e37;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

body.mc-gallery-page .mc-lightbox__image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    max-height: calc(100vh - 160px);
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0)
        ),
        #01182e;
}

body.mc-gallery-page .mc-lightbox__image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 160px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
}

body.mc-gallery-page .mc-lightbox__image.is-loaded {
    opacity: 1;
}

body.mc-gallery-page .mc-lightbox__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.24);
    border-top-color: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: mc-gallery-spin 0.8s linear infinite;
}

body.mc-gallery-page .mc-lightbox__loader.is-hidden {
    display: none;
}

body.mc-gallery-page .mc-lightbox__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 14px 20px;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

body.mc-gallery-page .mc-lightbox__caption {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mc-gallery-page .mc-lightbox__counter {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.70);
    font-size: 13px;
    font-weight: 600;
}

body.mc-gallery-page .mc-lightbox__close,
body.mc-gallery-page .mc-lightbox__navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 50%;
    background: rgba(0, 47, 98, 0.74);
    color: #ffffff;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

body.mc-gallery-page .mc-lightbox__close:hover,
body.mc-gallery-page .mc-lightbox__close:focus-visible,
body.mc-gallery-page .mc-lightbox__navigation:hover,
body.mc-gallery-page .mc-lightbox__navigation:focus-visible {
    border-color: #ffffff;
    background: var(--mc-red, #d7192d);
    outline: none;
}

body.mc-gallery-page .mc-lightbox__close:focus-visible,
body.mc-gallery-page .mc-lightbox__navigation:focus-visible {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

body.mc-gallery-page .mc-lightbox__close {
    position: absolute;
    top: -18px;
    right: 40px;
    z-index: 3;
    width: 46px;
    height: 46px;
}

body.mc-gallery-page .mc-lightbox__navigation {
    width: 54px;
    height: 54px;
}

body.mc-gallery-page .mc-lightbox__navigation--previous:hover {
    transform: translateX(-3px);
}

body.mc-gallery-page .mc-lightbox__navigation--next:hover {
    transform: translateX(3px);
}

body.mc-gallery-page .mc-lightbox__close svg {
    width: 23px;
    height: 23px;
}

body.mc-gallery-page .mc-lightbox__navigation svg {
    width: 28px;
    height: 28px;
}

body.mc-gallery-page .mc-lightbox__close svg,
body.mc-gallery-page .mc-lightbox__navigation svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================
   5. ANIMACIONES
   ========================================================== */

@keyframes mc-gallery-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mc-gallery-dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes mc-gallery-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


/* ==========================================================
   6. RESPONSIVE
   ========================================================== */

@media (max-width: 1120px) {

    body.mc-gallery-page .mc-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


@media (max-width: 820px) {

    body.mc-gallery-page .mc-gallery-hero__content {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    body.mc-gallery-page .mc-gallery-hero__description {
        max-width: 620px;
    }

    body.mc-gallery-page .mc-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    body.mc-gallery-page .mc-lightbox {
        padding: 18px;
    }

    body.mc-gallery-page .mc-lightbox__dialog {
        grid-template-columns: 46px minmax(0, 1fr) 46px;
        width: calc(100vw - 36px);
        gap: 10px;
    }

    body.mc-gallery-page .mc-lightbox__navigation {
        width: 44px;
        height: 44px;
    }

    body.mc-gallery-page .mc-lightbox__close {
        top: -15px;
        right: 18px;
    }
}


@media (max-width: 560px) {

    body.mc-gallery-page .mc-gallery-hero {
        padding: 26px 0 30px;
    }

    body.mc-gallery-page .mc-gallery-breadcrumb {
        margin-bottom: 24px;
        font-size: 12px;
    }

    body.mc-gallery-page .mc-gallery-hero h1 {
        font-size: 34px;
    }

    body.mc-gallery-page .mc-gallery-hero__description {
        font-size: 15px;
        line-height: 1.7;
    }

    body.mc-gallery-page .mc-gallery-section {
        padding: 34px 0 50px;
    }

    body.mc-gallery-page .mc-gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 22px;
        gap: 14px;
    }

    body.mc-gallery-page .mc-gallery-toolbar h2 {
        font-size: 22px;
    }

    body.mc-gallery-page .mc-gallery-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    body.mc-gallery-page .mc-gallery-card__media {
        aspect-ratio: 1.55 / 1;
    }

    body.mc-gallery-page .mc-lightbox {
        align-items: center;
        padding: 10px;
    }

    body.mc-gallery-page .mc-lightbox__dialog {
        display: block;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    body.mc-gallery-page .mc-lightbox__figure {
        border-radius: 11px;
    }

    body.mc-gallery-page .mc-lightbox__image-wrapper,
    body.mc-gallery-page .mc-lightbox__image {
        max-height: calc(100vh - 132px);
    }

    body.mc-gallery-page .mc-lightbox__image-wrapper {
        min-height: 210px;
    }

    body.mc-gallery-page .mc-lightbox__navigation {
        position: absolute;
        top: 50%;
        z-index: 3;
        width: 42px;
        height: 42px;
        background: rgba(0, 35, 68, 0.82);
        transform: translateY(-50%);
    }

    body.mc-gallery-page .mc-lightbox__navigation--previous {
        left: 10px;
    }

    body.mc-gallery-page .mc-lightbox__navigation--next {
        right: 10px;
    }

    body.mc-gallery-page .mc-lightbox__navigation--previous:hover,
    body.mc-gallery-page .mc-lightbox__navigation--next:hover {
        transform: translateY(-50%);
    }

    body.mc-gallery-page .mc-lightbox__close {
        top: 9px;
        right: 9px;
        width: 42px;
        height: 42px;
        background: rgba(0, 35, 68, 0.88);
    }

    body.mc-gallery-page .mc-lightbox__footer {
        min-height: 56px;
        padding: 12px 14px;
    }

    body.mc-gallery-page .mc-lightbox__caption {
        font-size: 12px;
    }

    body.mc-gallery-page .mc-lightbox__counter {
        font-size: 12px;
    }
}


@media (prefers-reduced-motion: reduce) {

    body.mc-gallery-page *,
    body.mc-gallery-page *::before,
    body.mc-gallery-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}