/*
 * Fitness Star × Active — Salla CSS Enhancements
 * الصق الملف بعد CSS القالب الأساسي.
 * عدّل متغيرات الألوان فقط إن رغبت بتغيير الهوية.
 */

:root {
  --color-primary: #ff4e08 !important;
  --color-primary-dark: #d93d00 !important;
  --color-primary-light: #ffede5 !important;
  --color-primary-reverse: #ffffff !important;

  --ae-navy: #07162b;
  --ae-navy-2: #0d2341;
  --ae-orange: #ff4e08;
  --ae-orange-hover: #ff6b18;
  --ae-ink: #101828;
  --ae-muted: #667085;
  --ae-soft: #f5f7f9;
  --ae-line: #e7eaf0;
  --ae-white: #ffffff;
  --ae-radius-sm: 10px;
  --ae-radius: 16px;
  --ae-radius-lg: 24px;
  --ae-shadow-sm: 0 8px 24px rgba(7, 22, 43, 0.07);
  --ae-shadow: 0 20px 55px rgba(7, 22, 43, 0.13);
  --ae-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}
body {
  color: var(--ae-ink);
  background: var(--ae-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--ae-white);
  background: var(--ae-orange);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(255, 78, 8, 0.26) !important;
  outline-offset: 3px;
}

/* الشريط العلوي */
:where(.top-navbar, .top-bar, .header-top, .announcement-bar) {
  color: var(--ae-white) !important;
  background: linear-gradient(
    100deg,
    #d93d00,
    var(--ae-orange) 52%,
    #ff7132
  ) !important;
  border: 0 !important;
  position: relative;
  overflow: hidden;
}

:where(.top-navbar, .top-bar, .header-top, .announcement-bar)::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 22%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transform: skewX(-20deg);
  animation: ae-announcement-shine 7s ease-in-out infinite;
  pointer-events: none;
}

:where(.top-navbar, .top-bar, .header-top, .announcement-bar) a,
:where(.top-navbar, .top-bar, .header-top, .announcement-bar) svg {
  color: inherit !important;
}

