/* Shared product detail gallery: independent of cart, list and delivery controls. */
#pd-content .pd-gallery { width:100%; min-width:0; max-width:100%; }
#pd-content .pd-gallery .pd-photo { touch-action:pan-y; cursor:zoom-in; }
#pd-content .pd-gallery .pd-photo img { object-fit:contain; }
#pd-content .pd-photo[data-gallery-bound="true"]:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
#pd-content .pd-gallery-controls { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:8px; margin-top:10px; }
#pd-content .pd-gallery-controls button { font:inherit; min-width:44px; min-height:44px; border:1px solid var(--line,#ddd); border-radius:8px; background:var(--surface,#fff); color:var(--ink,#222); cursor:pointer; }
#pd-content .pd-gallery-controls button:focus-visible, #pd-content .pd-gallery-thumbs button:focus-visible { outline:2px solid currentColor; outline-offset:-2px; }
#pd-content .pd-gallery-counter { text-align:center; font-size:13px; }
#pd-content .pd-gallery-thumbs { display:flex; gap:8px; overflow-x:auto; padding:4px 2px 6px; margin-top:8px; max-width:100%; }
#pd-content .pd-gallery-thumbs button { flex:0 0 64px; height:64px; padding:2px; overflow:hidden; border:2px solid transparent; border-radius:7px; background:var(--surface,#fff); cursor:pointer; }
#pd-content .pd-gallery-thumbs button[aria-pressed="true"] { border-color:var(--accent,#387347); }
#pd-content .pd-gallery-thumbs img { display:block; width:100%; height:100%; object-fit:contain; border-radius:4px; }
html[data-coop-theme="dark"] #pd-content :is(.pd-gallery-controls button,.pd-gallery-thumbs button) { background:var(--theme-surface,#242424); color:var(--theme-text,#eee); }

/* v7.8a.2: catalog-only photo navigation, separate from detail and cart. */
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow {
    position:absolute; top:32%; z-index:5; transform:translateY(-50%);
    display:grid; place-items:center; box-sizing:border-box;
    width:44px; height:44px; min-width:0; min-height:0;
    padding:0; margin:0; border:0; border-radius:50%;
    background:transparent; color:#26302a; cursor:pointer;
    box-shadow:none; touch-action:manipulation; -webkit-tap-highlight-color:transparent;
}
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow::before {
    content:''; position:absolute; inset:6px; border-radius:50%;
    background:rgba(255,255,255,.86); border:1px solid rgba(0,0,0,.09);
    box-shadow:0 1px 5px rgba(0,0,0,.15); pointer-events:none;
}
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow svg {
    width:19px; height:19px; position:relative; pointer-events:none;
}
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-prev { left:3px; }
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-next { right:3px; }
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow:hover::before,
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow:focus-visible::before { background:#fff; }
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow:focus-visible {
    outline:2px solid #347649; outline-offset:-4px;
}
/* The old interface keeps text and ordering controls on top of the photo. */
.product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-count {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap; pointer-events:none;
}
body#coop-modern .modern-product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow { top:50%; }
body#coop-modern .modern-product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-count {
    width:auto; height:auto; bottom:10px; left:50%; transform:translateX(-50%);
    clip-path:none; margin:0; padding:3px 8px; border-radius:20px;
    z-index:4; background:rgba(0,0,0,.52); color:white; font-size:11px; line-height:1.2;
}
.product-card--mini .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow {
    width:36px; height:36px;
}
.product-card--mini .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow::before { inset:5px; }
@media (max-width:540px) {
    .product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow::before { inset:7px; }
    .product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-arrow svg { width:17px; height:17px; }
    body#coop-modern .modern-product-card .product-image[data-catalog-gallery="true"] > .catalog-gallery-count { bottom:7px; font-size:10px; }
}
