:root {
    --azul-oscuro: #062457;
    --gris-menu: #e0e0e0;
    --rojo-corporativo: #8d0909;
    --dorado: #bf9000;
    --crema-publicidad: rgb(251, 229, 214, 0.4);
    --celeste-principal: rgb(222, 234, 246, 0.7);
    --texto-oscuro: #333;
}

body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
}

/* Contenedor responsivo */
.container {
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    grid-template-rows: auto auto 1fr auto auto;
    min-height: 100vh;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    /* Imagen de fondo */
    background-image: url('/imagen/fondo9.avif'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* La imagen se queda fija al hacer scroll */
    
    /* Capa de tinte para que el neón resalte */
    box-shadow: inset 0 0 0 2000px rgba(13, 27, 42, 0.4);
}

/* 1. Header Top - Reloj */
.header-top {
    grid-column: 1 / 4;
    background-color: var(--azul-oscuro);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 10px;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 8px;
    border: 3px solid var(--dorado); /* Grosor de 3px, estilo sólido y color dorado */
}

/* 2. Header Menu */
.header-menu {
    grid-column: 2 / 3;
    background-color: var(--gris-menu);
    display: flex;
    flex-wrap: wrap; /* Permite que los botones bajen si no caben */
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    gap: 10px;
    justify-content: flex-end;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: var(--texto-oscuro);
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 200;
    border-top: 3px solid var(--rojo-corporativo);
}

.dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
    color: black;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 13px;
}

/* Laterales - Se ocultan en móviles para ganar espacio */
.side-bar {
    background-color: var(--dorado);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 11px;
}
.side-left { grid-row: 2 / 5; grid-column: 1; transform: rotate(180deg); }
.side-right { grid-row: 2 / 5; grid-column: 3; }

/* Centro Responsivo */
.main-wrapper {
    grid-row: 3 / 4;
    grid-column: 2 / 3;
    display: grid;
    grid-template-columns: 250px 1fr; /* Default escritorio */
    gap: 15px;
    position: relative;
    padding-top: 20px;
}

.ad-section {
    background-color: var(--crema-publicidad);
    border-radius: 20px;
    border: 1px dashed #e49e7d;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    font-weight: bold;
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

#adContent {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#adContent img, #adContent video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: fadeIn 0.5s;
}

.ad-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

.ad-nav:hover { background: var(--rojo-corporativo); }
.prev { left: 10px; }
.next { right: 10px; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* termina ad secchion*/

.main-display {
    background-color: var(--celeste-principal);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 1px solid #b4c6e7;
    padding: 20px;
    text-align: center;
}

/* Footer */
.footer-main {
    grid-column: 2 / 3;
    background-color: var(--dorado);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-weight: bold;
    border-radius: 8px;
    text-align: center;
}

.currency-bar {
    grid-column: 1 / 4;
    background-color: var(--rojo-corporativo);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 8px;
}

/* Logos */
.circle {
    position: absolute;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 0 0 white) drop-shadow(-2px 0 0 white) 
            drop-shadow(0 2px 0 white) drop-shadow(0 -2px 0 white);
}

.logo-oficial { width: 90px; height: 90px; top: 35px; left: 15px; }
.logo-aniversario { width: 100px; height: 100px; bottom: 35px; right: 15px; }

/* Contenedor del Menú Circular */
.circular-menu {
    position: absolute;
    top: 50%;
    left: 250px; /* Alineado con tu diseño original */
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 1000;
}

/* Botón Central */
.menu-button {
    width: 70px;
    height: 70px;
    background-color: var(--rojo-corporativo);
    border: 4px solid white;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1010;
    transition: transform 0.3s ease;
}

.menu-button:active { transform: scale(0.9); }

/* Contenedor de Items */
.menu-items {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; /* Desactivado cuando está cerrado */
    transition: 0.5s ease;
}

/* Estado Activo */
.circular-menu.active .menu-items {
    pointer-events: auto;
}

