:root{
  --bht-diamond-size:150px; /* default, overridden inline by widget */
  --bht-step: calc(var(--bht-diamond-size) * 0.7071); /* center distance factor ~ cos45 */
}

/* wrapper */
.banner-hinh-thoi{
  width:100%;
  padding:0 0 28px 0;
  box-sizing:border-box;
}
.banner-hinh-thoi-inner{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns:46% 54%;
  gap:20px;
  align-items:center;
  height:360px; /* fixed per choice A */
  box-sizing:border-box;
}

/* left */
.bht-left{ padding-left:24px; box-sizing:border-box; }
.bht-title{ font-size:44px; font-weight:700; line-height:1.05; margin-bottom:18px; }
.bht-free-ship{ display:inline-block; padding:8px 16px; border-radius:40px; border:2px solid; font-weight:700; margin-bottom:12px; }
.bht-btn{ display:inline-block; padding:12px 22px; border-radius:6px; text-decoration:none; font-weight:700; }

/* right */
.bht-right{ display:flex; justify-content:flex-end; overflow:hidden; align-items:center; }

/* absolute mosaic container */
.bht-grid{
  position:relative;
  width: calc(var(--bht-step) * 4.6);  /* enough width to host cluster */
  height: 100%;
}

/* base diamond */
.bht-item{
  position:absolute;
  width: var(--bht-diamond-size);
  height: var(--bht-diamond-size);
  box-sizing:border-box;
}
.bht-diamond{
  width:100%;
  height:100%;
  overflow:hidden;
  transform: rotate(45deg);
  background:#fff;
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}
.bht-diamond img{
  position:absolute;
  top:-30%;
  left:-30%;
  width:160%;
  height:160%;
  object-fit:cover;
  transform: rotate(-45deg);
}
/* remove rounding to match sample */
.bht-diamond{ border-radius:0; }

/* placeholder */
.bht-item-empty .bht-placeholder{ width:100%; height:100%; background: var(--placeholder-bg); }

/* overlay */
.bht-overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.52);
  transform: rotate(-45deg);
  opacity:0;
  transition: opacity .18s ease;
  display:flex;
  justify-content:center;
  align-items:center;
}
.bht-item:hover .bht-overlay,
.bht-item:focus .bht-overlay{ opacity:1; }
.bht-overlay-inner{ transform: rotate(45deg); color:#fff; text-align:center; padding:8px; }
.bht-prod-title{ font-size:13px; font-weight:700; margin-bottom:6px; }
.bht-prod-price{ font-size:13px; font-weight:700; }
.bht-item-empty .bht-overlay{ display:none; }

/* Positioning to make diamonds touch (geometric layout).
   Use --bht-step (≈ size * cos45) as center-to-center horizontal step.
   We place each slot at coordinates (left, top) so diamonds are adjacent without overlap.
   These multipliers are tuned to reproduce Nexon-style cluster.
*/

/* Top row (1..4) */
.bht-grid > .bht-item[data-pos="1"]{ left: calc(var(--bht-step) * 0);      top: calc(var(--bht-step) * 0.6); }
.bht-grid > .bht-item[data-pos="2"]{ left: calc(var(--bht-step) * 1);      top: calc(var(--bht-step) * 0.0); }
.bht-grid > .bht-item[data-pos="3"]{ left: calc(var(--bht-step) * 2);      top: calc(var(--bht-step) * 0.6); }
.bht-grid > .bht-item[data-pos="4"]{ left: calc(var(--bht-step) * 3);      top: calc(var(--bht-step) * 0.0); }

/* Middle row (5..8) */
.bht-grid > .bht-item[data-pos="5"]{ left: calc(var(--bht-step) * 0.5);    top: calc(var(--bht-step) * 1.3); }
.bht-grid > .bht-item[data-pos="6"]{ left: calc(var(--bht-step) * 1.5);    top: calc(var(--bht-step) * 0.9); }
.bht-grid > .bht-item[data-pos="7"]{ left: calc(var(--bht-step) * 2.5);    top: calc(var(--bht-step) * 1.3); }
.bht-grid > .bht-item[data-pos="8"]{ left: calc(var(--bht-step) * 3.5);    top: calc(var(--bht-step) * 0.9); }

/* Bottom row (9..10) */
.bht-grid > .bht-item[data-pos="9"]{ left: calc(var(--bht-step) * 1.5);    top: calc(var(--bht-step) * 2.2); }
.bht-grid > .bht-item[data-pos="10"]{ left: calc(var(--bht-step) * 2.5);   top: calc(var(--bht-step) * 1.8); }

/* animation */
@keyframes bht-up{0%{transform:translateY(24px) scale(.96);opacity:0}100%{transform:translateY(0) scale(1);opacity:1}}
@keyframes bht-down{0%{transform:translateY(-24px) scale(.96);opacity:0}100%{transform:translateY(0) scale(1);opacity:1}}
@keyframes bht-left{0%{transform:translateX(24px) scale(.96);opacity:0}100%{transform:translateX(0) scale(1);opacity:1}}
@keyframes bht-right{0%{transform:translateX(-24px) scale(.96);opacity:0}100%{transform:translateX(0) scale(1);opacity:1}}

.banner-hinh-thoi.bht-eff-up .bht-item{animation:bht-up .6s ease-out both}
.banner-hinh-thoi.bht-eff-down .bht-item{animation:bht-down .6s ease-out both}
.banner-hinh-thoi.bht-eff-left .bht-item{animation:bht-left .6s ease-out both}
.banner-hinh-thoi.bht-eff-right .bht-item{animation:bht-right .6s ease-out both}

/* responsive: on mobile switch to stacked flex (not absolute) */
@media (max-width:900px){
  :root{ --bht-diamond-size:110px; --bht-step: calc(var(--bht-diamond-size) * 0.7071); }
  .banner-hinh-thoi-inner{ grid-template-columns:1fr; height:auto; padding:28px 14px; }
  .bht-left{ padding:0 12px 10px 12px; }
  .bht-title{ font-size:28px; }
  .bht-right{ justify-content:center; }
  .bht-grid{ position:static; width:auto; display:flex; flex-wrap:wrap; justify-content:center; gap:10px; height:auto; }
  .bht-item{ position:static; width:calc(var(--bht-diamond-size) * 0.72); height:calc(var(--bht-diamond-size) * 0.72); }
  .bht-diamond{ box-shadow: 0 6px 14px rgba(0,0,0,0.12); }
}
