/* Estilos para el main de la página de contacto */
main {
    min-height: 80vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 40px 20px;
    font-family: 'Arial', sans-serif;
}

main>div:first-child {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 3px solid #d4af37;
    position: relative;
    overflow: hidden;
}

main>div:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #d4af37, #f4e17a, #d4af37);
}

main h1 {
    color: #000000;
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 100px;
    position: relative;
    padding-bottom: 20px;
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
}

main h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #d4af37, #f4e17a);
    border-radius: 2px;
}

/* Contenedor de información de contacto con grid */
main>div:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Tabla de contacto - ocupará ambas columnas y se dividirá internamente */
main table {
    grid-column: 1 / -1;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

main table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 20px;
}

main table td {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #d4af37;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

main table td:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
    background: #f1f3f4;
}

/* Enlaces y información de contacto - TEXTO EN NEGRO */
main a,
main p {
    color: #000000 !important;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    font-family: 'Arial', sans-serif;
    text-decoration: none !important;
    font-weight: normal;
}

/* Efecto hover solo para enlaces */
main a:hover {
    color: #d4af37 !important;
    transition: color 0.3s ease;
}

/* Subtítulo h3 - CORREGIDO para cubrir toda la palabra */
main h3 {
    color: #000000;
    font-size: 1.6rem;
    font-weight: 600;
    font-family: 'Arial', sans-serif;
    margin: 0 0 15px 0;
    padding: 15px 35px;
    background: linear-gradient(135deg, #d4af37, #f4e17a);
    color: #000000;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    transition: transform 0.3s ease;
    display: inline-block;
    min-width: fit-content;
}

main h3:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* Iframe del mapa */
iframe {
    width: 100%;
    max-width: 1200px;
    height: 500px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 30px auto 0 auto;
    display: block;
    grid-column: 1 / -1;
    justify-self: center;
}

iframe:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Efectos de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main>div:first-child>* {
    animation: fadeInUp 0.8s ease forwards;
}

main h1 {
    animation-delay: 0.1s;
}

main table {
    animation-delay: 0.2s;
}

iframe {
    animation-delay: 0.4s;
}

.contact-card:hover::before {
    opacity: 1;
}

.contact-card h3 {
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 15px 35px;
    background: linear-gradient(135deg, #d4af37, #f4e17a);
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    display: inline-block;
    min-width: fit-content;
}

.contact-card:hover h3 {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.4);
}

/* Elementos p corregidos */
.contact-info {
    color: #000 !important;
    font-size: 1.2rem;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Enlaces interactivos con control de desbordamiento mejorado */
.contact-link {
    color: #000 !important;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1.8;
    font-weight: 500;
    display: block;
    padding: 8px 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
}

.contact-link.email:hover::before {
    content: "✉️ ";
}

.contact-link.phone:hover::before {
    content: "📞 ";
}

.contact-link.whatsapp:hover::before {
    content: "💬 ";
}

.contact-link.location:hover::before {
    content: "📍 ";
}

/* Responsive Design para tablets */
@media (max-width: 768px) {
    main {
        padding: 20px 10px;
    }

    main>div:first-child {
        display: block;
        padding: 30px 20px;
        margin: 10px;
    }

    main table tr {
        display: block;
        margin-bottom: 20px;
    }

    main table td {
        margin-bottom: 15px;
    }

    main h1 {
        font-size: 2.2rem;
        margin-bottom: 30px;
    }

    main a,
    main p {
        font-size: 1.2rem;
        color: #000000 !important;
    }

    main h3 {
        font-size: 1.4rem;
        padding: 12px 30px;
    }

    iframe {
        height: 350px;
        margin-top: 20px;
    }
}

/* RESPONSIVE OPTIMIZADO PARA 480px Y MENORES */
@media (max-width: 480px) {
    /* Main container */
    main {
        padding: 15px 8px;
        min-height: 75vh;
    }
    
    main > div:first-child {
        padding: 20px 12px;
        border-radius: 12px;
        margin: 5px;
        border: 2px solid #d4af37;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        display: block !important;
        grid-template-columns: none;
    }
    
    /* Título principal */
    main h1 {
        font-size: 1.8rem;
        margin-bottom: 25px;
        padding-bottom: 15px;
        line-height: 1.3;
        grid-column: unset;
        width: 100%;
    }
    
    main h1::after {
        width: 70px;
        height: 3px;
    }
    
    /* Table layout para móvil */
    main table {
        width: 100%;
        margin-bottom: 20px;
        grid-column: unset;
    }
    
    main table tr {
        display: block;
        margin-bottom: 15px;
        grid-template-columns: none;
        gap: 0;
    }
    
    main table td {
        margin-bottom: 15px;
        padding: 18px 15px;
        border-radius: 12px;
        border-left: 3px solid #d4af37;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    main table td:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
    }
    
    /* Subtítulos h3 */
    main h3 {
        font-size: 1.3rem;
        padding: 12px 25px;
        margin-bottom: 12px;
        border-radius: 20px;
        text-align: center;
    }
    
    main h3:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
    }
    
    /* Links y párrafos */
    main a,
    main p {
        font-size: 1.1rem;
        line-height: 1.5;
        color: #000000 !important;
        word-break: break-word;
    }
    
    .contact-info {
        font-size: 1.1rem;
        line-height: 1.6;
        padding: 5px 0;
        word-break: break-word;
    }
    
    .contact-link {
        font-size: 1.1rem;
        padding: 8px 12px;
        border-radius: 10px;
        display: inline-block;
        margin: 3px 0;
        word-break: break-word;
    }
    
    /* Contact cards específicas */
    .contact-card {
        margin-bottom: 15px;
        padding: 15px 10px;
        width: 250px;
        box-sizing: border-box;
        margin-left: 50px;
    }
    
    .contact-card h3 {
        font-size: 1.25rem;
        padding: 10px 20px;
        margin-bottom: 12px;
        border-radius: 18px;
    }
    
    /* Iframe del mapa */
    iframe {
        height: 260px;
        margin-top: 20px;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        grid-column: unset;
        width: 100%;
        box-sizing: border-box;
    }
    
    iframe:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    }
    
    /* Loading screen */
    .loading-image {
        max-width: 250px;
        max-height: 250px;
    }
    
    /* Animaciones más rápidas en móvil */
    main > div:first-child > * {
        animation-duration: 0.6s;
    }
}

