/* =========================================
   الأساسيات والمتغيرات (Shared Variables & Reset)
========================================= */
:root {
   --primary: #ffad5a;
   --primary-rgb: 255, 173, 90;
   --accent: #7de8ff;
   --accent-rgb: 125, 232, 255;
   --glass-bg: rgba(14, 12, 16, 0.88);
   --glass-border: rgba(255, 189, 125, 0.24);
   --gold: #ffd56b;
    --danger: #ff5252;
   --success: #9af7c0;
   --fixed-top-height: clamp(94px, 11vw, 104px);
   --page-gutter: clamp(12px, 4vw, 40px);
   --header-icon-size: clamp(40px, 4.7vw, 48px);
   --header-avatar-size: clamp(34px, 4.2vw, 40px);
   --header-icon-font: clamp(1.08rem, 2.25vw, 1.4rem);
   --header-gap: clamp(8px, 1.6vw, 15px);
   --floating-offset: clamp(14px, 3.2vw, 30px);
   --floating-bottom: clamp(24px, 7vw, 60px);
   --floating-size: clamp(56px, 8vw, 70px);
   --layer-scroll-safe-bottom: calc((var(--floating-size) * 3) + env(safe-area-inset-bottom, 0px) + 42px);
}

   body[data-theme="warm-dark"] {
      --primary: #ff9f46;
      --primary-rgb: 255, 159, 70;
      --accent: #67dfff;
      --accent-rgb: 103, 223, 255;
      --glass-bg: rgba(10, 8, 12, 0.94);
      --glass-border: rgba(255, 174, 94, 0.22);
      --gold: #ffcc5f;
      --success: #8ef0b8;
   }

   body[data-theme="warm-balanced"] {
      --primary: #ffb86a;
      --primary-rgb: 255, 184, 106;
      --accent: #8deeff;
      --accent-rgb: 141, 238, 255;
      --glass-bg: rgba(17, 14, 15, 0.82);
      --glass-border: rgba(255, 203, 141, 0.28);
      --gold: #ffdc7f;
      --success: #adffd0;
   }

   body[data-theme="warm-light"] {
      --primary: #f4c95d;
      --primary-rgb: 244, 201, 93;
      --accent: #d99a3d;
      --accent-rgb: 217, 154, 61;
      --glass-bg: rgba(42, 33, 24, 0.66);
      --glass-border: rgba(244, 201, 93, 0.34);
      --gold: #f0c24e;
      --success: #d6f0cf;
   }

/* === Color Palettes - ألوان فقط بدون تغيير الخلفية === */
body[data-palette="teal"]   { --primary: #3fd6d2; --primary-rgb: 63, 214, 210; --accent: #ffc857; --accent-rgb: 255, 200, 87; --gold: #ffc857; --glass-border: rgba(63, 214, 210, 0.26); --glass-bg: rgba(6, 20, 22, 0.9); }
body[data-palette="rose"]   { --primary: #ff7eb6; --primary-rgb: 255, 126, 182; --accent: #c4a0ff; --accent-rgb: 196, 160, 255; --gold: #ffb347; --glass-border: rgba(255, 126, 182, 0.26); --glass-bg: rgba(28, 10, 20, 0.9); }
body[data-palette="white"]  { --primary: #f5f5f5; --primary-rgb: 245, 245, 245; --accent: #d6dbe3; --accent-rgb: 214, 219, 227; --gold: #ffffff; --glass-border: rgba(245, 245, 245, 0.3); --glass-bg: rgba(22, 22, 22, 0.9); }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
input, textarea, select { user-select: auto; }
body { color: #fff; overflow-x: hidden; background-color: #000; display: flex; flex-direction: column; min-height: 100svh; font-size: 0.9rem;}
/* Smooth palette transitions */
header, .announcement-bar, .btn, .header-btn, .section-title, .badge-new, .badge-gold, .logo-brand,
.glass-card, .item-card, .story-avatar, .review-star, .item-price, .item-vip-price { transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease; }
body.modal-open {
   overflow: hidden;
   touch-action: none;
}

/* =========================================
   الخلفيات (Backgrounds)
========================================= */
.bg-slide { position: fixed; inset: 0; top: 0; left: 0; width: 100vw; height: 100svh; min-height: 100svh; z-index: -3; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; }
.bg-slide.active { opacity: 1; }
.bg-overlay { position: fixed; inset: 0; top: 0; left: 0; width: 100vw; height: 100svh; min-height: 100svh; background: linear-gradient(135deg, rgba(7, 12, 22, 0.74) 0%, rgba(15, 30, 50, 0.68) 100%); z-index: -2; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
:root {
   --header-height: 64px;
   --announcement-height: 36px;
}

body[data-theme="warm-dark"] .bg-overlay { background: linear-gradient(135deg, rgba(6, 7, 10, 0.9) 0%, rgba(16, 14, 18, 0.84) 100%); }
body[data-theme="warm-balanced"] .bg-overlay { background: linear-gradient(135deg, rgba(16, 14, 14, 0.72) 0%, rgba(20, 24, 28, 0.66) 100%); }
body[data-theme="warm-light"] .bg-overlay { background: linear-gradient(135deg, rgba(36, 28, 20, 0.68) 0%, rgba(52, 38, 24, 0.62) 100%); }
body[data-palette="teal"] .bg-overlay { background: linear-gradient(135deg, rgba(4, 18, 20, 0.9) 0%, rgba(10, 28, 30, 0.84) 100%); }
body[data-palette="rose"] .bg-overlay { background: linear-gradient(135deg, rgba(30, 10, 22, 0.88) 0%, rgba(40, 14, 30, 0.82) 100%); }
body[data-palette="white"] .bg-overlay { background: linear-gradient(135deg, rgba(18, 18, 18, 0.9) 0%, rgba(34, 34, 34, 0.84) 100%); }

/* =========================================
   الهيدر وشريط الإعلانات (Header & Ticker)
========================================= */
.fixed-top-container { position: fixed; top: 0; left: 0; width: 100%; z-index: 3200; display: flex; flex-direction: column; transition: transform 0.3s ease, opacity 0.3s ease; }
.fixed-top-container.hidden-by-layer { transform: translateY(-120%); opacity: 0; pointer-events: none; }
.fixed-top-container,
.global-search-panel,
.app-layer,
.modal-box,
.trending-track {
   will-change: transform;
}
header { background: rgba(14, 12, 16, 0.66); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(var(--primary-rgb), 0.28); padding: 12px var(--page-gutter); min-height: 64px; display: flex; justify-content: space-between; align-items: center; position: relative; overflow: visible; }
body[data-theme="warm-dark"] header { background: rgba(10, 9, 12, 0.76); }
body[data-theme="warm-balanced"] header { background: rgba(18, 16, 15, 0.62); }
body[data-theme="warm-light"] header { background: rgba(40, 31, 22, 0.74); }
body[data-palette="teal"] header { background: rgba(6, 20, 22, 0.82); }
body[data-palette="rose"] header { background: rgba(28, 12, 22, 0.8); }
body[data-palette="white"] header { background: rgba(24, 24, 24, 0.82); }
.logo { font-size: 1.6rem; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 0 10px var(--primary); cursor: pointer; text-decoration: none; transition: 0.3s;}
.logo-brand {
   display: inline-block;
   background: linear-gradient(90deg, var(--gold) 0%, var(--primary) 42%, var(--accent) 100%);
   background-clip: text;
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.logo:hover { transform: scale(1.02); filter: brightness(1.08); }
.logo-img { height: clamp(30px, 4.4vw, 38px); width: auto; display: block; object-fit: contain; filter: drop-shadow(0 0 8px rgba(var(--primary-rgb),0.25)); }

.nav-actions { display: flex; gap: var(--header-gap); flex-wrap: nowrap; align-items: center; flex-shrink: 0; }
.header-btn { position: relative; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(var(--primary-rgb), 0.25); color: #fff; width: var(--header-icon-size); height: var(--header-icon-size); min-width: 44px; min-height: 44px; border-radius: 50%; cursor: pointer; transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; font-size: var(--header-icon-font); flex: 0 0 auto; }
.header-btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 15px var(--primary); transform: translateY(-2px); }
.header-btn:active { transform: scale(0.88); opacity: 0.75; transition: transform 0.08s ease, opacity 0.08s ease; }
#headerSearchBtn.search-open {
   background: var(--primary);
   color: #000;
   box-shadow: 0 0 15px var(--primary);
}

.nav-actions.search-open { gap: 0; }
.nav-actions.search-open .header-btn:not(#headerSearchBtn) {
   opacity: 0;
   transform: scale(0.75);
   width: 0;
   height: 0;
   margin: 0;
   padding: 0;
   border-width: 0;
   pointer-events: none;
}

.cart-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 0.75rem; min-width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 2px solid #000; transition: 0.3s transform; }
.cart-badge.pop { transform: scale(1.3); }

.announcement-bar { background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12), rgba(var(--accent-rgb), 0.08)); border-bottom: 1px solid rgba(var(--primary-rgb), 0.22); color: var(--gold); height: 32px; min-height: 32px; max-height: 32px; padding: 0; font-weight: bold; font-size: 13px; text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.35); overflow: hidden; white-space: nowrap; position: relative; direction: ltr; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: flex; align-items: center; cursor: pointer; }
.announcement-bar:active { transform: scale(0.998); }
body[data-theme="warm-dark"] .announcement-bar { color: var(--gold); }
body[data-theme="warm-balanced"] .announcement-bar { color: var(--gold); }
body[data-theme="warm-light"] .announcement-bar { color: var(--gold); }
.ticker-text { display: inline-block; white-space: nowrap; animation: moveRight 24s linear infinite; line-height: 32px; }
.ticker-line { display: inline-block; direction: rtl; white-space: nowrap; }
@keyframes moveRight { 0% { transform: translateX(-100%); } 100% { transform: translateX(100vw); } }

@media (max-width: 768px) {
   .announcement-bar {
      height: 30px;
      min-height: 30px;
      max-height: 30px;
      font-size: 12.5px;
   }
   .ticker-text { line-height: 30px; }
}

.global-search-panel {
      position: absolute;
      top: 0; /* overlay the top container */
   left: 50%;
   right: auto;
   width: min(80vw, 680px);
   margin: 0;
      background: transparent; /* no heavy outer box */
      border: 0;
      border-radius: 0;
      padding: 6px 0; /* reduce outer padding */
      -webkit-backdrop-filter: none; backdrop-filter: none;
      box-shadow: none;
   opacity: 0;
   transform: translate(calc(-50% + var(--search-from-x, 0px)), 6px) scale(0.86);
   transform-origin: top center;
   pointer-events: none;
   max-height: 0;
   overflow: hidden;
   transition: opacity 0.34s ease, transform 0.36s ease, max-height 0.38s ease;
   z-index: 4000;
}

/* close-panel-btn removed — button was causing undesired layout on small screens */

.global-search-panel.open {
      opacity: 1;
   transform: translate(-50%, 6px) scale(1); /* slightly below top */
   pointer-events: auto;
      max-height: 999px;
}

@media (max-width: 768px) {
      .global-search-panel {
   left: auto;
   right: var(--page-gutter);
         width: min(80vw, 680px);
          top: 0;
         transform: translate(var(--search-from-x, 0px), 6px) scale(0.86);
         transform-origin: top right;
    }

    .global-search-panel.open {
   transform: translate(0, 6px) scale(1);
      }

      .header-btn {
         position: relative;
         z-index: 4100;
      }

      #headerSearchBtn.search-open {
         position: fixed;
         left: var(--page-gutter);
         right: auto;
         top: calc(env(safe-area-inset-top, 0px) + 8px);
         z-index: 4210;
         transform: none;
      }
}

@media (max-width: 560px) {
         .global-search-panel {
            left: auto;
            right: var(--page-gutter);
            width: min(84vw, 520px);
            /* overlay the header but be narrower and aligned to the right */
            top: 0;
            transform: translate(var(--search-from-x, 0px), 6px) scale(0.86);
            max-height: calc(100svh - 12px);
         }

      .global-search-panel.open {
         transform: translate(0, 6px) scale(1);
      }
}

   /* Small-screen header adjustments: allow actions to wrap and make search panel full-width */
   @media (max-width: 420px) {
      header { padding: 8px var(--page-gutter); min-height: 56px; }
      .nav-actions { gap: 6px; flex-wrap: wrap; }
      .header-btn { width: 44px; height: 44px; }
      /* On very small screens, keep the panel overlaying the header but slightly smaller and right-aligned */
      .global-search-panel {
         left: auto;
         right: var(--page-gutter);
         width: min(84vw, 420px);
         top: 0;
         transform: translate(var(--search-from-x, 0px), 6px) scale(0.86);
         max-height: calc(100svh - 10px);
      }
      .global-search-panel.open { transform: translate(0, 8px) scale(1); }
      .global-search-head .input-field { padding: 10px 12px; }
   }

   @media (max-width: 420px) {
      /* keep header buttons above the search overlay so the close button stays clickable */
      .header-btn { position: relative; z-index: 4100; }
      /* removed close-panel-btn adjustments */
   }

#profileModal.profile-fullsheet {
   top: var(--fixed-top-height);
   height: calc(100% - var(--fixed-top-height));
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
   overscroll-behavior-y: contain;
    padding: 0;
    background: rgba(0,0,0,0.9);
   touch-action: pan-y;
}

