/* filepath: public/assets/css/servicios.css
 * Estilos de la página "Servicios" (auxiliar de ventas).
 * - Mostrador interactivo (hotspots + modales)
 * - Otros ajustes puntuales de la página
 */

:root {
    --header-h: 124px;
}

/* ═══ Mostrador: imagen + hotspots ═══════════════════════════════ */
.jm-servicios-hero {
    position: relative;
    display: block;            /* block para que el contenedor tenga el tamaño exacto de la imagen */
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;            /* centrar el contenedor si sobra ancho */
    overflow: hidden;          /* recorta labels de hotspots que se salen */
}

.jm-servicios-hero__img {
    display: block;
    width: 100%;
    height: auto;              /* mantiene aspect ratio (7983x3421 → 2.33:1) */
    max-height: 75vh;          /* limita altura en pantallas muy grandes */
    object-fit: contain;
    border-radius: 14px;
    box-shadow:
        0 4px 12px -2px rgba(26, 26, 26, 0.12),
        0 2px 4px -2px rgba(26, 26, 26, 0.06);
}

/* ─── Hotspot button ─────────────────────────────────────── */
.jm-hotspot {
    position: absolute;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #1A1A1A;
    border: 2px solid #98C040;
    border-radius: 9999px;
    box-shadow:
        0 6px 16px -4px rgba(26, 26, 26, 0.30),
        0 2px 6px -2px rgba(26, 26, 26, 0.15),
        inset 0 0 0 4px rgba(152, 192, 64, 0.12);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 220ms ease,
                background 220ms ease,
                border-color 220ms ease;
}

.jm-hotspot::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 9999px;
    background: #98C040;
    opacity: 0.35;
    animation: jm-hotspot-pulse 2.4s ease-out infinite;
    z-index: -1;
    pointer-events: none;
}

.jm-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
        0 14px 28px -6px rgba(26, 26, 26, 0.35),
        0 4px 10px -2px rgba(26, 26, 26, 0.18),
        inset 0 0 0 4px rgba(152, 192, 64, 0.20);
}

.jm-hotspot:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(152, 192, 64, 0.45),
        0 14px 28px -6px rgba(26, 26, 26, 0.35);
}

.jm-hotspot[aria-pressed="true"] {
    background: #98C040;
    border-color: #7BA030;
    color: #ffffff;
    box-shadow:
        0 14px 28px -6px rgba(26, 26, 26, 0.35),
        inset 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.jm-hotspot[aria-pressed="true"]::before {
    background: #7BA030;
}

.jm-hotspot__icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

@keyframes jm-hotspot-pulse {
    0%   { transform: scale(0.85); opacity: 0.55; }
    100% { transform: scale(1.6);  opacity: 0;    }
}

/* ─── Label flotante lateral (tooltip) ─────────────────────── */
.jm-hotspot__label {
    position: absolute;
    top: 50%;
    left: calc(100% + 14px);
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 8px 14px;
    background: #ffffff;
    color: #1A1A1A;
    font: 600 13px/1 'Inter', ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -0.005em;
    border: 1px solid rgba(26, 26, 26, 0.10);
    border-radius: 10px;
    box-shadow:
        0 8px 18px -4px rgba(26, 26, 26, 0.22),
        0 2px 6px -2px rgba(26, 26, 26, 0.10);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
    z-index: 10;
}

.jm-hotspot__label::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #ffffff;
}

.jm-hotspot--label-left .jm-hotspot__label {
    left: auto;
    right: calc(100% + 14px);
}

.jm-hotspot--label-left .jm-hotspot__label::before {
    right: auto;
    left: 100%;
    border-right-color: transparent;
    border-left-color: #ffffff;
}

.jm-hotspot:hover .jm-hotspot__label,
.jm-hotspot:focus-visible .jm-hotspot__label,
.jm-hotspot[aria-pressed="true"] .jm-hotspot__label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(2px);
}

.jm-hotspot--label-left:hover .jm-hotspot__label,
.jm-hotspot--label-left:focus-visible .jm-hotspot__label,
.jm-hotspot--label-left[aria-pressed="true"] .jm-hotspot__label {
    transform: translateY(-50%) translateX(-2px);
}

.jm-hotspot[aria-pressed="true"] .jm-hotspot__label {
    background: #1A1A1A;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
}

.jm-hotspot[aria-pressed="true"] .jm-hotspot__label::before {
    border-right-color: #1A1A1A;
}

.jm-hotspot--label-left[aria-pressed="true"] .jm-hotspot__label::before {
    border-left-color: #1A1A1A;
}

/* ═══ Modal ════════════════════════════════════════════════════ */
.jm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 15, 15, 0.72);
    animation: jm-modal-fade-in 200ms ease-out;
}

