/* ================================================================
   MobiStore Hero Slider — Frontend CSS
   ================================================================ */

/* ── Keyframes ─────────────────────────────────────────────────── */
@keyframes mhs-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}
@keyframes mhs-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}
@keyframes mhs-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes mhs-zoom {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}
@keyframes mhs-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mhs-shake {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(-3deg); }
  40%       { transform: rotate(3deg); }
  60%       { transform: rotate(-2deg); }
  80%       { transform: rotate(2deg); }
}
@keyframes mhs-ring-spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
@keyframes mhs-ring-spin-rev {
  from { transform: translate(-50%,-50%) rotate(360deg); }
  to   { transform: translate(-50%,-50%) rotate(0deg); }
}
@keyframes mhs-dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes mhs-content-in {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mhs-content-in-rtl {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mhs-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Wrapper ───────────────────────────────────────────────────── */
.mhs-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Peek mode (slide width < 100%) ───────────────────────────── */
.mhs-slider-wrap.mhs-peek-mode { overflow: visible; }
.mhs-slider-wrap.mhs-peek-mode .mhs-arrow { z-index: 30; }

/* ── Slides Track ──────────────────────────────────────────────── */
.mhs-slides-track {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}
.mhs-slider-wrap[data-transition="fade"] .mhs-slides-track {
  display: block;
}

/* ── Individual Slide ──────────────────────────────────────────── */
.mhs-slide {
  /* Width is set per-slide via inline style (flex + min-width + max-width).
     Default 100% is applied by JS on init; CSS must NOT override inline. */
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* prevent accidental shrinking */
}
.mhs-slider-wrap[data-transition="fade"] .mhs-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.mhs-slider-wrap[data-transition="fade"] .mhs-slide--active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

/* ── Inner Layout ──────────────────────────────────────────────── */
.mhs-slide-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  gap: 40px;
  box-sizing: border-box;
}
.mhs-slide--rtl .mhs-slide-inner {
  flex-direction: row-reverse;
}
.mhs-valign--top    { align-items: flex-start; }
.mhs-valign--center { align-items: center; }
.mhs-valign--bottom { align-items: flex-end; }

/* ── Columns ───────────────────────────────────────────────────── */
.mhs-col { box-sizing: border-box; }
.mhs-col--content { padding-right: 20px; }
.mhs-slide--rtl .mhs-col--content { padding-right: 0; padding-left: 20px; }
.mhs-col--image { display: flex; justify-content: center; }

/* ── Content Animation (on active slide entry) ─────────────────── */
.mhs-slide--active .mhs-anim-slide-in {
  animation: mhs-content-in 0.7s ease-out forwards;
}
.mhs-slide--rtl.mhs-slide--active .mhs-anim-slide-in {
  animation: mhs-content-in-rtl 0.7s ease-out forwards;
}

/* ── Hero Tag ──────────────────────────────────────────────────── */
.mhs-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: mhs-fade-up 0.5s ease-out 0.1s both;
}
.mhs-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: mhs-dot-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Heading ───────────────────────────────────────────────────── */
.mhs-heading {
  font-size: clamp(28px, 4.5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  animation: mhs-fade-up 0.5s ease-out 0.2s both;
}
.mhs-heading-em {
  font-style: normal;
  display: inline-block;
}

/* ── Subtext ───────────────────────────────────────────────────── */
.mhs-subtext {
  font-size: 16px;
  line-height: 1.7;
  max-width: 500px;
  margin: 0 0 28px;
  animation: mhs-fade-up 0.5s ease-out 0.3s both;
}
.mhs-slide--rtl .mhs-subtext { max-width: 100%; }

/* ── Button Group ──────────────────────────────────────────────── */
.mhs-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
  animation: mhs-fade-up 0.5s ease-out 0.35s both;
}
.mhs-slide--rtl .mhs-btn-group { justify-content: flex-start; }

.mhs-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.mhs-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  filter: brightness(1.05);
}
.mhs-btn svg { width: 16px; height: 16px; transition: transform 0.2s; flex-shrink: 0; }
.mhs-btn--filled:hover svg { transform: translateX(4px); }
.mhs-slide--rtl .mhs-btn--filled:hover svg { transform: translateX(-4px); }

/* ── Button Size (per-slide, applies to all CTA buttons) ───────── */
.mhs-btn--size-sm { padding: 9px 18px;  font-size: 13px; gap: 7px; }
.mhs-btn--size-md { padding: 14px 28px; font-size: 15px; gap: 10px; } /* default */
.mhs-btn--size-lg { padding: 17px 36px; font-size: 17px; gap: 11px; }
.mhs-btn--size-xl { padding: 21px 46px; font-size: 19px; gap: 12px; }
.mhs-btn--size-lg svg,
.mhs-btn--size-xl svg { width: 18px; height: 18px; }

/* ── Button Shape (per-slide) — custom inline radius overrides these ── */
.mhs-btn--shape-square  { border-radius: 0; }
.mhs-btn--shape-rounded { border-radius: 12px; } /* default */
.mhs-btn--shape-pill    { border-radius: 999px; }

