/* Product Gallery – Frontend CSS v4 */

/* ── Gallery Grid ─────────────────────────────────────────────── */
.pg-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 768px) { .pg-gallery { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .pg-gallery { grid-template-columns: 1fr; } }

/* ── Gallery Item (no hover animation) ───────────────────────── */
.pg-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    background: #fff;
}

.pg-item-img-wrap {
    position: relative;
    aspect-ratio: var(--pg-ratio, 300/530);  /* default: 300×530 portrait */
    overflow: hidden;
}
.pg-item-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.pg-item-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.32);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .18s;
    font-size: 26px; color: #fff;
}
.pg-item:hover .pg-item-overlay { opacity: 1; }

.pg-item-title {
    padding: 9px 12px 10px;
    font-weight: 600; font-size: 13px; color: #333;
}

.pg-no-products { color: #aaa; font-style: italic; padding: 20px 0; }

/* ── Popup Overlay ────────────────────────────────────────────── */
#pg-popup-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.78);
    z-index: 99999;
    padding: 20px; box-sizing: border-box;
    align-items: center; justify-content: center;
}
#pg-popup-overlay[style*="display: block"],
#pg-popup-overlay[style*="display:block"] { display: flex !important; }

/* ── Popup Box ────────────────────────────────────────────────── */
#pg-popup {
    background: #fff;
    border-radius: 14px;
    max-width: 820px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    display: flex; position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.45);
    animation: pg-in .22s ease;
}
@keyframes pg-in {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ── Close ────────────────────────────────────────────────────── */
#pg-popup-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 50%; background: #f0f0f0;
    border: none; font-size: 20px; color: #555;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    z-index: 20; transition: background .15s;
}
#pg-popup-close:hover { background: #e0e0e0; color: #111; }

/* ── Left: image + prev/next arrows ──────────────────────────── */
#pg-popup-left {
    width: 46%; padding: 22px;
    flex-shrink: 0; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    background: #f7f7f7; border-radius: 14px 0 0 14px;
    position: relative;
}
#pg-popup-img {
    width: 100%; max-height: 460px;
    object-fit: contain; display: block;
    border-radius: 8px;
}

/* ── Right: info ──────────────────────────────────────────────── */
#pg-popup-right {
    width: 54%; padding: 28px 24px 24px;
    border-left: 1px solid #eee; box-sizing: border-box;
}
#pg-popup-name {
    font-size: 20px; font-weight: 700;
    margin: 0 0 5px; color: #111; padding-right: 28px;
}
#pg-popup-cat {
    font-size: 11px; color: #bbb;
    text-transform: uppercase; letter-spacing: .5px; margin: 0 0 18px;
}

/* ── Product Information Card ─────────────────────────────────── */
.pg-info-card {
    border-radius: 10px; overflow: hidden;
    border: 1px solid #ebebeb;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.pg-info-header {
    background: linear-gradient(135deg, #8a7d00 0%, #1a2f40 100%);
    padding: 13px 18px;
    color: #fff; font-weight: 700; font-size: 14px;
}
.pg-info-body { background: #fff; }
.pg-info-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 12px 18px; border-bottom: 1px solid #f2f2f2;
}
.pg-info-row:last-child { border-bottom: none; }
.pg-info-label {
    font-weight: 600; font-size: 13px; color: #222;
    flex-shrink: 0; padding-right: 12px;
}
.pg-info-values { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.pg-info-values span { font-size: 13px; color: #888; line-height: 1.5; }
.pg-no-desc { color: #aaa; font-style: italic; font-size: 13px; margin-top: 10px; }

/* ── Body lock ────────────────────────────────────────────────── */
body.pg-no-scroll { overflow: hidden; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #pg-popup { flex-direction: column; max-height: 95vh; }
    #pg-popup-left { width: 100%; border-radius: 14px 14px 0 0; padding: 16px; }
    #pg-popup-right { width: 100%; border-left: none; border-top: 1px solid #eee; box-sizing: border-box; }
    #pg-popup-img { max-height: 260px; }
}
