/*
 * Radis Chile — Teleradiología
 * Basado en Zoom Template (templatemo.com/tm-414-zoom)
 * SEO v2: variables CSS, transiciones, tipografía refinada, accesibilidad
 */

/* Variables CSS */
:root {
    --blue-primary: #246BB2;
    --blue-accent: #6CF;
    --yellow-accent: #FF6;
    --orange-accent: #F60;
    --green-accent: #CF0;
    --bg-dark: rgba(0, 0, 0, 0.8);
    --bg-light: rgba(255, 255, 255, 0.8);
    --font-main: 'Raleway', sans-serif;
    --transition-speed: 0.4s;
}

body, html {
    overflow-x: hidden;
    font-family: var(--font-main);
    font-size: 1em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, span, p {
    font-family: var(--font-main);
}

.blue { color: var(--blue-accent); }
.green { color: var(--green-accent); }

h2 {
    padding: 15px 0;
    margin: 0;
    line-height: 1.3;
}

p {
    padding: 8px 0;
    text-align: justify;
}

a {
    color: var(--yellow-accent);
    text-decoration: none;
}

a:hover {
    color: var(--orange-accent);
}

a:focus {
    outline: 2px solid var(--blue-accent);
    outline-offset: 2px;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

img {
    vertical-align: middle;
    max-width: 100%;
    height: auto;
}

/* Preloader — oscuro, más profesional */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a2e;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#status {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--blue-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* General */
#main-wrapper {
    overflow: hidden;
}

.templatemo-logo {
    z-index: 1;
}

.templatemo-site-title {
    color: #fff !important;
    text-shadow: 0px 3px 4px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
}

h1.templatemo-site-title {
    font-size: 2.5em;
    font-weight: 700;
}

h3.templatemo-site-title {
    font-size: 1.2em;
    font-weight: 400;
    margin-top: 0.5em;
}

p.templatemo-subtitle {
    font-size: 1.2em;
    font-weight: 400;
    margin-top: 0.5em;
    text-align: center; }

.templatemo-site-title a {
    color: #fff;
    text-decoration: none;
}

.templatemo-site-title a:hover {
    text-decoration: none;
}

img.slide {
    width: 100%;
    z-index: -9999999;
    position: absolute;
}

.active {
    display: block;
}

.inactive {
    display: none;
}

/* Fondo fijo con zoom */
.image-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.image-container {
    position: relative;
}

.image-container img {
    position: absolute;
}

/* Contenido principal */
.templatemo-content {
    position: relative;
    overflow: hidden;
    margin-top: 8%;
    padding-bottom: 8%;
    z-index: 2;
}

/* Botones negros con hover mejorado */
.black-bg {
    background-color: var(--bg-dark);
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.black-bg:before, .black-bg:after {
    content: "";
    display: table;
    line-height: 0;
}

.black-bg:after {
    clear: both;
}

.templatemo-content section {
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
    top: 0;
    padding-bottom: 20px;
}

.templatemo-content-wrapper {
    overflow: hidden;
}

.templatemo-content h2 {
    color: #fff;
    font-family: var(--font-main);
}

.templatemo-content p {
    font-family: var(--font-main);
    color: #fff;
    font-size: 16px;
    line-height: 1.7;
}

.templatemo-content ul {
    color: #fff;
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
}

.templatemo-content ul li {
    padding: 6px 0;
}

#map-canvas {
    height: 260px;
}

/* Footer con gradiente */
.footer {
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
    z-index: 10;
}

.footer-text {
    font-family: var(--font-main);
    color: #fff;
    text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.8);
    margin-left: 30px;
    font-size: 13px;
    padding: 10px 0;
}

.footer-text a {
    color: var(--blue-accent);
}

.footer-text a:hover {
    color: var(--yellow-accent);
}

.margin-top-20 {
    margin-top: 20px;
}

.margin-bottom-20 {
    margin-bottom: 20px;
}

/* Botones de menú mejorados */
.btn-menu {
    padding: 10px 0;
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.btn-menu > img,
.btn-menu > svg {
    width: 48px;
    height: 48px;
    margin: 0;
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    transition: all var(--transition-speed) ease;
}

.btn-menu > svg {
    fill: none;
    stroke: #ccc;
    filter: brightness(0.9);
}

.btn-menu:hover > svg {
    filter: brightness(1.3);
    stroke: var(--blue-accent);
}

.btn-menu:hover > img {
    filter: brightness(1.2);
}

.btn-menu > h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Burbuja de precio al hover */
.price-tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(36, 107, 178, 0.95);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-menu {
    position: relative;
}

.change-section:hover .price-tooltip {
    display: block;
    animation: tooltipFade 0.3s ease;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Centrar los botones inferiores (Nuestra Empresa + Cómo subir) */
.menu-bottom-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: stretch;
}

.menu-bottom-row > [class*="col-"] {
    flex: 0 0 auto;
    max-width: 300px;
}

/* Botones inferiores sin altura fija pero uniformes */
.menu-bottom-row .btn-menu {
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 30px !important;
}

/* Botones de sección interna (Volver) */
#nuestra-empresa-section .btn-menu,
#como-subo-mi-radiografia-section .btn-menu {
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 30px !important;
}

#nuestra-empresa-section .btn-menu > h2,
#como-subo-mi-radiografia-section .btn-menu > h2 {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.3 !important;
    letter-spacing: 0.5px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: center !important;
}

/* Links de sección */
.change-section {
    color: #fff;
    text-decoration: none;
}

.change-section .black-bg {
    transition: all var(--transition-speed) ease;
}

.change-section .black-bg > h2 {
    transition: all var(--transition-speed) ease;
}

.change-section:hover {
    text-decoration: none;
    color: var(--blue-accent);
}

.change-section:hover .black-bg {
    background-color: var(--bg-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.change-section:hover .black-bg > h2 {
    color: var(--blue-primary);
}

/* Transición de secciones — reemplaza jQuery UI effects */
section {
    transition: opacity var(--transition-speed) ease;
}

/* Accessibilidad: skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--blue-primary);
    color: #fff;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Responsive */
@media (max-width: 991px) {
    .footer {
        overflow: hidden;
        position: static;
        text-align: center;
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.5));
    }
    
    .footer-text {
        margin-left: 0;
        text-align: center;
    }
    
    .templatemo-content {
        margin-top: 12%;
    }
    
    .btn-menu > h2 {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .templatemo-site-title {
        font-size: 1.5em;
    }
    
    h3.templatemo-site-title {
        font-size: 1em;
    }
    
    p.templatemo-subtitle {
        font-size: 1em;
    }
    
    .templatemo-content {
        margin-top: 15%;
        padding-bottom: 12%;
    }
    
    .btn-menu > img,
    .btn-menu > svg {
        width: 36px;
        height: 36px;
    }
}

/* Movil: los dos botones inferiores a ancho completo.
   Antes, con flex 0 0 auto y max-width 300, la fila medía 615px en una pantalla de 360
   y quedaban centrados fuera de pantalla: se cortaba "Nuestra Empresa" y "Como subo mi radiografia". */
@media (max-width: 768px) {
    .menu-bottom-row {
        flex-wrap: wrap;
    }
    .menu-bottom-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    /* el h2 es absolute + nowrap: con left:50% solo dispone de medio ancho y parte el texto.
       En estos dos botones pasa a flujo normal y el flex del boton lo centra. */
    .menu-bottom-row .btn-menu > h2 {
        position: static;
        transform: none;
        margin: 0;
        white-space: normal;
        text-align: center;
    }
}
