/* ============================================================
   FYONA — Experience Layer v1
   شاشة افتتاحية + إعادة ترتيب الصفحة + شارات النوع + زر السلة
   طبقة مستقلة فوق تصميم المتجر، لا تعدّل منطق السلة أو الدفع.
   ============================================================ */

:root {
  --fy-experience-gold: #d9b77a;
  --fy-experience-gold-light: #f1dfbd;
  --fy-experience-wine: #2b0609;
  --fy-experience-wine-2: #3a080b;
  --fy-experience-ease-out: cubic-bezier(.16, 1, .3, 1);
  --fy-experience-ease-in-out: cubic-bezier(.76, 0, .24, 1);
}

/* ---------- أدوات إتاحة ---------- */
.fyona-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ============================================================
   1) الشاشة الافتتاحية
   ============================================================ */

html.fyona-intro-lock,
html.fyona-intro-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

html.fyona-skip-intro #fyonaIntro {
  display: none !important;
}

.fyona-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 34%, #4b0e14 0%, #34080c 44%, #1b0406 100%);
  color: var(--fy-experience-gold-light);
  transition:
    transform .78s var(--fy-experience-ease-in-out),
    opacity .55s ease;
  will-change: transform;
  /* شبكة أمان: إن تعطّل الجافاسكربت لا تحجب الموقع للأبد */
  animation: fyonaIntroFallback .4s 7s forwards;
}

.fyona-intro::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 30% at 50% 40%, rgba(217, 183, 122, .18), transparent 72%),
    radial-gradient(60% 40% at 15% 85%, rgba(120, 26, 38, .45), transparent 70%),
    radial-gradient(55% 40% at 85% 12%, rgba(90, 18, 28, .5), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.fyona-intro__frame {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(217, 183, 122, .22);
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
}

.fyona-intro__frame::before,
.fyona-intro__frame::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  border-color: rgba(241, 223, 189, .55);
  border-style: solid;
}

.fyona-intro__frame::before {
  top: -1px;
  right: -1px;
  border-width: 1px 1px 0 0;
}

.fyona-intro__frame::after {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 1px 1px;
}

.fyona-intro__glow {
  position: absolute;
  width: min(78vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 183, 122, .16) 0%, rgba(217, 183, 122, .04) 42%, transparent 66%);
  filter: blur(10px);
  opacity: 0;
  animation: fyonaIntroGlow 1800ms var(--fy-experience-ease-out) 120ms both;
  z-index: 0;
}

.fyona-intro__stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  transition: opacity .5s ease, transform .6s var(--fy-experience-ease-out);
}

.fyona-intro__markwrap {
  position: relative;
  width: min(52vw, 232px);
  aspect-ratio: 665 / 557;
  display: grid;
  place-items: center;
}

.fyona-intro__mark {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  animation: fyonaIntroMark 1150ms var(--fy-experience-ease-out) 140ms both;
}

.fyona-intro__shimmer {
  display: none;
}

.fyona-intro__word {
  margin: 6px 0 0;
  padding-inline-start: .34em;
  font-family: "Cormorant Garamond", "Cormorant", Georgia, serif;
  font-weight: 500;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1;
  letter-spacing: .34em;
  color: var(--fy-experience-gold-light);
  text-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  animation: fyonaIntroWord 900ms var(--fy-experience-ease-out) 520ms both;
}

.fyona-intro__rule {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 183, 122, .95), transparent);
  animation: fyonaIntroRule 900ms var(--fy-experience-ease-in-out) 820ms forwards;
}

.fyona-intro__tag {
  margin: 0;
  font-family: "Amiri", "Cairo", sans-serif;
  font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: .34em;
  color: rgba(241, 223, 189, .72);
  opacity: 0;
  animation: fyonaIntroTag 700ms ease 980ms both;
}

.fyona-intro__skip {
  position: absolute;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(217, 183, 122, .42);
  background: rgba(0, 0, 0, .18);
  color: #e9d6ae;
  font-family: "Cairo", sans-serif;
  font-size: 12px;
  letter-spacing: .14em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: fyonaIntroSkip 500ms ease 1000ms both;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
  z-index: 4;
}

