:root {
    --safe-space: clamp(20px, 2vw, 32px);
    --viewport-safe-width: calc(100vw - (var(--safe-space) * 2));
    --viewport-safe-height: calc(100vh - (var(--safe-space) * 2));
    --kiosk-stage-width: min(var(--viewport-safe-width), calc(var(--viewport-safe-height) * 0.5625));
    --kiosk-stage-height: min(var(--viewport-safe-height), calc(var(--viewport-safe-width) * 1.777777778));
    --ficha-side-safe: clamp(20px, 5vw, 88px);
    --ficha-top-safe: clamp(12px, 2.4vh, 24px);
    --ficha-bottom-safe: clamp(20px, 4vh, 40px);
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 30%),
        linear-gradient(180deg, #0f172a, #111827);
    margin: 0;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: manipulation;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

h1 {
    color: #333;
}

#viewer {
    width: 90%;
    max-width: 1000px;
    border: 2px solid #ccc;
    overflow: hidden;
    position: relative;
    background-color: #fff;
}

#car-container {
    position: relative;
    transition: transform 0.5s ease-in-out;
}

#car-image {
    width: 100%;
    display: block;
}

.hotspot {
    position: absolute;
    border: 2px dashed rgba(255, 0, 0, 0.7);
    cursor: pointer;
    transition: background-color 0.3s;
    box-sizing: border-box;
}

.hotspot:hover {
    background-color: rgba(255, 0, 0, 0.3);
}

#info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 30px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.5s ease-in-out;
    box-sizing: border-box;
}

#info-panel:not(.hidden) {
    transform: translateX(0);
}

#info-panel.hidden {
    opacity: 0;
    visibility: hidden;
}

#close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

#info-image {
    width: 100%;
    height: auto;
    margin-top: 15px;
    border-radius: 8px;
}

.main-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #243d91 0%, #182b6b 100%);
    overflow: hidden;
    box-shadow: none;
}

#viewer-container {
    flex: 0 0 38%;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

#info-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--ficha-top-safe) var(--ficha-side-safe) var(--ficha-bottom-safe);
    box-sizing: border-box;
    background: transparent;
    min-height: 0;
}

#c {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#info-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0 auto;
}

h1 {
    position: absolute;
    top: 10px;
    left: 20px;
    z-index: 10;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-size: 1.5em;
}

#reset-btn {
    position: absolute;
    top: var(--safe-space);
    right: var(--safe-space);
    z-index: 10;
    min-height: 52px;
    padding: 12px 20px;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    touch-action: manipulation;
}

#reset-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.back-to-menu-btn {
    position: absolute;
    top: var(--safe-space);
    left: var(--safe-space);
    z-index: 100;
    min-height: 52px;
    padding: 12px 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    text-decoration: none;
    font-family: sans-serif;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    touch-action: manipulation;
}

.back-to-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
