:root {
    --lumira-navy: #0B1329;
    --lumira-navy-2: #162447;
    --lumira-gold: #D4AF37;
    --lumira-gold-light: #F3E5AB;
    --primary: #198754;
    --primary-dark: #146c43;
    --primary-light: #ecfdf5;
    --success: #10b981;
    --danger: #dc2626;
    --warning: #d97706;
    --text: #0f172a;
    --muted: #64748b;
    --background: #f1f5f9;
    --card-radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Cairo", sans-serif;
    background: var(--background);
    color: var(--text);
    padding-bottom: 120px;
}

button,
input,
select {
    font-family: inherit;
}

.fw-extrabold {
    font-weight: 800 !important;
}

.fw-black {
    font-weight: 900 !important;
}

/* ==========================================
   HERO & OFFICIAL LUMIRA LOGO ANIMATION
========================================== */
.hero-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 55% 45% at 25% 0%, rgba(243, 229, 171, 0.16), transparent 70%),
        radial-gradient(ellipse 60% 50% at 90% 100%, rgba(16, 185, 129, 0.22), transparent 70%),
        linear-gradient(145deg, #0B1329 0%, #132247 55%, #0d3b38 100%);
    color: #fff;
    padding: 28px 16px 34px;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    box-shadow: 0 12px 35px rgba(11, 19, 41, 0.22);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.lumira-hero-brand {
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.lumira-hero-mark {
    --k: 1;
    width: 44px;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.35));
}

.lumira-hero-wordmark {
    font-family: "SF Pro Display", "Inter", "Montserrat", "Segoe UI", sans-serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.25em;
    line-height: 1;
    background: linear-gradient(100deg, #B8932A, var(--lumira-gold) 25%, var(--lumira-gold-light) 50%, var(--lumira-gold) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lumira-hero-tagline {
    font-family: "SF Pro Display", "Inter", "Montserrat", "Segoe UI", sans-serif;
    font-size: 6.5px;
    letter-spacing: 0.45em;
    color: #cbd5e1;
    margin-top: 4px;
}

.lumira-draw {
    stroke-dasharray: 1;
    animation: lumiraDraw calc(var(--k, 0) * 2.2s) cubic-bezier(.55, 0, .2, 1) both;
}

@keyframes lumiraDraw {
    from {
        stroke-dashoffset: 1;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.lumira-fade {
    animation: lumiraFade calc(var(--k, 0) * .9s) ease-out calc(var(--k, 0) * 1.2s) both;
}

@keyframes lumiraFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lumira-pop,
.lumira-twk {
    transform-box: fill-box;
    transform-origin: center;
}

.lumira-pop {
    animation: lumiraPop calc(var(--k, 0) * .9s) cubic-bezier(.2, 1.4, .4, 1) calc(var(--k, 0) * 2s) both;
}

.lumira-twk {
    animation: lumiraTwk calc(var(--k, 0) * 4s) ease-in-out calc(var(--k, 0) * 3s) infinite;
}

@keyframes lumiraPop {
    from {
        transform: scale(0) rotate(-90deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes lumiraTwk {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.16);
    }
}

.lumira-runner {
    stroke-dasharray: .07 .93;
    opacity: 0;
    animation: lumiraRun calc(var(--k, 0) * 3.4s) linear calc(var(--k, 0) * 3s) infinite;
}

@keyframes lumiraRun {
    0% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: -1;
        opacity: 0;
    }
}

.hero-title {
    font-size: clamp(1.45rem, 4.5vw, 2.2rem);
    font-weight: 900;
    margin-bottom: 6px;
    color: #ffffff;
}

.hero-subtitle {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.search-wrapper {
    max-width: 780px;
    margin: auto;
    position: relative;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
    font-size: 1.2rem;
}

.search-box {
    width: 100%;
    min-height: 56px;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    padding: 12px 52px 12px 48px;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text);
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--lumira-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.25), 0 10px 28px rgba(0, 0, 0, 0.25);
}

.clear-search {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    display: none;
    padding: 4px;
}

.clear-search:hover {
    color: var(--danger);
}

.search-chip {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    transition: all 0.2s ease;
}

.search-chip:hover,
.search-chip.active {
    background: var(--lumira-gold);
    color: var(--lumira-navy);
    border-color: var(--lumira-gold);
    transform: translateY(-1px);
}

.hero-biosphere-btn {
    background: linear-gradient(135deg, #22e6ff, #10b981);
    color: #050b18 !important;
    border: none;
    font-size: 0.92rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-biosphere-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 230, 255, 0.35) !important;
}

/* ==========================================
   CATEGORIES TABS (شريط الأقسام مع الأيقونات)
========================================== */
.categories-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 4px 2px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll-container::-webkit-scrollbar {
    display: none;
}

.cat-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    border: 1.5px solid #e2e8f0;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.cat-pill-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.cat-pill-btn.active {
    background: linear-gradient(135deg, var(--lumira-navy), #1e3a5f);
    color: #ffffff;
    border-color: var(--lumira-gold);
    box-shadow: 0 6px 16px rgba(11, 19, 41, 0.18);
}

.cat-pill-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #f8fafc;
    flex-shrink: 0;
}

.cat-pill-count {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
}

.cat-pill-btn.active .cat-pill-count {
    background: var(--lumira-gold);
    color: var(--lumira-navy);
}

/* ==========================================
   PACKAGES SECTION (بطاقات الباقات الشاملة)
========================================== */
.pkg-section-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--lumira-navy), #1e3a5f);
    color: var(--lumira-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.package-catalog-card {
    height: 100%;
    border-radius: 22px;
    background: linear-gradient(165deg, #0B1329 0%, #152244 100%);
    color: #f8fafc;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 28px rgba(11, 19, 41, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.package-catalog-card:hover {
    transform: translateY(-4px);
    border-color: var(--lumira-gold);
    box-shadow: 0 16px 36px rgba(11, 19, 41, 0.24);
}

.pkg-card-img-wrap {
    position: relative;
    height: 145px;
    width: 100%;
    overflow: hidden;
    background: #091022;
}

.pkg-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.package-catalog-card:hover .pkg-card-img-wrap img {
    transform: scale(1.04);
}

.pkg-card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0B1329 2%, rgba(11, 19, 41, 0.25) 60%, transparent 100%);
}