/* RESPONSIVE PARA MÓVILES MUY PEQUEÑOS (360px y menores) */
@media (max-width: 360px) {
    main {
        padding: 12px 5px;
        min-height: 70vh;
    }
    
    main > div:first-child {
        padding: 15px 10px;
        margin: 3px;
        border-radius: 10px;
        border: 2px solid #d4af37;
    }
    
    main h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
        line-height: 1.2;
    }
    
    main h1::after {
        width: 50px;
        height: 2px;
    }
    
    main table td {
        padding: 15px 10px;
        border-left: 2px solid #d4af37;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    main h3 {
        font-size: 1.1rem;
        padding: 10px 18px;
        margin-bottom: 10px;
        word-wrap: break-word;
        line-height: 1.2;
    }
    
    main a,
    main p {
        font-size: 0.95rem;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .contact-info {
        font-size: 0.95rem;
        max-width: 100%;
        overflow-wrap: break-word;
        line-height: 1.4;
    }
    
    .contact-link {
        font-size: 0.95rem;
        padding: 8px 10px;
        max-width: 100%;
        overflow-wrap: break-word;
        text-align: left;
        display: block;
        margin: 5px 0;
    }
    
    iframe {
        height: 220px;
        margin-top: 15px;
    }
    
    .loading-image {
        max-width: 200px;
        max-height: 200px;
    }
    
    /* Contact cards para móviles muy pequeños */
    .contact-card {
        padding: 12px 8px;
    }
    
    .contact-card h3 {
        font-size: 1.05rem;
        padding: 8px 15px;
    }
}

/* RESPONSIVE PARA MÓVILES EXTRA PEQUEÑOS (320px y menores) */
@media (max-width: 320px) {
    main {
        padding: 10px 3px;
    }
    
    main > div:first-child {
        padding: 12px 8px;
        margin: 2px;
        border: 1px solid #d4af37;
    }
    
    main h1 {
        font-size: 1.4rem;
        margin-bottom: 18px;
        padding-bottom: 10px;
    }
    
    main h1::after {
        width: 40px;
        height: 2px;
    }
    
    main table td {
        padding: 12px 8px;
        border-radius: 8px;
    }
    
    main h3 {
        font-size: 1rem;
        padding: 8px 15px;
        margin-bottom: 8px;
        border-radius: 15px;
    }
    
    main a,
    main p,
    .contact-info,
    .contact-link {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .contact-link {
        padding: 6px 8px;
        border-radius: 8px;
    }
    
    iframe {
        height: 200px;
        border-radius: 8px;
    }
}

/* ORIENTACIÓN HORIZONTAL EN MÓVILES */
@media (max-width: 480px) and (orientation: landscape) {
    main {
        padding: 10px 8px;
        min-height: 60vh;
    }
    
    main h1 {
        font-size: 1.6rem;
        margin-bottom: 18px;
    }
    
    iframe {
        height: 200px;
    }
    
    main table td {
        padding: 12px 10px;
    }
    
    main h3 {
        font-size: 1.2rem;
        padding: 8px 12px;
    }
}