.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.4s ease-in-out, background 0.3s ease;
}

.navbar--hidden {
    transform: translateY(-100%);
}

.anim-hero-video {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center; 
    justify-content: center;
    padding-top: 50px;
    overflow: hidden;
}

.anim-hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; 
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 0;
}

.anim-hero-bg {
    position: absolute;
    inset: 0;
    background: url('hero-animacion.jpg') center/cover no-repeat;
    z-index: 1;
}

.anim-hero-video .anim-hero-video-bg:not([src=""]) ~ .anim-hero-bg {
    display: none;
}

.dw-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(39,35,34,0.88) 100%);
    z-index: 2;
}

.dw-hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.dw-hero-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--verde);
    border: 1px solid rgba(89, 104, 81, 0.4);
    padding: 0.4rem 1.25rem;
    border-radius: 9999px;
    margin-bottom: 2rem;
}

.dw-hero-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.05;
    color: var(--blanco);
    margin-bottom: 1.5rem;
}

.dw-hero-subtitle {
    max-width: 32rem;
    margin: 0 auto;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
}

.dw-hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* ===== Features Strip ===== */
.dw-features {
    background: var(--arena);
    padding: 5rem 0;
}

.dw-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 640px) {
    .dw-features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .dw-features-grid { grid-template-columns: repeat(4, 1fr); }
}

.dw-feature {
    text-align: center;
    padding: 0 1rem;
}

.dw-feature-number {
    font-family: var(--font-title);
    font-size: 3rem;
    color: rgba(89, 104, 81, 0.2);
    line-height: 1;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.dw-feature:hover .dw-feature-number {
    color: var(--verde);
}

.dw-feature h3 {
    font-family: var(--font-title);
    font-size: 1.125rem;
    color: var(--oscuro);
    margin-bottom: 0.5rem;
}

.dw-feature p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.5);
}

/* ===== Info Section ===== */
.dw-info {
    background: var(--negro);
    padding: 6rem 0;
}

.dw-info-header {
    text-align: center;
    margin-bottom: 4rem;
}

.dw-info-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .dw-info-grid { grid-template-columns: repeat(2, 1fr); }
}

.dw-card {
    background: var(--gradient-card);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.dw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.dw-card-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--verde);
    transition: width 0.5s ease;
}

.dw-card:hover .dw-card-line {
    width: 100%;
}

.dw-card-title {
    font-family: var(--font-title);
    font-size: 1.35rem;
    color: var(--blanco);
    margin-bottom: 1.25rem;
}

.dw-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dw-card-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.65rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
}

.dw-card-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--verde);
}

.dw-card-list li:last-child {
    margin-bottom: 0;
}

/* ===== Process Steps ===== */
.dw-process {
    background: var(--arena);
    padding: 6rem 0;
}

.dw-process-header {
    text-align: center;
    margin-bottom: 4rem;
}

.dw-steps {
    max-width: 60rem; /* Ancho ampliado para 2 columnas */
    margin: 0 auto;
    display: grid;
    gap: 2rem 4rem;
}

/* 2 columnas en pantallas medianas y grandes */
@media (min-width: 768px) {
    .dw-steps {
        grid-template-columns: 1fr 1fr;
    }
}

.dw-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(89, 104, 81, 0.1); 
}

@media (min-width: 768px) {
    .dw-step {
        border-bottom: none; /* Limpieza en escritorio */
    }
}

.dw-step-icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--oscuro);
    color: var(--verde);
    transition: all 0.3s ease;
}

.dw-step:hover .dw-step-icon {
    background: var(--verde);
    color: var(--blanco);
    transform: scale(1.05);
}

.dw-step-content {
    flex: 1;
}

.dw-step-num {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--verde);
    display: block;
    margin-bottom: 0.25rem;
}

.dw-step-content h4 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--oscuro);
    margin-bottom: 0.5rem;
}

.dw-step-content p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.6);
}

/* Eliminamos el conector antiguo */
.dw-step-connector {
    display: none;
}

/* ===== Portfolio Gallery ===== */

/* Contenedor general del portafolio */
.portfolio-grid {
    display: grid;
    /* En móvil: 1 sola columna. En pantallas grandes: 2 columnas */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 20px;
}

/* Ajuste de la tarjeta de video */
.portfolio-item {
    width: 10%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Hacer que el video sea responsivo y respete el formato 9:16 */
.portfolio-video {
    width: 150%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

/* Media query para asegurar que en pantallas muy pequeñas se vea perfecto */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr; /* Una sola columna */
    }
    
    .dw-hero-title {
        font-size: 1.8rem; /* Ajustamos el título que querías más chico */
    }
}

.portfolio-info {
    margin-top: 15px;
    padding: 0 5px;
}

.portfolio-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--blanco);
}

.portfolio-info p {
    font-size: 0.9rem;
    color: #888; /* Gris suave para la descripción */
}

