/* ================================================================
   Wapu Shoppable Images – Front-end CSS v2.1
   Blue scheme – Tooltip + Minicard + Modal
   ================================================================ */

.wapu-si-container {
    position: relative; display: inline-block; max-width: 100%; line-height: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wapu-si-image-wrap { position: relative; display: inline-block; max-width: 100%; }
.wapu-si-image { display: block; max-width: 100%; height: auto; }

/* ── Hotspot button ──────────────────────────────────────── */
.wapu-si-hotspot {
    position: absolute; transform: translate(-50%, -50%);
    width: var(--wapu-dot-size, 26px); height: var(--wapu-dot-size, 26px);
    border: none; background: transparent; cursor: pointer; padding: 0; z-index: 5; outline: none;
}
.wapu-si-hotspot-dot {
    display: block; width: 100%; height: 100%;
    background: var(--wapu-dot-color, #2563EB);
    border: 2.5px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.2);
    transition: transform .15s ease;
}
.wapu-si-hotspot--circle .wapu-si-hotspot-dot { border-radius: 50%; }
.wapu-si-hotspot--square .wapu-si-hotspot-dot { border-radius: 3px; }
.wapu-si-hotspot--pin .wapu-si-hotspot-dot { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.wapu-si-hotspot:hover .wapu-si-hotspot-dot, .wapu-si-hotspot:focus .wapu-si-hotspot-dot { transform: scale(1.2); }
.wapu-si-hotspot--pin:hover .wapu-si-hotspot-dot, .wapu-si-hotspot--pin:focus .wapu-si-hotspot-dot { transform: rotate(-45deg) scale(1.2); }

.wapu-si-hotspot-pulse {
    position: absolute; inset: -3px; border-radius: 50%;
    border: 2px solid var(--wapu-dot-color, #2563EB);
    opacity: 0; animation: wapu-pulse 2s ease-out infinite;
}
@keyframes wapu-pulse { 0% { transform: scale(.85); opacity: .5; } 100% { transform: scale(1.6); opacity: 0; } }

/* ══════════════════════════════════════════════════════
 *  MODAL
 * ══════════════════════════════════════════════════════ */
.wapu-si-modal {
    display: none; position: fixed; inset: 0; z-index: 99999;
    align-items: center; justify-content: center;
}
.wapu-si-modal[aria-hidden="false"] { display: flex; }
.wapu-si-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); }
.wapu-si-modal-content {
    position: relative; background: #fff; border-radius: 14px;
    max-width: 380px; width: 90%; padding: 20px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18); z-index: 1;
    animation: wapu-modal-in .2s ease; line-height: 1.5;
}
@keyframes wapu-modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.wapu-si-modal-close {
    position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
    border: none; background: #F1F5F9; border-radius: 50%; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #64748B; transition: background .12s; line-height: 1;
}
.wapu-si-modal-close:hover { background: #E2E8F0; color: #0F172A; }
.wapu-si-modal-body { text-align: center; }
.wapu-si-modal-loader { padding: 32px 0; color: #94A3B8; font-size: 13px; }

/* ══════════════════════════════════════════════════════
 *  TOOLTIP – card style
 * ══════════════════════════════════════════════════════ */
.wapu-si-tooltip {
    display: none; position: absolute; z-index: 100;
    width: 220px; background: #fff; border-radius: 10px; padding: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.15); animation: wapu-tip-in .15s ease;
    line-height: 1.4; font-size: 13px; pointer-events: auto;
    overflow: visible;
}
.wapu-si-tooltip.is-visible { display: block; }
/* Invisible hover bridge for tooltip too */
.wapu-si-tooltip::before {
    content: ''; position: absolute; top: -8px; bottom: -8px;
    left: -16px; right: -16px; z-index: -1;
}
@keyframes wapu-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.wapu-si-tooltip-close {
    position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
    border: none; background: #F1F5F9; border-radius: 50%; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #94A3B8; line-height: 1; transition: background .12s;
}
.wapu-si-tooltip-close:hover { background: #E2E8F0; color: #0F172A; }

.wapu-si-tooltip-body { text-align: left; }
.wapu-si-tooltip-loader { padding: 14px 0; color: #94A3B8; font-size: 12px; text-align: center; }

.wapu-si-tooltip .wapu-si-product-card { text-align: left; }
.wapu-si-tooltip .wapu-si-product-image {
    width: 100%; max-height: 100px; object-fit: contain;
    border-radius: 6px; margin-bottom: 8px; background: #F8FAFC;
}
.wapu-si-tooltip .wapu-si-product-name { font-size: 12.5px; margin-bottom: 2px; }
.wapu-si-tooltip .wapu-si-product-price { font-size: 12px; margin-bottom: 6px; }
.wapu-si-tooltip .wapu-si-product-actions { gap: 4px; margin-top: 6px; }
.wapu-si-tooltip .wapu-si-product-actions a,
.wapu-si-tooltip .wapu-si-product-actions button { padding: 5px 8px; font-size: 11px; border-radius: 6px; }

/* ══════════════════════════════════════════════════════
 *  MINICARD – tiny horizontal card
 * ══════════════════════════════════════════════════════ */
.wapu-si-minicard {
    display: none; position: absolute; z-index: 100;
    background: #fff; border-radius: 8px; padding: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,.14); animation: wapu-tip-in .15s ease;
    line-height: 1.4; font-size: 13px; pointer-events: auto;
    overflow: visible; cursor: pointer; min-width: 180px; max-width: 260px;
}
.wapu-si-minicard.is-visible { display: flex; align-items: stretch; }
/* Invisible hover bridge so mouse can travel from hotspot to minicard */
.wapu-si-minicard::before {
    content: ''; position: absolute; top: -8px; bottom: -8px;
    left: -16px; right: -16px; z-index: -1;
}

.wapu-si-minicard-inner {
    display: flex; align-items: stretch; overflow: hidden;
    border-radius: 8px; background: #fff; width: 100%;
}
.wapu-si-minicard-img {
    width: 56px; min-height: 48px; flex-shrink: 0;
    object-fit: cover; background: #F1F5F9; display: block;
    border-radius: 8px 0 0 8px;
}

.wapu-si-minicard-info {
    padding: 8px 12px; display: flex; flex-direction: column; justify-content: center;
    min-width: 0; flex: 1;
}

.wapu-si-minicard-name {
    font-size: 12.5px; font-weight: 600; color: #0F172A;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin: 0; line-height: 1.3;
}

.wapu-si-minicard-price {
    font-size: 11px; color: #475569; margin-top: 2px; line-height: 1.3;
}
.wapu-si-minicard-price del { color: #94A3B8; }
.wapu-si-minicard-price ins { text-decoration: none; font-weight: 600; color: #0F172A; }

.wapu-si-minicard-loader {
    padding: 14px 16px; color: #94A3B8; font-size: 12px; text-align: center; width: 180px;
}

.wapu-si-minicard:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
}

/* ══════════════════════════════════════════════════════
 *  PRODUCT CARD (shared modal & tooltip)
 * ══════════════════════════════════════════════════════ */
.wapu-si-product-card { text-align: left; }

.wapu-si-product-image {
    width: 100%; max-height: 200px; object-fit: contain;
    border-radius: 8px; margin-bottom: 12px; background: #F8FAFC;
}

.wapu-si-product-name {
    font-size: 15px; font-weight: 600; color: #0F172A; margin: 0 0 4px; line-height: 1.3;
}
.wapu-si-product-price { font-size: 14px; color: #334155; margin-bottom: 12px; }
.wapu-si-product-price del { color: #94A3B8; margin-right: 4px; }
.wapu-si-product-price ins { text-decoration: none; font-weight: 600; color: #0F172A; }

.wapu-si-product-actions { display: flex; gap: 8px; margin-top: 12px; }
.wapu-si-product-actions a,
.wapu-si-product-actions button {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    gap: 4px; padding: 9px 14px; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: all .12s ease; font-family: inherit;
}
.wapu-si-btn-view { background: #F1F5F9; color: #334155; }
.wapu-si-btn-view:hover { background: #E2E8F0; color: #0F172A; }
.wapu-si-btn-cart { background: #2563EB; color: #fff; }
.wapu-si-btn-cart:hover { background: #1D4ED8; }
.wapu-si-btn-cart:disabled { opacity: .6; cursor: not-allowed; }
.wapu-si-btn-cart.is-added { background: #059669; color: #fff; }

.wapu-si-out-of-stock {
    display: block; text-align: center; padding: 8px;
    background: #FEF2F2; color: #DC2626; border-radius: 6px;
    font-size: 12px; font-weight: 500; margin-top: 8px;
}

@media (max-width: 480px) {
    .wapu-si-modal-content { padding: 14px; border-radius: 10px; }
    .wapu-si-product-actions { flex-direction: column; }
    .wapu-si-tooltip { width: 200px; padding: 10px; }
    .wapu-si-minicard { min-width: 160px; }
}
