/* ========== PÁGINA DE SERVIÇO — GALERIA ========== */
.servico-galeria-page {
    min-height: 60vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a0f0d 50%, #0a0a0a 100%);
    padding: clamp(24px, 4vw, 60px) 0;
    width: 100%;
    box-sizing: border-box;
}

.servico-galeria-container {
    max-width: 1000px;
    margin: 0 auto;
}

.servico-voltar-link {
    display: inline-block;
    color: #d55900;
    text-decoration: none;
    font-size: clamp(14px, 1.6vw, 16px);
    margin-bottom: clamp(20px, 3vw, 32px);
    transition: color 0.3s ease, transform 0.3s ease;
}

.servico-voltar-link:hover {
    color: #e07020;
    transform: translateX(-4px);
}

.servico-galeria-header {
    text-align: center;
    margin-bottom: clamp(24px, 3vw, 36px);
}

.servico-galeria-header h1 {
    font-size: clamp(28px, 5vw, 44px);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.servico-galeria-desc {
    font-size: clamp(15px, 1.9vw, 18px);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
}

.servico-galeria-subtitle {
    font-size: clamp(20px, 2.5vw, 26px);
    color: #d55900;
    text-align: center;
    margin-bottom: clamp(20px, 2.5vw, 28px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-loading,
.gallery-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(15px, 1.8vw, 17px);
    padding: 2rem 1rem;
}

/* —— Carrossel —— */
.gallery-carousel {
    margin-bottom: clamp(32px, 4vw, 48px);
}

.gallery-viewport {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    outline: none;
}

.gallery-track-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(213, 89, 0, 0.3);
    background: #1a1210;
    width: 100%;
    min-height: clamp(280px, 55vw, 520px);
    max-height: min(75vh, 600px);
    aspect-ratio: 16 / 10;
}

.gallery-track {
    display: flex;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

/* Transição entre mídias: dissolve + leve deslize */
.gallery-track.gallery-track--fade {
    display: block;
    transform: none !important;
}

.gallery-track--fade .gallery-slide {
    position: absolute;
    inset: 0;
    flex: none;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
    transition:
        opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-track--fade .gallery-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.gallery-track--fade .gallery-slide.is-active.is-entering-from-next .gallery-slide-media,
.gallery-track--fade .gallery-slide.is-active.is-entering-from-next .gallery-video-player,
.gallery-track--fade .gallery-slide.is-active.is-entering-from-next > img {
    animation: gallerySlideInFromRight 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.gallery-track--fade .gallery-slide.is-active.is-entering-from-prev .gallery-slide-media,
.gallery-track--fade .gallery-slide.is-active.is-entering-from-prev .gallery-video-player,
.gallery-track--fade .gallery-slide.is-active.is-entering-from-prev > img {
    animation: gallerySlideInFromLeft 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

@keyframes gallerySlideInFromRight {
    from {
        opacity: 0;
        transform: translateX(28px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes gallerySlideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-28px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.gallery-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1210;
}

.gallery-slide > img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-slide video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-slide--video {
    padding: 0;
    align-items: stretch;
}

.gallery-video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(213, 89, 0, 0.88);
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* —— Player de vídeo customizado —— */
.gallery-video-player {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1f1512 0%, #0a0808 70%);
    overflow: hidden;
}

.gallery-video-media {
    width: 100%;
    height: 100%;
    max-height: min(70vh, 560px);
    object-fit: contain;
    display: block;
    cursor: pointer;
    background-color: #1a1210;
    vertical-align: top;
}

.gallery-video-big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: clamp(64px, 14vw, 88px);
    height: clamp(64px, 14vw, 88px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #d55900 0%, #a83a00 100%);
    box-shadow:
        0 8px 32px rgba(213, 89, 0, 0.45),
        0 0 0 4px rgba(213, 89, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
    padding: 0;
}

.gallery-video-big-play svg {
    width: 42%;
    height: 42%;
    margin-left: 4%;
}

.gallery-video-big-play:hover {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow:
        0 12px 40px rgba(213, 89, 0, 0.55),
        0 0 0 6px rgba(213, 89, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.gallery-video-player.is-playing .gallery-video-big-play {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.85);
}

.gallery-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: clamp(36px, 8vw, 48px) clamp(12px, 2vw, 16px) clamp(12px, 2vw, 14px);
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(8, 6, 6, 0.75) 35%,
        rgba(12, 8, 7, 0.96) 100%
    );
    border-top: 1px solid rgba(213, 89, 0, 0.15);
    opacity: 1;
    transition: opacity 0.35s ease;
}

.gallery-video-player.is-playing:not(.is-controls-visible):not(:hover):not(:focus-within) .gallery-video-controls {
    opacity: 0;
    pointer-events: none;
}

.gallery-video-player.is-playing:hover .gallery-video-controls,
.gallery-video-player.is-playing:focus-within .gallery-video-controls,
.gallery-video-player.is-playing.is-controls-visible .gallery-video-controls,
.gallery-video-player.is-paused .gallery-video-controls {
    opacity: 1;
    pointer-events: auto;
}

.gallery-video-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(213, 89, 0, 0.4);
    border-radius: 10px;
    background: rgba(25, 16, 12, 0.85);
    color: #f5ebe6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.gallery-video-btn svg {
    width: 20px;
    height: 20px;
}

.gallery-video-btn:hover {
    background: rgba(213, 89, 0, 0.28);
    border-color: #d55900;
    color: #fff;
}

.gallery-video-btn:active {
    transform: scale(0.94);
}

.gallery-video-progress-wrap {
    flex: 1 1 120px;
    min-width: 80px;
    display: flex;
    align-items: center;
}

.gallery-video-progress,
.gallery-video-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    outline: none;
}

.gallery-video-progress::-webkit-slider-thumb,
.gallery-video-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e07020, #d55900);
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(213, 89, 0, 0.5);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.gallery-video-progress::-webkit-slider-thumb:hover,
.gallery-video-volume::-webkit-slider-thumb:hover {
    transform: scale(1.12);
}

.gallery-video-progress::-moz-range-thumb,
.gallery-video-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e07020, #d55900);
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(213, 89, 0, 0.5);
    cursor: pointer;
}

.gallery-video-progress::-moz-range-track,
.gallery-video-volume::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
}

.gallery-video-time {
    flex-shrink: 0;
    font-size: clamp(11px, 1.4vw, 13px);
    font-variant-numeric: tabular-nums;
    color: rgba(255, 248, 245, 0.85);
    letter-spacing: 0.03em;
    min-width: 5.5rem;
    text-align: center;
}

.gallery-video-volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.gallery-video-volume {
    width: clamp(56px, 12vw, 88px);
}

.gallery-video-player.is-fullscreen {
    max-height: none;
    background: #000;
}

.gallery-video-player.is-fullscreen .gallery-video-media {
    max-height: 100vh;
}

@media (max-width: 520px) {
    .gallery-video-volume {
        display: none;
    }

    .gallery-video-controls {
        gap: 6px 8px;
        padding-bottom: 10px;
    }

    .gallery-video-time {
        min-width: auto;
        font-size: 11px;
    }
}

.gallery-nav {
    position: relative;
    flex-shrink: 0;
    width: clamp(44px, 8vw, 52px);
    height: clamp(44px, 8vw, 52px);
    border: 1px solid rgba(213, 89, 0, 0.45);
    border-radius: 50%;
    background: rgba(20, 12, 10, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    animation: galleryNavGlow 3.2s ease-in-out infinite;
}

.gallery-nav::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(213, 89, 0, 0.35);
    opacity: 0;
    animation: galleryNavRing 3.2s ease-in-out infinite;
    pointer-events: none;
}

.gallery-nav:hover:not(:disabled) {
    background: rgba(213, 89, 0, 0.25);
    border-color: #d55900;
    animation-play-state: paused;
}

.gallery-nav:hover:not(:disabled)::before {
    animation-play-state: paused;
    opacity: 0.7;
    transform: scale(1.06);
}

.gallery-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    animation: none;
}

.gallery-nav:disabled::before {
    animation: none;
    display: none;
}

.gallery-arrow-icon {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1;
    color: #d55900;
    font-weight: bold;
    user-select: none;
}

.gallery-nav-prev .gallery-arrow-icon {
    animation: galleryArrowNudgeLeft 2.4s ease-in-out infinite;
}

.gallery-nav-next .gallery-arrow-icon {
    animation: galleryArrowNudgeRight 2.4s ease-in-out infinite;
}

.gallery-nav:hover:not(:disabled) .gallery-arrow-icon {
    animation-play-state: paused;
}

.gallery-nav:disabled .gallery-arrow-icon {
    animation: none;
}

@keyframes galleryArrowNudgeLeft {
    0%,
    100% {
        transform: translateX(0);
        opacity: 0.92;
    }
    50% {
        transform: translateX(-5px);
        opacity: 1;
    }
}

@keyframes galleryArrowNudgeRight {
    0%,
    100% {
        transform: translateX(0);
        opacity: 0.92;
    }
    50% {
        transform: translateX(5px);
        opacity: 1;
    }
}

@keyframes galleryNavGlow {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(213, 89, 0, 0);
    }
    50% {
        box-shadow: 0 0 16px 2px rgba(213, 89, 0, 0.22);
    }
}

@keyframes galleryNavRing {
    0%,
    100% {
        opacity: 0;
        transform: scale(0.92);
    }
    50% {
        opacity: 0.55;
        transform: scale(1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-nav,
    .gallery-nav::before,
    .gallery-arrow-icon {
        animation: none !important;
    }

    .gallery-track--fade .gallery-slide {
        transition: opacity 0.15s ease, visibility 0.15s ease;
    }

    .gallery-track--fade .gallery-slide.is-active.is-entering-from-next > img,
    .gallery-track--fade .gallery-slide.is-active.is-entering-from-prev > img,
    .gallery-track--fade .gallery-slide.is-active.is-entering-from-next .gallery-video-player,
    .gallery-track--fade .gallery-slide.is-active.is-entering-from-prev .gallery-video-player {
        animation: none;
    }
}

.gallery-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 24px;
    margin-top: clamp(16px, 2vw, 24px);
}

.gallery-counter {
    font-size: clamp(14px, 1.6vw, 16px);
    color: #d55900;
    font-weight: 600;
    letter-spacing: 1px;
}

.gallery-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 100%;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.2s ease;
}

.gallery-dot.is-active {
    background: #d55900;
    transform: scale(1.15);
}

.gallery-swipe-hint {
    text-align: center;
    font-size: clamp(12px, 1.4vw, 14px);
    color: rgba(255, 255, 255, 0.45);
    margin-top: 12px;
}

@media (min-width: 601px) {
    .gallery-nav:hover:not(:disabled) {
        transform: scale(1.05);
    }
}

@media (min-width: 769px) {
    .gallery-swipe-hint {
        display: none;
    }
}

/* CTA orçamento */
.servico-cta-orcamento {
    text-align: center;
    padding: clamp(28px, 4vw, 40px);
    background: rgba(213, 89, 0, 0.08);
    border: 1px solid rgba(213, 89, 0, 0.3);
    border-radius: 16px;
}

.servico-cta-orcamento p {
    color: #fff;
    font-size: clamp(16px, 2vw, 20px);
    margin-bottom: 20px;
}

.servico-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: clamp(14px, 2vw, 18px) clamp(24px, 3vw, 36px);
    background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(15px, 1.8vw, 18px);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
}