#profileModal.profile-fullsheet.active-layer {
   pointer-events: auto;
}

#profileModal.profile-fullsheet .modal-box {
    width: 100%;
    max-width: none;
    max-height: none;
   min-height: calc(100vh - var(--fixed-top-height));
    border-radius: 0;
    padding: 20px var(--page-gutter) 24px;
   overflow: visible;
   touch-action: pan-y;
}

#profileModal.profile-fullsheet,
#profileModal.profile-fullsheet * {
   touch-action: pan-y;
}

#profileModal.profile-fullsheet input,
#profileModal.profile-fullsheet textarea,
#profileModal.profile-fullsheet select {
   touch-action: auto;
}

.global-search-head { display: flex; gap: 8px; align-items: center; }
.global-search-head .input-field {
      margin: 0; width: 100%;
      border-color: rgba(var(--primary-rgb), 0.22);
   background: rgba(0,0,0,0.78); /* darker input background */
      padding: 10px 14px 10px 40px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.5) inset;
      color: #fff;
}

   .global-search-head .input-field::placeholder { color: rgba(255,255,255,0.6); }
   .global-search-head .input-field:focus { box-shadow: 0 6px 18px rgba(var(--primary-rgb),0.12); }

.global-search-history {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-top: 10px;
   min-height: 10px;
}

.search-chip {
   border: 1px solid var(--glass-border);
   background: rgba(255,255,255,0.05);
   color: #ddd;
   border-radius: 18px;
   padding: 6px 10px;
   font-size: 0.8rem;
   cursor: pointer;
   transition: 0.25s ease;
}

.search-chip:hover {
   border-color: var(--primary);
   color: var(--primary);
   transform: translateY(-1px);
}

.global-search-results {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 40vh;
      overflow-y: auto;
      padding: 8px;
   background: rgba(0,0,0,0.72); /* darker fill behind results */
      border-radius: 10px;
}