.fyona-intro__skip:hover {
  background: rgba(217, 183, 122, .16);
  border-color: rgba(241, 223, 189, .7);
  color: #fff6e6;
}

.fyona-intro__skip:focus-visible {
  outline: 2px solid var(--fy-experience-gold-light);
  outline-offset: 3px;
}

.fyona-intro.is-leaving {
  transform: translateY(-101%);
}

.fyona-intro.is-leaving .fyona-intro__stage {
  opacity: 0;
  transform: translateY(-12px) scale(1.025);
}

@keyframes fyonaIntroMark {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(.955);
    clip-path: inset(0 0 100% 0);
  }
  58% { opacity: 1; }
  100% {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes fyonaIntroWord {
  0% {
    opacity: 0;
    letter-spacing: .86em;
    filter: blur(7px);
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    letter-spacing: .34em;
    filter: blur(0);
    transform: none;
  }
}

@keyframes fyonaIntroRule {
  from { width: 0; opacity: 0; }
  to { width: min(240px, 56vw); opacity: 1; }
}

@keyframes fyonaIntroTag {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes fyonaIntroSkip {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fyonaIntroGlow {
  0% { opacity: 0; transform: scale(.92); }
  60% { opacity: 1; }
  100% { opacity: .75; transform: scale(1); }
}

@keyframes fyonaIntroFallback {
  to { opacity: 0; visibility: hidden; }
}

/* ============================================================
   2) إزالة الهيرو وترتيب الصفحة
   ============================================================ */

/* الهيرو يُحذف بالكامل — الشبكة تأخذ مكانه أعلى الصفحة */
.home-page .hero-section {
  display: none !important;
}

.home-page .products-section {
  padding-top: 30px !important;
}

.home-page .fyona-catalogue-section {
  margin-top: 0 !important;
  padding-top: 4px !important;
}

/* فاصل أنيق قبل قسم المروحة (الذي أصبح أسفل الشبكة) */
.home-page .products-section > .section-container > .section-header {
  position: relative;
  margin-top: 58px !important;
}

.home-page .products-section > .section-container > .section-header::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 72%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 183, 122, .38), transparent);
}

/* ============================================================
   3) فلتر النوع — مخفي بالكامل (بناءً على طلب إزالة الفلترة)
   ============================================================ */

.home-page .gender-filter-horizontal,
.home-page .fyona-catalogue-heading .gender-filter-horizontal {
  display: none !important;
}

/* ============================================================
   4) شارة النوع (مثلث الزاوية)
   ============================================================ */

.fyona-gender-flag {
  position: absolute;
  top: 0;
  left: 0;
  width: 92px;
  height: 92px;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px 0 0 14px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background: linear-gradient(135deg, #16232b 0%, #223b49 55%, #2b4f60 100%);
  color: #f0d9ad;
  font-family: "Cairo", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .05em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.fyona-gender-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent calc(50% - 1px), rgba(217, 183, 122, .55) 50%, transparent calc(50% + 1px));
}

