/* ==========================================================================
   Home hero: categories + slider
   ========================================================================== */

.me-home-hero {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin: 48px 0 36px;
  position: relative;
  overflow: visible;
}

.me-home-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.me-home-slider {
  height: 420px;
  min-height: 420px;
  background: #fff;
  overflow: hidden;
}

.me-home-videos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.me-home-videos .box {
  position: relative;
  background: #ffffff;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 36, 64, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.me-home-videos .box:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(15, 36, 64, 0.16);
}

.me-home-videos .box h3 {
  margin: 0;
  padding: 12px 14px;
  background: #0b63b6;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.me-home-videos .textwidget {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #101820;
}

.me-home-videos .textwidget p {
  margin: 0;
}

.me-home-videos iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 1200px) {
  .me-home-videos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .me-home-hero {
    grid-template-columns: 1fr;
  }

  .me-home-slider {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .me-home-videos {
    grid-template-columns: 1fr;
  }

  .me-home-slider {
    height: 240px;
    min-height: 240px;
  }
}

/* Slider holder */
.me-home-slider {
  position: relative;
  min-width: 0;
  height: 420px;
  min-height: 420px;
  background: #fff;
  overflow: hidden;
}

/* Force MetaSlider to fill holder */
.me-home-slider .metaslider,
.me-home-slider .metaslider .flexslider,
.me-home-slider .metaslider .slides,
.me-home-slider .metaslider .slides > li,
.me-home-slider .metaslider .slides > li > a {
  width: 100% !important;
  height: 100% !important;
}

.me-home-slider .metaslider {
  max-width: none !important;
}

.me-home-slider .metaslider .flexslider {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* Image always fills slider holder */
.me-home-slider .metaslider img,
.me-home-slider .metaslider .slides img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Remove extra space from slider controls */
.me-home-slider .flex-control-nav {
  bottom: 16px !important;
  z-index: 10;
}

/* Same visual height with menu */
.me-home-categories {
  min-height: 420px;
}

/* Important: mega menu must not be cut */
.me-home-hero,
.me-home-slider,
.me-home-slider .metaslider,
.me-home-slider .metaslider .flexslider {
  overflow: visible;
}

.me-home-slider .metaslider .slides,
.me-home-slider .metaslider .slides > li {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 991px) {
  .me-home-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 24px;
  }

  .me-home-categories {
    min-height: auto;
  }

  .me-home-slider {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .me-home-slider {
    height: 240px;
    min-height: 240px;
  }
}

.me-home-videos .box {
  display: flex;
  flex-direction: column;
  min-height: 202px;
}

.me-home-videos .box h3 {
  flex: 0 0 auto;
}

.me-home-videos .textwidget {
  flex: 1 1 auto;
  height: auto;
  min-height: 150px;
  aspect-ratio: auto;
  position: relative;
  overflow: hidden;
}

.me-home-videos .textwidget p {
  margin: 0;
  height: 100%;
}

.me-home-videos iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}