.search-result-item {
      border: 1px solid rgba(255,255,255,0.04);
      background: rgba(255,255,255,0.02);
      border-radius: 8px;
      padding: 10px 12px;
      text-align: right;
      cursor: pointer;
      transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.search-result-item:hover {
   border-color: var(--primary);
   background: rgba(var(--primary-rgb),0.12);
}

.search-result-title { color: #fff; font-size: 0.9rem; font-weight: 700; }
.search-result-meta { color: #aaa; font-size: 0.76rem; margin-top: 3px; }

/* =========================================
   الحاويات والأقسام (Layout & Views)
========================================= */
.container { width: min(1200px, calc(100% - (var(--page-gutter) * 2))); margin: 130px auto 40px auto; flex: 1; }
.home-block,
.folders-grid,
.items-grid {
   content-visibility: auto;
   contain-intrinsic-size: 1px 700px;
}
.view-section { display: none; animation: fadeIn 0.26s ease-out; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   أزرار الرجوع والبحث (Top Bar Navigation)
========================================= */
.section-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.back-capsule { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: #fff; padding: 8px 20px; border-radius: 30px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: 0.3s; font-weight: bold; font-size: 0.9rem; text-decoration: none;}
.back-capsule:hover { background: var(--primary); color: #000; box-shadow: 0 0 15px var(--primary); transform: translateX(5px); }
.back-capsule svg { transform: rotate(180deg); }

.search-box { flex: 1; min-width: 200px; max-width: 400px; position: relative; }
.search-box input { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border); color: #fff; padding: 10px 15px 10px 40px; border-radius: 20px; outline: none; transition: 0.3s; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(var(--primary-rgb),0.28); }
.search-box svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; width: 18px; height: 18px; pointer-events: none; }

/* =========================================
   البطاقات والمجلدات (Cards & Folders)
========================================= */
.folders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.glass-card { background: rgba(255, 255, 255, 0.03); -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); border: 1px solid var(--glass-border); border-radius: 15px; padding: 42px 8px 16px 8px; text-align: center; transition: 0.4s; position: relative; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: white; box-shadow: 0 5px 15px rgba(0,0,0,0.5); touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
   .glass-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.2); }
}
.glass-card:active { transform: scale(0.96); opacity: 0.85; transition: transform 0.1s ease, opacity 0.1s ease; }
.folder-img { width: 84%; max-width: none; min-width: 0; aspect-ratio: 1/1; height: auto; object-fit: cover; margin: 6px 0 10px 0; border-radius: 16px; border: 2px solid transparent; transition: 0.3s; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));}
#mainContainer .folder-img { border-color: var(--primary); object-fit: cover; } /* خاص بصفحة الاندكس */
.glass-card h3 { font-size: 1.15rem; margin-bottom: 5px; color: #fff;}
.glass-card p { color: rgba(255, 255, 255, 0.5); font-size: 0.85rem; margin: 0; }

#mainSectionsGrid { grid-template-columns: repeat(auto-fill, minmax(117px, 1fr)); gap: 9px; }
#mainSectionsGrid .glass-card { padding: 32px 7px 11px 7px; border-radius: 11px; }
#mainSectionsGrid .folder-img { width: 74%; margin: 2px 0 7px 0; border-radius: 12px; }
#mainSectionsGrid .glass-card h3 { font-size: 0.9rem; margin-bottom: 3px; }
#mainSectionsGrid .glass-card p { font-size: 0.68rem; }

/* =========================================
   السلع والمنتجات (Items & Services)
========================================= */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.item-card { background: rgba(255, 255, 255, 0.02); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 18px; padding: 50px 20px 20px 20px; text-align: center; transition: 0.4s; position: relative; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: fadeIn 0.6s ease forwards; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
   .item-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 15px 35px rgba(var(--primary-rgb), 0.22); }
   .item-card:hover .item-img { transform: scale(1.1); }
}
.item-card:active { transform: scale(0.97); opacity: 0.88; transition: transform 0.1s ease, opacity 0.1s ease; }
.item-img { width: 75px; height: 75px; object-fit: contain; margin-bottom: 15px; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); transition: 0.3s; display: block; margin-left: auto; margin-right: auto;}
.item-card h3 { font-size: 1.1rem; margin-bottom: 5px; color: #fff; }
.item-card p { color: #aaa; font-size: 0.8rem; margin-bottom: 15px; height: 35px; overflow: hidden; }

.item-price-wrapper { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 15px; width: 100%;}
.item-price-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 15px; width: 100%;}
.item-price { color: var(--success); font-weight: 900; font-size: 1.3rem; }
.item-vip-price { color: var(--gold); font-size: 0.85rem; font-weight: bold; background: rgba(255, 170, 0, 0.1); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255, 170, 0, 0.3); }
.item-old-price { color: #666; text-decoration: line-through; font-size: 0.9rem; }

/* شارات المنتجات (Badges) */
.item-badge { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.5); z-index: 10; }
.badge-hot { background: linear-gradient(45deg, #ff5252, #ff0077); color: #fff; }
.badge-new { background: linear-gradient(45deg, var(--primary), var(--accent)); color: #1a1206; }
.badge-gold { background: linear-gradient(45deg, var(--gold), var(--primary)); color: #000; }


/* =========================================
   الأزرار العامة (Buttons)
========================================= */
.btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: #fff; padding: 12px 18px; min-height: 44px; border-radius: 10px; cursor: pointer; font-weight: bold; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 0.95rem; width: 100%; touch-action: manipulation;}
.btn:hover { background: var(--primary); color: #000; border-color: var(--primary); box-shadow: 0 0 15px var(--primary); }
.btn:active { opacity: 0.75; transform: scale(0.97); transition: transform 0.08s ease, opacity 0.08s ease; }
.btn-primary { background: var(--primary); color: #000; border-color: var(--primary); border: none;}
.btn-primary:hover { box-shadow: 0 0 15px var(--primary); }
.btn-danger { background: rgba(255, 0, 0, 0.1); border-color: rgba(255, 0, 0, 0.5); color: #ff4d4d; }
.btn-danger:hover { background: #ff4d4d; color: #fff; box-shadow: 0 0 15px #ff4d4d; border-color: var(--danger); }
.btn-buy { background: linear-gradient(90deg, rgba(var(--primary-rgb),0.14) 0%, rgba(var(--accent-rgb),0.22) 100%); border-color: var(--primary); color: var(--gold); }
.btn-buy:hover { background: var(--primary); color: #000; box-shadow: 0 0 15px var(--primary); }
.btn-vip-buy { background: linear-gradient(90deg, rgba(var(--primary-rgb),0.18) 0%, rgba(var(--primary-rgb),0.34) 100%); border-color: var(--gold); color: var(--gold); }
.btn-vip-buy:hover { background: var(--gold); color: #000; box-shadow: 0 0 15px var(--gold); }
.header-btn:focus-visible,
.btn:focus-visible,
.floating-btn:focus-visible,
.close-btn:focus-visible,
.search-chip:focus-visible,
.search-result-item:focus-visible,
.contact-icon-btn:focus-visible,
.password-eye-btn:focus-visible {
   outline: 2px solid rgba(var(--primary-rgb), 0.9);
   outline-offset: 2px;
   box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.25);
}

.header-btn:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
.floating-btn:focus:not(:focus-visible),
.close-btn:focus:not(:focus-visible),
.search-chip:focus:not(:focus-visible),
.search-result-item:focus:not(:focus-visible),
.contact-icon-btn:focus:not(:focus-visible),
.password-eye-btn:focus:not(:focus-visible) {
   outline: none;
   box-shadow: none;
}
.vip-crown-wrap { position: relative; overflow: visible; }
.vip-crown-wrap .btn-vip-buy { position: relative; }
.vip-crown-badge {
   position: absolute;
   top: -15px;
   left: -6px;
   background: none;
   color: inherit;
   font-size: clamp(1.22rem, 3.1vw, 1.55rem);
   font-weight: 900;
   line-height: 1;
   transform: rotate(-16deg);
   padding: 0;
   border: none;
   box-shadow: none;
   filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4));
   z-index: 2;
   pointer-events: none;
}
.back-btn-modern { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); color: var(--primary); width: fit-content !important; padding: 10px 25px; border-radius: 30px; margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px; font-weight: 800; transition: 0.4s; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.back-btn-modern:hover { background: var(--primary); color: #000; box-shadow: 0 0 20px var(--primary); transform: scale(1.05); }

/* =========================================
   أدوات المشرف (Admin Controls)
========================================= */
.admin-controls { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 15; }
.admin-edit-icon, .admin-delete-icon { background: rgba(8, 14, 24, 0.78); width: 34px; height: 34px; min-width: 34px; min-height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; cursor: pointer; transition: 0.25s; border: 1px solid rgba(255,255,255,0.18); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); z-index: 5;}
.admin-edit-icon:hover { background: var(--primary); color: #000; border-color: var(--primary); }
.admin-delete-icon:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
#mainContainer .admin-edit-icon, #mainContainer .admin-delete-icon { background: rgba(255,255,255,0.15); display: none;} /* توافق مع الاندكس */

/* VIP Tag */
.vip-tag { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, var(--gold) 0%, var(--primary) 60%, color-mix(in srgb, var(--primary) 72%, #000 28%) 100%); color: #210f00; padding: 4px 14px 4px 10px; border-radius: 4px 20px 20px 4px; font-weight: 900; font-size: 0.88rem; letter-spacing: 0.5px; box-shadow: 0 2px 12px rgba(var(--primary-rgb),0.55), inset 0 1px 0 rgba(255,255,255,0.3); position: relative; }
.vip-tag::before { content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%); border: 9px solid transparent; border-left: none; border-right: 9px solid var(--gold); }

/* Req-Type Badge على بطاقات الخدمات */
.req-type-badge { display: inline-block; font-size: 0.72rem; font-weight: bold; padding: 3px 9px; border-radius: 20px; margin-bottom: 8px; }
.req-id { background: rgba(125,232,255,0.14); color: var(--accent); border: 1px solid rgba(125,232,255,0.3); }
.req-id_zone { background: rgba(255,173,90,0.14); color: var(--primary); border: 1px solid var(--glass-border); }
.req-link { background: rgba(154,247,192,0.14); color: var(--success); border: 1px solid rgba(154,247,192,0.3); }

/* Shipping Req Input highlight */
.req-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.18); }

/* الأزرار العائمة */
.floating-btn { position: fixed; bottom: max(var(--floating-bottom), calc(env(safe-area-inset-bottom, 0px) + 16px)); width: var(--floating-size); height: var(--floating-size); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(24px, 4vw, 32px); cursor: pointer; z-index: 3600; opacity: 0.85; transition: all 0.3s ease; }
.floating-btn:hover { opacity: 1; transform: scale(1.1); }
.chat-btn { inset-inline-end: var(--floating-offset); background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #111; box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.38), inset 0 2px 5px rgba(255, 255, 255, 0.28); border: 2px solid rgba(255,255,255,0.22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chat-btn svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.msg-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 0.75rem; min-width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #000; font-weight: 900; box-shadow: 0 2px 10px rgba(255, 82, 82, 0.6); }
.admin-add-btn { display: none; inset-inline-start: var(--floating-offset); background: var(--primary); color: #000; box-shadow: 0 5px 20px rgba(var(--primary-rgb), 0.34); font-size: 1.5rem; font-weight: bold; border: 2px solid rgba(255,255,255,0.18); }
.admin-add-btn.menu-open { transform: rotate(45deg); opacity: 1; }
.admin-topups-btn { inset-inline-start: var(--floating-offset); bottom: calc(max(var(--floating-bottom), calc(env(safe-area-inset-bottom, 0px) + 16px)) + var(--floating-size) + 12px); background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%); color: #10212b; box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.34); border: 2px solid rgba(255,255,255,0.2); font-size: clamp(20px, 3.6vw, 28px); }
.admin-move-btn { inset-inline-start: var(--floating-offset); bottom: calc(max(var(--floating-bottom), calc(env(safe-area-inset-bottom, 0px) + 16px)) + (var(--floating-size) * 2) + 24px); background: linear-gradient(135deg, var(--gold) 0%, var(--primary) 100%); color: #231204; box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.38); border: 2px solid rgba(255,255,255,0.22); font-size: clamp(20px, 3.6vw, 28px); }
select.input-field { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 36px; cursor: pointer; }
select.input-field option { background: #111318; color: #fff; }

/* قائمة الإضافة */
.add-options-menu { display: none; position: fixed; bottom: calc(max(var(--floating-bottom), calc(env(safe-area-inset-bottom, 0px) + 16px)) + var(--floating-size) + 12px); inset-inline-start: var(--floating-offset); flex-direction: column; gap: 8px; z-index: 3601; min-width: 220px; }
.option-item { background: var(--glass-bg); border: 1px solid var(--glass-border); color: #ffe1b2; padding: 12px 20px; border-radius: 14px; cursor: pointer; font-size: 0.9rem; font-weight: bold; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: slideUp 0.25s ease; box-shadow: 0 4px 18px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06); transition: 0.25s; text-align: right; white-space: nowrap;}
.option-item:hover { background: rgba(var(--primary-rgb), 0.22); border-color: var(--primary); color: var(--primary); transform: translateX(-4px); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   التبويبات (Tabs & Filters)
========================================= */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); color: #aaa; padding: 8px 18px; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: 0.3s; font-size: 0.85rem; font-weight: bold; }
.filter-tab.active { background: rgba(var(--primary-rgb),0.18); color: #ffe1b2; border-color: var(--primary); }

.tabs-wrapper { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.tab-btn { flex: 1; background: rgba(255,255,255,0.05); color: #aaa; border: 1px solid transparent; transition: 0.3s; padding: 12px; border-radius: 10px 10px 0 0; font-weight: bold;}
.tab-btn.active { background: rgba(var(--primary-rgb), 0.14); color: #ffe1b2; border-bottom: 2px solid var(--primary); }

@media (max-width: 768px) {
   #layer-admin .tabs-wrapper {
      overflow-x: auto;
      overflow-y: hidden;
      flex-wrap: nowrap;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-x;
      padding-bottom: 6px;
   }

   #layer-admin .tabs-wrapper::-webkit-scrollbar {
      display: none;
   }

   #layer-admin .tab-btn {
      flex: 0 0 auto;
      width: auto;
      min-width: max-content;
      white-space: nowrap;
   }
}

/* =========================================
   النوافذ المنبثقة وحقول الإدخال (Modals & Inputs)
========================================= */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 5000; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); justify-content: center; align-items: center; padding: 20px; overscroll-behavior: none; touch-action: none; }
.modal-box { background: var(--glass-bg); border: 1px solid var(--primary); width: 100%; max-width: 450px; border-radius: 20px; padding: 30px; position: relative; box-shadow: 0 0 30px rgba(0, 0, 0, 0.8); max-height: 90vh; overflow-y: auto; text-align: center; overscroll-behavior: contain; touch-action: pan-y; scrollbar-gutter: stable both-edges; }
.close-btn { position: absolute; top: 12px; left: 16px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; color: #fff; transition: 0.3s; z-index: 35; pointer-events: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.close-btn:hover { color: var(--primary); }

.input-field { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px; border-radius: 8px; margin: 10px 0; outline: none; text-align: right; font-size: 0.95rem; }
.input-field:focus { border-color: var(--primary); }
.password-toggle-line { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; color: #cfcfcf; font-size: 0.82rem; cursor: pointer; user-select: none; }
.password-toggle-line input { accent-color: var(--success); cursor: pointer; }
.password-hint { text-align: right; color: #aab0bc; font-size: 0.78rem; margin-top: 8px; }
.register-pass-toggle {
   margin-top: 8px;
   justify-content: center;
   border: 1px solid rgba(255,255,255,0.14);
   border-radius: 999px;
   padding: 8px 12px;
   background: rgba(255,255,255,0.04);
   transition: border-color 0.2s ease, background 0.2s ease;
}
.register-pass-toggle:hover {
   border-color: rgba(var(--primary-rgb), 0.55);
   background: rgba(var(--primary-rgb), 0.12);
}
.register-pass-toggle-icon {
   width: 24px;
   height: 24px;
   border-radius: 50%;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   background: rgba(255,255,255,0.08);
}

.trend-inline-badge {
   display: inline-flex;
   align-items: center;
   gap: 4px;
   font-size: 0.72rem;
   font-weight: 700;
   color: #ffe2b5;
   background: rgba(var(--primary-rgb), 0.16);
   border: 1px solid rgba(var(--primary-rgb), 0.3);
   border-radius: 999px;
   padding: 2px 8px;
   margin-right: 6px;
}

#mainAvatar,
#profileImgPreview,
#headerAvatar {
   overflow: hidden;
}

#headerAvatar {
   display: flex;
   align-items: center;
   justify-content: center;
   width: var(--header-avatar-size);
   height: var(--header-avatar-size);
   font-size: clamp(1.2rem, 2.45vw, 1.55rem);
   border-radius: 50%;
}

#mainAvatar img,
#profileImgPreview img {
   transform: scale(1.12);
}

#headerAvatar img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-radius: 50%;
   transform: none;
}

.confirm-modal-box {
   max-width: 390px;
   text-align: center;
}

.confirm-message {
   color: #ddd;
   line-height: 1.9;
   font-size: 0.94rem;
   margin: 8px 0 16px;
}

.confirm-actions {
   display: flex;
   gap: 10px;
}

.confirm-actions .btn {
   flex: 1;
}

.admin-email-modal-box {
   border-color: rgba(var(--primary-rgb), 0.48);
   background:
      radial-gradient(circle at 82% 8%, rgba(var(--accent-rgb), 0.16), transparent 42%),
      radial-gradient(circle at 6% 100%, rgba(var(--primary-rgb), 0.16), transparent 46%),
      var(--glass-bg);
   box-shadow: 0 12px 34px rgba(0, 0, 0, 0.58);
}

.admin-email-modal-title {
   color: var(--primary);
   margin-bottom: 10px;
   text-align: center;
   letter-spacing: 0.2px;
}

.admin-email-modal-target {
   text-align: center;
   margin-bottom: 10px;
   color: #aeb8c8;
   padding: 9px 12px;
   border-radius: 10px;
   border: 1px solid rgba(var(--accent-rgb), 0.24);
   background: rgba(var(--accent-rgb), 0.07);
}

.admin-email-presets {
   display: flex;
   gap: 8px;
   flex-wrap: wrap;
   margin: 4px 0 10px;
}

.admin-email-preset-btn {
   border: 1px solid rgba(var(--primary-rgb), 0.35);
   background: rgba(var(--primary-rgb), 0.14);
   color: #ffe0ba;
   border-radius: 999px;
   padding: 6px 12px;
   font-size: 0.78rem;
   font-weight: 700;
   cursor: pointer;
   transition: 0.2s ease;
}

.admin-email-preset-btn:hover {
   background: rgba(var(--primary-rgb), 0.24);
   border-color: var(--primary);
   color: #fff;
}

.admin-email-field-label {
   font-size: 0.82rem;
   color: #cfd7e4;
}

.admin-email-body-input {
   line-height: 1.8;
}

.admin-email-modal-note {
   margin-top: 7px;
   font-size: 0.76rem;
   color: #9fb0c5;
}

.admin-email-actions .btn-primary {
   background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.96), rgba(var(--accent-rgb), 0.86));
   color: #111;
   border: none;
}

.custom-select-wrapper { position: relative; width: 100%; margin: 10px 0; text-align: right; }
.custom-select { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px; border-radius: 8px; font-size: 0.9rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.custom-select:hover { border-color: var(--primary); }
.custom-dropdown { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: rgba(15, 23, 42, 0.98); border: 1px solid var(--primary); border-radius: 8px; overflow: hidden; z-index: 3000; box-shadow: 0 10px 25px rgba(0,0,0,0.8); margin-top: 5px; flex-direction: column; max-height: 200px; overflow-y: auto; }
.custom-dropdown.show { display: flex; }
.custom-dropdown div { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; text-align: right; font-size: 0.9rem; transition: 0.2s; }
.custom-dropdown div:hover { background: rgba(var(--primary-rgb), 0.2); padding-right: 20px; color: #ffd79b; }

/* عناصر الاندكس الخاصة بالـ Modals */
.shape-control { margin-top: 15px; padding: 15px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 10px; text-align: right; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; margin-top: 10px;}
.slider-value { font-size: 0.8rem; color: #ffd79b; font-weight: bold; background: rgba(var(--primary-rgb), 0.13); padding: 2px 6px; border-radius: 5px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.preview-container { margin-bottom: 20px; padding: 15px; background: rgba(0,0,0,0.4); border-radius: 10px; border: 1px dashed var(--primary); display: flex; justify-content: center; overflow-x: auto; }

/* =========================================
   تسجيل الدخول والإعدادات (Login & Profile)
========================================= */
.social-login-btn { display: flex; align-items: center; justify-content: center; gap: 10px; flex: 1; padding: 10px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; color: #fff; transition: 0.3s; }
.social-login-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.social-icon { width: 18px; height: 18px; flex-shrink: 0; }
.social-google-btn { background: #ffffff; color: #1a1a1a; border: 1px solid rgba(255,255,255,0.18); }
.social-google-btn:hover { background: #f3f5f8; }
.social-facebook-btn { background: #1877f2; color: #ffffff; border: 1px solid rgba(255,255,255,0.16); }
.social-facebook-btn:hover { background: #1265cf; }
#balanceSignPlusBtn.active {
   background: rgba(0, 255, 136, 0.2);
   border-color: var(--success);
}
#balanceSignMinusBtn.active {
   background: rgba(255, 59, 59, 0.16);
   border-color: var(--danger);
   color: #ffd3d3;
}
.register-text { font-size: 0.85rem; font-weight: 400; color: #bbb; margin-top: 20px; }
.register-text span { color: var(--primary); cursor: pointer; font-weight: bold; text-decoration: underline; }
.header-btn,
.floating-btn,
.contact-icon-btn,
.btn {
   touch-action: manipulation;
   -webkit-tap-highlight-color: transparent;
}
.home-intro-card {
   margin-bottom: 16px;
   padding: 0;
   border-radius: 0;
   background: transparent;
   border: 0;
   box-shadow: none;
   text-align: center;
}
.home-top-note {
   margin-top: 8px;
   margin-bottom: 12px;
   width: 100%;
   text-align: right;
}
.home-inline-countdown {
   margin: 6px 0 0 auto;
   width: fit-content;
   max-width: min(100%, 620px);
   font-size: 0.74rem;
   color: #b9c6dc;
   letter-spacing: 0.1px;
   direction: rtl;
   text-align: right;
   opacity: 0.92;
}
.home-inline-note {
   margin: 0;
   display: inline-flex;
   align-items: center;
   flex-wrap: wrap;
   gap: 4px;
   margin-left: auto;
   margin-right: 0;
   max-width: min(100%, 620px);
   width: fit-content;
   direction: rtl;
   text-align: right;
   color: #f5f8ff;
   font-size: 0.86rem;
   line-height: 1.6;
   font-weight: 500;
   letter-spacing: 0.1px;
   padding: 6px 12px;
   border-radius: 999px;
   border: 1px solid rgba(255, 224, 138, 0.2);
   background: linear-gradient(90deg, rgba(255, 224, 138, 0.09), rgba(125, 232, 255, 0.08));
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.home-inline-note::before {
   content: '•';
   color: var(--gold);
   margin-left: 6px;
   opacity: 0.95;
}
.home-inline-note-label {
   color: var(--gold);
   font-weight: 800;
   letter-spacing: 0.2px;
}
#weeklyChampionLine .home-inline-note-label {
   color: #ffe08a !important;
}
#weeklyChampionText {
   color: #eef3ff;
}
.weekly-champion-mark {
   display: inline-block;
   margin-left: 6px;
   color: #ffe7a2;
   font-size: 0.95em;
   text-shadow: 0 0 12px rgba(255, 214, 108, 0.45);
}
.weekly-champion-name {
   color: #ffffff;
   font-weight: 800;
   margin-left: 6px;
}
.weekly-champion-details {
   color: #c9d4e6;
   font-weight: 500;
}
.weekly-champion-metric {
   display: inline-block;
   direction: rtl;
   unicode-bidi: isolate;
}
.home-intro-card h2 {
   color: var(--gold);
   font-size: 1.05rem;
   margin-bottom: 7px;
}
.home-intro-card p {
   color: #d7deeb;
   font-size: 0.9rem;
   line-height: 1.8;
   margin: 0;
}
.contact-footer-block {
   margin-bottom: 26px;
}
@media (max-width: 560px) {
   .home-top-note {
      margin-top: 6px;
      margin-bottom: 10px;
   }
   .home-inline-countdown {
      font-size: 0.7rem;
      margin-top: 5px;
   }
   .home-inline-note {
      font-size: 0.77rem;
      max-width: min(94vw, 620px);
      width: fit-content;
      padding: 5px 10px;
      border-radius: 999px;
      line-height: 1.55;
   }
}
.contact-icons-row {
   display: flex;
   justify-content: center;
   flex-wrap: wrap;
   gap: 14px;
}
.contact-icon-btn {
   position: relative;
   overflow: hidden;
   isolation: isolate;
   appearance: none;
   -webkit-appearance: none;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 52px;
   height: 52px;
   padding: 0;
   line-height: 0;
   outline: none;
   border-radius: 50%;
   border: 1px solid rgba(var(--primary-rgb), 0.34);
   background: linear-gradient(145deg, rgba(var(--primary-rgb),0.22), rgba(var(--accent-rgb),0.12));
   color: #f6ead3;
   cursor: pointer;
   box-shadow: 0 8px 16px rgba(0,0,0,0.24);
   transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
}
.contact-icon-btn:focus,
.contact-icon-btn:focus-visible {
   outline: none;
}
.contact-icon-btn::-moz-focus-inner {
   border: 0;
   padding: 0;
}
.contact-icon-btn::before {
   content: none;
}
.contact-icon-btn::after {
   content: none;
}
.contact-icon-btn:hover {
   transform: translateY(-2px) scale(1.05);
   box-shadow: 0 12px 24px rgba(0,0,0,0.3), 0 0 12px rgba(var(--primary-rgb),0.22);
   filter: saturate(1.08);
}
.contact-icon {
   width: 22px;
   height: 22px;
   display: block;
   shape-rendering: geometricPrecision;
}
.contact-icon-btn.whatsapp {
   background: linear-gradient(145deg, rgba(var(--primary-rgb),0.28), rgba(22,166,120,0.18));
   border-color: rgba(var(--primary-rgb),0.46);
}
.contact-icon-btn.telegram {
   background: linear-gradient(145deg, rgba(var(--accent-rgb),0.26), rgba(var(--primary-rgb),0.16));
   border-color: rgba(var(--accent-rgb),0.46);
}
.contact-icon-btn.instagram {
   background: linear-gradient(145deg, rgba(var(--primary-rgb),0.22), rgba(var(--accent-rgb),0.16));
   border-color: rgba(var(--primary-rgb),0.44);
}
.contact-footer-desc {
   margin: 12px 0 10px;
   text-align: center;
   color: #9fb0c5;
   line-height: 1.8;
   font-size: 0.8rem;
}
.password-input-wrap {
   position: relative;
}
.password-input-wrap .input-field {
   margin: 0;
   padding-left: 42px;
}
.password-eye-btn {
   position: absolute;
   left: 10px;
   top: 50%;
   transform: translateY(-50%);
   width: 28px;
   height: 28px;
   border-radius: 8px;
   border: 1px solid rgba(255,255,255,0.14);
   background: rgba(255,255,255,0.06);
   color: #e7edf8;
   cursor: pointer;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   font-size: 0.92rem;
}
.password-eye-btn:hover {
   border-color: rgba(var(--primary-rgb), 0.6);
   background: rgba(var(--primary-rgb), 0.16);
}
.reviews-block {
   margin-bottom: 28px;
}
.reviews-grid {
   display: grid;
   gap: 10px;
}
.reviews-grid.compact .review-card:nth-child(n+3) {
   display: none;
}
.review-card {
   border: 1px solid var(--glass-border);
   border-radius: 12px;
   padding: 10px 12px;
   background: rgba(255,255,255,0.03);
}
.review-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-bottom: 5px;
}
.review-stars {
   font-size: 0.84rem;
   display: inline-flex;
   align-items: center;
   gap: 1px;
}
.review-card p {
   margin: 0;
   color: #d8e0ef;
   font-size: 0.86rem;
   line-height: 1.8;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}
.reviews-grid.expanded .review-card p {
   white-space: normal;
   display: -webkit-box;
   -webkit-line-clamp: 3;
   line-clamp: 3;
   -webkit-box-orient: vertical;
}
.review-form-lite {
   margin-top: 12px;
   display: grid;
   gap: 8px;
}
.review-rating-picker {
   display: flex;
   align-items: center;
   justify-content: flex-start;
   gap: 10px;
   padding: 8px 10px;
   border: 1px solid var(--glass-border);
   border-radius: 10px;
   background: rgba(255,255,255,0.03);
}
.review-rating-stars {
   font-size: 1rem;
   display: inline-flex;
   align-items: center;
   gap: 1px;
   min-width: 74px;
}

.review-star {
   color: rgba(var(--primary-rgb), 0.32);
   line-height: 1;
}

.review-star.filled {
   color: var(--gold);
}

.review-star.half {
   color: transparent;
   background: linear-gradient(90deg, var(--gold) 50%, rgba(var(--primary-rgb), 0.32) 50%);
   -webkit-background-clip: text;
   background-clip: text;
}
.review-rating-slider {
   flex: 1;
   min-width: 130px;
   accent-color: var(--gold);
   cursor: pointer;
}
.review-rating-label {
   margin-inline-start: auto;
   color: #9fb0c5;
   font-size: 0.82rem;
}
.profile-modal-box {
   background: linear-gradient(180deg, rgba(18, 20, 28, 0.95) 0%, rgba(12, 14, 20, 0.92) 100%);
   border-color: rgba(var(--primary-rgb), 0.45);
}
#profileModal .btn {
   width: min(100%, 360px);
   margin-inline: auto;
   padding: 10px 14px;
   font-size: clamp(0.84rem, 2.2vw, 0.95rem);
}

@media (max-width: 560px) {
   #profileModal .btn {
      width: 100%;
      padding: 9px 12px;
      font-size: 0.84rem;
   }

   #profileModal #mainAvatar {
      width: 70px !important;
      height: 70px !important;
      font-size: 2.4rem !important;
   }

   #profileModal .profile-authority-card {
      padding: 9px 10px;
      border-radius: 12px;
   }
}

.profile-identity-line {
   color: #b9c4d6;
   font-size: 0.78rem;
   margin-top: -2px;
   margin-bottom: 6px;
   direction: ltr;
   text-align: center;
}
.profile-identity-copyable {
   cursor: pointer;
   color: #d9e6ff;
}
.profile-identity-copyable:hover {
   color: #ffffff;
}
.profile-identity-email {
   display: block;
   margin-top: 4px;
   color: #9fb0c5;
   font-size: 0.74rem;
   direction: ltr;
}
.profile-authority-card {
   margin-top: 10px;
   border: 1px solid rgba(var(--primary-rgb), 0.28);
   background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(var(--accent-rgb), 0.08) 100%);
   border-radius: 14px;
   padding: 10px 12px;
   text-align: right;
}
.profile-authority-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
}
.profile-role-badge {
   font-size: 0.82rem;
   font-weight: 800;
   color: #ffe2b6;
}
.profile-stars {
   color: var(--gold);
   font-size: 0.85rem;
   font-weight: 900;
}
.profile-role-hint {
   margin-top: 6px;
   color: #d5dbe7;
   font-size: 0.76rem;
   line-height: 1.5;
}
.profile-admin-section { display: none; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.profile-admin-title {
   text-align: right;
   color: #ffd79b;
   font-size: 0.84rem;
   font-weight: 800;
   margin-bottom: 8px;
}
.profile-admin-perms {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   margin-bottom: 12px;
}
.profile-admin-perm-chip {
   border: 1px solid rgba(var(--primary-rgb), 0.35);
   background: rgba(var(--primary-rgb), 0.12);
   color: #ffe6be;
   border-radius: 999px;
   padding: 4px 9px;
   font-size: 0.7rem;
   font-weight: 700;
}

.profile-action-layer .container {
   width: min(980px, calc(100% - (var(--page-gutter) * 2)));
   margin: 0 auto 24px;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
   touch-action: pan-y;
}

.profile-layer-card {
   width: 100%;
   max-width: 720px;
   margin: 0 auto;
   max-height: none;
   overflow: visible;
   touch-action: pan-y;
}

.profile-action-layer,
.profile-action-layer * {
   touch-action: pan-y;
}

.profile-action-layer input,
.profile-action-layer textarea,
.profile-action-layer select,
.profile-action-layer button {
   touch-action: auto;
}

#announcementsList,
#accountNotificationsList,
#pendingTopupsLayerList {
   -webkit-overflow-scrolling: touch;
}

.announcements-feed-list {
   display: grid;
   gap: 8px;
   max-height: 55svh;
   overflow-y: auto;
   padding: 2px;
}

.announcement-feed-item {
   display: flex;
   gap: 10px;
   align-items: center;
   padding: 10px;
   border: 1px solid rgba(255,255,255,0.11);
   border-radius: 10px;
   background: rgba(255,255,255,0.03);
}

#dynamicListArea,
#pendingTopupsLayerList,
#adminUsersList {
   padding-bottom: max(36px, var(--layer-scroll-safe-bottom));
}

@media (max-width: 560px) {
   .profile-action-layer .container {
      width: calc(100% - (var(--page-gutter) * 2));
   }

   .profile-layer-card {
      padding: 16px 12px;
      border-radius: 12px;
   }
}

/* =========================================
   عناصر صفحة الإدارة (Admin Elements)
========================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stats-grid .glass-card { padding: 25px 15px;}
.stats-grid .glass-card h3 { font-size: 1.15rem; margin-bottom: 5px; color: var(--primary); }
.stats-grid .glass-card p { color: #fff; font-size: 1.5rem; font-weight: bold; margin: 0; text-shadow: 0 0 10px var(--primary);}
.admin-stat-value {
   min-height: 1.6em;
   min-width: 56px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   transition: opacity 0.2s ease;
}
.admin-stat-value.admin-stat-loading {
   color: transparent !important;
   position: relative;
   text-shadow: none;
}
.admin-stat-value.admin-stat-loading::after {
   content: '';
   width: 58px;
   height: 18px;
   border-radius: 999px;
   background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.26) 50%, rgba(255,255,255,0.08) 100%);
   background-size: 180% 100%;
   animation: hemoStatSkeletonPulse 1.2s ease-in-out infinite;
}

@keyframes hemoStatSkeletonPulse {
   0% { background-position: 150% 0; }
   100% { background-position: -50% 0; }
}

.admin-list-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); padding: 15px; border-radius: 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; flex-wrap: wrap; gap: 10px; cursor: pointer; }
.admin-list-item:hover { background: rgba(255,255,255,0.06); border-color: var(--primary); }
.admin-request-card {
   border: 1px solid rgba(255,255,255,0.08);
   border-radius: 12px;
   background: rgba(255,255,255,0.03);
   margin-bottom: 10px;
   overflow: hidden;
   transition: border-color 0.25s ease, background 0.25s ease;
}
.admin-request-card:hover {
   border-color: rgba(var(--primary-rgb), 0.44);
   background: rgba(255,255,255,0.05);
}
.admin-request-head {
   width: 100%;
   border: 0;
   background: transparent;
   color: inherit;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
   padding: 11px 12px;
   cursor: pointer;
   text-align: right;
}
.admin-request-head-main {
   display: grid;
   gap: 3px;
   min-width: 0;
}
.admin-request-title {
   color: #ffe1b2;
   font-size: 0.92rem;
   font-weight: 700;
}
.admin-request-sub {
   color: #9fb0c5;
   font-size: 0.78rem;
   display: flex;
   align-items: center;
   gap: 8px;
   flex-wrap: wrap;
}
.admin-request-amount {
   color: #9fffdf;
   font-weight: 700;
}
.admin-request-chevron {
   color: #c8d7ee;
   font-size: 0.98rem;
   transition: transform 0.26s ease;
   flex-shrink: 0;
}
.admin-request-card.expanded .admin-request-chevron {
   transform: rotate(180deg);
}
.admin-request-body {
   max-height: 0;
   opacity: 0;
   transform: translateY(-6px);
   overflow: hidden;
   transition: max-height 0.3s ease, opacity 0.24s ease, transform 0.24s ease;
   will-change: max-height, opacity, transform;
}
.admin-request-card.expanded .admin-request-body {
   max-height: 850px;
   opacity: 1;
   transform: translateY(0);
}
.admin-request-content {
   padding: 0 12px 12px;
   display: grid;
   gap: 8px;
}
.user-info { display: flex; align-items: center; min-width: 200px; gap: 15px;}
.user-avatar { width: 45px; height: 45px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; border: 1px solid var(--primary); }
.user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.rank-badge { padding: 3px 10px; border-radius: 15px; font-size: 0.75rem; font-weight: bold; display: inline-block; }
.rank-new { background: rgba(255,255,255,0.1); color: #ddd; }
.rank-regular { background: rgba(var(--primary-rgb), 0.15); color: var(--gold); border: 1px solid var(--primary); }
.rank-premium { background: rgba(var(--primary-rgb), 0.15); color: var(--primary); border: 1px solid var(--primary); }
.rank-vip { background: linear-gradient(45deg, #ff00cc, #3333ff); color: #fff; box-shadow: 0 0 10px rgba(255,0,204,0.4); }
.rank-admin-asst { background: rgba(0, 204, 102, 0.2); color: #00cc66; border: 1px solid #00cc66; }
.rank-admin-reg { background: rgba(51, 136, 255, 0.2); color: #3388ff; border: 1px solid #3388ff; }
.rank-admin-mid { background: rgba(255, 85, 0, 0.2); color: #ff5500; border: 1px solid #ff5500; }

.rank-select-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #ccc; padding: 10px; border-radius: 8px; cursor: pointer; transition: 0.3s; flex: 1; text-align: center; font-size: 0.85rem;}
.rank-select-btn.active { background: var(--primary); color: #000; font-weight: bold; box-shadow: 0 0 10px var(--primary); border-color: var(--primary); }
.online-dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; box-shadow: 0 0 8px var(--success); margin-left: 8px;}

/* زر الرجوع الخاص بالدردشة */
.chat-back-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: var(--primary); width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; }
.chat-back-btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 10px var(--primary);}

/* =========================================
   نظام الإشعارات (Toasts)
========================================= */
#toastContainer { position: fixed; top: calc(var(--fixed-top-height) + 14px); right: 15px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { width: 220px; padding: 10px 15px; min-height: 48px; background: rgba(15, 23, 42, 0.98); -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); border-right: 4px solid var(--primary); border-radius: 8px; color: #fff; box-shadow: 0 8px 25px rgba(0,0,0,0.5); font-weight: bold; font-size: 0.85rem; line-height: 1.4; cursor: pointer; pointer-events: auto; transform: translateX(130%); transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1); text-align: right; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(150%); opacity: 0; }
.toast-success { border-right-color: var(--success); }
.toast-danger { border-right-color: var(--danger); }

/* =========================================
   نظام الطبقات الجديد (Stack Navigation Layers)
========================================= */
.app-layer {
    position: fixed;
   top: var(--fixed-top-height); 
    right: 0; /* يبدأ من اليمين للتوافق مع العربية */
    width: 100%; 
   height: calc(100% - var(--fixed-top-height));
    background-color: #0a0f19; /* نفس لون خلفية المتجر */
   background-image: radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.07), transparent 40%),
                 radial-gradient(circle at bottom left, rgba(var(--accent-rgb), 0.06), transparent 40%);
    z-index: 2000; /* يغطي كل شيء */
    overflow-y: auto;
   pointer-events: none;
   overscroll-behavior-y: auto;
   -webkit-overflow-scrolling: touch;
    
    /* الحركة السلسة والانزلاق */
   transform: translateX(100%);
   transition: transform 0.2s ease-out;
   will-change: transform;
   backface-visibility: hidden;
}

.app-layer.hide-global-header {
   top: var(--fixed-top-height);
   height: calc(100% - var(--fixed-top-height));
}

.app-layer .container {
   margin: 0 auto 30px auto;
   padding-bottom: max(36px, var(--layer-scroll-safe-bottom));
}

/* Keep a guaranteed scroll tail so floating buttons never block bottom actions. */
.app-layer::after {
   content: '';
   display: block;
   height: max(24px, calc(var(--layer-scroll-safe-bottom) - 18px));
}

.app-layer.active-layer {
    transform: translateX(0); /* دخول الطبقة للشاشة */
}

.app-layer.layer-interactive {
   pointer-events: auto;
   overflow-y: auto;
   touch-action: pan-y;
}

.app-layer.layer-blocked {
   pointer-events: none;
   overflow: hidden;
   touch-action: none;
}

/* هيدر مخصص للطبقات مع زر الرجوع */
.layer-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(10, 15, 25, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
   :root { --fixed-top-height: 96px; }

   /* Keep layer navigation fast on mobile by removing expensive compositing effects. */
   .app-layer {
      transition-duration: 0.16s;
      background-image: none;
      -webkit-backdrop-filter: none; backdrop-filter: none;
   }

   .view-section {
      animation: none;
   }
}

/* =========================================
   واجهة الرئيسية الجديدة (Mobile-First Home)
========================================= */
.home-block { margin-bottom: 20px; content-visibility: auto; contain-intrinsic-size: 1px 620px; }
.section-title { margin-bottom: 12px; border-right: 4px solid var(--primary); padding-right: 10px; font-size: 1.1rem; }

.stories-strip {
   display: flex;
   gap: 14px;
   overflow-x: auto;
   padding: 2px 4px 6px;
   scrollbar-width: none;
}
.stories-strip::-webkit-scrollbar { display: none; }

.story-item {
   min-width: 84px;
   text-align: center;
   cursor: pointer;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 6px;
   position: relative;
   touch-action: manipulation;
}

.story-avatar {
   width: 78px;
   height: 78px;
   border-radius: 50%;
   padding: 2px;
   background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
   display: flex;
   align-items: center;
   justify-content: center;
}

.story-avatar img {
   width: 100%;
   height: 100%;
   border-radius: 50%;
   object-fit: contain;
   background: rgba(8, 12, 22, 0.95);
   padding: 9px;
}

.story-item span { font-size: 0.82rem; color: #ddd; }

.quick-story-edit {
   position: absolute;
   top: -2px;
   right: 4px;
   width: 30px;
   height: 30px;
   min-width: 30px;
   min-height: 30px;
   font-size: 0.72rem;
   border-radius: 8px;
   background: rgba(var(--primary-rgb), 0.14);
   color: #ffe1b2;
   border: 1px solid var(--glass-border);
   box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.quick-story-edit:hover {
   background: var(--primary);
   color: #000;
   border-color: var(--primary);
}

.trending-grid {
   display: block;
   position: relative;
   overflow: visible;
}

.trending-slider {
   width: 100%;
   overflow-x: auto;
   overflow-y: hidden;
   -webkit-overflow-scrolling: touch;
   scroll-snap-type: x proximity;
   touch-action: auto;
   padding-bottom: 4px;
   overscroll-behavior-x: contain;
}

.trending-track {
   display: flex;
   align-items: stretch;
   gap: 10px;
   width: max-content;
   contain: content;
}

.trend-card--marquee {
   flex: 0 0 clamp(132px, 31vw, 170px);
   max-width: 170px;
   min-height: 206px;
   scroll-snap-align: start;
}

.trend-card--marquee .product-preview-image-wrap {
   aspect-ratio: 16 / 10;
}

.trend-card--marquee .product-preview-content {
   min-height: 42px;
}

.trend-card--marquee .product-preview-actions {
   gap: 6px;
}

.trend-card--marquee .product-preview-actions .btn,
.trend-card--marquee .product-preview-actions .btn.btn-vip-buy {
   --buy-btn-font-size: 0.86rem;
   min-height: 38px;
}

.trend-card--marquee .product-preview-actions .btn.price-fit-sm,
.trend-card--marquee .product-preview-actions .btn.btn-vip-buy.price-fit-sm {
   --buy-btn-font-size: 0.8rem;
}

.trend-card--marquee .product-preview-actions .btn.price-fit-xs,
.trend-card--marquee .product-preview-actions .btn.btn-vip-buy.price-fit-xs {
   --buy-btn-font-size: 0.74rem;
}

.trend-card--marquee h3,
.trend-card--marquee p {
   overflow: hidden;
   display: -webkit-box;
   -webkit-box-orient: vertical;
}

.trend-card--marquee h3 {
   line-clamp: 2;
   -webkit-line-clamp: 2;
}

.trend-card--marquee p {
   line-clamp: 2;
   -webkit-line-clamp: 2;
   min-height: 30px;
}

.trending-slider::-webkit-scrollbar {
   height: 6px;
}

.trending-slider::-webkit-scrollbar-thumb {
   background: rgba(255,255,255,0.22);
   border-radius: 999px;
}

.trend-card {
   background: rgba(255, 255, 255, 0.04);
   border: 1px solid var(--glass-border);
   border-radius: 14px;
   padding: 12px;
   position: relative;
.admin-payments-panel {
   border: 1px solid var(--glass-border);
   border-radius: 12px;
   padding: 12px;
   background: rgba(255, 255, 255, 0.03);
   margin-bottom: 12px;
}
.admin-payment-form-grid,
.admin-coupon-form-grid {
   display: grid;
   gap: 8px;
   margin-bottom: 10px;
}
.admin-coupon-options-grid {
   display: grid;
   gap: 10px;
   grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
   margin-bottom: 10px;
}
.admin-coupon-option-card {
   border: 1px solid rgba(255,255,255,0.1);
   border-radius: 12px;
   padding: 10px;
   background: rgba(255,255,255,0.02);
}
.admin-coupon-option-card h4 {
   margin: 0 0 8px;
   color: #ffe1b2;
   font-size: 0.9rem;
}
.admin-payment-option-group {
   display: grid;
   gap: 8px;
   margin-bottom: 10px;
}
.admin-payment-section-note {
   font-size: 0.82rem;
   color: #9fb0c5;
   margin: -2px 0 10px;
}
.admin-payment-form-grid {
   grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.admin-coupon-form-grid {
   grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.admin-payments-list {
   display: grid;
   gap: 8px;
   margin-top: 10px;
}
.admin-payment-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: 10px;
}
.admin-payment-row-content {
   flex: 1;
   text-align: right;
   min-width: 0;
}
.admin-payment-row-actions {
   display: flex;
   gap: 6px;
   flex-wrap: wrap;
}
@media (max-width: 700px) {
   .admin-payment-row {
      flex-direction: column;
      align-items: stretch;
   }
   .admin-payment-row-actions {
      width: 100%;
      justify-content: flex-start;
   }
}
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.trend-badge {
   position: absolute;
   top: 6px;
   right: 6px;
   background: transparent;
   color: inherit;
   font-size: 1.34rem;
   font-weight: 800;
   padding: 0;
   border-radius: 0;
   border: 0;
   box-shadow: none;
}

.trend-badge-discount {
   position: absolute;
   top: 6px;
   right: 6px;
   overflow: hidden;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: fit-content;
   max-width: max-content;
   white-space: nowrap;
   background: linear-gradient(120deg, #ffde75 0%, #ff9f2f 22%, #ff5a1f 48%, #ff2f12 74%, #ffcf64 100%);
   background-size: 220% 220%;
   color: #fff9eb;
   font-size: 0.61rem;
   padding: 3px 8px;
   border-radius: 999px;
   border: 1px solid rgba(255, 219, 173, 0.34);
   box-shadow: 0 4px 9px rgba(255, 86, 18, 0.19), 0 0 5px rgba(255, 134, 20, 0.16), inset 0 1px 0 rgba(255,255,255,0.22);
   line-height: 1;
   letter-spacing: 0.1px;
   text-shadow: 0 1px 3px rgba(50, 12, 0, 0.48);
   animation: hemoDiscountFireFlow 2.2s linear infinite, hemoDiscountFirePulse 1.45s ease-in-out infinite;
}

.trend-badge-discount::before {
   content: '';
   position: absolute;
   inset: -12% -30%;
   background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.34) 48%, transparent 66%);
   transform: translateX(-55%) skewX(-14deg);
   mix-blend-mode: screen;
   pointer-events: none;
   animation: hemoDiscountFireShine 1.9s ease-in-out infinite;
}

.trend-badge-discount::after {
   content: '';
   position: absolute;
   top: -5px;
   left: 13%;
   width: 74%;
   height: 8px;
   background:
      radial-gradient(9px 6px at 12% 100%, rgba(255, 238, 164, 0.9), rgba(255, 151, 38, 0.66) 58%, rgba(255, 94, 22, 0) 100%),
      radial-gradient(10px 7px at 46% 100%, rgba(255, 226, 138, 0.88), rgba(255, 120, 32, 0.64) 60%, rgba(255, 76, 18, 0) 100%),
      radial-gradient(9px 6px at 82% 100%, rgba(255, 235, 156, 0.88), rgba(255, 140, 34, 0.64) 58%, rgba(255, 88, 20, 0) 100%);
   filter: drop-shadow(0 -1px 1px rgba(255, 123, 26, 0.34));
   pointer-events: none;
   opacity: 0.9;
   animation: hemoDiscountTopFlame 1.35s ease-in-out infinite;
}

@keyframes hemoDiscountFireFlow {
   0% { background-position: 0% 48%; }
   100% { background-position: 100% 52%; }
}

@keyframes hemoDiscountFirePulse {
   0%, 100% { box-shadow: 0 4px 9px rgba(255, 86, 18, 0.19), 0 0 5px rgba(255, 134, 20, 0.16), inset 0 1px 0 rgba(255,255,255,0.22); }
   50% { box-shadow: 0 5px 11px rgba(255, 82, 18, 0.25), 0 0 7px rgba(255, 146, 25, 0.22), inset 0 1px 0 rgba(255,255,255,0.25); }
}

@keyframes hemoDiscountFireShine {
   0% { transform: translateX(-65%) skewX(-14deg); opacity: 0.18; }
   45% { opacity: 0.48; }
   100% { transform: translateX(75%) skewX(-14deg); opacity: 0.16; }
}

@keyframes hemoDiscountTopFlame {
   0%, 100% { transform: translateY(0) scaleY(0.92); opacity: 0.86; }
   50% { transform: translateY(-1px) scaleY(1.06); opacity: 1; }
}

.trend-badge-flame {
   display: inline-block;
   line-height: 1;
   transform-origin: 50% 82%;
   will-change: transform, filter;
   filter: drop-shadow(0 1px 1px rgba(255, 120, 16, 0.52)) drop-shadow(0 0 7px rgba(255, 76, 0, 0.35));
   animation: hemoFlameRealistic 1.38s ease-in-out infinite;
}

@keyframes hemoFlameRealistic {
   0% {
      transform: translateY(0) scale(0.95) rotate(-3deg);
      filter: saturate(0.95) brightness(0.96) drop-shadow(0 1px 1px rgba(255, 120, 16, 0.48)) drop-shadow(0 0 5px rgba(255, 76, 0, 0.28));
   }
   14% {
      transform: translateY(-1px) scale(1.04) rotate(2deg);
      filter: saturate(1.12) brightness(1.07) drop-shadow(0 2px 2px rgba(255, 132, 22, 0.58)) drop-shadow(0 0 8px rgba(255, 88, 0, 0.42));
   }
   27% {
      transform: translateY(0) scale(0.99) rotate(-1deg);
      filter: saturate(1.04) brightness(1) drop-shadow(0 1px 1px rgba(255, 122, 14, 0.52)) drop-shadow(0 0 6px rgba(255, 76, 0, 0.34));
   }
   46% {
      transform: translateY(-2px) scale(1.1) rotate(3deg);
      filter: saturate(1.22) brightness(1.13) drop-shadow(0 2px 3px rgba(255, 140, 32, 0.62)) drop-shadow(0 0 11px rgba(255, 92, 0, 0.5));
   }
   63% {
      transform: translateY(-1px) scale(1.03) rotate(-2deg);
      filter: saturate(1.08) brightness(1.04) drop-shadow(0 1px 2px rgba(255, 124, 16, 0.56)) drop-shadow(0 0 8px rgba(255, 80, 0, 0.4));
   }
   78% {
      transform: translateY(0) scale(0.97) rotate(1deg);
      filter: saturate(0.98) brightness(0.98) drop-shadow(0 1px 1px rgba(255, 116, 12, 0.48)) drop-shadow(0 0 6px rgba(255, 70, 0, 0.3));
   }
   100% {
      transform: translateY(0) scale(0.95) rotate(-3deg);
      filter: saturate(0.95) brightness(0.96) drop-shadow(0 1px 1px rgba(255, 120, 16, 0.48)) drop-shadow(0 0 5px rgba(255, 76, 0, 0.28));
   }
}

.trend-img {
   width: 64px;
   height: 64px;
   object-fit: contain;
   margin: 5px auto 2px;
}

.product-preview-card {
   width: 90%;
   margin: 0 auto;
   padding: 7px !important;
   text-align: right !important;
   justify-content: flex-start !important;
   align-items: stretch !important;
   gap: 5px;
}

.product-preview-image-wrap {
   width: 100%;
   aspect-ratio: 1.04/1;
   border-radius: 12px;
   overflow: hidden;
   border: 1px solid rgba(var(--primary-rgb), 0.22);
   background: rgba(0, 0, 0, 0.22);
}

.cart-compact-wrap {
   max-width: 760px;
}

.cart-compact-panel {
   display: grid;
   gap: 6px;
   border: 1px solid var(--glass-border);
   border-radius: 11px;
   padding: 10px;
   background: rgba(255, 255, 255, 0.03);
}

.cart-items-container {
   max-height: 272px;
   overflow-y: auto;
   border: 1px solid var(--glass-border);
   border-radius: 11px;
   padding: 10px;
   background: rgba(255, 255, 255, 0.03);
}

.cart-total-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   font-size: 0.95rem;
}

.cart-item-row {
   margin-bottom: 8px;
   padding-bottom: 8px;
   border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.cart-item-topline {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: 8px;
}

.cart-item-name {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   font-size: 0.93rem;
}

.cart-item-prices {
   margin-top: 2px;
   display: flex;
   align-items: center;
   gap: 8px;
   font-size: 0.84rem;
}

.cart-item-prices strong {
   color: #ffe1b2;
   font-size: 0.88rem;
}

.cart-item-prices span {
   color: var(--success);
}

.cart-item-remove-btn {
   width: auto;
   padding: 3px 9px;
   font-size: 0.76rem;
   min-height: 28px;
}

.cart-item-player-data {
   margin-top: 6px;
   padding: 5px 8px;
   background: rgba(var(--primary-rgb), 0.1);
   border-radius: 8px;
   border: 1px solid var(--glass-border);
   font-size: 0.78rem;
   color: #ccc;
   direction: ltr;
   text-align: left;
}

.cart-item-player-data > summary {
   cursor: pointer;
   direction: rtl;
   text-align: right;
   color: #a9bdd7;
   font-size: 0.76rem;
   margin-bottom: 4px;
}

@media (max-width: 560px) {
   .cart-compact-wrap {
      width: 100%;
   }

   .cart-compact-panel,
   .cart-items-container {
      padding: 9px;
      border-radius: 10px;
   }

   .cart-items-container {
      max-height: 240px;
   }

   .cart-country-row {
      align-items: flex-start;
   }

   .cart-country-inline-note {
      display: block;
      margin-top: 2px;
      font-size: 0.72rem !important;
   }

   .cart-coupon-row {
      display: grid !important;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
      align-items: stretch !important;
   }

   #layer-cart #cartCouponInput {
      grid-column: 1 / -1;
      min-width: 0 !important;
      font-size: 0.86rem;
      padding: 9px 10px;
   }

   #layer-cart #cartApplyCouponBtn,
   #layer-cart #removeCartCouponBtn {
      width: 100% !important;
      min-height: 38px;
      padding: 8px 8px !important;
   }

   .cart-total-row {
      align-items: baseline;
      font-size: 0.9rem;
      gap: 8px;
   }

   #layer-cart #cartTotal {
      font-size: 0.92rem;
      text-align: left;
   }

   .cart-actions-row {
      gap: 7px !important;
   }

   .cart-actions-row .btn {
      min-height: 40px;
      padding: 9px 8px;
      font-size: 0.85rem;
   }

   .cart-item-name {
      font-size: 0.88rem;
   }

   .cart-item-prices {
      font-size: 0.8rem;
      gap: 6px;
      flex-wrap: wrap;
   }

   .cart-item-player-data {
      font-size: 0.74rem;
      line-height: 1.7;
   }
}

@media (max-width: 390px) {
   .cart-actions-row {
      display: grid !important;
      grid-template-columns: 1fr;
   }

   .cart-actions-row .btn {
      width: 100%;
   }

   .cart-item-topline {
      align-items: flex-start;
      gap: 6px;
   }

   .cart-item-remove-btn {
      min-width: 56px;
      padding: 3px 7px;
      font-size: 0.73rem;
   }
}

.product-preview-img {
   width: 100% !important;
   height: 100% !important;
   object-fit: cover !important;
   margin: 0 !important;
   border-radius: 0 !important;
   border: 0 !important;
   filter: none !important;
}

.product-preview-content {
   display: grid;
   gap: 3px;
}

.product-preview-card h3 {
   margin: 0;
   font-size: 0.9rem;
}

.product-preview-card p {
   margin: 0;
   color: #aaa;
   font-size: 0.79rem;
   min-height: 24px;
}

.product-preview-actions {
   display: flex;
   gap: 5px;
   margin-top: 2px;
   align-items: stretch;
}

.product-preview-actions > .btn,
.product-preview-actions > .vip-crown-wrap {
   flex: 1 1 0;
   min-width: 0;
}

.product-preview-actions .vip-crown-wrap {
   display: flex;
   align-items: stretch;
   min-height: 42px;
   height: 42px;
}

.product-preview-card .product-preview-actions .btn,
.product-preview-card .product-preview-actions .btn.btn-vip-buy {
   --buy-btn-font-size: 1rem;
   flex: 1 1 0;
   min-width: 0;
   min-height: 42px;
   height: 42px;
   padding: 0 8px !important;
   font-size: var(--buy-btn-font-size) !important;
   line-height: 1;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: clip;
   letter-spacing: -0.1px;
}

.product-preview-card .product-preview-actions .vip-crown-wrap .btn.btn-vip-buy {
   width: 100%;
   min-height: 42px;
   height: 42px;
}

/* =========================================
   نمط البحث الذكي للوجهات (Smart Destination Search)
========================================= */
.destination-option {
   transition: background-color 0.15s ease;
}

.destination-option:hover {
   background-color: rgba(255, 255, 255, 0.08) !important;
}

.destination-option:first-child {
   border-top: none;
}


.product-preview-card .product-preview-actions .btn,
.product-preview-card .product-preview-actions .btn.btn-vip-buy,
.product-preview-card .product-preview-actions .vip-crown-wrap .btn.btn-vip-buy {
   display: inline-flex;
   align-items: center;
   justify-content: center;
}

.discount-price-stack {
   display: inline-flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   line-height: 1;
   gap: 2px;
}

.discount-old-price {
   font-size: 0.56rem;
   color: rgba(255,255,255,0.58);
   text-decoration: line-through;
   font-weight: 700;
}

.discount-new-price {
   font-size: 0.92rem;
   color: var(--gold);
   font-weight: 900;
   text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.18);
}

.product-preview-discount-row {
   min-height: 14px;
   margin-top: 4px;
   width: 100%;
   text-align: center;
}

.discount-countdown {
   display: inline-block;
   font-size: 0.63rem;
   color: color-mix(in srgb, var(--success) 82%, #d9fff0 18%);
   letter-spacing: 0.1px;
   opacity: 0.92;
}

.product-preview-card .product-preview-actions .btn.btn-primary .discount-old-price {
   color: rgba(17, 17, 17, 0.55);
}

.product-preview-card .product-preview-actions .btn.btn-primary .discount-new-price {
   color: #101010;
   text-shadow: none;
}

.product-preview-card .product-preview-actions .btn.btn-vip-buy .discount-old-price {
   color: rgba(255, 244, 214, 0.68);
}

.product-preview-card .product-preview-actions .btn.btn-vip-buy .discount-new-price {
   color: var(--gold);
}

.product-preview-card .product-preview-actions .btn.price-fit-sm,
.product-preview-card .product-preview-actions .btn.btn-vip-buy.price-fit-sm {
   --buy-btn-font-size: 0.9rem;
}

.product-preview-card .product-preview-actions .btn.price-fit-xs,
.product-preview-card .product-preview-actions .btn.btn-vip-buy.price-fit-xs {
   --buy-btn-font-size: 0.82rem;
   letter-spacing: -0.2px;
}

@media (max-width: 480px) {
   .trend-badge-discount {
      top: 5px;
      right: 5px;
      font-size: 0.56rem;
      padding: 2px 6px;
      border-width: 1px;
      box-shadow: 0 3px 7px rgba(255, 86, 18, 0.16), 0 0 4px rgba(255, 134, 20, 0.12), inset 0 1px 0 rgba(255,255,255,0.2);
   }

   .trend-badge-discount::after {
      top: -4px;
      left: 14%;
      width: 72%;
      height: 6px;
   }

   .product-preview-card .product-preview-actions {
      gap: 4px;
   }

   .product-preview-card .product-preview-actions .btn,
   .product-preview-card .product-preview-actions .btn.btn-vip-buy {
      min-height: 40px;
      height: 40px;
      padding: 0 6px !important;
      font-size: 0.96rem !important;
   }

   .product-preview-card .product-preview-actions .btn.price-fit-sm,
   .product-preview-card .product-preview-actions .btn.btn-vip-buy.price-fit-sm {
      font-size: 0.86rem !important;
   }

   .product-preview-card .product-preview-actions .btn.price-fit-xs,
   .product-preview-card .product-preview-actions .btn.btn-vip-buy.price-fit-xs {
      font-size: 0.78rem !important;
   }
}

.trend-card h3 { font-size: 0.95rem; text-align: center; min-height: 38px; }
.trend-price { text-align: center; color: var(--success); font-size: 1.05rem; font-weight: 800; }

/* =========================================
   الفوتر (Footer)
========================================= */
footer { background: rgba(10, 15, 25, 0.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid rgba(255,255,255,0.05); padding: 30px 20px; text-align: center; margin-top: auto; }
body[data-theme="warm-dark"] footer { background: rgba(10, 9, 12, 0.82); border-top: 1px solid rgba(var(--primary-rgb), 0.22); }
body[data-theme="warm-balanced"] footer { background: rgba(16, 14, 14, 0.68); border-top: 1px solid rgba(var(--primary-rgb), 0.24); }
body[data-theme="warm-light"] footer { background: rgba(30, 22, 14, 0.48); border-top: 1px solid rgba(var(--primary-rgb), 0.32); }
.social-icons { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.social-btn { color: #fff; text-decoration: none; width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: 0.25s ease; border: 1px solid rgba(255,255,255,0.45); box-shadow: 0 8px 18px rgba(0,0,0,0.35), inset 0 1px 2px rgba(255,255,255,0.28); }
.social-btn svg { width: 24px; height: 24px; fill: currentColor; transition: transform 0.25s ease; }
.social-btn:hover { transform: translateY(-4px) scale(1.04); filter: brightness(1.06); }

.whatsapp-btn { background: linear-gradient(135deg, #25D366 0%, #18a54b 100%); border-color: rgba(255,255,255,0.5); border-radius: 50%; }
.instagram-btn { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 72%, #515bd4 100%); border-color: rgba(255,255,255,0.5); border-radius: 15px; }
.telegram-btn { background: linear-gradient(135deg, #2AABEE 0%, #0088cc 100%); border-color: rgba(255,255,255,0.5); border-radius: 50%; }

.whatsapp-btn:hover { box-shadow: 0 0 18px rgba(37, 211, 102, 0.55), 0 8px 18px rgba(0,0,0,0.35); }
.instagram-btn:hover { box-shadow: 0 0 18px rgba(221, 42, 123, 0.55), 0 8px 18px rgba(0,0,0,0.35); }
.telegram-btn:hover { box-shadow: 0 0 18px rgba(0, 136, 204, 0.55), 0 8px 18px rgba(0,0,0,0.35); }

/* Disable hover-only desktop effects on touch devices to avoid first-tap hover capture. */
@media (hover: none), (pointer: coarse) {
   .logo,
   .header-btn,
   .back-capsule,
   .glass-card,
   .item-card,
   .btn,
   .back-btn-modern,
   .admin-edit-icon,
   .admin-delete-icon,
   .floating-btn,
   .option-item,
   .close-btn,
   .search-chip,
   .search-result-item,
   .social-login-btn,
   .social-btn,
   .contact-icon-btn,
   .password-eye-btn,
   .admin-list-item,
   .admin-request-card,
   .chat-back-btn,
   .quick-story-edit {
      touch-action: manipulation;
   }

   .logo:hover,
   .header-btn:hover,
   .back-capsule:hover,
   .item-card:hover,
   .item-card:hover .item-img,
   .back-btn-modern:hover,
   .admin-edit-icon:hover,
   .admin-delete-icon:hover,
   .floating-btn:hover,
   .option-item:hover,
   .close-btn:hover,
   .search-chip:hover,
   .search-result-item:hover,
   .social-login-btn:hover,
   .social-btn:hover,
   .contact-icon-btn:hover,
   .password-eye-btn:hover,
   .admin-list-item:hover,
   .admin-request-card:hover,
   .chat-back-btn:hover,
   .quick-story-edit:hover,
   .whatsapp-btn:hover,
   .instagram-btn:hover,
   .telegram-btn:hover {
      transform: none !important;
      filter: none !important;
      box-shadow: none !important;
   }

   .btn:hover {
      background: rgba(255, 255, 255, 0.05) !important;
      color: #fff !important;
      border-color: var(--glass-border) !important;
   }

   .btn-primary:hover {
      background: var(--primary) !important;
      color: #000 !important;
      border-color: var(--primary) !important;
   }

   .btn-danger:hover {
      background: rgba(255, 0, 0, 0.1) !important;
      color: #ff4d4d !important;
      border-color: rgba(255, 0, 0, 0.5) !important;
   }

   .btn-buy:hover {
      background: linear-gradient(90deg, rgba(var(--primary-rgb),0.14) 0%, rgba(var(--accent-rgb),0.22) 100%) !important;
      color: var(--gold) !important;
      border-color: var(--primary) !important;
   }

   .btn-vip-buy:hover {
      background: linear-gradient(90deg, rgba(var(--primary-rgb),0.18) 0%, rgba(var(--primary-rgb),0.34) 100%) !important;
      color: var(--gold) !important;
      border-color: var(--gold) !important;
   }

   .header-btn:hover {
      background: rgba(255, 255, 255, 0.05) !important;
      color: #fff !important;
      border-color: rgba(var(--primary-rgb), 0.25) !important;
   }

   .back-capsule:hover,
   .back-btn-modern:hover,
   .chat-back-btn:hover {
      background: rgba(255, 255, 255, 0.05) !important;
      color: #fff !important;
      border-color: var(--glass-border) !important;
   }
}

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

   .fixed-top-container,
   .global-search-panel,
   .app-layer,
   .modal-box,
   .trending-track {
      will-change: auto;
   }
}

/* =========================================
   الشاشات الصغيرة (Responsive Media Queries)
========================================= */
@media (max-width: 768px) {
   header { min-height: 68px; }
   header { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
   .announcement-bar { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
   .glass-card, .item-card { -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
   #headerSearchBtn.search-open { transform: scale(0.95); }
   .logo { font-size: clamp(1.1rem, 4.5vw, 1.4rem); }
    .container { margin-top: 130px; } 
   .folders-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); } 
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px;}
   #toastContainer { right: 15px; left: auto; top: calc(var(--fixed-top-height) + 14px); align-items: flex-end; }
    .search-box { min-width: 100%; }
}

@media (max-width: 480px) {
   :root {
      --page-gutter: 10px;
      --header-gap: 6px;
      --header-icon-size: 40px;
      --header-avatar-size: 34px;
      --header-icon-font: 1.05rem;
      --floating-offset: 12px;
      --floating-size: 56px;
   }
   .logo { letter-spacing: 1px; }
}