.perfume-card-wrapper.women-category .fyona-gender-flag {
  background: linear-gradient(135deg, #450d1c 0%, #6d1a2c 55%, #8d2638 100%);
  color: #ffe6d2;
}

/* ============================================================
   5) زر «أضف إلى السلة»
   ============================================================ */

.home-page .perfume-card .buy-btn {
  min-height: 46px;
  border-radius: 6px !important;
  background: linear-gradient(135deg, #4a0d12, #2b0609) !important;
  border: 1px solid rgba(217, 183, 122, .5) !important;
  color: #f5cc86 !important;
  font-family: "Cairo", sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background .24s ease, box-shadow .24s ease, border-color .24s ease, transform .16s ease;
}

.home-page .perfume-card .buy-btn .btn-arrow {
  font-size: 15px;
  line-height: 1;
  color: var(--fy-experience-gold-light);
  opacity: .9;
}

.home-page .perfume-card .buy-btn:hover {
  background: linear-gradient(135deg, #6a171e, #3a080b) !important;
  border-color: rgba(241, 223, 189, .8) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}

.home-page .perfume-card .buy-btn:active {
  transform: scale(.985);
}

.home-page .perfume-card .buy-btn:focus-visible {
  outline: 2px solid var(--fy-experience-gold-light);
  outline-offset: 2px;
}

.home-page .perfume-card .buy-btn.is-added {
  background: linear-gradient(135deg, #1e6b52, #124a39) !important;
  border-color: rgba(120, 220, 180, .65) !important;
  color: #eafff5 !important;
  box-shadow: 0 10px 26px rgba(30, 107, 82, .35);
}

.home-page .perfume-card .buy-btn.fyona-soldout {
  background: linear-gradient(135deg, #4a4440, #2c2825) !important;
  border-color: rgba(217, 183, 122, .22) !important;
  color: #c9bda9 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

/* إخفاء وميض نافذة المنتج أثناء الإضافة السريعة */
html.fyona-quick-add .perfume-detail-modal,
html.fyona-quick-add .perfume-detail-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

/* حجب السلة لحظة الإضافة حتى تكتمل رحلة الصورة */
html.fyona-cart-hold .cart-overlay,
html.fyona-cart-hold .cart-modal {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  animation: none !important;
  transition: none !important;
}

/* الصورة التي تطير إلى أيقونة السلة */
.cart-button { position: relative; }
.cart-item { position: relative; }

.fyona-fly-clone {
  position: fixed;
  z-index: 100000;
  object-fit: contain;
  pointer-events: none;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(58, 8, 11, .92), rgba(20, 3, 5, .96));
  box-shadow: 0 22px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(217, 183, 122, .4);
  will-change: transform, opacity;
}

/* نبض أيقونة السلة عند وصول الصورة */
.fyona-cart-bump .cart-icon {
  display: inline-block;
  animation: fyonaCartBump .62s cubic-bezier(.34, 1.56, .64, 1) both;
}

.fyona-cart-bump .cart-badge {
  animation: fyonaBadgePulse .72s ease-out both;
}

.fyona-cart-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #f1dfbd;
  pointer-events: none;
  animation: fyonaRipple .72s ease-out forwards;
}

@keyframes fyonaCartBump {
  0% { transform: scale(1); }
  28% { transform: scale(1.24); }
  58% { transform: scale(.92); }
  100% { transform: scale(1); }
}

@keyframes fyonaBadgePulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 183, 122, .85); }
  100% { box-shadow: 0 0 0 16px rgba(217, 183, 122, 0); }
}

@keyframes fyonaRipple {
  from { opacity: .95; transform: scale(.55); }
  to { opacity: 0; transform: scale(3.4); }
}

/* ظهور السلة بعد وصول الصورة */
html.fyona-cart-enter .cart-overlay {
  animation: fyonaCartOverlay .34s ease-out both !important;
}

html.fyona-cart-enter .cart-modal {
  animation: fyonaCartPanel .52s cubic-bezier(.16, 1, .3, 1) both !important;
}

html.fyona-cart-enter .cart-item {
  animation: fyonaCartItemIn .48s cubic-bezier(.16, 1, .3, 1) both !important;
}

html.fyona-cart-enter .cart-item:nth-child(2) { animation-delay: .05s; }
html.fyona-cart-enter .cart-item:nth-child(3) { animation-delay: .1s; }
html.fyona-cart-enter .cart-item:nth-child(4) { animation-delay: .15s; }
html.fyona-cart-enter .cart-item:nth-child(5) { animation-delay: .2s; }

@keyframes fyonaCartOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fyonaCartPanel {
  from { opacity: 0; transform: translateY(26px) scale(.975); }
  to { opacity: 1; transform: none; }
}

@keyframes fyonaCartItemIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* تمييز العطر المُضاف للتو */
.fyona-added-chip {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e6b52, #124a39);
  color: #eafff5;
  font-family: "Cairo", sans-serif;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  animation: fyonaChipIn .42s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes fyonaChipIn {
  from { opacity: 0; transform: translateY(4px) scale(.85); }
  to { opacity: 1; transform: none; }
}

.cart-item.fyona-new-item {
  border-color: rgba(217, 183, 122, .75) !important;
  box-shadow: 0 0 0 1px rgba(217, 183, 122, .35), 0 10px 24px rgba(0, 0, 0, .28);
  animation: fyonaNewItemPulse 1.05s ease-out 2;
}

@keyframes fyonaNewItemPulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 183, 122, .7), 0 10px 24px rgba(0, 0, 0, .28); }
  70% { box-shadow: 0 0 0 14px rgba(217, 183, 122, 0), 0 10px 24px rgba(0, 0, 0, .28); }
  100% { box-shadow: 0 0 0 0 rgba(217, 183, 122, 0), 0 10px 24px rgba(0, 0, 0, .28); }
}

