/* Photobubble collection picker – Pixory-style scroll box */
.pb-tpl {
    --pb-accent: #d6336c;          /* swap for the Photobubble pink */
    --pb-border: #e2e2e2;
    --pb-radius: 10px;
    margin: .75em 0 1.25em;
    max-width: 640px;
}

.pb-tpl__head {
    font-size: .875em;
    font-weight: 700;
    margin-bottom: .5em;
}
.pb-tpl__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pb-tpl__title { font-size: 1.1em; }
.pb-tpl__current { font-weight: 400; color: #555; }
.pb-tpl__current strong { color: #111; }

.pb-tpl__search {
    width: 100%;
    margin: 0 0 .5em !important;
    border-radius: var(--pb-radius) !important;
}

.pb-tpl__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 360px;             /* ~1.5 rows visible, then scroll */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--pb-border);
    border-radius: var(--pb-radius);
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.pb-tpl__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit;
    text-align: center;
    transition: border-color .15s, background-color .15s;
}
.pb-tpl__item[hidden] { display: none; }
.pb-tpl__item:hover { background: #f7f7f7; }
.pb-tpl__item:focus-visible { outline: 2px solid var(--pb-accent); outline-offset: 2px; }
.pb-tpl__item.is-selected { border-color: var(--pb-accent); }

.pb-tpl__img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 6px;
    background: #f2f2f2;
}
.pb-tpl__img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    margin: 0 !important;
}

.pb-tpl__label {
    font-size: .75em;
    line-height: 1.25;
    color: #555;
}
.pb-tpl__item.is-selected .pb-tpl__label { color: #111; font-weight: 700; }

.pb-tpl__empty {
    grid-column: 1 / -1;
    margin: 1em 0;
    text-align: center;
    color: #777;
    font-size: .875em;
}

.pb-tpl.is-loading .pb-tpl__grid { opacity: .6; pointer-events: none; }
.pb-tpl__item.is-loading { border-color: var(--pb-border); }

/* Quick view (desktop): bigger tiles, 3 across */
@media (min-width: 850px) {
    .product-lightbox .pb-tpl__grid,
    .product-quick-view-container .pb-tpl__grid,
    .mfp-content .pb-tpl__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 400px;
    }
}
@media (max-width: 849px) {
    .pb-tpl { max-width: none; }
    .pb-tpl__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: 270px; }
}
@media (max-width: 480px) {
    .pb-tpl__grid { gap: 6px; padding: 6px; max-height: 270px; }
    .pb-tpl__label { font-size: .7em; }
}

/* "What's the difference?" buttons next to attribute headings */
.pb-help-btn {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 0 0 8px;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--pb-border, #e2e2e2);
    border-radius: 999px;
    font-size: .75em;
    font-weight: 400;
    font-style: normal !important;
    line-height: 1.4;
    color: #555 !important;
    background: #fff;
    text-decoration: none !important;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}
.pb-help-btn::before {
    content: "?";
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #555;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.pb-help-btn:hover,
.pb-help-btn:focus-visible {
    border-color: #d6336c;
    color: #d6336c !important;
}
.pb-help-btn:hover::before,
.pb-help-btn:focus-visible::before { background: #d6336c; }

/* Quick view "How it works" text */
.pb-qv-intro { margin-bottom: .5em; }
.pb-qv-intro p { margin-bottom: .4em; }
.pb-qv-steps { margin: 0 0 .5em 1.2em; padding: 0; }
.pb-qv-steps li { margin: 0 0 .35em; padding-left: .2em; }

/* Quick view preview */
.pb-preview {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #f4f4f4;
    animation: pb-fade .2s ease;
}
.pb-preview[hidden] { display: none; }
.pb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pb-preview__tag {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(17, 17, 17, .8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
@keyframes pb-fade { from { opacity: 0; } to { opacity: 1; } }

.pb-tpl__preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin: 0 0 .5em;
    padding: 8px 10px;
    border-radius: var(--pb-radius);
    background: #fdf0f4;
    font-size: .85em;
}
.pb-tpl__preview[hidden] { display: none; }
.pb-tpl__preview-actions { display: inline-flex; align-items: center; gap: 10px; }
.pb-tpl__go {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pb-accent);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}
.pb-tpl__back {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #555 !important;
    font-size: 1em !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-decoration: underline !important;
    line-height: 1.4 !important;
    cursor: pointer;
}
.pb-tpl__item.is-previewing { border-color: var(--pb-accent); border-style: dashed; }

/* Quick view, covers only: hide options, quantity, Customize, meta */
.pb-qv-covers-only form.cart,
.pb-qv-covers-only form.variations_form,
.pb-qv-covers-only .product_meta,
.pb-qv-covers-only .pb-deals-section {
    display: none !important;
}
.pb-tpl__cta {
    display: block;
    margin: 12px 0 0;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--pb-accent);
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    transition: filter .15s;
}
.pb-tpl__cta:hover { filter: brightness(.92); }

/* "Check the differences… here" lines: hidden from the start; their links become the
   "What's the difference?" buttons (no flash on page load). */
.pb-diff-line { display: none !important; }
