* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.7;
}

/* Overlay sutil solo para legibilidad del texto */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    opacity: 0;
    animation: fadeIn 1.5s ease-out forwards;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Section */
.logo-section {
    margin-top: 50px;
    text-align: center;
    animation: slideDown 1s ease-out 0.5s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: linear-gradient(45deg, #64b5f6, #ffffff, #81c784);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
    margin-bottom: 10px;
}

.company-logo {
    max-width: 300px;
    max-height: 120px;
    width: auto;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 20px rgba(100, 181, 246, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.company-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(100, 181, 246, 0.5));
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    color: #b0bec5;
    letter-spacing: 0.05em;
}

/* Branches Section */
.branches-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 60px;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.branches-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 50px;
    justify-items: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.branches-container .branch-link:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
    animation: scaleIn 0.8s ease-out 1.2s both;
}

.branches-container .branch-link:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    animation: scaleIn 0.8s ease-out 1.4s both;
}

.branches-container .branch-link:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    animation: scaleIn 0.8s ease-out 1.6s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.branch-link {
    text-decoration: none;
    position: relative;
}

.branch-card {
    position: relative;
    cursor: pointer;
}

.branch-image {
    width: 380px;
    height: 260px;
    background: linear-gradient(135deg, #424242 0%, #212121 100%);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.branch-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: inherit;
    z-index: 1;
}

.flag-icon {
    font-size: 4rem;
    transition: transform 0.3s ease;
}

.branch-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    border-radius: 17px;
    position: relative;
    z-index: 0;
}

.branch-photo:hover {
    filter: brightness(1.1) contrast(1.05);
}

.flag-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 25px;
    width: 200px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    padding: 0 15px 0 20px;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    animation: flagPulse 4s ease-in-out infinite;
}

.flag-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.country-name {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    flex: 1;
    white-space: nowrap;
    opacity: 0.9;
    transition: all 0.3s ease;
    padding-right: 10px;
}

.flag-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 12px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

@keyframes flagPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 40px rgba(100, 181, 246, 0.2);
    }
}

.branch-link:hover .flag-overlay {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(1.08);
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.9) 0%, rgba(129, 199, 132, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 45px rgba(100, 181, 246, 0.4);
    width: 220px;
    height: 85px;
}

.branch-link:hover .flag-overlay::before {
    left: 100%;
}

.branch-link:hover .country-name {
    color: #ffffff;
    opacity: 1;
    transform: translateX(-5px);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    font-size: 0.95rem;
}

.branch-link:hover .flag-image {
    transform: scale(1.1) rotate(2deg);
    border-radius: 15px;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* Efectos específicos por sucursal con imágenes reales */
.panama, .usa, .spain {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 3px solid rgba(255, 255, 255, 0.15);
}

/* Hover Effects */
.branch-link:hover .branch-image {
    transform: scale(1.05);
    box-shadow: 
        0 16px 48px rgba(100, 181, 246, 0.2),
        0 0 40px rgba(100, 181, 246, 0.1),
        inset 0 0 0 2px rgba(100, 181, 246, 0.3);
    border-color: rgba(100, 181, 246, 0.4);
}

.branch-link:hover .branch-photo {
    transform: scale(1.05);
    filter: brightness(1.15) contrast(1.1) saturate(1.1);
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(0, 0, 0, 0.9);
}

.branch-link:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) rotate(0deg);
}

/* Footer */
.footer {
    margin-bottom: 30px;
    text-align: center;
    color: #78909c;
    font-size: 0.9rem;
    opacity: 0;
    animation: fadeIn 1s ease-out 2s both;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .branches-container {
        gap: 40px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        max-width: 100%;
    }
    
    .branches-container .branch-link:first-child {
        grid-column: 1;
        grid-row: 1;
    }
    
    .branches-container .branch-link:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .branches-container .branch-link:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }
    
    .branch-image {
        width: 320px;
        height: 220px;
    }
    
    .company-logo {
        max-width: 250px;
        max-height: 100px;
    }
    
    .flag-overlay {
        width: 160px;
        height: 65px;
        top: 15px;
        right: 15px;
        padding: 0 10px 0 15px;
    }
    
    .country-name {
        font-size: 0.8rem;
        letter-spacing: 0.3px;
    }
    
    .flag-image {
        width: 40px;
        height: 40px;
    }
    
    .branch-link:hover .flag-overlay {
        width: 170px;
        height: 68px;
    }
    
    .branch-link:hover .country-name {
        font-size: 0.85rem;
    }
    
    .flag-icon {
        font-size: 3rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Ajustar opacidad del video en móviles para mejor rendimiento */
    .video-background {
        opacity: 0.6;
    }
    
    body::before {
        background: rgba(0, 0, 0, 0.25);
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .branch-image {
        width: 280px;
        height: 190px;
    }
    
    .company-logo {
        max-width: 200px;
        max-height: 80px;
    }
    
    .flag-overlay {
        width: 140px;
        height: 55px;
        top: 12px;
        right: 12px;
        padding: 0 8px 0 12px;
    }
    
    .country-name {
        font-size: 0.7rem;
        letter-spacing: 0.2px;
    }
    
    .flag-image {
        width: 35px;
        height: 35px;
    }
    
    .branch-link:hover .flag-overlay {
        width: 150px;
        height: 58px;
    }
    
    .branch-link:hover .country-name {
        font-size: 0.75rem;
    }
    
    .flag-icon {
        font-size: 2.5rem;
    }
    
    .branches-container {
        gap: 30px;
        max-width: 100%;
    }
    
    /* Mayor overlay en pantallas muy pequeñas para mejor legibilidad */
    .video-background {
        opacity: 0.5;
    }
    
    body::before {
        background: rgba(0, 0, 0, 0.3);
    }
}