.jm-modal {
    position: relative;
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1500px;
    min-height: 900px;
    max-height: calc(100vh - 32px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.35),
        0 8px 16px -4px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: jm-modal-pop-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.jm-modal__media {
    position: relative;
    flex: 0 0 80%;
    background: #F4F4F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.jm-modal__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jm-modal__placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    padding: 24px;
    text-align: center;
    color: #A0A0A0;
    background:
        radial-gradient(circle at 30% 30%, rgba(152, 192, 64, 0.06), transparent 60%),
        repeating-linear-gradient(
            135deg,
            transparent 0,
            transparent 14px,
            rgba(26, 26, 26, 0.025) 14px,
            rgba(26, 26, 26, 0.025) 28px
        );
}

.jm-modal__placeholder-icon { color: #CFE5A0; opacity: 0.9; }
.jm-modal__placeholder-text { font: 500 13px/1.4 'Inter', ui-sans-serif, system-ui, sans-serif; color: #6A6A6A; letter-spacing: 0.02em; }

.jm-modal__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 28px 32px;
    min-width: 0;
}

.jm-modal__title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: #1A1A1A;
    letter-spacing: -0.01em;
}

.jm-modal__body {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.65;
    color: #4A4A4A;
}

.jm-modal__body strong {
    color: #1A1A1A;
    font-weight: 600;
}

.jm-modal__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 13px 22px;
    background: #98C040;
    color: #ffffff;
    font: 600 14px/1 'Inter', ui-sans-serif, system-ui, sans-serif;
    border-radius: 10px;
    text-decoration: none;
    transition: background 200ms ease, transform 150ms ease;
}

.jm-modal__cta:hover {
    background: #7BA030;
    transform: translateY(-1px);
}

.jm-modal__cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(152, 192, 64, 0.35);
}

.jm-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #DC2626;
    color: #ffffff;
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.45);
    transition: background 200ms ease, transform 150ms ease, box-shadow 200ms ease;
}

.jm-modal__close:hover {
    background: #B91C1C;
    transform: scale(1.05);
}

.jm-modal__close:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 0 5px #DC2626,
        0 4px 12px -2px rgba(220, 38, 38, 0.45);
}

@keyframes jm-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes jm-modal-pop-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@media (prefers-reduced-motion: reduce) {
    .jm-hotspot__dot::before,
    .jm-hotspot::before,
    .jm-modal-backdrop,
    .jm-modal,
    .jm-hotspot,
    .jm-modal__close,
    .jm-modal__cta {
        animation: none !important;
        transition: none !important;
    }
}

/* ═══ Tabs (Alcances) ══════════════════════════════════════════ */
.jm-tabs {
    min-width: 0; /* evita que el wrapper crezca por contenido de los hijos */
    overflow: hidden; /* recorta cualquier overflow visual del tablist */
}
.jm-tabs__list {
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ─── Mostrador: prevenir overflow horizontal por labels absolutos ─ */
.jm-servicios-hero {
    overflow: hidden; /* recorta labels y tooltips que se salen */
}

.jm-tabpanel {
    animation: jm-tab-fade-in 200ms ease-out;
}

@keyframes jm-tab-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Utility: scrollbar-none ══════════════════════════════════ */
.scrollbar-none {
    scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ═══ Mobile / Tablet responsive ═══════════════════════════════ */
@media (max-width: 1024px) {
    .jm-modal__media { flex: 0 0 70%; }
}

@media (max-width: 768px) {
    /* Mostrador: layout block (no flex centering) para que hotspots
       coincidan exactamente con la imagen. */
    .jm-servicios-hero {
        display: block;
        min-height: 0;
    }
    .jm-servicios-hero__img {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: none;
        height: auto;
        border-radius: 8px;
    }

    .jm-hotspot { width: 48px; height: 48px; border-width: 2px; }
    .jm-hotspot__icon { width: 28px; height: 28px; }
    .jm-hotspot__label { font-size: 12px; padding: 6px 10px; }

    .jm-modal {
        flex-direction: column;
        min-height: 0;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    .jm-modal__media {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }
    .jm-modal__img,
    .jm-modal__placeholder { height: 200px; }
    .jm-modal__content { padding: 24px 22px; }
    .jm-modal__title { font-size: 21px; }
    .jm-modal__body  { font-size: 14px; }
    .jm-modal__cta   { margin-top: 20px; padding: 12px 20px; }
}

@media (max-width: 480px) {
    .jm-hotspot { width: 40px; height: 40px; }
    .jm-hotspot__icon { width: 24px; height: 24px; }
    .jm-hotspot__label { font-size: 11px; padding: 5px 8px; }
}
