/**
 * HB-368 — homepage polish (theme-freeze overlay)
 * 1) Center hero/banner: kill empty white foot under CTAs/arrows
 * 2) Right quick-link cards: soft ALV cyan-blue → transparent/white gradient
 * 3) Đối tác thương hiệu: keep continuous horizontal marquee moving
 * Never touches index-C7BUmI7G.js / index-BN2ZtJyR.css / THEME_UI_FREEZE hashes of C7/BN2.
 */

/* —— Brand tokens (ALV / Trang chủ cyan-blue; avoid violet accents) —— */
html.storefront-root {
  --hb368-alv-blue: #0077b6;
  --hb368-alv-cyan: #008eab;
  --hb368-alv-sky: #33d6ff;
  --hb368-alv-soft: #e8fbff;
  --hb368-alv-mist: #e6f7fa;
}

/* —— 1) Center hero card: content fills the card (no awkward empty foot) —— */
html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section > .relative.z-10 {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  /* Pack content — avoid space-between void between CTAs and arrows */
  justify-content: flex-start !important;
  gap: 0.35rem !important;
  min-height: 0 !important;
  height: 100% !important;
  box-sizing: border-box !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.35rem !important;
}

/* Let the text/image grid absorb leftover height so the foot is not empty white */
html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section > .relative.z-10 > .grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
}

/* Tighten slide nav foot on embedded hero (mt-3 / pt-1 leave a white band) */
html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section > .relative.z-10 > .flex.shrink-0 {
  margin-top: 0.15rem !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 1023px) {
  /* Mobile: let content define height — no fixed 360/380 empty foot */
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section > .relative.z-10 {
    height: auto !important;
    padding-top: 0.55rem !important;
    padding-bottom: 0.35rem !important;
  }
}

@media (min-width: 1024px) {
  /*
   * Desktop equal columns — 480px (beats layout-polish 560) so center banner
   * content/CTAs sit closer to the foot instead of a tall empty white band.
   */
  html.storefront-root .grid:has([data-home-category-sidebar]) > [data-home-category-sidebar],
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:nth-child(2),
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:nth-child(3),
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) {
    height: 480px !important;
    min-height: 480px !important;
    max-height: 480px !important;
  }

  /* Pack hero copy/CTAs toward the bottom of the text column (less empty foot) */
  html.storefront-root .grid:has([data-home-category-sidebar]) > div:has(> section) > section > .relative.z-10 > .grid > div:first-child {
    justify-content: flex-end !important;
    padding-bottom: 0.15rem !important;
  }
}

/* —— 2) Right column quick-link cells: soft blue → white —— */
html.storefront-root .grid:has([data-home-category-sidebar]) [class*="lg:grid-rows-4"] {
  background: linear-gradient(
    180deg,
    rgba(230, 247, 250, 0.72) 0%,
    rgba(232, 251, 255, 0.35) 45%,
    rgba(255, 255, 255, 0.2) 100%
  ) !important;
  border-color: rgba(0, 119, 182, 0.32) !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) [class*="lg:grid-rows-4"] > button {
  background-color: #ffffff !important;
  background-image: linear-gradient(
    180deg,
    #b8e8f2 0%,
    #d4f4fc 22%,
    #e8fbff 48%,
    rgba(255, 255, 255, 0.88) 78%,
    #ffffff 100%
  ) !important;
  border-color: rgba(0, 119, 182, 0.42) !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) [class*="lg:grid-rows-4"] > button:hover {
  background-image: linear-gradient(
    180deg,
    #9fdceb 0%,
    #c5ebf5 28%,
    #dff6fb 55%,
    rgba(255, 255, 255, 0.92) 82%,
    #ffffff 100%
  ) !important;
  border-color: rgba(0, 142, 171, 0.58) !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) [class*="lg:grid-rows-4"] > button p:first-child {
  color: #005a6b !important;
}

html.storefront-root .grid:has([data-home-category-sidebar]) [class*="lg:grid-rows-4"] > button p:last-of-type {
  color: #0b4f6a !important;
}

/* —— 3) Brand partners marquee: always run continuous horizontal scroll —— */
@keyframes hb368ScrollLeft {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes hb368ScrollRight {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

html.storefront-root .home-brand-scroll-row-left,
html.storefront-root .home-brand-scroll-row-left.is-marquee-paused,
html.storefront-root .home-brand-scroll-row-left.is-marquee-running,
html.storefront-root .home-brand-scroll-row-left[data-hb368-marquee="1"] {
  display: flex !important;
  width: max-content !important;
  /* Do NOT set transform:!important — it freezes keyframes */
  animation: hb368ScrollLeft var(--brand-marquee-duration, 72s) linear infinite !important;
  animation-play-state: running !important;
  will-change: transform;
  backface-visibility: hidden;
}

html.storefront-root .home-brand-scroll-row-right,
html.storefront-root .home-brand-scroll-row-right.is-marquee-paused,
html.storefront-root .home-brand-scroll-row-right.is-marquee-running,
html.storefront-root .home-brand-scroll-row-right[data-hb368-marquee="1"] {
  display: flex !important;
  width: max-content !important;
  animation: hb368ScrollRight var(--brand-marquee-duration, 72s) linear infinite !important;
  animation-play-state: running !important;
  will-change: transform;
  backface-visibility: hidden;
}

html.storefront-root .home-brand-scroll-row:not(.home-brand-scroll-row-left):not(.home-brand-scroll-row-right),
html.storefront-root .home-brand-scroll-row.is-marquee-paused,
html.storefront-root .home-brand-scroll-row.is-marquee-running {
  display: flex !important;
  width: max-content !important;
  animation: hb368ScrollLeft var(--brand-marquee-duration, 96s) linear infinite !important;
  animation-play-state: running !important;
}

/* Beat hb189 compositor reduced-motion kill for partner logos (site already opted into marquee UX) */
@media (prefers-reduced-motion: reduce) {
  html.storefront-root .home-brand-scroll-row-left,
  html.storefront-root .home-brand-scroll-row-left.is-marquee-paused,
  html.storefront-root .home-brand-scroll-row-left.is-marquee-running {
    animation: hb368ScrollLeft var(--brand-marquee-duration, 96s) linear infinite !important;
    animation-play-state: running !important;
  }
  html.storefront-root .home-brand-scroll-row-right,
  html.storefront-root .home-brand-scroll-row-right.is-marquee-paused,
  html.storefront-root .home-brand-scroll-row-right.is-marquee-running {
    animation: hb368ScrollRight var(--brand-marquee-duration, 96s) linear infinite !important;
    animation-play-state: running !important;
  }
}

html.storefront-root .brand-container {
  overflow: hidden !important;
}
