/* ══════════════════════════════════════════════════════════════
   BHGRE Template Overlay — Frontend v3
   Hover zoom + Lightbox popup
   ══════════════════════════════════════════════════════════════ */

/* ── Tabs ────────────────────────────────────────────────────── */
.bhgreo-wrap { font-family: Arial, Helvetica, sans-serif; }
.bhgreo-tabs-nav {
    display: flex; gap: 0; border-bottom: 2px solid #e5e7eb;
    margin-bottom: 28px; flex-wrap: wrap;
}
.bhgreo-tab-btn {
    background: none; border: none; border-bottom: 3px solid transparent;
    padding: 12px 26px; font-size: 15px; font-weight: 600; cursor: pointer;
    color: #6b7280; margin-bottom: -2px;
    transition: color .2s, border-color .2s;
}
.bhgreo-tab-btn:hover  { color: #00a550; }
.bhgreo-tab-btn.active { color: #111827; border-bottom-color: #00a550; }
.bhgreo-tab-panel  { display: none; }
.bhgreo-tab-panel.active { display: block; }

/* ── Grid ────────────────────────────────────────────────────── */
.bhgreo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
@media (max-width: 640px) { .bhgreo-grid { grid-template-columns: 1fr; } }

/* ── Card — hover zoom ───────────────────────────────────────── */
.bhgreo-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 3px 14px rgba(0,0,0,.13);
    transition: box-shadow .28s ease, transform .28s ease;
    outline: none;
    display: block;
    line-height: 0;
}
.bhgreo-card:hover,
.bhgreo-card:focus-visible {
    box-shadow: 0 10px 36px rgba(0,0,0,.28);
    transform: translateY(-5px) scale(1.012);
}
.bhgreo-card:focus-visible {
    outline: 3px solid #00a550;
    outline-offset: 3px;
}

/* Inner wrap — clips the zooming image */
.bhgreo-card-inner {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

/* Image zoom on hover */
.bhgreo-template-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .45s cubic-bezier(.25,.46,.45,.94);
    transform-origin: center center;
}
.bhgreo-card:hover .bhgreo-template-img,
.bhgreo-card:focus-visible .bhgreo-template-img {
    transform: scale(1.07);
}

/* ── Zoom overlay (green tint + icon on hover) ───────────────── */
.bhgreo-card-zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 110, 50, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
    transition: background .3s ease;
    pointer-events: none;
}
.bhgreo-card:hover .bhgreo-card-zoom-overlay,
.bhgreo-card:focus-visible .bhgreo-card-zoom-overlay {
    background: rgba(0, 110, 50, 0.38);
}

.bhgreo-card-zoom-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,.92);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #00a550;
    transform: scale(0) rotate(-15deg);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
    opacity: 0;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.bhgreo-card-zoom-text {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
    transform: translateY(8px);
    opacity: 0;
    transition: transform .28s ease .05s, opacity .25s ease .05s;
}
.bhgreo-card:hover .bhgreo-card-zoom-icon,
.bhgreo-card:focus-visible .bhgreo-card-zoom-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}
.bhgreo-card:hover .bhgreo-card-zoom-text,
.bhgreo-card:focus-visible .bhgreo-card-zoom-text {
    transform: translateY(0);
    opacity: 1;
}

.bhgreo-empty {
    color: #9ca3af; font-style: italic; padding: 20px;
    font-size: 13px; line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════════ */
.bhgreo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
}
.bhgreo-lightbox.bhgreo-lb-visible {
    visibility: visible;
    pointer-events: all;
}

/* Backdrop */
.bhgreo-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 15, 0);
    transition: background .35s ease;
    cursor: zoom-out;
}
.bhgreo-lightbox.bhgreo-lb-open .bhgreo-lb-backdrop {
    background: rgba(5, 10, 15, .88);
}

/* Stage — holds the card */
.bhgreo-lb-stage {
    position: relative;
    z-index: 2;
    width: 90vw;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(.88);
    opacity: 0;
    transition: transform .35s cubic-bezier(.34,1.2,.64,1), opacity .3s ease;
}
.bhgreo-lightbox.bhgreo-lb-open .bhgreo-lb-stage {
    transform: scale(1);
    opacity: 1;
}

/* Content — the cloned card */
.bhgreo-lb-content {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
    line-height: 0;
    opacity: 0;
    transform: scale(0.93);
    will-change: transform, opacity;
    background: #fff;
}

/* Card inside lightbox — remove hover effects */
.bhgreo-lb-content .bhgreo-lb-card {
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    cursor: default;
    pointer-events: none;
}
.bhgreo-lb-content .bhgreo-template-img { transform: none !important; }
.bhgreo-lb-content .bhgreo-card-zoom-overlay { display: none; }

/* Close button */
.bhgreo-lb-close {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 10;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: 26px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s;
    opacity: 0;
    transform: scale(.7) rotate(-90deg);
}
.bhgreo-lightbox.bhgreo-lb-open .bhgreo-lb-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: background .2s, transform .35s cubic-bezier(.34,1.4,.64,1) .15s, opacity .25s ease .15s;
}
.bhgreo-lb-close:hover { background: rgba(220, 50, 50, .7); transform: scale(1.1) rotate(90deg) !important; }

/* Prev / Next arrows */
.bhgreo-lb-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    z-index: 10;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.25);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s, opacity .2s;
    opacity: 0;
}
.bhgreo-lightbox.bhgreo-lb-open .bhgreo-lb-arrow {
    opacity: 1;
    transition: background .2s, opacity .3s ease .1s, transform .3s ease;
}
.bhgreo-lb-prev { left: 16px; }
.bhgreo-lb-next { right: 16px; }
.bhgreo-lb-prev:hover:not(:disabled) { background: rgba(0,165,80,.7); transform: translateY(-50%) scale(1.1); }
.bhgreo-lb-next:hover:not(:disabled) { background: rgba(0,165,80,.7); transform: translateY(-50%) scale(1.1); }
.bhgreo-lb-arrow:disabled { opacity: .25 !important; cursor: default; }

/* Counter */
.bhgreo-lb-counter {
    position: absolute;
    bottom: 18px; left: 50%; transform: translateX(-50%);
    z-index: 10;
    color: rgba(255,255,255,.75);
    font-size: 13px; font-weight: 600; letter-spacing: 1px;
    font-family: Arial, sans-serif;
    opacity: 0;
    transition: opacity .3s ease .2s;
}
.bhgreo-lightbox.bhgreo-lb-open .bhgreo-lb-counter { opacity: 1; }

/* Spinner */
.bhgreo-lb-spinner {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.bhgreo-lb-spinner div {
    width: 10px; height: 10px; margin: 4px;
    border-radius: 50%; background: #fff;
    animation: bhgreo-bounce 1.2s infinite ease-in-out both;
}
.bhgreo-lb-spinner div:nth-child(1) { animation-delay: -.32s; }
.bhgreo-lb-spinner div:nth-child(2) { animation-delay: -.16s; }
.bhgreo-lb-spinner div:nth-child(3) { animation-delay: 0s; }
.bhgreo-lb-spinner div:nth-child(4) { animation-delay: .16s; }
@keyframes bhgreo-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: .3; }
    40%            { transform: scale(1); opacity: 1; }
}

/* Mobile */
@media (max-width: 600px) {
    .bhgreo-lb-stage { width: 96vw; max-height: 85vh; }
    .bhgreo-lb-prev  { left: 6px; }
    .bhgreo-lb-next  { right: 6px; }
    .bhgreo-lb-arrow { width: 40px; height: 40px; }
}
