/**
 * Dịch Vụ Bảo Hành & Bento Grid Styles
 * Exact match for ACIT & Industrial Technical Service Showcase
 *
 * @package Flatsome Child
 */

:root {
  --bento-height: 520px;
  --bento-radius: 0px;
}

/* ============================================================
   Parent Container
   ============================================================ */
.bao-hanh-bento {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.bao-hanh-bento__wrapper {
  display: flex;
  width: 100%;
  min-height: var(--bento-height, 520px);
  border-radius: var(--bento-radius, 0px);
  overflow: hidden;
  box-sizing: border-box;
  background-color: rgb(243, 247, 248);
}

/* ============================================================
   Left Banner (50% - Brand & Hotline Conversion)
   ============================================================ */
.bao-hanh-bento__banner {
  position: relative;
  flex: 1 1 30%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 46px;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #0d2238;
}

.bao-hanh-bento__banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bao-hanh-bento__banner-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.8s ease;
}

.bao-hanh-bento__banner-bg .bao-hanh-bento-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d2238 0%, #061524 100%);
}

.bao-hanh-bento__banner:hover .bao-hanh-bento__banner-bg img {
  transform: scale(1.05);
}

.bao-hanh-bento__banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(135deg,
      rgba(7, 21, 38, 0.94) 0%,
      rgba(7, 21, 38, 0.82) 55%,
      rgba(7, 21, 38, 0.6) 100%);
}

.bao-hanh-bento__banner-content {
  position: relative;
  z-index: 3;
  max-width: 92%;
}

.bao-hanh-bento__banner-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--banner-title-color, #ffffff) !important;
  margin: 0 0 18px 0 !important;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bao-hanh-bento__banner-desc {
  font-size: 18px;
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.88) !important;
  margin: 0 0 28px 0 !important;
}

/* Hotline Pill Button */
.bao-hanh-bento__hotline-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: 50px;
  background-color: var(--hotline-color, #00a86b);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.35s ease;
  width: fit-content;
}

.bao-hanh-bento__hotline-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
  color: #ffffff !important;
}

.bao-hanh-bento__hotline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.bao-hanh-bento__hotline-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ============================================================
   Right Bento Grid (50% - Asymmetric Service Cards)
   ============================================================ */
.bao-hanh-bento__grid {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  box-sizing: border-box;
}

/* Desktop & Tablet (>= 768px): CSS Grid Layouts */
@media (min-width: 768px) {
  .bao-hanh-bento__grid {
    display: grid;
  }

  /* Layout 1: Bento 3 (2 stacked left + 1 tall right) - Mẫu ACIT */
  .bao-hanh-bento__grid.layout-bento-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .bao-hanh-bento__grid.layout-bento-3>.bao-hanh-item:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .bao-hanh-bento__grid.layout-bento-3>.bao-hanh-item:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }

  .bao-hanh-bento__grid.layout-bento-3>.bao-hanh-item:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    /* Spans full height 2 rows */
  }

  /* Layout 2: Grid 4 (2x2 Balanced) */
  .bao-hanh-bento__grid.layout-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .bao-hanh-bento__grid.layout-grid-4>.bao-hanh-item:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .bao-hanh-bento__grid.layout-grid-4>.bao-hanh-item:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  .bao-hanh-bento__grid.layout-grid-4>.bao-hanh-item:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }

  .bao-hanh-bento__grid.layout-grid-4>.bao-hanh-item:nth-child(4) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }
}

/* ============================================================
   Child Item (Bento Block)
   ============================================================ */
.bao-hanh-item {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  text-decoration: none !important;
  color: #ffffff !important;
  cursor: pointer;
  background-color: var(--item-bg-color, #132b4b);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 34px 28px;
  transition: all 0.4s ease;
}

/* Maintain flush layout for bento tiles on hover */
.bao-hanh-bento__banner.reveal-done:hover,
.bao-hanh-item.reveal-done:hover {
  transform: none !important;
}

.bao-hanh-item__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bao-hanh-item__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.65s cubic-bezier(0.25, 1, 0.45, 1);
}

.bao-hanh-item__bg .bao-hanh-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.bao-hanh-item:hover .bao-hanh-item__bg img {
  transform: scale(1.08);
}

