/* ANB Lab focused visual repair r4.
   Existing checkout, JavaScript, product functionality and desktop gallery layout untouched.
   Paired with rounded corners directly on image tags in category/product Twig. */

/* Actual square picture frames (NOT the whole subcategory card).
   Keep source images entirely visible and make the curved cutout visible. */
body.anblab-theme #product-category.anb-category-page .anb-subcategory-card .anb-subcategory-media {
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.anblab-theme #product-category.anb-category-page .anb-subcategory-card .anb-subcategory-media > img.anb-photo-soft-corners {
  display:block!important;
  width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;
  aspect-ratio:1/1!important;object-fit:contain!important;
  border-radius:20px!important;
  -webkit-clip-path:inset(0 round 20px)!important;
  clip-path:inset(0 round 20px)!important;
  overflow:hidden!important;
  box-shadow:none!important;
}
/* Grid products: clip photo itself and its link. Non-cropping, square picture. */
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a {
  overflow:hidden!important;
  border-radius:20px!important;
}
body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a>img.anb-photo-soft-corners {
  display:block!important;
  border-radius:19px!important;
  -webkit-clip-path:inset(0 round 19px)!important;
  clip-path:inset(0 round 19px)!important;
  object-fit:contain!important;
}
/* Main product photo: crop only the four corners, NEVER the product or label. */
body.anblab-theme #product-product.anb-product-page .anb-gallery-main>a.thumbnail {
  overflow:hidden!important;
  border-radius:21px!important;
}
body.anblab-theme #product-product.anb-product-page .anb-gallery-main>a.thumbnail>img.anb-photo-soft-corners {
  display:block!important;
  border-radius:21px!important;
  -webkit-clip-path:inset(0 round 21px)!important;
  clip-path:inset(0 round 21px)!important;
  object-fit:contain!important;
}

/* Dedicated desktop dropdown. Cleanly override ONLY old OpenCart cart styles.
   > ul is critical to avoid affecting nested dropdowns. */
@media (min-width:768px) {
  body.anblab-theme .anb-header-cart #cart.anb-mini-cart>ul.dropdown-menu {
    box-sizing:border-box!important;
    width:388px!important;
    max-width:min(388px,calc(100vw - 22px))!important;
    min-width:0!important;
    top:calc(100% + 10px)!important;
    right:0!important;left:auto!important;
    padding:0!important;margin:0!important;
    overflow:hidden!important;
    border:1px solid #dce8f6!important;
    border-radius:18px!important;
    background:#fff!important;
    box-shadow:0 18px 48px rgba(25,53,96,.18)!important;
  }
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart>ul.dropdown-menu>li,
body.anblab-theme .anb-header-cart #cart.anb-mini-cart>ul.dropdown-menu>li>.anb-mini-content {
  width:100%!important;max-width:100%!important;min-width:0!important;
  float:none!important;margin:0!important;padding:0!important;
  box-sizing:border-box!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-content {
  background:#fff!important;overflow:hidden!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-title {
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  box-sizing:border-box!important;padding:16px 17px!important;
  border-bottom:1px solid #e4edf8!important;background:#fff!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-products {
  background:#fff!important;max-height:310px!important;overflow-y:auto!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-product {
  display:grid!important;grid-template-columns:58px minmax(0,1fr) 28px!important;
  align-items:start!important;gap:10px!important;
  padding:14px 16px!important;margin:0!important;
  box-sizing:border-box!important;width:100%!important;min-width:0!important;
  border-bottom:1px solid #edf2f8!important;background:#fff!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-img {
  display:block!important;box-sizing:border-box!important;
  width:58px!important;height:58px!important;overflow:hidden!important;
  border:1px solid #e4ebf5!important;border-radius:12px!important;
  background:#f7faff!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-img img {
  width:100%!important;height:100%!important;
  max-width:100%!important;max-height:100%!important;
  object-fit:contain!important;border-radius:11px!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-details {
  min-width:0!important;width:auto!important;
  display:flex!important;flex-direction:column!important;gap:5px!important;
  overflow-wrap:anywhere!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-name {
  display:-webkit-box!important;-webkit-line-clamp:3!important;
  -webkit-box-orient:vertical!important;overflow:hidden!important;
  line-height:1.42!important;white-space:normal!important;
  font-weight:750!important;color:#19395f!important;text-decoration:none!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-remove {
  width:28px!important;height:28px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  padding:0!important;margin:0!important;float:none!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-totals {
  box-sizing:border-box!important;padding:12px 17px!important;
  width:100%!important;background:#f6faff!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-total {
  display:flex!important;justify-content:space-between!important;
  align-items:center!important;gap:12px!important;
  padding:6px 0!important;margin:0!important;line-height:1.45!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-total.anb-mini-grand {
  padding-top:11px!important;margin-top:5px!important;
  border-top:1px solid #dce8f6!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-actions {
  display:flex!important;flex-direction:column!important;gap:8px!important;
  box-sizing:border-box!important;padding:13px 16px 16px!important;
  background:#fff!important;
}
body.anblab-theme .anb-header-cart #cart.anb-mini-cart .anb-mini-actions>a {
  display:flex!important;justify-content:center!important;align-items:center!important;
  box-sizing:border-box!important;width:100%!important;min-height:43px!important;
  line-height:1.35!important;border-radius:11px!important;
  text-align:center!important;margin:0!important;
}

@media (max-width:767px) {
  /* Keep earlier mobile layout; these rules only enforce picture clipping. */
  body.anblab-theme #product-category.anb-category-page .anb-subcategory-card .anb-subcategory-media>img.anb-photo-soft-corners {
    border-radius:17px!important;
    -webkit-clip-path:inset(0 round 17px)!important;
    clip-path:inset(0 round 17px)!important;
  }
  body.anblab-theme #product-category.anb-category-page .anb-catalog-products .product-thumb .image>a>img.anb-photo-soft-corners {
    border-radius:17px!important;
    -webkit-clip-path:inset(0 round 17px)!important;
    clip-path:inset(0 round 17px)!important;
  }
  body.anblab-theme #product-product.anb-product-page .anb-gallery-main>a.thumbnail>img.anb-photo-soft-corners {
    border-radius:20px!important;
    -webkit-clip-path:inset(0 round 20px)!important;
    clip-path:inset(0 round 20px)!important;
  }
}
