/**
 * Home Box Manager — Native Classic Front Office layouts.
 *
 * All selectors are module scoped (.hbm-*). No global theme overrides.
 *
 * @author    Anton Shevchenko
 * @copyright Copyright (c) Anton Shevchenko
 * @license   AFL-3.0
 */

.hbm-hook {
  width: 100%;
  overflow: visible;
}

.container .hbm-hook__container {
  width: 100%;
  max-width: none;
  padding-right: 0;
  padding-left: 0;
  overflow: visible;
}

.hbm-section {
  position: relative;
  width: 100%;
  margin: 0 0 2.5rem;
}

.hbm-section:last-child {
  margin-bottom: 0;
}

.hbm-section__inner {
  position: relative;
  width: 100%;
  padding: 1.5rem 0;
}

.hbm-section--has-background {
  position: relative;
  z-index: 0;
  isolation: isolate;
  background: transparent;
}

.hbm-section--has-background::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
  background-color: #f6f6f6;
  background-image: var(--hbm-section-bg-image, none);
  background-position: var(--hbm-section-bg-position, center center);
  background-size: var(--hbm-section-bg-size, cover);
  background-repeat: var(--hbm-section-bg-repeat, no-repeat);
}

@supports (width: 100dvw) {
  .hbm-section--has-background::before {
    width: 100dvw;
  }
}

.hbm-section--has-background > .hbm-section__inner {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
  padding-right: 0;
  padding-left: 0;
}

.hbm-section__header {
  width: 100%;
  margin: 0 0 1.75rem;
  text-align: center;
}

.hbm-section__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin-top: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.hbm-section__title-icon,
.hbm-item__title-icon {
  flex: 0 0 auto;
  font-size: 1em;
  line-height: 1;
}

.hbm-section__title-text,
.hbm-item__title-text {
  min-width: 0;
}

.hbm-section__subtitle {
  max-width: 48rem;
  margin: 0.625rem auto 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.hbm-native-products,
.hbm-section--products .hbm-section__inner {
  width: 100%;
}

/*
 * The Classic theme only enables the flex grid for `.products` when it sits
 * under `#products`, `.featured-products` or `.product-accessories`. The
 * HomeBox wrapper matches none of those, so the native miniatures fall back to
 * floated Bootstrap columns and break across rows. Re-apply the theme's own
 * flex contract scoped to the HomeBox wrapper (no theme edit, no copied markup).
 */
.hbm-native-products .products {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
}

.hbm-products-fallback {
  width: 100%;
}

.hbm-products-fallback__item {
  margin-bottom: 1.5rem;
}

.hbm-products-fallback__link {
  display: block;
  height: 100%;
  padding: 1rem;
  border: 1px solid #ebebeb;
  background: #fff;
  color: #232323;
  text-decoration: none;
}

.hbm-products-fallback__link:hover,
.hbm-products-fallback__link:focus {
  color: #232323;
  text-decoration: none;
}

.hbm-products-fallback__image {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}

.hbm-products-fallback__title,
.hbm-products-fallback__price {
  display: block;
}

.hbm-products-fallback__price {
  margin-top: 0.5rem;
  font-weight: 600;
}

.hbm-grid {
  width: auto;
  display: grid;
  margin-left: 0;
  margin-right: 0;
  gap: 1.5rem;
  align-items: stretch;
}

.hbm-grid--cols-2 {
  grid-template-columns: minmax(0, 1fr);
}

.hbm-grid--cols-3,
.hbm-grid--cols-4 {
  grid-template-columns: minmax(0, 1fr);
}

.hbm-grid__item {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  flex: none;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 0;
}

.hbm-item-card {
  display: flex;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ebebeb;
  background: #fff;
  color: #232323;
  text-decoration: none;
  box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hbm-grid-tile {
  width: 100%;
  height: 100%;
}

.hbm-item-card:hover,
.hbm-item-card:focus {
  color: #232323;
  text-decoration: none;
  box-shadow: 2px 2px 12px 0 rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

.hbm-item-card__media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f6f6f6;
}

.hbm-item-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hbm-item-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: #f6f6f6;
}

.hbm-item-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1rem;
}