.menu-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 75px;  /* Aumentamos un poco el tamaño */
    height: 75px;
    background-color: var(--azul-oscuro);
    border-radius: 50%;
    display: flex;
    flex-direction: column; /* Icono arriba, texto abajo */
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    opacity: 0;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
/* Estilo del Icono */
.menu-item .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* Estilo del Texto/Título */
.menu-item .title {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: bold;
    text-align: center;
    line-height: 1;
}

/* Etiquetas flotantes al pasar el mouse */
.menu-item::after {
    content: attr(data-label);
    position: absolute;
    background: #333;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    bottom: -20px;
    opacity: 0;
    transition: 0.3s;
}
.menu-item:hover::after { opacity: 1; }

/* Posicionamiento Radial cuando está activo */
/* Los items ahora esperan una variable --x y --y que enviará JS */
.circular-menu.active .item-wrapper .menu-item {
    transform: translate(var(--x), var(--y));
    opacity: 1;
}

.item-wrapper {
    position: absolute;
    width: 75px;
    height: 75px;
    transition: 0.4s ease;
}

/* Ajuste para que los submenús salgan hacia el lado correcto según la posición */
.item-wrapper:hover .sub-radial {
    display: block;
    /* Si el botón está muy a la derecha, el submenú se ajusta */
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
}

/* IMPORTANTE: Ajuste para el botón central que a veces tapa el click */
.circular-menu.active .menu-items {
    pointer-events: auto;
}


/* Sub-menú al hacer clic en el item principal (opcional simplificado) */
.sub-radial {
    display: none;
    position: absolute;
    left: 70px;
    top: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 10px;
}

/* Ajuste del contenedor para que NO haya huecos */
.item-wrapper {
    position: absolute;
    width: 100px; /* Aumentado para que el área de hover llegue al submenú */
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

/* Sub-menú corregido */
.sub-radial {
    display: none;
    position: absolute;
    left: 80px; /* Pegado al borde del icono */
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 8px 0;
    min-width: 180px;
    z-index: 2000;
    border-left: 4px solid var(--rojo-corporativo);
}

/* El truco del "Puente Invisible" */
/* El "Puente" invisible: Esto rellena el espacio vacío entre el circulo y la lista */
.sub-radial::before {
    content: "";
    position: absolute;
    left: -30px; /* Extiende el área sensible hacia la izquierda */
    top: 0;
    width: 30px;
    height: 100%;
}

/* Mantener abierto mientras el mouse esté en el wrapper */
.item-wrapper:hover .sub-radial {
    display: block;
}

/* Estilo de los links del sub-menú */
.sub-radial a {
    display: block;
    color: var(--texto-oscuro);
    text-decoration: none;
    font-size: 13px;
    padding: 10px 20px;
    transition: background 0.2s;
}

.sub-radial a:hover {
    background-color: #f8f8f8;
    color: var(--rojo-corporativo);
}


/* Adaptación Móvil */
@media (max-width: 768px) {
    .circular-menu {
        left: 50%;
        top: 20%; /* Ajustar según conveniencia */
    }
}


/* --- MEDIA QUERIES (ADAPTACIÓN) --- */

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr; /* Una sola columna */
        grid-template-rows: auto auto auto auto auto auto;
        padding: 5px;
    }

    .side-bar { display: none; } /* Ocultamos barras laterales en móvil */

    .header-top, .header-menu, .main-wrapper, .footer-main, .currency-bar {
        grid-column: 1 / 2;
    }

    .main-wrapper {
        grid-template-columns: 1fr; /* Publicidad arriba, contenido abajo */
    }

    .logo-oficial { width: 70px; height: 70px; top: 10px; left: 10px; }
    .logo-aniversario { width: 80px; height: 80px; bottom: 10px; right: 10px; }
    
    .menu-float {
        left: 50%;
        top: 0;
        transform: translate(-50%, -50%);
    }

    .header-menu {
        margin-left: 0;
        justify-content: center;
    }
}