/* =========================================================
   MSB – msb_product_group (Desktop + Mobile polish per UI)
   - Product title: 18px
   - Subtitle/bullets: 16px
   - CTA buttons: 16px
   - Compare icon: support SVG/PNG via <img>
   ========================================================= */

.msb-product-group{
  padding: 10px 0 24px;
}

.msb-product-group__title{
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #1f2a37;
}

.msb-product-group__empty{
  padding: 14px;
  border: 1px dashed rgba(0, 0, 0, .25);
  border-radius: 12px;
  background: #fff;
  color: rgba(0, 0, 0, .65);
}

/* Grid */
.msb-product-group__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
/* =========================================================
   MSB Product Group – Align CTA to bottom & equal height cards per row
   ========================================================= */

/* 1) Ensure grid items stretch to the same row height */
.msb-product-group__grid{
  align-items: stretch; /* make all grid items in the row same height */
}

/* 2) Make card a column flex container and fill the grid cell height */
.msb-product-card{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 3) Let body take remaining space so actions can stick to bottom */
.msb-product-card__body{
  display: flex;
  flex-direction: column;
  flex: 1;           /* fill available height inside card */
  min-height: 0;     /* prevent overflow issues in flex children */
}

/* 4) Push CTA row to the bottom regardless of bullet length */
.msb-product-card__actions{
  margin-top: auto;  /* key: keeps CTA at the bottom */
}
/* =========================================================
   Tag overlay inside thumb (bottom-left)
   ========================================================= */

.msb-product-card__media{
  position: relative;
}

/* ensure image area clips overlay nicely */
.msb-product-card__thumb{
  display: block;
  overflow: hidden;
}

/* move tags into thumb area */
.msb-product-card__tags{
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;

  display: flex;
  gap: 8px;
  flex-wrap: wrap;

  /* IMPORTANT: allow clicking the tag */
  pointer-events: auto;
}

/* tag style stays pill (you can keep your existing colors) */
.msb-tag{
  pointer-events: auto; /* ensure <a> clickable */
}