.hbm-item-card__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hbm-item-card__description {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hbm-cards {
  width: auto;
  display: grid;
  margin-left: 0;
  margin-right: 0;
  gap: 2rem;
  align-items: stretch;
}

.hbm-cards--cols-2 {
  grid-template-columns: minmax(0, 1fr);
}

.hbm-cards--cols-3,
.hbm-cards--cols-4 {
  grid-template-columns: minmax(0, 1fr);
}

.hbm-cards__item {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  flex: none;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 0;
}

.hbm-card {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.hbm-card--static {
  cursor: default;
  text-decoration: none;
  color: inherit;
}

.hbm-card--static:hover,
.hbm-card--static:focus,
.hbm-card.hbm-card--static:hover,
.hbm-card.hbm-card--static:focus {
  transform: none;
  box-shadow: none;
  text-decoration: none;
  color: inherit;
}

.hbm-card__media {
  min-height: 260px;
}

.hbm-card__image,
.hbm-card__placeholder {
  min-height: 260px;
}

.hbm-card__title {
  margin: 0;
}

.hbm-card__description {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hbm-banners {
  width: auto;
}

.hbm-banner {
  display: flex;
  margin-bottom: 1.5rem;
}

.hbm-banner__link {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 340px;
  overflow: hidden;
  align-items: center;
  padding: 2.5rem;
  border: 1px solid #ebebeb;
  background: #f6f6f6;
  color: #232323;
  text-decoration: none;
  transition: box-shadow 0.25s ease;
}

.hbm-banner__background {
  position: absolute;
  inset: 0;
  transition: transform 0.45s ease;
  will-change: transform;
}

.hbm-banner__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.hbm-banner__link--has-image {
  color: #fff;
  background: transparent;
  border-color: transparent;
}

.hbm-banner__link--has-image .hbm-banner__overlay {
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.78) 0%,
    rgba(15, 23, 42, 0.42) 52%,
    rgba(15, 23, 42, 0.12) 100%
  );
}

.hbm-banner__content {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 560px;
  transition: transform 0.3s ease;
}

.hbm-banner__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  color: inherit;
}

.hbm-banner__description {
  display: block;
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: inherit;
  opacity: 0.92;
}

.hbm-banner__button {
  margin-top: 1rem;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.hbm-banner__link--has-image:hover,
.hbm-banner__link--has-image:focus-visible {
  color: #fff;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgba(36, 185, 215, 0.55);
}

.hbm-banner__link--has-image:hover .hbm-banner__overlay,
.hbm-banner__link--has-image:focus-visible .hbm-banner__overlay {
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.88) 0%,
    rgba(15, 23, 42, 0.52) 52%,
    rgba(36, 185, 215, 0.22) 100%
  );
}

.hbm-banner__link--has-image:hover .hbm-banner__background,
.hbm-banner__link--has-image:focus-visible .hbm-banner__background {
  transform: scale(1.05);
}

.hbm-banner__link--has-image:hover .hbm-banner__content,
.hbm-banner__link--has-image:focus-visible .hbm-banner__content {
  transform: translateY(-2px);
}

.hbm-banner__link--has-image:hover .hbm-banner__title,
.hbm-banner__link--has-image:hover .hbm-banner__description,
.hbm-banner__link--has-image:focus-visible .hbm-banner__title,
.hbm-banner__link--has-image:focus-visible .hbm-banner__description {
  color: #fff;
}

.hbm-banner__link--has-image:hover .hbm-banner__button,
.hbm-banner__link--has-image:focus-visible .hbm-banner__button {
  background-color: #24b9d7;
  border-color: #24b9d7;
  color: #fff;
  box-shadow: 0 6px 16px rgba(36, 185, 215, 0.35);
  transform: translateY(-1px);
}

.hbm-banner__link:not(.hbm-banner__link--has-image):hover,
.hbm-banner__link:not(.hbm-banner__link--has-image):focus-visible {
  color: #232323;
  text-decoration: none;
  box-shadow: 2px 2px 12px 0 rgba(0, 0, 0, 0.14);
}

.hbm-banner__link:not(.hbm-banner__link--has-image):hover .hbm-banner__button,
.hbm-banner__link:not(.hbm-banner__link--has-image):focus-visible .hbm-banner__button {
  background-color: #24b9d7;
  border-color: #24b9d7;
  color: #fff;
}

