/* =====================================================
   Hotspot Image Widget — hotspot.css
   ===================================================== */

/* Contenedor principal */
.hiw-wrap {
    position: relative;
    display: block;
    line-height: 0;
    overflow: visible;
}

.hiw-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}

/* ---- Dot ---- */
.hiw-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

/* Anillo pulsante */
.hiw-dot::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: hiw-pulse 2.2s ease-out infinite;
    pointer-events: none;
}

/* Círculo interior */
.hiw-dot-inner {
    display: block;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
    transition: transform 0.22s cubic-bezier(.34,1.56,.64,1),
                background 0.2s ease;
    position: relative;
    z-index: 2;
}

.hiw-dot:hover .hiw-dot-inner,
.hiw-dot:focus .hiw-dot-inner {
    transform: scale(1.35);
    background: #111;
    outline: none;
}

/* ---- Animación pulso ---- */
@keyframes hiw-pulse {
    0%   { transform: scale(0.75); opacity: 0.9; }
    70%  { transform: scale(2.2);  opacity: 0;   }
    100% { transform: scale(0.75); opacity: 0;   }
}

/* =====================================================
   TOOLTIP
   ===================================================== */
.hiw-tooltip {
    position: absolute;
    width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.34,1.2,.64,1);
    z-index: 20;
    overflow: hidden;
    line-height: 1.4;
}

/* Visible */
.hiw-dot:hover .hiw-tooltip,
.hiw-dot:focus .hiw-tooltip,
.hiw-dot.hiw-active .hiw-tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Direcciones ---- */

/* TOP (por defecto) */
.hiw-dot-dir-top .hiw-tooltip {
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
}
.hiw-dot-dir-top:hover .hiw-tooltip,
.hiw-dot-dir-top:focus .hiw-tooltip,
.hiw-dot-dir-top.hiw-active .hiw-tooltip {
    transform: translateX(-50%) translateY(0);
}

/* BOTTOM */
.hiw-dot-dir-bottom .hiw-tooltip {
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
}
.hiw-dot-dir-bottom:hover .hiw-tooltip,
.hiw-dot-dir-bottom:focus .hiw-tooltip,
.hiw-dot-dir-bottom.hiw-active .hiw-tooltip {
    transform: translateX(-50%) translateY(0);
}

/* RIGHT */
.hiw-dot-dir-right .hiw-tooltip {
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
}
.hiw-dot-dir-right:hover .hiw-tooltip,
.hiw-dot-dir-right:focus .hiw-tooltip,
.hiw-dot-dir-right.hiw-active .hiw-tooltip {
    transform: translateY(-50%) translateX(0);
}

/* LEFT */
.hiw-dot-dir-left .hiw-tooltip {
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
}
.hiw-dot-dir-left:hover .hiw-tooltip,
.hiw-dot-dir-left:focus .hiw-tooltip,
.hiw-dot-dir-left.hiw-active .hiw-tooltip {
    transform: translateY(-50%) translateX(0);
}

/* ---- Flecha del tooltip ---- */
.hiw-tooltip::after {
    content: '';
    position: absolute;
    border: 7px solid transparent;
}

.hiw-dot-dir-top .hiw-tooltip::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #fff;
}
.hiw-dot-dir-bottom .hiw-tooltip::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #fff;
}
.hiw-dot-dir-right .hiw-tooltip::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #fff;
}
.hiw-dot-dir-left .hiw-tooltip::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #fff;
}

/* ---- Imagen del producto ---- */
.hiw-tooltip-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.hiw-tooltip-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.hiw-dot:hover .hiw-tooltip-img {
    transform: scale(1.04);
}

/* ---- Cuerpo del tooltip ---- */
.hiw-tooltip-body {
    padding: 12px 14px 14px;
}

.hiw-tooltip-name {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.hiw-tooltip-price {
    margin: 0 0 10px;
    font-size: 12px;
    color: #666;
    line-height: 1;
}

/* ---- Botón ---- */
.hiw-tooltip-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: #111;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none !important;
    border-radius: 4px;
    transition: background 0.18s ease, transform 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.hiw-tooltip-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

/* =====================================================
   RESPONSIVE — Móvil: tooltip siempre abajo
   ===================================================== */
@media (max-width: 767px) {
    .hiw-dot-inner {
        width: 22px;
        height: 22px;
    }

    /* En móvil el tooltip aparece siempre abajo */
    .hiw-tooltip {
        bottom: auto !important;
        right: auto !important;
        left: 50% !important;
        top: calc(100% + 12px) !important;
        transform: translateX(-50%) translateY(-6px) !important;
        width: 170px;
    }

    .hiw-dot:hover .hiw-tooltip,
    .hiw-dot:focus .hiw-tooltip,
    .hiw-dot.hiw-active .hiw-tooltip {
        transform: translateX(-50%) translateY(0) !important;
    }

    .hiw-tooltip::after {
        top: auto;
        bottom: 100% !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        border-color: transparent !important;
        border-bottom-color: #fff !important;
    }
}