/* Optional: if you want overlay more readable on bright images */
.msb-tag,
.msb-tag--mfirst{
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* ensure caret can rotate smoothly */
.msb-more-btn::after{
  transition: transform 180ms ease;
  transform-origin: 50% 50%;
}

/* expanded -> caret up */
.msb-more-btn[data-state="expanded"]::after{
  transform: rotate(180deg);
}
/* base caret */
.msb-more-btn::before{
  display: inline-flex;            /* quan trọng */
  align-items: center;
  justify-content: center;

  transition: transform 180ms ease;
  transform-origin: 50% 50%;
}

/* expanded -> rotate up */
.msb-more-btn[data-state="expanded"]::before{
  transform: rotate(180deg);
}
@media (max-width: 991px){
  .msb-product-group__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px){
  .msb-product-group__grid{ grid-template-columns: 1fr; }
}

/* Card */
.msb-product-card{
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  box-shadow: 0px 0px 4px 0px #1D293926;
  backdrop-filter: blur(24px);
  border: 1px solid #FFFFFF;
}

.msb-product-card.is-hidden{ display:none; }

.msb-product-card:hover{
  border-color: #ff6a00;
  box-shadow: 0 14px 34px rgba(31, 42, 55, 0.14);
  transform: translateY(-2px);
}

/* Thumb */
.msb-product-card__thumb{
  display:block;
  background:#fff;
  overflow:hidden;
  position: relative;
}

.msb-product-card__thumb img{
  width:100%;
  height:auto;
  object-fit:cover;
  display:block;
  transform: scale(1);
  transition: transform 220ms ease;
  will-change: transform;
}

.msb-product-card:hover .msb-product-card__thumb img{
  transform: scale(1.06);
}

.msb-product-card__thumb--placeholder{
  height:170px;
}

.msb-product-card__body{
  padding: 12px;
}

/* Name */
.msb-product-card__name{
  margin: 0 0 10px;
  font-size: 18px;              /* per UI */
  line-height: 1.25;
  font-weight: 700;
  color: #091E42 !important;
}

.msb-product-card__name a{
  color: inherit;
  text-decoration: none;
  font-size: 18px;
}

/* Features */
.msb-product-card__features{
  margin: 0 0 14px;
  padding-left: 0;
  color: #334155;
  font-size: 16px;              /* per UI */
  line-height: 1.5;
  font-weight: 400;
}

.msb-product-card__features li{ margin: 6px 0; }

/* Actions row */
.msb-product-card__actions{
  display:flex;
  gap: 14px;
  align-items:center;
  justify-content: flex-start;
}

/* Primary button pushes right */
.msb-product-card__actions .msb-btn--primary{
  margin-left: auto;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.msb-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 1;
  border-radius: 10px;
  font-size: 16px;              /* per UI */
  line-height: 1;
  text-decoration:none;
  cursor:pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

/* Compare button */
.msb-btn--ghost{
  border-color: transparent;
  background: transparent;
  padding: 0;
  height: 44px;
  color: #F4600C;
  font-weight: 500;
  gap: 10px;
  text-transform: unset;
  margin: 0;
}

/* NEW: Icon as <img> (supports SVG/PNG) */
.msb-btn__icon{
  width: 22px;
  height: 22px;
  display: inline-block;
  object-fit: contain;
}

/* Compare hover -> orange */
.msb-btn--ghost:hover{
  color: #ff6a00;
}

/* Primary button */
.msb-btn--primary{
  padding: 0 18px;
  border-radius: 10px;
  border-color: #ff6a00;
  color:#fff;
  font-weight: 500;
  background: linear-gradient(270deg, #E45F35 20.9%, #FFA95A 110.29%);
  min-height: 44px;
}

.msb-btn--primary:hover{
  color: #fff;
}

/* =========================================================
   MSB Product Group – Xem thêm (final UI)
   - Orange caret
   - Two horizontal orange lines
   ========================================================= */

.msb-product-group__more{
  position: relative;
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* two orange lines – center perfectly */
.msb-product-group__more::before,
.msb-product-group__more::after{
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  background: rgba(255, 106, 0, 0.35);
}

/* left line */
.msb-product-group__more::before{
  left: 0;
  right: 50%;
  margin-right: 86px; /* half of button visual width */
}

/* right line */
.msb-product-group__more::after{
  left: 50%;
  right: 0;
  margin-left: 82px; /* half of button visual width */
}

/* button itself */
.msb-more-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1.5px solid #ff6a00;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #ff6a00;
    transition: background-color 160ms ease, box-shadow 160ms ease;
    left: 6px;
    top: 6px;
    text-transform: none;
}

/* caret icon – force orange */
.msb-more-btn::before{
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-color: #091E42;

  -webkit-mask: url("/wp-content/themes/msb-website/assets/icons/chevron-down.svg") center / contain no-repeat;
          mask: url("/wp-content/themes/msb-website/assets/icons/chevron-down.svg") center / contain no-repeat;
}

/* hover */
.msb-more-btn:hover{
  background: #fff4ec;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.18);
}

/* mobile tweak */
@media (max-width: 575px){
  .msb-product-group__more::before,
  .msb-product-group__more::after{
    width: calc(50% - 80px);
  }
}
/* =========================================================
   MSB Product Card – Tag badge (position + style like UI)
   ========================================================= */

.msb-product-card__tags{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 12px;     /* below image, before title */
}

.msb-tag{
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f6e7bf;    /* light yellow */
  color: #1f2a37;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: filter 160ms ease, transform 120ms ease;
}

.msb-tag:hover{
  filter: brightness(0.98);
}

.msb-tag:active{
  transform: translateY(1px);
}

.msb-tag:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}

/* Optional: keep same look for m-first */
.msb-tag--mfirst{
  background: #f6e7bf;
  color: #1f2a37;
}

@media (prefers-reduced-motion: reduce){
  .msb-product-card,
  .msb-product-card__thumb img,
  .msb-btn{ transition: none; }
  .msb-product-card:hover{ transform: none; }
}

/* Mobile fine-tuning */
@media (max-width: 575px){
  .msb-product-card__body{
    padding: 14px 14px 16px;
  }

  .msb-product-card__name{
    font-size: 18px;
    margin-bottom: 10px;
  }

  .msb-product-card__features{
    font-size: 16px;
    margin-bottom: 14px;
  }

  .msb-product-card__actions{
    gap: 12px;
  }

  .msb-btn--primary{
    min-width: 140px;
  }
}