/* ── Full-width button group ───────────────────────────────────── */
.mhs-btn-group--block { flex-direction: column; align-items: stretch; }
.mhs-btn-group--block .mhs-btn { width: 100%; justify-content: center; }

/* ── Stats ─────────────────────────────────────────────────────── */
.mhs-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  animation: mhs-fade-up 0.5s ease-out 0.45s both;
}
.mhs-stat strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.mhs-stat span {
  font-size: 13px;
  opacity: 0.6;
}

/* ── Image Column ──────────────────────────────────────────────── */
.mhs-image-wrap {
  position: relative;
  width: 100%;
  max-width: 540px;
  min-height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Decorative rings */
.mhs-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
}
.mhs-ring--outer {
  width: 440px;
  height: 440px;
  border: 1px solid rgba(0,0,0,0.07);
  animation: mhs-ring-spin 40s linear infinite;
}
.mhs-ring--inner {
  width: 330px;
  height: 330px;
  border: 1px solid rgba(0,0,0,0.05);
  animation: mhs-ring-spin-rev 28s linear infinite;
}

/* Product image container */
.mhs-product-image {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: var(--mhs-img-max-h, 480px);
  display: flex;
  justify-content: center;
  align-items: center;
}
.mhs-product-img {
  max-width: 100%;
  max-height: var(--mhs-img-max-h, 480px);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.12));
  animation: mhs-fade-up 0.6s ease-out 0.2s both;
}

/* ── Motion Effects — applied to .mhs-motion-unit (image + overlays as one) ── */
/* Scale wrapper: holds the user's Scale (%) value. Kept separate from the
   animated .mhs-motion-unit so the motion keyframes (which set `transform`)
   do not override the scale. The two transforms compose via nesting. */
.mhs-scale-unit {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    transform-origin: center center;
    will-change: transform;
}
.mhs-motion-unit {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: var(--mhs-img-max-h, 480px);
}
.mhs-motion-unit .mhs-product-image {
    /* image sits inside the motion unit — no extra animation here */
    position: relative; z-index: 1;
    display: flex; justify-content: center; align-items: center;
}

/* Motion classes on the unit wrapper */
.mhs-motion-unit.mhs-motion--float    { animation: mhs-float    var(--motion-speed, 5s) ease-in-out infinite; }
.mhs-motion-unit.mhs-motion--pulse    { animation: mhs-pulse    var(--motion-speed, 5s) ease-in-out infinite; }
.mhs-motion-unit.mhs-motion--spin     { animation: mhs-spin     var(--motion-speed, 8s) linear infinite; }
.mhs-motion-unit.mhs-motion--zoom     { animation: mhs-zoom     var(--motion-speed, 5s) ease-in-out infinite; }
.mhs-motion-unit.mhs-motion--slide-in { animation: mhs-slide-in var(--motion-speed, 0.8s) ease-out forwards; }
.mhs-motion-unit.mhs-motion--shake    { animation: mhs-shake    var(--motion-speed, 5s) ease-in-out infinite; }
.mhs-motion-unit.mhs-motion--tilt     { transition: transform 0.15s ease-out; }
.mhs-motion-unit.mhs-motion--none     { animation: none; }

/* ── Overlay Cards ─────────────────────────────────────────────── */
.mhs-overlay-card {
  position: absolute;
  z-index: 10;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  backdrop-filter: blur(8px);
  animation: mhs-fade-up 0.6s ease-out 0.5s both;
}
.mhs-overlay--top-left      { top: 10%; left: 0; }
.mhs-overlay--top-right     { top: 10%; right: 0; }
.mhs-overlay--bottom-left   { bottom: 10%; left: 0; }
.mhs-overlay--bottom-right  { bottom: 10%; right: 0; }
.mhs-overlay--center-right  { top: 50%; right: 0; transform: translateY(-50%); }
.mhs-overlay--center-left   { top: 50%; left: 0; transform: translateY(-50%); }

.mhs-overlay-icon { font-size: 22px; flex-shrink: 0; }
.mhs-overlay-text { display: flex; flex-direction: column; line-height: 1.3; }
.mhs-overlay-text strong { font-size: 13px; font-weight: 700; }
.mhs-overlay-text span    { font-size: 11px; opacity: 0.7; }

/* ── Navigation Arrows ─────────────────────────────────────────── */
.mhs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  color: #111;
}
.mhs-arrow:hover {
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-50%) scale(1.05);
}
.mhs-arrow svg { width: 20px; height: 20px; }
.mhs-arrow--prev { left: 16px; }
.mhs-arrow--next { right: 16px; }

/* Flip arrows for RTL sliders */
[dir="rtl"] .mhs-arrow--prev { left: auto; right: 16px; }
[dir="rtl"] .mhs-arrow--next { right: auto; left: 16px; }

/* ── Dot Indicators ────────────────────────────────────────────── */
.mhs-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}
.mhs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s;
}
.mhs-dot--active {
  background: #111;
  width: 24px;
  border-radius: 4px;
}

