:root {
    --bg-color: #050505; /* Casi negro profundo */
    --text-color: #ffffff;
    --card-bg: linear-gradient(145deg, #ffffff, #f0f0f0);
    --card-text: #1a1a1a;
    --accent-color: #e60000; /* Rojo vibrante */
    --accent-hover: #ff1a1a;
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Optimización táctil para iPadOS */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: radial-gradient(circle at 50% -20%, #3a0000 0%, var(--bg-color) 70%);
    color: var(--text-color);
    font-family: var(--font-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Pantalla Principal */
#main-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 2rem;
    transition: opacity 0.4s ease, visibility 0.4s;
}

#main-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.logo-container {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    /* Resplandor rojo detrás del logo para destacarlo aún más */
    filter: drop-shadow(0 0 25px rgba(230, 0, 0, 0.25));
}

.logo-container img {
    max-height: 100%;
    max-width: 80%;
    object-fit: contain;
}

#logo-fallback {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.15rem;
    color: var(--accent-color);
}

header h2 {
    font-family: var(--font-primary);
    font-size: 2.2rem;
    font-weight: 300;
    color: #e0e0e0;
    letter-spacing: 0.05rem;
}

.cards-grid {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
    flex: 1;
    align-items: center;
    padding-bottom: 4rem;
}

.card {
    position: relative;
    background: var(--card-bg);
    border: none;
    border-radius: 24px;
    padding: 3.5rem 2rem;
    width: 28%;
    max-width: 360px;
    height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* Sombra múltiple para lograr un efecto 3D premium flotante */
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.7), 
        0 1px 3px rgba(255, 255, 255, 0.8) inset,
        0 -10px 30px rgba(230, 0, 0, 0.05) inset,
        0 15px 30px rgba(230, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
    color: var(--card-text);
    outline: none;
    overflow: hidden;
}

/* Franja superior roja decorativa para la tarjeta */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #ff1a1a, #990000);
}

.card:active {
    transform: scale(0.96) translateY(4px);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.5), 
        0 1px 3px rgba(255, 255, 255, 0.8) inset,
        0 -5px 15px rgba(230, 0, 0, 0.05) inset,
        0 8px 15px rgba(230, 0, 0, 0.2);
}

.card-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 2.5rem;
    color: var(--accent-color);
    /* Sombra al propio icono */
    filter: drop-shadow(0 4px 8px rgba(230, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.card:active .card-icon {
    transform: scale(0.9);
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
    color: var(--card-text);
}

/* Visor Kiosco (Iframe) */
#viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: opacity 0.4s ease, visibility 0.4s;
    opacity: 1;
    visibility: visible;
}

#viewer-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.viewer-controls {
    height: 85px;
    background: #0a0a0a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    z-index: 1001;
    border-bottom: 1px solid rgba(230, 0, 0, 0.15);
}

.control-btn {
    background: linear-gradient(145deg, var(--accent-color), #b30000);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 1.2rem 2.5rem;
    font-size: 1.5rem;
    font-family: var(--font-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(230, 0, 0, 0.3), inset 0 1px 2px rgba(255,255,255,0.3);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.control-btn.secondary {
    background: linear-gradient(145deg, #333333, #1a1a1a);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255,255,255,0.1);
}

.control-btn:active {
    transform: scale(0.94) translateY(2px);
    filter: brightness(0.9);
}

.control-btn svg {
    width: 28px;
    height: 28px;
}

#kiosk-frame {
    flex: 1;
    width: 100%;
    background: #ffffff;
}

/* Adaptación para iPad en vertical (Portrait) */
@media screen and (max-aspect-ratio: 1/1) {
    .cards-grid {
        flex-direction: column;
        gap: 2.5rem;
        padding-bottom: 2rem;
    }
    
    .card {
        width: 85%;
        height: auto;
        padding: 2.5rem 2rem;
        flex-direction: row;
        justify-content: flex-start;
        max-width: 600px;
    }
    
    .card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 0;
        margin-right: 2.5rem;
    }
    
    .card h3 {
        text-align: left;
        font-size: 2.2rem;
    }
    
    /* En vertical la franja pasa a estar a la izquierda */
    .card::before {
        width: 6px;
        height: 100%;
        background: linear-gradient(180deg, #ff1a1a, #990000);
    }
}