.dw-portfolio {
    background: var(--negro);
    padding: 6rem 0;
}

.dw-portfolio-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.portfolio-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.75rem;
}

.anim-gallery-row {
    margin-bottom: 3.5rem;
}

.anim-gallery-row:last-child {
    margin-bottom: 0;
}

.anim-row-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--verde);
    margin-bottom: 1.25rem;
    padding-left: 0.25rem;
}

.anim-gallery-items {
    display: grid;
    gap: 1.25rem;
}

.anim-gallery-horizontal { grid-template-columns: 1fr; }
.anim-gallery-square    { grid-template-columns: repeat(2, 1fr); }
.anim-gallery-vertical {
    display: flex; /* Cambiamos grid por flex */
    flex-wrap: wrap; /* Para que bajen en móvil */
    gap: 1.25rem;
    justify-content: center; /* O 'flex-start' si los quieres alineados a la izquierda */
    
}

.anim-gallery-card[data-format="vertical"] {
    /* Quitamos el width: 100% implícito del grid y dejamos que el contenido mande */
    width: fit-content; 
    margin: 0 auto; /* Centra la tarjeta si está sola */
}

.anim-gallery-card[data-format="vertical"] .anim-video-wrapper {
    aspect-ratio: 9 / 16;
    width: 100%;   /* El ancho será proporcional al aspect-ratio y la altura */
}

.anim-gallery-card[data-format="vertical"] .anim-video-wrapper video {
    width: 100%;
}

@media (min-width: 768px) {
    .anim-gallery-horizontal { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .anim-gallery-square,
    .anim-gallery-vertical { grid-template-columns: 1fr; }
}

/* ===== Gallery Card ===== */
.anim-gallery-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s, transform 0.3s;
}

.anim-gallery-card:hover {
    border-color: rgba(89, 104, 81, 0.4);
    transform: translateY(-3px);
}

/* ===== Video Wrapper with Aspect Ratios ===== */
.anim-video-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(89,104,81,0.1) 0%, rgba(0,0,0,0.4) 100%);
}

.anim-gallery-card[data-format="horizontal"] .anim-video-wrapper {
    aspect-ratio: 16 / 9;
}

.anim-gallery-card[data-format="square"] .anim-video-wrapper {
    aspect-ratio: 1 / 1;
}

.anim-gallery-card[data-format="vertical"] .anim-video-wrapper {
    aspect-ratio: 9 / 16;
    max-height: 28rem;
}

.anim-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== Play/Pause Overlay ===== */
.anim-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.3s;
    cursor: pointer;
    z-index: 5;
}

.anim-gallery-card:hover .anim-play-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.anim-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(89, 104, 81, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blanco);
    transition: transform 0.3s, background 0.3s;
    backdrop-filter: blur(4px);
}

.anim-play-btn:hover {
    transform: scale(1.1);
    background: var(--verde);
}

/* Playing state */
.anim-gallery-card.playing .anim-play-overlay {
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.anim-gallery-card.playing:hover .anim-play-overlay {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.3);
}

.anim-gallery-card.playing .anim-play-btn svg {
    display: none;
}

.anim-gallery-card.playing .anim-play-btn::before {
    content: '';
    width: 10px;
    height: 28px;
    border-left: 4px solid var(--blanco);
    border-right: 4px solid var(--blanco);
}

/* ===== Card Info ===== */
.anim-card-info {
    padding: 1.25rem 1.5rem;
}

.anim-card-info h4 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    color: var(--blanco);
    margin: 0.5rem 0 0.25rem;
}

.anim-card-info p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== CTA ===== */
.dw-cta {
    background: var(--arena);
    padding: 6rem 0;
}

.dw-cta-box {
    max-width: 44rem;
    margin: 0 auto;
    text-align: center;
}

.dw-cta-box h2 {
    font-family: var(--font-title);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: var(--oscuro);
    margin-bottom: 0.75rem;
}

.dw-cta-box p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 2.5rem;
}

.dw-cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .dw-cta-buttons { flex-direction: row; justify-content: center; }
}

/* ===== Active link in dropdown ===== */
.dropdown-menu .active-link {
    color: var(--blanco);
    background: rgba(89, 104, 81, 0.15);
    border-left: 3px solid var(--verde);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .anim-hero-video { min-height: 65vh; }
    .dw-hero-label { font-size: 0.65rem; padding: 0.3rem 1rem; }
    .dw-features { padding: 3.5rem 0; }
    .dw-info,
    .dw-portfolio,
    .dw-process,
    .dw-cta { padding: 4rem 0; }
    .dw-card { padding: 1.75rem; }
    .dw-step { gap: 1rem; }
    .anim-play-btn { width: 48px; height: 48px; }
    .anim-play-btn svg { width: 28px; height: 28px; }
}
