/* ══════════════════════════════════════════════════════════
   ROTAR 360° VIEWER — viewer.css v1.0.0
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ── Wrap principal ──────────────────────────────────────── */
.rotar360-wrap {
    width: 100%;
    margin-bottom: 28px;
    font-family: 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Canvas container ───────────────────────────────────── */
.r360-canvas-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;    /* ratio 16:9 por defecto; JS lo ajusta al ratio real */
    background: #ffffff;       /* blanco puro para evitar fondo negro */
    border-radius: 8px;
    overflow: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg width="36" height="36" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11" fill="%230b4268" stroke="%23ffffff" stroke-width="2"/><path d="M16 12H8M16 12L13 9M16 12L13 15M8 12L11 9M8 12L11 15" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') 18 18, ew-resize;
}
.r360-canvas-wrap:active { 
    cursor: url('data:image/svg+xml;utf8,<svg width="36" height="36" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11" fill="%23000000" stroke="%23ffffff" stroke-width="2"/><path d="M16 12H8M16 12L13 9M16 12L13 15M8 12L11 9M8 12L11 15" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') 18 18, ew-resize; 
}

/* Canvas absoluto */
.r360-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

/* ── Hint overlay ─────────────────────────────────────────── */
.r360-hint {
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    pointer-events: none;
    z-index: 10;
    transition: opacity .5s ease;
}
.r360-hint span {
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.15);
    white-space: nowrap;
    letter-spacing: .3px;
}
.r360-hint.hidden { opacity: 0; }

/* ── Floating Hint (Dinámico en cursor) ───────────────────── */
.r360-float-hint {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(11, 66, 104, 0.85);
    color: #fff;
    padding: 16px 28px;
    border-radius: 40px;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 30px rgba(11, 66, 104, 0.4);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}
.r360-float-hint svg {
    width: 36px !important;
    height: 36px !important;
}
.r360-float-hint span {
    font-size: 16px !important;
}
.r360-float-hint.r360-visible {
    opacity: 1;
}

@keyframes r360MouseAnim {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-8px); }
}
.r360-mouse-anim {
    display: inline-flex;
    animation: r360MouseAnim 1.5s infinite ease-in-out;
}

/* ── Specifications Panel ────────────────────────────────── */
.r360-specs-panel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 6%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 20;
    max-width: 220px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}
.r360-specs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #0b4268;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 6px;
}
.r360-specs-header svg {
    width: 18px;
    height: 18px;
}
.r360-specs-content {
    font-size: 12px;
    line-height: 1.4;
    color: #555;
}
.r360-specs-content ul {
    margin: 0;
    padding-left: 16px;
}

/* ── Toolbar ──────────────────────────────────────────────── */
.r360-toolbar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}
.r360-tb-btn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s;
    border: 1px solid rgba(255,255,255,.2);
    line-height: 1;
    padding: 0;
}
.r360-tb-btn:hover {
    background: rgba(11, 66, 104, 0.75);
    transform: scale(1.08);
}

/* ── Loader ───────────────────────────────────────────────── */
.r360-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 8px;
    z-index: 30;
    gap: 14px;
    transition: opacity .4s ease;
}
.r360-loader.hidden { opacity: 0; pointer-events: none; }

/* Video-wrap: el video fluye normal y define la altura, sin padding-bottom */
.rotar360-video-wrap .r360-canvas-wrap {
    padding-bottom: 0 !important;  /* anula el truco del padding */
    height: auto;
}
/* El video en modo normal (no absolute) define el alto del contenedor */
.rotar360-video-wrap .r360-video {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 8px;
    background-color: #ffffff !important;
}

.r360-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(0,0,0,.08);
    border-top-color: #0b4268;
    border-radius: 50%;
    animation: r360spin .8s linear infinite;
}
@keyframes r360spin { to { transform: rotate(360deg); } }