.servico-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}

[hidden] {
    display: none !important;
}

.servico-not-found {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a0f0d 100%);
    color: #fff;
}

.servico-not-found h1 {
    color: #d55900;
    margin-bottom: 1rem;
}

.servico-btn-voltar {
    margin-top: 1.5rem;
    color: #d55900;
    text-decoration: none;
    font-weight: 600;
}

/* Link do portfólio — sem alterar visual do card */
.portfolio-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.portfolio-card-link:focus-visible {
    outline: 2px solid #d55900;
    outline-offset: 4px;
    border-radius: 20px;
}

@media (max-width: 900px) {
    .servico-galeria-container {
        padding-left: max(var(--site-padding-x, 16px), env(safe-area-inset-left, 0px));
        padding-right: max(var(--site-padding-x, 16px), env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .servico-galeria-page {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .gallery-viewport {
        flex-direction: column;
    }

    .gallery-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    .gallery-nav::before {
        inset: -3px;
    }

    .gallery-nav-prev {
        left: 8px;
    }

    .gallery-nav-next {
        right: 8px;
    }

    .gallery-viewport {
        position: relative;
    }

    .gallery-track-wrap {
        width: 100%;
        min-height: 220px;
        aspect-ratio: 4 / 3;
    }

    .gallery-track-wrap.is-video-active {
        aspect-ratio: auto;
        height: auto;
        max-height: min(72vh, 520px);
    }

    .gallery-slide--video {
        background: #1a1210;
    }

    .gallery-slide--video .gallery-video-player {
        min-height: 0;
        height: 100%;
        width: 100%;
        max-height: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: #1a1210;
    }

    .gallery-slide--video .gallery-video-media {
        flex: 1 1 auto;
        width: 100%;
        height: auto;
        max-height: calc(100% - 48px);
        min-height: 0;
        object-fit: contain;
        object-position: center center;
        background-color: #1a1210;
    }

    .gallery-slide--video .gallery-video-controls {
        position: relative;
        flex-shrink: 0;
        width: 100%;
        margin-top: 0;
        padding: 10px 12px 12px;
        background: linear-gradient(180deg, rgba(12, 8, 7, 0.98) 0%, rgba(12, 8, 7, 1) 100%);
        border-top: 1px solid rgba(213, 89, 0, 0.12);
    }

    .gallery-nav:hover:not(:disabled) {
        transform: translateY(-50%);
        box-shadow: 0 0 20px 3px rgba(213, 89, 0, 0.35);
    }
}
