/* ================================================================
   VITABRI – HOTSPOT IMAGE
   Plik: child-theme/assets/css/hotspot.css
================================================================ */

/* --- Kontener --- */
.vitabri-hotspot-wrap {
    width: 100%;
}

.vitabri-hotspot-inner {
    position: relative;
    display: inline-block; /* kurczy się do rozmiaru obrazu */
    width: 100%;
    overflow: visible;     /* popupy mogą wystawać */
}

.vitabri-hotspot-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: inherit;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Kropka (dot) --- */
.vitabri-hotspot-dot {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

/* pulsująca obwódka */
.vitabri-hotspot-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(250, 79, 0, 0.25);
    animation: vitabri-pulse 2s ease-out infinite;
}

@keyframes vitabri-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    70%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* środkowy okrąg */
.vitabri-hotspot-icon {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #fa4f00;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    transition: background .2s, transform .2s;
}

.vitabri-hotspot-dot:hover .vitabri-hotspot-icon,
.vitabri-hotspot-dot:focus .vitabri-hotspot-icon {
    background: #fa4f00;
    transform: scale(1.15);
}

/* --- Popup karta --- */
.vitabri-hotspot-card {
    position: absolute;
    width: 380px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    pointer-events: none;
    opacity: 0;
    transform: scale(.92);
    transition: opacity .22s cubic-bezier(.4,0,.2,1),
                transform .22s cubic-bezier(.4,0,.2,1);
    z-index: 100;
}

.vitabri-hotspot-dot:hover .vitabri-hotspot-card,
.vitabri-hotspot-dot:focus .vitabri-hotspot-card,
.vitabri-hotspot-dot.is-open .vitabri-hotspot-card {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Kierunki popupu */
.vitabri-hotspot-card--right {
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(.92);
}
.vitabri-hotspot-dot:hover .vitabri-hotspot-card--right,
.vitabri-hotspot-dot:focus .vitabri-hotspot-card--right,
.vitabri-hotspot-dot.is-open .vitabri-hotspot-card--right {
    transform: translateY(-50%) scale(1);
}

.vitabri-hotspot-card--left {
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(.92);
}
.vitabri-hotspot-dot:hover .vitabri-hotspot-card--left,
.vitabri-hotspot-dot:focus .vitabri-hotspot-card--left,
.vitabri-hotspot-dot.is-open .vitabri-hotspot-card--left {
    transform: translateY(-50%) scale(1);
}

.vitabri-hotspot-card--top {
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) scale(.92);
}
.vitabri-hotspot-dot:hover .vitabri-hotspot-card--top,
.vitabri-hotspot-dot:focus .vitabri-hotspot-card--top,
.vitabri-hotspot-dot.is-open .vitabri-hotspot-card--top {
    transform: translateX(-50%) scale(1);
}

.vitabri-hotspot-card--bottom {
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) scale(.92);
}
.vitabri-hotspot-dot:hover .vitabri-hotspot-card--bottom,
.vitabri-hotspot-dot:focus .vitabri-hotspot-card--bottom,
.vitabri-hotspot-dot.is-open .vitabri-hotspot-card--bottom {
    transform: translateX(-50%) scale(1);
}

/* --- Wnętrze karty --- */
.vitabri-hotspot-card-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 14px;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    transition: background .15s;
}

.vitabri-hotspot-card-inner:hover {
    background: #fafafa;
}

/* miniaturka */
.vitabri-hotspot-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #f4f4f4;
}

.vitabri-hotspot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* teksty */
.vitabri-hotspot-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vitabri-hotspot-cat {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vitabri-hotspot-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vitabri-hotspot-price {
    font-size: 13px;
    font-weight: 700;
    color: #fa4f00;
    margin-top: 4px;
}

.vitabri-hotspot-price .woocommerce-Price-amount {
    color: #fa4f00;
}

/* strzałka */
.vitabri-hotspot-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: #ccc;
    transition: color .15s, transform .15s;
}

.vitabri-hotspot-card-inner:hover .vitabri-hotspot-arrow {
    color: #fa4f00;
    transform: translateX(3px);
}

/* ================================================================
   MOBILE – touch: kliknięcie zamiast hover
================================================================ */
@media (max-width: 768px) {
    .vitabri-hotspot-card {
        width: 240px;
    }

    /* na małych ekranach zawsze kierunek: dół */
    .vitabri-hotspot-card--right,
    .vitabri-hotspot-card--left,
    .vitabri-hotspot-card--top {
        left: 50%;
        right: auto;
        bottom: auto;
        top: calc(100% + 10px);
        transform: translateX(-50%) scale(.92);
    }

    .vitabri-hotspot-dot:hover .vitabri-hotspot-card--right,
    .vitabri-hotspot-dot:hover .vitabri-hotspot-card--left,
    .vitabri-hotspot-dot:hover .vitabri-hotspot-card--top,
    .vitabri-hotspot-dot.is-open .vitabri-hotspot-card--right,
    .vitabri-hotspot-dot.is-open .vitabri-hotspot-card--left,
    .vitabri-hotspot-dot.is-open .vitabri-hotspot-card--top {
        transform: translateX(-50%) scale(1);
    }
}