.pkg-savings-ribbon {
    background: linear-gradient(135deg, #D4AF37, #b58d1f);
    color: #0B1329;
    font-weight: 800;
    font-size: 0.74rem;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.pkg-test-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.73rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pkg-test-tag:hover {
    background: rgba(34, 230, 255, 0.18);
    border-color: #22e6ff;
    color: #ffffff;
}

/* ==========================================
   TOOLBAR & TEST CARDS (بطاقات التحاليل الفردية)
========================================== */
.catalog-container {
    max-width: 1220px;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.results-count {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sort-select {
    min-width: 165px;
    border-radius: 10px;
    border-color: #cbd5e1;
}

.algo-filter-btn {
    background: #f5f3ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.algo-filter-btn.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.test-card {
    height: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--card-radius);
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.test-card:hover {
    transform: translateY(-3px);
    border-color: #94a3b8;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
}

.test-card.in-cart-card {
    border-color: var(--primary) !important;
    background: linear-gradient(180deg, rgba(25, 135, 84, 0.03) 0%, #ffffff 40%);
}

.test-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.test-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 8px;
    padding: 3px 9px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #a7f3d0;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: monospace;
    white-space: nowrap;
}

.test-cat-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 8px;
}

.test-title-link {
    text-decoration: none;
    color: var(--text);
    display: block;
    margin-top: 10px;
}

.test-title-link:hover .test-name {
    color: var(--primary);
}

.test-name {
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 3px;
    transition: color 0.15s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.test-name-en {
    color: var(--muted);
    font-size: 0.78rem;
    font-family: monospace;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-description {
    color: #475569;
    font-size: 0.8rem;
    margin-top: 8px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.test-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 12px;
}

.meta-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.71rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-badge.fasting-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.test-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.test-price {
    color: var(--primary);
    font-weight: 900;
    font-size: 1.1rem;
    white-space: nowrap;
    line-height: 1.2;
}

.test-old-price {
    color: #ef4444;
    text-decoration: line-through;
    font-size: 0.76rem;
    font-weight: 700;
    display: block;
}

.btn-add {
    min-width: 108px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.84rem;
    padding: 8px 14px;
}

/* تأثير إطار وتوهج بطاقة الخوارزمية */
.algo-card-highlight {
    border: 1.5px solid rgba(99, 102, 241, 0.4) !important;
}

.algo-badge {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.algo-badge:hover {
    background: #4f46e5;
    color: #ffffff;
}

/* زر الإضافة والإلغاء */
.btn-added {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #10b981;
    font-weight: 800;
    transition: all 0.2s ease-in-out;
}

.btn-added:hover {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* LOADING & EMPTY STATES */
.loading-container {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 2.8rem;
    height: 2.8rem;
}

.empty-state {
    background: #fff;
    border-radius: 24px;
    padding: 45px 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.empty-icon {
    font-size: 3.2rem;
    color: #94a3b8;
    margin-bottom: 12px;
}

/* ==========================================
   FLOATING CART & SIDEBAR
========================================== */
.floating-cart {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    background: rgba(11, 19, 41, 0.96);
    color: #fff;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    display: none;
}

.floating-cart-inner {
    max-width: 1200px;
    width: 100%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.cart-total-label {
    color: #cbd5e1;
    font-size: 0.75rem;
}

.cart-total {
    color: #34d399;
    font-size: 1.25rem;
    font-weight: 900;
}

.cart-button {
    border-radius: 999px;
    font-weight: 800;
    padding: 10px 22px;
    white-space: nowrap;
}

.cart-badge {
    min-width: 25px;
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.cart-sidebar {
    width: 100% !important;
    max-width: 100%;
    border: none !important;
}

@media (min-width: 768px) {
    .cart-sidebar {
        width: 450px !important;
        border-left: 1px solid #e2e8f0 !important;
        border-radius: 24px 0 0 24px;
    }
}

.offcanvas-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}

.pb-safe {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
}

.cart-list {
    max-height: 42vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.cart-item {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-name {
    font-weight: 700;
    line-height: 1.4;
    font-size: 0.92rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

.remove-item {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.token-box {
    background: #f0fdf4;
    border: 1.5px dashed #10b981;
    border-radius: 18px;
    padding: 16px;
}

.token-value {
    font-size: clamp(1.6rem, 6vw, 2.3rem);
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
    direction: ltr;
}

@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.pulse-animation {
    animation: softPulse 2s infinite;
}

@media (max-width: 575.98px) {
    .sort-select {
        flex-grow: 1;
    }

    .cart-button {
        padding: 9px 16px;
        font-size: 0.9rem;
    }

    .cart-total {
        font-size: 1.1rem;
    }
}

/* ==========================================
   INSTAGRAM / FACEBOOK SKELETON SHIMMER UI
========================================== */
.skeleton-card {
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 18px;
    border: 1.5px solid #e2e8f0;
    min-height: 220px;
}

.skeleton-box {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: lumiraShimmer 1.3s infinite linear;
    border-radius: 8px;
}

@keyframes lumiraShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}