/* حالة النفاد داخل صفحة المنتج */
.perfume-detail-modal .add-to-cart-btn-large.fyona-soldout,
.perfume-detail-modal .add-to-cart-btn-large:disabled {
  background: linear-gradient(135deg, #4a4440, #2c2825) !important;
  color: #c9bda9 !important;
  border-color: rgba(217, 183, 122, .22) !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* ============================================================
   6) ظهور الشبكة بعد الافتتاحية
   ============================================================ */

@keyframes fyonaCardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper {
  animation: fyonaCardIn .62s var(--fy-experience-ease-out) both;
}

html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(1) { animation-delay: .02s; }
html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(2) { animation-delay: .07s; }
html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(3) { animation-delay: .12s; }
html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(4) { animation-delay: .17s; }
html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(5) { animation-delay: .22s; }
html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper:nth-child(6) { animation-delay: .27s; }

/* ============================================================
   7) صفحة المنتج: مبدّل العملة الفوري
   ============================================================ */

.fyona-currency-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 183, 122, .28);
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
}

.fyona-currency-label {
  font-family: "Cairo", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #e7d6b6;
}

.fyona-currency-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fyona-currency-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(217, 183, 122, .3);
  background: rgba(255, 255, 255, .04);
  color: #e7d6b6;
  font-family: "Cairo", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .16s ease;
}

.fyona-currency-chip:hover {
  background: rgba(217, 183, 122, .14);
  border-color: rgba(217, 183, 122, .55);
  transform: translateY(-1px);
}

.fyona-currency-chip.active {
  background: linear-gradient(135deg, #d9b77a, #f1dfbd);
  border-color: transparent;
  color: #2b0609;
  box-shadow: 0 6px 18px rgba(217, 183, 122, .24);
}

.fyona-currency-chip:focus-visible {
  outline: 2px solid #f1dfbd;
  outline-offset: 2px;
}

/* ============================================================
   8) صفحة المنتج (النافذة) على الجوال
   ============================================================ */

@media (max-width: 720px) {
  .perfume-detail-modal .add-to-cart-btn-large {
    position: sticky;
    bottom: 10px;
    z-index: 6;
  }

  .fyona-currency-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .fyona-currency-chips {
    width: 100%;
  }

  .fyona-currency-chip {
    flex: 1;
    min-height: 40px;
  }

  .fyona-gender-flag {
    width: 74px;
    height: 74px;
    font-size: 9px;
    padding: 9px 0 0 10px;
  }

  .home-page .fyona-catalogue-heading .gender-filter-horizontal {
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .home-page .gender-btn-horizontal {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 40px;
    padding: 0 14px !important;
    font-size: 12px !important;
  }

  .perfume-detail-modal .add-to-cart-btn-large {
    box-shadow: 0 -14px 26px rgba(43, 6, 9, .92);
  }

  .fyona-intro__frame {
    inset: 10px;
  }

  .fyona-intro__word {
    letter-spacing: .28em;
    padding-inline-start: .28em;
  }
}

/* ============================================================
   8) احترام تقليل الحركة
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .fyona-intro,
  .fyona-intro * {
    animation: none !important;
    transition: none !important;
  }

  .fyona-intro__mark,
  .fyona-intro__word,
  .fyona-intro__tag,
  .fyona-intro__skip {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
  }

  .fyona-intro__shimmer {
    display: none !important;
  }

  .fyona-intro.is-leaving {
    transform: none;
    opacity: 0;
  }

  html.fyona-grid-in .fyona-products-catalogue .perfume-card-wrapper {
    animation: none !important;
  }

  .home-page .gender-btn-horizontal,
  .home-page .perfume-card .buy-btn,
  .fyona-currency-chip {
    transition: none !important;
  }
}