/* الهيدر والقائمة */
:where(.main-nav-container, header.store-header, #mainnav, .site-header) {
  color: var(--ae-white) !important;
  background: rgba(7, 22, 43, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.ae-header-scrolled
  :where(.main-nav-container, header.store-header, #mainnav, .site-header),
:where(
  .main-nav-container,
  header.store-header,
  #mainnav,
  .site-header
).ae-header-scrolled {
  background: rgba(7, 22, 43, 0.92) !important;
  box-shadow: 0 14px 40px rgba(7, 22, 43, 0.18) !important;
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

:where(.main-nav-container, header.store-header, #mainnav)
  :where(a, button, .s-user-menu-trigger) {
  color: var(--ae-white);
}

:where(.main-nav-container, header.store-header, #mainnav)
  :where(a, button):hover {
  color: var(--ae-orange) !important;
}

:where(.main-menu, .main-menu ul) > li > a {
  position: relative;
  transition: color 0.22s ease;
}

:where(.main-menu, .main-menu ul) > li > a::after {
  content: "";
  position: absolute;
  right: 50%;
  left: 50%;
  bottom: 2px;
  height: 2px;
  border-radius: 9px;
  background: var(--ae-orange);
  transition:
    right 0.25s var(--ae-ease),
    left 0.25s var(--ae-ease);
}

:where(.main-menu, .main-menu ul) > li > a:hover::after,
:where(.main-menu, .main-menu ul) > li.active > a::after {
  right: 12%;
  left: 12%;
}

:where(salla-cart-summary, .s-cart-summary-wrapper) {
  --color-primary: var(--ae-orange);
}

:where(.s-cart-summary-count, .cart-count) {
  color: var(--ae-white) !important;
  background: var(--ae-orange) !important;
  box-shadow: 0 0 0 3px rgba(255, 78, 8, 0.17);
}

.ae-cart-pulse {
  animation: ae-cart-pulse 0.55s var(--ae-ease);
}

/* البنر الرئيسي */
:where(.home-slider, .main-slider, .hero-slider, .s-block--hero) {
  position: relative;
  overflow: hidden;
  background: var(--ae-navy);
}

:where(.home-slider, .main-slider, .hero-slider)
  :where(.swiper-slide, .splide__slide) {
  overflow: hidden;
}

:where(.home-slider, .main-slider, .hero-slider) img {
  transition:
    transform 1.2s var(--ae-ease),
    filter 0.5s ease;
}

:where(.home-slider, .main-slider, .hero-slider)
  :where(.swiper-slide-active, .is-active)
  img {
  transform: scale(1.035);
}

:where(.home-slider, .main-slider, .hero-slider)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(7, 22, 43, 0.08),
    rgba(7, 22, 43, 0.58)
  );
  pointer-events: none;
}

:where(.home-slider, .main-slider, .hero-slider)
  :where(.swiper-pagination-bullet, .splide__pagination__page) {
  width: 9px;
  height: 9px;
  border-radius: 9px;
  opacity: 0.65;
  background: var(--ae-white);
  transition:
    width 0.25s ease,
    opacity 0.25s ease,
    background 0.25s ease;
}

:where(.home-slider, .main-slider, .hero-slider)
  :where(.swiper-pagination-bullet-active, .is-active) {
  width: 28px;
  opacity: 1;
  background: var(--ae-orange) !important;
}

/* العناوين */
:where(.s-slider-block__title, .section-title, .s-block__title, section h2) {
  color: var(--ae-navy);
  letter-spacing: -0.02em;
}

:where(.s-slider-block__title, .section-title, .s-block__title) {
  position: relative;
}

:where(.s-slider-block__title, .section-title, .s-block__title)::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 3px;
  margin-inline-end: 10px;
  border-radius: 9px;
  vertical-align: middle;
  background: var(--ae-orange);
}

/* بطاقات الأقسام والبنرات */
:where(
  .category-card,
  .banner-entry,
  .s-block--categories .swiper-slide > a,
  .s-block--banners a
) {
  position: relative;
  overflow: hidden;
  border-radius: var(--ae-radius) !important;
  box-shadow: var(--ae-shadow-sm);
  isolation: isolate;
  transition:
    transform 0.35s var(--ae-ease),
    box-shadow 0.35s ease;
}

:where(
  .category-card,
  .banner-entry,
  .s-block--categories .swiper-slide > a,
  .s-block--banners a
)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 35%, rgba(7, 22, 43, 0.74));
  pointer-events: none;
}

:where(
    .category-card,
    .banner-entry,
    .s-block--categories .swiper-slide > a,
    .s-block--banners a
  )
  img {
  width: 100%;
  transition:
    transform 0.55s var(--ae-ease),
    filter 0.35s ease;
}

:where(
  .category-card,
  .banner-entry,
  .s-block--categories .swiper-slide > a,
  .s-block--banners a
):hover {
  transform: translateY(-6px);
  box-shadow: var(--ae-shadow);
}

:where(
    .category-card,
    .banner-entry,
    .s-block--categories .swiper-slide > a,
    .s-block--banners a
  ):hover
  img {
  transform: scale(1.06);
  filter: saturate(1.06) contrast(1.03);
}

/* بطاقات المنتجات — يدعم مكوّن Twilight الرسمي */
salla-product-card {
  display: block;
  height: 100%;
}

:where(.s-product-card-entry, .product-entry, .product-card) {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--ae-line) !important;
  border-radius: var(--ae-radius) !important;
  background: var(--ae-white) !important;
  box-shadow: 0 4px 18px rgba(7, 22, 43, 0.045) !important;
  transition:
    transform 0.35s var(--ae-ease),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

:where(.s-product-card-entry, .product-entry, .product-card):hover {
  transform: translateY(-8px);
  border-color: rgba(255, 78, 8, 0.22) !important;
  box-shadow: var(--ae-shadow) !important;
}

:where(.s-product-card-image, .product-entry__image, .product-card__image) {
  overflow: hidden;
  background: linear-gradient(145deg, #f8f9fb, #eef1f4) !important;
}

:where(
  .s-product-card-image img,
  .product-entry__image img,
  .product-card__image img
) {
  mix-blend-mode: multiply;
  transition:
    transform 0.55s var(--ae-ease),
    filter 0.35s ease;
}

:where(.s-product-card-entry, .product-entry, .product-card):hover
  :where(
    .s-product-card-image img,
    .product-entry__image img,
    .product-card__image img
  ) {
  transform: scale(1.055);
  filter: saturate(1.04);
}

:where(
  .s-product-card-content,
  .product-entry__content,
  .product-card__content
) {
  padding: 17px !important;
}

:where(.s-product-card-name, .product-entry__title, .product-card__title) {
  color: var(--ae-navy) !important;
  font-weight: 700 !important;
  line-height: 1.65;
  transition: color 0.2s ease;
}

:where(
  .s-product-card-name,
  .product-entry__title,
  .product-card__title
):hover {
  color: var(--ae-orange) !important;
}

:where(.s-product-card-price, .product-entry__price, .product-card__price) {
  color: var(--ae-navy) !important;
  font-weight: 800 !important;
}

:where(.s-product-card-sale-price, .sale-price, .product-card__sale-price) {
  color: var(--ae-orange) !important;
}

:where(.s-product-card-promotion-title, .product-badge, .badge--sale) {
  color: var(--ae-white) !important;
  background: var(--ae-orange) !important;
  border-radius: 7px !important;
  box-shadow: 0 7px 18px rgba(255, 78, 8, 0.22);
}

:where(.s-product-card-wishlist-btn, .btn--wishlist, .product-card__wishlist) {
  border-radius: 50% !important;
  color: var(--ae-navy) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: var(--ae-shadow-sm);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

:where(
  .s-product-card-wishlist-btn,
  .btn--wishlist,
  .product-card__wishlist
):hover,
:where(
  .s-product-card-wishlist-btn,
  .btn--wishlist,
  .product-card__wishlist
).is-added {
  color: var(--ae-white) !important;
  background: var(--ae-orange) !important;
  transform: scale(1.08);
}

/* الأزرار */
:where(
  .s-button-primary,
  .s-product-card-add-btn,
  .btn--primary,
  button[type="submit"]
):not(.swiper-pagination-bullet) {
  position: relative;
  overflow: hidden;
  border-color: var(--ae-orange) !important;
  border-radius: var(--ae-radius-sm) !important;
  color: var(--ae-white) !important;
  background: linear-gradient(110deg, #e94303, var(--ae-orange)) !important;
  box-shadow: 0 10px 24px rgba(255, 78, 8, 0.19);
  transition:
    transform 0.22s var(--ae-ease),
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

:where(
    .s-button-primary,
    .s-product-card-add-btn,
    .btn--primary,
    button[type="submit"]
  ):not(.swiper-pagination-bullet):hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 78, 8, 0.28);
  filter: brightness(1.05);
}

:where(
    .s-button-primary,
    .s-product-card-add-btn,
    .btn--primary,
    button[type="submit"]
  ):not(.swiper-pagination-bullet):active {
  transform: translateY(0) scale(0.985);
}

.ae-ripple {
  position: absolute;
  z-index: 5;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ae-ripple 0.62s ease-out forwards;
}

/* النماذج والبحث */
:where(input, select, textarea, .s-search-input) {
  border-color: var(--ae-line) !important;
  border-radius: var(--ae-radius-sm) !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

:where(input, select, textarea, .s-search-input):focus {
  border-color: var(--ae-orange) !important;
  box-shadow: 0 0 0 4px rgba(255, 78, 8, 0.09) !important;
}

:where(
  .s-slider-prev,
  .s-slider-next,
  .swiper-button-prev,
  .swiper-button-next
) {
  color: var(--ae-navy) !important;
  background: var(--ae-white) !important;
  border: 1px solid var(--ae-line) !important;
  box-shadow: var(--ae-shadow-sm);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

:where(
  .s-slider-prev,
  .s-slider-next,
  .swiper-button-prev,
  .swiper-button-next
):hover {
  color: var(--ae-white) !important;
  background: var(--ae-orange) !important;
  transform: scale(1.06);
}

/* الفوتر */
:where(.store-footer, footer.footer, .site-footer) {
  color: rgba(255, 255, 255, 0.68) !important;
  background: linear-gradient(140deg, #040b15, var(--ae-navy) 72%) !important;
  border: 0 !important;
}

:where(.store-footer, footer.footer, .site-footer) :where(h2, h3, h4, strong) {
  color: var(--ae-white) !important;
}

:where(.store-footer, footer.footer, .site-footer) a {
  color: rgba(255, 255, 255, 0.68) !important;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

:where(.store-footer, footer.footer, .site-footer) a:hover {
  color: var(--ae-orange) !important;
}

/* حركة الظهور التي يفعّلها ملف JavaScript */
.ae-reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 0.72s var(--ae-ease) var(--ae-delay, 0ms),
    transform 0.72s var(--ae-ease) var(--ae-delay, 0ms);
  will-change: opacity, transform;
}

.ae-reveal.ae-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.ae-back-to-top {
  position: fixed;
  z-index: 90;
  left: 18px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ae-white);
  background: var(--ae-orange);
  box-shadow: 0 12px 28px rgba(255, 78, 8, 0.3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s var(--ae-ease),
    background 0.2s ease;
}

.ae-back-to-top::before {
  content: "↑";
  font-size: 21px;
  line-height: 1;
}
.ae-back-to-top.ae-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.ae-back-to-top:hover {
  background: var(--ae-navy);
  transform: translateY(-3px);
}

@keyframes ae-announcement-shine {
  0%,
  58% {
    left: -35%;
  }
  78%,
  100% {
    left: 120%;
  }
}

@keyframes ae-ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes ae-cart-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18);
  }
}

@media (max-width: 767px) {
  :root {
    --ae-radius: 13px;
    --ae-radius-lg: 18px;
  }

  :where(.main-nav-container, header.store-header, #mainnav, .site-header) {
    background: var(--ae-navy) !important;
  }

  :where(.home-slider, .main-slider, .hero-slider)::after {
    background: linear-gradient(
      180deg,
      rgba(7, 22, 43, 0.04),
      rgba(7, 22, 43, 0.64)
    );
  }

  :where(
    .s-product-card-content,
    .product-entry__content,
    .product-card__content
  ) {
    padding: 13px !important;
  }

  :where(.s-product-card-entry, .product-entry, .product-card):hover,
  :where(
    .category-card,
    .banner-entry,
    .s-block--categories .swiper-slide > a,
    .s-block--banners a
  ):hover {
    transform: translateY(-3px);
  }

  .ae-back-to-top {
    left: 12px;
    bottom: 78px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ae-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}