:root {
    --primary-color: #FF6B00;
    --secondary-color: #003399;
    --text-color: #333;
    --background-color: #f5f5f5;
    --card-width: 420px;
    --card-height: 650px;
}

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

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

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

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-width)), 1fr));
    gap: 2rem;
    width: 100%;
    max-width: var(--card-width);
    margin: 0 auto;
    padding: 0;
}

.card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    width: 100%;
    height: var(--card-height);
    position: relative;
    animation: fadeIn 0.8s ease-out forwards;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color) 60%, var(--secondary-color) 100%);
    height: 260px;
    position: relative;
    overflow: hidden;
    padding-top: 25px;
}

.card-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color) 60%, var(--secondary-color) 100%);
    border-radius: 50% 50% 0 0;
    transform: scaleX(1.5);
}

.company-logo {
    position: relative;
    max-height: 150px;
    max-width: 380px;
    object-fit: contain;
    z-index: 2;
    display: block;
    margin: 0 auto 25px;
    transition: all 0.4s ease;
    animation: scaleIn 0.6s ease-out forwards;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.company-logo:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.25));
}

.card-body {
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: white;
    height: calc(100% - 260px);
}

.profile-image {
    width: 230px;
    height: 230px;
    border-radius: 15px;
    margin: -115px auto 2rem;
    border: 3px solid white;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 3;
    transition: all 0.4s ease;
    animation: slideInFromTop 0.8s ease-out forwards;
    cursor: pointer;
    transform-origin: center center;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    transition: all 0.4s ease;
    border-radius: 12px;
}

.profile-image:hover, 
.profile-image:active,
.profile-image.clicked {
    transform: scale(1.12);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-width: 2px;
}

.profile-image:hover img,
.profile-image:active img,
.profile-image.clicked img {
    transform: scale(1.1);
}

/* Eliminamos el contenedor intermedio que ya no necesitamos */
.profile-image-container {
    display: none;
}

h2 {
    color: var(--secondary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.4;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.contact-button {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background-color: #f8f8f8;
    border-radius: 30px;
    transition: all 0.4s ease;
    border: 2px solid var(--primary-color);
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.6s;
    opacity: 0;
    white-space: nowrap;
    min-width: 44px;
    flex: 1;
    justify-content: center;
    max-width: 130px;
}

.contact-button i {
    font-size: 1.1rem;
}

.contact-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.2);
}

/* Eliminamos los estilos antiguos del email que ya no necesitamos */
.email {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        padding: 0;
        min-height: 100vh;
    }

    .cards-grid {
        gap: 1rem;
        padding: 1rem;
    }

    .card {
        width: 100%;
        margin: 0 auto;
    }

    :root {
        --card-width: 320px;
        --card-height: 580px;
    }

    .card-header {
        height: 220px;
        padding-top: 20px;
    }

    .company-logo {
        max-height: 120px;
        max-width: 300px;
        margin-bottom: 20px;
        filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.15));
    }

    .company-logo:hover {
        transform: scale(1.1);
        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.2));
    }

    .profile-image {
        width: 200px;
        height: 200px;
        margin: -100px auto 1.8rem;
        border-width: 2px;
        border-radius: 12px;
    }

    .profile-image img {
        border-radius: 10px;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }

    .card-body {
        padding: 1.5rem 1rem;
        height: calc(100% - 220px);
    }

    .contact-buttons {
        gap: 0.6rem;
        padding: 0 0.5rem;
    }

    .contact-button {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
        max-width: 110px;
    }

    .contact-button i {
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .cards-grid {
        padding: 0.5rem;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .contact-button {
        max-width: 160px;
        width: 100%;
    }
}

/* Media queries para pantallas estrechas */
@media screen and (max-width: 400px) {
    :root {
        --card-width: 360px;
        --card-height: 650px;
    }

    .card-header {
        height: 220px;
    }

    .company-logo {
        max-width: 280px;
        max-height: 120px;
        margin-bottom: 15px;
    }

    .profile-image {
        width: 200px;
        height: 200px;
        margin: -100px auto 1.5rem;
    }

    .contact-buttons {
        gap: 0.5rem;
    }

    .contact-button {
        padding: 0.5rem;
        font-size: 0.75rem;
        width: 160px;
    }

    .contact-button i {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 360px) {
    :root {
        --card-width: 320px;
        --card-height: 650px;
    }

    .company-logo {
        max-width: 260px;
    }

    .profile-image {
        width: 200px;
        height: 200px;
        margin: -100px auto 1.2rem;
    }

    .contact-button {
        width: 140px;
        padding: 0.4rem;
        font-size: 0.7rem;
    }

    .contact-button i {
        font-size: 1rem;
    }
}