/* ANB Lab — precise follow-up corrections after mobile/gallery refresh.
   Scoped to catalogue/product/cart/checkout. Loaded after the previous CSS. */

/* Desktop product gallery: earlier high-specificity .thumbnails grid defined
   eight tiny columns. The current Twig instead has TWO div children. */
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .thumbnails.anb-gallery-shell {
  display:grid!important;grid-template-columns:minmax(0,1fr) 88px!important;
  grid-auto-rows:auto;gap:12px!important;width:100%!important;
  min-width:0!important;max-width:100%!important;margin:0!important;
  padding:0!important;align-items:start!important;overflow:visible!important;
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-shell>.anb-gallery-main {
  display:block!important;min-width:0!important;width:100%!important;
  max-width:100%!important;grid-column:1!important;align-self:start;
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-shell>.anb-gallery-main>a.thumbnail {
  display:flex!important;justify-content:center!important;align-items:center!important;
  box-sizing:border-box!important;width:100%!important;min-width:0!important;
  max-width:none!important;height:auto!important;aspect-ratio:1/1!important;
  padding:10px!important;margin:0!important;border:1px solid #dbe7f4!important;
  border-radius:18px!important;overflow:hidden!important;background:#fff!important;
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-main>a.thumbnail>img {
  display:block!important;width:100%!important;height:100%!important;
  max-width:100%!important;max-height:100%!important;min-width:0!important;
  object-fit:contain!important;border-radius:13px!important;
  clip-path:inset(0 round 13px);
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-shell>.anb-gallery-rail {
  display:flex!important;grid-column:2!important;flex-direction:column!important;
  min-width:0!important;max-height:min(580px,45vw)!important;
  width:100%!important;overflow-x:hidden!important;overflow-y:auto!important;
  gap:9px!important;padding:1px 2px 2px 0!important;
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-rail>a.thumbnail {
  display:flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 auto!important;box-sizing:border-box!important;
  width:100%!important;height:auto!important;aspect-ratio:1/1!important;
  padding:4px!important;margin:0!important;border:1px solid #dbe7f5!important;
  border-radius:12px!important;overflow:hidden!important;background:white!important;
}
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-rail>a.thumbnail>img {
  display:block!important;max-width:100%!important;max-height:100%!important;
  width:100%!important;height:100%!important;object-fit:contain!important;
  border-radius:8px!important;clip-path:inset(0 round 8px);
}
/* Without extra photos, let the main photo fill its entire parent. */
body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-shell:not(:has(.anb-gallery-rail)) {
  grid-template-columns:minmax(0,1fr)!important;
}

/* Subcategory images fill their soft-blue media panel, rather than remaining
   at their original 150px intrinsic size on desktop. */
body.anblab-theme #product-category.anb-category-page .anb-subcategory-media {
  display:flex!important;align-items:center!important;justify-content:center!important;
  min-width:0!important;overflow:hidden!important;
}
body.anblab-theme #product-category.anb-category-page .anb-subcategory-media>img {
  display:block!important;flex:0 1 auto!important;
  width:84%!important;height:84%!important;max-width:230px!important;
  max-height:230px!important;aspect-ratio:1/1!important;
  object-fit:contain!important;padding:0!important;border-radius:14px!important;
}
/* Product images have actual clipped/rounded corners, including on iPhone. */
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb>.image,
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a {
  box-sizing:border-box;overflow:hidden!important;border-radius:14px!important;
}
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a>img,
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image img.img-responsive {
  border-radius:13px!important;clip-path:inset(0 round 13px)!important;
  overflow:hidden!important;object-fit:contain!important;
}

/* Cart summary footer and line-item layout — keep icon, quantity and prices
   separate even when core OpenCart mobile styles are enabled. */
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item {
  box-sizing:border-box!important;min-width:0!important;
}
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item-body,
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item-price {min-width:0!important;}
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item-price {text-align:right;}
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item-price strong {white-space:nowrap;}
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-safe {
  display:flex!important;align-items:center;justify-content:center;gap:7px;
  width:100%;margin:13px 0 0!important;text-align:center;
  font-size:11px;line-height:1.5;color:#7a8fa8;
}
body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-safe i{flex:0 0 auto;}
/* In the header dropdown, protect the product's 3-column row. */
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-product {
  display:grid!important;grid-template-columns:55px minmax(0,1fr) 30px!important;
  align-items:start!important;gap:10px!important;width:100%!important;
  box-sizing:border-box!important;min-width:0!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-details {min-width:0!important;}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-name {
  white-space:normal!important;overflow-wrap:anywhere!important;display:block;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-remove {padding:0!important;margin:0!important;}

/* OpenCart's BACS/COD confirmation widget stays in the document for its
   existing event handlers, but its legacy table never paints on-screen.
   A future payment provider requiring a visible interactive step can opt in
   with .anb-op-needs-action (handled by the JS fallback). */
body.anblab-theme #anb-onepage #anb-op-payment-confirm:not(.anb-op-needs-action) {
  display:none!important;visibility:hidden!important;
}
body.anblab-theme #anb-onepage #anb-op-payment-confirm.anb-op-needs-action {
  display:block!important;visibility:visible!important;
  position:static!important;clip-path:none!important;
  overflow-x:auto!important;max-width:100%!important;height:auto!important;
}

/* Nova Poshta: extremely long parcel-locker descriptions must not set the
   page width on Safari/iOS. The actual form value remains unchanged. */
body.anblab-theme #anb-onepage,
body.anblab-theme #anb-onepage .anb-op-layout,
body.anblab-theme #anb-onepage .anb-op-fields,
body.anblab-theme #anb-onepage .anb-op-card,
body.anblab-theme #anb-onepage .anb-op-np,
body.anblab-theme #anb-onepage #ocnp_novaposhta_area,
body.anblab-theme #anb-onepage #ocnp_novaposhta_city,
body.anblab-theme #anb-onepage #ocnp_novaposhta_warehouse {
  min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
}
body.anblab-theme #anb-onepage .anb-op-np select[name^="ocnp_novaposhta_"] {
  display:block!important;box-sizing:border-box!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  text-overflow:ellipsis!important;white-space:nowrap!important;
  overflow:hidden!important;
}

@media(max-width:767px){
  body.anblab-theme #product-product.anb-product-page .anb-product-gallery .thumbnails.anb-gallery-shell {
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    gap:10px!important;max-width:100%!important;
  }
  body.anblab-theme #product-product.anb-product-page .anb-gallery-shell>.anb-gallery-main,
  body.anblab-theme #product-product.anb-product-page .anb-gallery-shell>.anb-gallery-rail {
    width:100%!important;max-width:100%!important;min-width:0!important;
  }
  body.anblab-theme #product-product.anb-product-page .anb-gallery-main>a.thumbnail {
    width:100%!important;aspect-ratio:1/1!important;
    max-height:none!important;border-radius:18px!important;padding:6px!important;
  }
  body.anblab-theme #product-product.anb-product-page .anb-gallery-main>a.thumbnail>img {
    border-radius:14px!important;clip-path:inset(0 round 14px)!important;
  }
  body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-shell>.anb-gallery-rail {
    flex:0 0 auto!important;flex-direction:row!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    max-height:98px!important;gap:9px!important;
    scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;
  }
  body.anblab-theme #product-product.anb-product-page .anb-product-gallery .anb-gallery-rail>a.thumbnail {
    flex:0 0 77px!important;width:77px!important;height:77px!important;
    border-radius:11px!important;scroll-snap-align:start;
  }
  body.anblab-theme #product-category.anb-category-page .anb-subcategory-media>img {
    width:89%!important;height:89%!important;max-width:100%!important;
    max-height:100%!important;border-radius:13px!important;
  }
  body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a>img {
    clip-path:inset(0 round 13px)!important;border-radius:13px!important;
  }
  /* Mobile purchases need only quantity editing and checkout. Extras remain on desktop. */
  body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-extras {display:none!important;}
  body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-item-price {
    align-items:flex-start!important;text-align:left!important;
  }
  body.anblab-theme #checkout-cart.anb-cart-page .anb-cart-safe {padding:0 8px!important;}
  body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-product {
    grid-template-columns:52px minmax(0,1fr) 27px!important;gap:8px!important;
  }
}