.hbm-hook--displayWrapperTop {
  margin-top: 0;
}

.hbm-hook--displayWrapperTop .hbm-section {
  margin-bottom: 0;
}

.hbm-hook--displayWrapperTop .hbm-section__inner {
  padding: 0;
}

.hbm-hook--displayWrapperTop .hbm-banners {
  margin-left: 0;
  margin-right: 0;
}

.hbm-hook--displayWrapperTop .hbm-banners > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

.hbm-hook--displayWrapperTop .hbm-banner {
  margin-bottom: 0;
}

.hbm-hook--displayWrapperTop .hbm-banner__link {
  min-height: 300px;
  padding: 1.25rem 1.5rem;
  border: 0;
  border-radius: 0;
}

.hbm-hook--displayWrapperTop .hbm-banner + .hbm-banner,
.hbm-hook--displayWrapperTop .hbm-banners > [class*="col-"] + [class*="col-"] .hbm-banner__link {
  border-left: 0;
}

@media (min-width: 768px) {
  .hbm-hook--displayWrapperTop .hbm-banners > [class*="col-"]:first-child {
    padding-right: 1px;
  }

  .hbm-hook--displayWrapperTop .hbm-banners > [class*="col-"]:last-child {
    padding-left: 1px;
  }
}

.hbm-custom-html {
  width: 100%;
}

.hbm-custom-html__item {
  width: 100%;
  margin-bottom: 1.5rem;
}

.hbm-custom-html__item:last-child {
  margin-bottom: 0;
}

.hbm-custom-html__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 0.75rem;
  color: #232323;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hbm-custom-html__content {
  width: 100%;
}

/* Neutral content surface for unstyled blocks (CMS-like white card). */
.hbm-content-surface {
  width: 100%;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: #fff;
  text-align: justify;
}

.hbm-content-surface:last-child {
  margin-bottom: 0;
}

.hbm-section__inner > .hbm-content-surface {
  margin-bottom: 0;
}

.hbm-content-surface > :first-child {
  margin-top: 0;
}

.hbm-content-surface > :last-child {
  margin-bottom: 0;
}

/* Presentation blocks keep their own dark design — never apply the surface. */
.hbm-content-surface:has(> .hbm-pres) {
  padding: 0;
  background: transparent;
  text-align: inherit;
}

/* Card body keeps a readable white text area, left aligned. */
.hbm-grid-tile .hbm-item-card__body,
.hbm-card .hbm-item-card__body {
  background: #fff;
  text-align: left;
}

.hbm-item-card:focus-visible,
.hbm-banner__link:focus-visible {
  outline: 2px solid #2fb5d2;
  outline-offset: 2px;
}

@media (min-width: 576px) {
  .hbm-grid--cols-3,
  .hbm-grid--cols-4,
  .hbm-cards--cols-3,
  .hbm-cards--cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .hbm-grid--cols-2,
  .hbm-cards--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .hbm-grid--cols-3,
  .hbm-cards--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hbm-grid--cols-4,
  .hbm-cards--cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .hbm-grid--cols-4,
  .hbm-cards--cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  .hbm-grid,
  .hbm-cards {
    gap: 1.25rem;
  }
}

@media (max-width: 767px) {
  .hbm-section {
    margin-bottom: 2rem;
  }

  .hbm-section--has-background > .hbm-section__inner {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .hbm-grid,
  .hbm-cards {
    gap: 1rem;
  }

  .hbm-banner {
    margin-bottom: 1rem;
  }

  .hbm-section__header {
    margin-bottom: 1.25rem;
  }

  .hbm-content-surface {
    padding: 1rem;
    text-align: left;
  }

  .hbm-banner__link {
    min-height: 260px;
    padding: 1.5rem;
  }

  .hbm-hook--displayWrapperTop .hbm-banner__link {
    min-height: 220px;
    padding: 1rem 1.25rem;
  }

  .hbm-hook--displayWrapperTop .hbm-banners > [class*="col-"] + [class*="col-"] {
    margin-top: 1px;
  }

  .hbm-banner__title {
    font-size: 1.5rem;
  }
}