.r360-load-pct {
    color: #333333;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ── Scrubbar ─────────────────────────────────────────────── */
.r360-scrubbar {
    margin-top: 14px;
    padding: 0 4px;
}
.r360-scrub {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #0b4268 0%, #0b4268 0%, #2a2a4a 0%);
    outline: none;
    cursor: ew-resize;
    transition: height .2s;
}
.r360-scrub:hover { height: 8px; }
.r360-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0b4268;
    cursor: ew-resize;
    box-shadow: 0 2px 8px rgba(11, 66, 104, 0.5);
    border: 3px solid #fff;
    transition: transform .15s;
}
.r360-scrub::-webkit-slider-thumb:hover { transform: scale(1.2); }
.r360-scrub::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0b4268;
    cursor: ew-resize;
    border: 3px solid #fff;
}
/* track progress fill via JS */

/* ── Badge 360° ───────────────────────────────────────────── */
.r360-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #0b4268, #115f96);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: .8px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(11, 66, 104, 0.4);
    z-index: 10;
    pointer-events: none;
}

/* ── Fullscreen ───────────────────────────────────────────── */
.rotar360-wrap:-webkit-full-screen { background: #ffffff; }
.rotar360-wrap:-moz-full-screen    { background: #ffffff; }
.rotar360-wrap:fullscreen          { background: #ffffff; }

/* ── Hotspot Detail Panel ─────────────────────────────────── */
.r360-hs-detail-panel {
    position: absolute;
    width: 250px;
    background: rgba(11, 66, 104, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 200, 255, 0.5);
    border-radius: 20px;
    color: #fff;
    padding: 20px 20px 20px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), left 0.1s, top 0.1s;
    z-index: 50;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.3), inset 0 0 10px rgba(0, 200, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translate(25px, -50%) scale(0.9);
}
.r360-hs-detail-panel.r360-visible {
    opacity: 1;
    transform: translate(25px, -50%) scale(1);
    pointer-events: auto;
}
.r360-hs-detail-panel.r360-align-left {
    transform: translate(calc(-100% - 25px), -50%) scale(0.9);
}
.r360-hs-detail-panel.r360-align-left.r360-visible {
    transform: translate(calc(-100% - 25px), -50%) scale(1);
}

/* Flecha apuntando a la izquierda */
.r360-hs-detail-panel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -11px;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent rgba(0, 200, 255, 0.5) transparent transparent;
}
.r360-hs-detail-panel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -9px;
    transform: translateY(-50%);
    border-width: 9px 9px 9px 0;
    border-style: solid;
    border-color: transparent rgba(11, 66, 104, 0.95) transparent transparent;
}

/* Flecha apuntando a la derecha (cuando panel está a la izq) */
.r360-hs-detail-panel.r360-align-left::before {
    left: auto;
    right: -11px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent rgba(0, 200, 255, 0.5);
}
.r360-hs-detail-panel.r360-align-left::after {
    left: auto;
    right: -9px;
    border-width: 9px 0 9px 9px;
    border-color: transparent transparent transparent rgba(11, 66, 104, 0.95);
}
.r360-hs-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffffff;
    border: none;
    color: #0b4268;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.r360-hs-detail-close:hover {
    transform: scale(1.15);
    background: #f0f0f0;
}
.r360-hs-detail-title {
    display: none;
}
.r360-hs-detail-body {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    padding-right: 20px;
}

.rotar360-wrap:-webkit-full-screen .r360-canvas-wrap { padding-bottom: 0; height: 100vh; border-radius: 0; background: #ffffff; }
.rotar360-wrap:-moz-full-screen    .r360-canvas-wrap { padding-bottom: 0; height: 100vh; border-radius: 0; background: #ffffff; }
.rotar360-wrap:fullscreen          .r360-canvas-wrap { padding-bottom: 0; height: 100vh; border-radius: 0; background: #ffffff; }

/* ── Hotspots ────────────────────────────────────────────── */
.r360-hotspot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e05000;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 40;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.r360-hotspot.r360-hs-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}
.r360-hotspot::before {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border: 2px solid #e05000;
    border-radius: 50%;
    animation: r360Pulse 1.5s infinite;
}
@keyframes r360Pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.r360-hotspot-tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 66, 104, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.r360-hotspot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(11, 66, 104, 0.9) transparent transparent transparent;
}
.r360-hotspot:hover .r360-hotspot-tooltip {
    opacity: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .r360-hint span { font-size: 10px; padding: 4px 9px; }
    .r360-tb-btn { width: 40px; height: 40px; font-size: 18px; }
    .r360-specs-panel { display: none; }
}