/* ── RTL-specific overrides ────────────────────────────────────── */
.mhs-slide--rtl .mhs-col--content { text-align: right; }
.mhs-slide--rtl .mhs-hero-tag     { direction: rtl; }
.mhs-slide--rtl .mhs-stats        { justify-content: flex-end; }
.mhs-slide--rtl .mhs-btn-group    { direction: rtl; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mhs-slide-inner {
    flex-direction: column !important;
    padding: 40px 20px 60px;
    gap: 30px;
  }
  .mhs-col--content,
  .mhs-col--image {
    flex: 0 0 100% !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .mhs-slide--rtl .mhs-col--content { text-align: center; }
  .mhs-stats, .mhs-btn-group { justify-content: center; }
  .mhs-subtext { max-width: 100%; }
  .mhs-ring--outer { width: 280px; height: 280px; }
  .mhs-ring--inner { width: 210px; height: 210px; }
  .mhs-product-img { max-height: 300px; }
}

@media (max-width: 480px) {
  .mhs-heading { font-size: clamp(22px, 7vw, 36px); }
  .mhs-btn { padding: 12px 20px; font-size: 14px; }
  .mhs-stat strong { font-size: 22px; }
  .mhs-arrow { width: 36px; height: 36px; }
  .mhs-arrow svg { width: 16px; height: 16px; }
}

/* ── Additional overlay positions ─────────────────────────────── */
.mhs-overlay--center-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
/* XY positioned overlays use inline style left/top set by template */
.mhs-overlay--xy {
    position: absolute;
    /* left and top set inline */
}

/* ── Transition effects ────────────────────────────────────────── */

/* Fade / Blur */
.mhs-trans--fade .mhs-slide,
.mhs-trans--blur .mhs-slide {
  position: absolute; top: 0; left: 0;
  opacity: 0; transition: opacity 0.6s ease; pointer-events: none;
}
.mhs-trans--fade .mhs-slide--active,
.mhs-trans--blur .mhs-slide--active { opacity: 1; position: relative; pointer-events: auto; }
.mhs-trans--blur .mhs-slide--leaving { filter: blur(8px); opacity: 0; }
.mhs-trans--blur .mhs-slide--entering { filter: blur(8px) }
.mhs-trans--blur .mhs-slide--active   { filter: blur(0); transition: opacity 0.6s ease, filter 0.6s ease; }

/* Slide Up/Down */
.mhs-trans--slide-up .mhs-slides-track,
.mhs-trans--slide-down .mhs-slides-track { display: block; position: relative; }
.mhs-trans--slide-up .mhs-slide,
.mhs-trans--slide-down .mhs-slide {
  position: absolute; top: 0; left: 0;
  opacity: 0; pointer-events: none;
}
.mhs-trans--slide-up .mhs-slide--active,
.mhs-trans--slide-down .mhs-slide--active { position: relative; opacity: 1; pointer-events: auto; }
.mhs-trans-slide-up--in    { animation: mhs-slide-up-in    0.6s ease forwards; }
.mhs-trans-slide-up--out   { animation: mhs-slide-up-out   0.6s ease forwards; }
.mhs-trans-slide-down--in  { animation: mhs-slide-down-in  0.6s ease forwards; }
.mhs-trans-slide-down--out { animation: mhs-slide-down-out 0.6s ease forwards; }
@keyframes mhs-slide-up-in    { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes mhs-slide-up-out   { from { transform: translateY(0);    opacity: 1; } to { transform: translateY(-40px); opacity: 0; } }
@keyframes mhs-slide-down-in  { from { transform: translateY(-40px);opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes mhs-slide-down-out { from { transform: translateY(0);    opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

/* Zoom, Flip, Cube, Cards — handled inline via JS */
.mhs-trans--zoom-in  .mhs-slides-track,
.mhs-trans--zoom-out .mhs-slides-track,
.mhs-trans--flip-h   .mhs-slides-track,
.mhs-trans--flip-v   .mhs-slides-track,
.mhs-trans--cube     .mhs-slides-track,
.mhs-trans--cards    .mhs-slides-track { display: block; position: relative; overflow: hidden; }
.mhs-trans--zoom-in  .mhs-slide,
.mhs-trans--zoom-out .mhs-slide,
.mhs-trans--flip-h   .mhs-slide,
.mhs-trans--flip-v   .mhs-slide,
.mhs-trans--cube     .mhs-slide,
.mhs-trans--cards    .mhs-slide {
  position: absolute; top: 0; left: 0;
  opacity: 0; pointer-events: none;
  backface-visibility: hidden;
}
.mhs-trans--zoom-in  .mhs-slide--active,
.mhs-trans--zoom-out .mhs-slide--active,
.mhs-trans--flip-h   .mhs-slide--active,
.mhs-trans--flip-v   .mhs-slide--active,
.mhs-trans--cube     .mhs-slide--active,
.mhs-trans--cards    .mhs-slide--active {
  position: relative; opacity: 1; pointer-events: auto;
}
