/* ==========================================================================
   Hira Product Gallery — navy / blue theme
   Mobile-first, touch-swipe, variation image swap, full Elementor controls.
   ========================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
.hpg-gallery {
    --hpg-accent:       #2f6fed;
    --hpg-accent-mid:   #1e5bc6;
    --hpg-accent-pale:  #eef4fb;
    --hpg-border:       #e6ebf1;
    --hpg-bg:           #eef3f6;
    --hpg-white:        #ffffff;
    --hpg-arrow-bg:     #ffffff;
    --hpg-arrow-clr:    #374151;
    --hpg-arrow-hover-bg:  #2f6fed;
    --hpg-arrow-hover-clr: #ffffff;
    --hpg-radius:       14px;
    --hpg-t-radius:     8px;
    --hpg-thumb-size:   74px;
    --hpg-gap:          8px;
    --hpg-badge-bg:     #14304f;
    --hpg-badge-color:  #ffffff;

    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    user-select: none;
}

/* ── Main image area ────────────────────────────────────────────────────── */
.hpg-main-wrap {
    position: relative;
    width: 100%;
    height: 480px;
    background: var(--hpg-bg);
    border: 1.5px solid var(--hpg-border);
    border-radius: var(--hpg-radius);
    overflow: hidden;
    outline: none;
}

.hpg-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.hpg-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
}

.hpg-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.hpg-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: var(--hpg-radius);
}

/* ── Zoom button ────────────────────────────────────────────────────────── */
.hpg-zoom-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.88);
    border-radius: 50%;
    color: #374151;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: background .15s, color .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

.hpg-zoom-btn:hover {
    background: var(--hpg-accent);
    color: #fff;
}

/* ── Badge (e.g. "New", "Sale") ──────────────────────────────────────────── */
.hpg-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--hpg-badge-color);
    background: var(--hpg-badge-bg);
    border-radius: 20px;
    pointer-events: none;
}

/* ── Arrows ─────────────────────────────────────────────────────────────── */
.hpg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--hpg-arrow-bg);
    color: var(--hpg-arrow-clr);
    border: 1.5px solid var(--hpg-border);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.hpg-prev { left: 12px; }
.hpg-next { right: 12px; }

.hpg-arrow:hover {
    background: var(--hpg-arrow-hover-bg);
    color: var(--hpg-arrow-hover-clr);
    border-color: var(--hpg-arrow-hover-bg);
    box-shadow: 0 4px 14px rgba(47,111,237,.25);
}

.hpg-arrow:focus-visible {
    outline: 2px solid var(--hpg-accent);
    outline-offset: 2px;
}

/* ── Dots (mobile indicator) ─────────────────────────────────────────────── */
.hpg-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 6px;
    z-index: 10;
}

.hpg-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(47,111,237,.25);
    transition: background .2s, transform .2s;
    cursor: pointer;
}

.hpg-dot.is-active {
    background: var(--hpg-accent);
    transform: scale(1.35);
}

/* ── Slide counter pill ─────────────────────────────────────────────────── */
.hpg-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    z-index: 10;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(15,23,42,.45);
    padding: 3px 9px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    line-height: 1.6;
}

/* ── Thumbnails ─────────────────────────────────────────────────────────── */
.hpg-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--hpg-gap);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--hpg-accent) transparent;
}

.hpg-thumbs::-webkit-scrollbar { height: 4px; }
.hpg-thumbs::-webkit-scrollbar-thumb { background: var(--hpg-accent); border-radius: 4px; }

.hpg-thumb {
    flex-shrink: 0;
    width: var(--hpg-thumb-size);
    height: var(--hpg-thumb-size);
    padding: 0;
    background: var(--hpg-bg);
    border: 2px solid var(--hpg-border);
    border-radius: var(--hpg-t-radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

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

.hpg-thumb:hover {
    border-color: var(--hpg-accent);
}

.hpg-thumb.is-active {
    border-color: var(--hpg-accent);
    box-shadow: 0 0 0 3px rgba(47,111,237,.18);
}

.hpg-thumb:focus-visible {
    outline: 2px solid var(--hpg-accent);
    outline-offset: 2px;
}

/* ── Editor placeholder ─────────────────────────────────────────────────── */
.hpg-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 280px;
    border: 2px dashed #bcd4f2;
    border-radius: 14px;
    padding: 32px;
    color: #7ba7de;
    background: #eef4fb;
    font-size: .875rem;
    text-align: center;
}

.hpg-placeholder p { margin: 0; color: #14304f; font-weight: 500; }

/* ── Vertical thumbnail layout ──────────────────────────────────────────── */
.hpg-gallery.hpg-layout-vertical {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.hpg-gallery.hpg-layout-vertical .hpg-main-wrap {
    flex: 1;
    min-width: 0;
}

.hpg-gallery.hpg-layout-vertical .hpg-thumbs {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 480px;
    padding-bottom: 0;
    padding-right: 4px;
    order: -1;
    scrollbar-width: thin;
    scrollbar-color: var(--hpg-accent) transparent;
}

/* ── Responsive — Tablet ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hpg-gallery.hpg-layout-vertical {
        flex-direction: column;
    }

    .hpg-gallery.hpg-layout-vertical .hpg-thumbs {
        flex-direction: row;
        max-height: none;
        overflow-y: hidden;
        overflow-x: auto;
        order: 0;
    }
}

/* ── Responsive — Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hpg-main-wrap {
        height: 320px;
    }

    .hpg-dots {
        display: flex;
    }

    .hpg-counter {
        display: none;
    }

    .hpg-prev { left: 8px; }
    .hpg-next { right: 8px; }

    .hpg-arrow {
        width: 32px;
        height: 32px;
    }

    .hpg-thumbs {
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hpg-slide,
    .hpg-arrow,
    .hpg-thumb,
    .hpg-zoom-btn { transition: none; }
}