.bao-hanh-item__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-color: var(--item-bg-color, #132b4b);
  opacity: var(--item-opacity, 0.82);
  mix-blend-mode: multiply;
  transition: opacity 0.4s ease;
}

.bao-hanh-item__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  background: linear-gradient(to bottom,
      rgba(5, 15, 25, 0.30) 0%,
      rgba(5, 15, 25, 0.15) 45%,
      rgba(5, 15, 25, 0.40) 100%);
}

.bao-hanh-item:hover .bao-hanh-item__overlay {
  opacity: calc(var(--item-opacity, 0.82) - 0.1);
}

.bao-hanh-item__inner {
  position: relative;
  z-index: 4;
}

.bao-hanh-item__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.32;
  color: #ffffff !important;
  margin: 0 0 12px 0 !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  letter-spacing: -0.2px;
}

.bao-hanh-item__desc {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9) !important;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* For tall item in bento-3, allow more description lines */
.layout-bento-3>.bao-hanh-item:nth-child(3) .bao-hanh-item__desc {
  -webkit-line-clamp: 5;
}

/* ============================================================
   Responsive (Tablet & Mobile)
   ============================================================ */
@media (max-width: 991px) {
  .bao-hanh-bento__wrapper {
    flex-direction: column;
    min-height: auto;
  }

  .bao-hanh-bento__banner {
    flex: 1 1 auto;
    padding: 42px 30px;
  }

  .bao-hanh-bento__banner-title {
    font-size: 22px;
  }

  .bao-hanh-bento__grid {
    flex: 1 1 auto;
    min-height: 400px;
  }
}

@media (max-width: 767px) {
  .bao-hanh-bento__banner {
    padding: 34px 20px;
  }

  .bao-hanh-bento__grid {
    min-height: 300px;
  }

  .bao-hanh-bento__banner-title {
    font-size: 20px;
  }

  .bao-hanh-bento__banner-desc {
    font-size: 14px;
    margin-bottom: 22px !important;
  }

  .bao-hanh-bento__hotline-btn {
    font-size: 16px;
    padding: 10px 20px;
  }

  /* Option A (Default): Slider Mode (Smooth Touch Swipe) */
  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    touch-action: pan-y !important;
    position: relative !important;
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid::-webkit-scrollbar {
    display: none !important;
  }

  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid.is-dragging {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
  }

  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid img,
  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid a {
    -webkit-user-drag: none !important;
    user-drag: none !important;
  }

  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid .bao-hanh-item {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 300px !important;
    padding: 30px 24px !important;
    box-sizing: border-box !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  /* Make items immediately visible when swiping on mobile */
  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__grid [class*="reveal-"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    pointer-events: auto !important;
  }

  /* Dots Indicator for Mobile Slider */
  .bao-hanh-bento.is-mobile-slider .bao-hanh-bento__dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 0 18px 0 !important;
    margin: 0 !important;
    background: rgb(243, 247, 248);
  }

  .bao-hanh-bento__dot {
    all: unset !important;
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    border-radius: 50% !important;
    background: #00000056 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-sizing: border-box !important;
  }

  .bao-hanh-bento__dot.is-active {
    background: var(--primary-color) !important;
    transform: scale(1.35) !important;
  }

  /* Option B: Stack Mode (Vertical List fallback) */
  .bao-hanh-bento:not(.is-mobile-slider) .bao-hanh-bento__grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: auto !important;
  }

  .bao-hanh-bento:not(.is-mobile-slider) .bao-hanh-bento__grid .bao-hanh-item {
    width: 100% !important;
    min-height: 210px !important;
    padding: 26px 20px !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .bao-hanh-bento:not(.is-mobile-slider) .bao-hanh-bento__dots {
    display: none !important;
  }

  .bao-hanh-item__title {
    font-size: 22px;
  }

  .bao-hanh-item__desc {
    font-size: 16px;
    -webkit-line-clamp: 2;
  }
}

/* Hide dots on Desktop & Tablet */
@media (min-width: 768px) {
  .bao-hanh-bento__dots {
    display: none !important;
  }
}