/* ============================================
   MPP Jewellers - Product Info Button & Popover
   The (i) button only renders when the admin has
   entered info text for that product.
   ============================================ */

/* --- The (i) button on the product card --- */
.product-image { position: relative; }

.pinfo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(166, 138, 62, 0.45);
    background: rgba(255, 255, 255, 0.92);
    color: #a68a3e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    padding: 0;
}
.pinfo-btn:hover {
    background: #a68a3e;
    color: #fff;
    transform: scale(1.1);
}
.pinfo-btn svg { display: block; }

/* --- Backdrop (mobile bottom sheet) --- */
.pinfo-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 9, 7, 0.45);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
@media (min-width: 641px) {
    .pinfo-backdrop { display: none; } /* desktop: no dark backdrop, just the popover */
}
.pinfo-backdrop.pinfo-open {
    opacity: 1;
    visibility: visible;
}

/* --- Popover card --- */
.pinfo-pop {
    position: fixed;
    z-index: 99991;
    width: max-content;
    max-width: 320px;
    background: #fffdf8;
    border: 1px solid rgba(166, 138, 62, 0.35);
    border-radius: 14px;
    box-shadow: 0 14px 44px rgba(20, 15, 5, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.pinfo-pop.pinfo-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.pinfo-pop-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(166, 138, 62, 0.18);
    color: #a68a3e;
}
.pinfo-pop-title {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 0.6px;
    color: #4a3b18;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pinfo-pop-close {
    background: none;
    border: none;
    color: #9a8a60;
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.pinfo-pop-close:hover {
    background: rgba(166, 138, 62, 0.12);
    color: #5c4a1e;
}

.pinfo-pop-body {
    padding: 12px 16px 15px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #4b4335;
    white-space: pre-line; /* admin newlines become line breaks */
    max-height: 46vh;
    overflow-y: auto;
}

/* --- Mobile: bottom sheet --- */
@media (max-width: 640px) {
    .pinfo-pop.pinfo-sheet {
        left: 0 !important;
        right: 0;
        bottom: 0;
        top: auto !important;
        max-width: none !important;
        width: 100%;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1), visibility 0.25s;
    }
    .pinfo-pop.pinfo-sheet.pinfo-open {
        transform: translateY(0);
    }
    .pinfo-pop.pinfo-sheet::before {
        content: '';
        display: block;
        width: 42px;
        height: 4px;
        border-radius: 2px;
        background: rgba(166, 138, 62, 0.35);
        margin: 10px auto 0;
    }
    .pinfo-pop-body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
