/* ==========================================================================
   1. الإعدادات ومتغيرات الألوان الطبية الفاخرة (Clinical Luxury Tokens)
   ========================================================================== */
:root {
    --color-emerald-deep: #0c3c2e;   /* الأخضر الزمردي المخبري الفخم */
    --color-emerald-light: #165241;
    --color-emerald-soft: rgba(12, 60, 46, 0.05);
    --color-gold-muted: #d4af37;     /* لمسات ذهبية مطفية */
    --color-pure-white: #ffffff;
    --color-clean-bg: #fcfdfe;       /* خلفية نظيفة ومريحة للعين */
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-border-light: #e2e8f0;
    
    --font-heading: 'Amiri', 'Cairo', serif;
    --font-body: 'Cairo', sans-serif;
    --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-clean-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button, select, input, textarea {
    font-family: var(--font-body);
    outline: none;
}

/* الأزرار الاحترافية */
.btn {
    display: inline-block;
    padding: 14px 38px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    border: none;
    border-radius: 4px;
}

.btn-emerald {
    background-color: var(--color-emerald-deep);
    color: var(--color-pure-white);
}

.btn-emerald:hover {
    background-color: var(--color-emerald-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(12, 60, 46, 0.15);
}

.btn-dark-emerald {
    background-color: #07221b;
    color: var(--color-pure-white);
}

.btn-dark-emerald:hover {
    background-color: var(--color-emerald-deep);
}

.w-100 { width: 100%; }

/* العناوين والخطوط الزمردية */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--color-emerald-deep);
    margin-bottom: 12px;
    font-weight: 700;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

.emerald-line {
    width: 50px;
    height: 3px;
    background-color: var(--color-gold-muted);
    margin: 15px auto 0 auto;
    border-radius: 2px;
}

/* ==========================================================================
   2. أشرطة الموقع العلوية (Top Bar & Header)
   ========================================================================== */
.top-bar {
    background-color: var(--color-emerald-deep);
    color: var(--color-pure-white);
    text-align: center;
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.top-bar i {
    color: var(--color-gold-muted);
    margin-left: 6px;
}

.main-header {
    position: fixed;
    top: 35px; /* يترك مساحة للتوب بار العلوي */
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    z-index: 1000;
    transition: var(--transition-fast);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-emerald-deep);
}

.logo a span {
    color: var(--color-gold-muted);
    font-weight: 300;
    margin-right: 2px;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-menu ul a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-main);
    position: relative;
    padding: 5px 0;
}

.nav-menu ul a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-emerald-deep);
    transition: var(--transition-fast);
}

.nav-menu ul a:hover::after,
.nav-menu ul a.active::after {
    width: 100%;
}

.nav-menu ul a:hover,
.nav-menu ul a.active {
    color: var(--color-emerald-deep);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cart-toggle-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--color-emerald-deep);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.cart-toggle-btn:hover {
    color: var(--color-gold-muted);
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background-color: var(--color-gold-muted);
    color: var(--color-emerald-deep);
    font-size: 0.75rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--color-emerald-deep);
    cursor: pointer;
}

/* ==========================================================================
   3. القسم الترحيبي الطبي العضوي (Hero Section)
   ========================================================================== */
.hero-section {
    position: relative;
    height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1540555700478-4be289fbecef?q=80&w=1600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: var(--color-pure-white);
    padding-top: 115px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(12,60,46,0.85), rgba(12,60,46,0.4));
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 650px;
}

.hero-badge {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    color: var(--color-gold-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 40px;
    color: #e2e8f0;
}

/* ==========================================================================
   4. قسم الثقة والضمان المخبري (Trust Badges)
   ========================================================================== */
.trust-section {
    padding: 60px 0;
    background-color: var(--color-pure-white);
    border-bottom: 1px solid var(--color-border-light);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.trust-card {
    text-align: center;
    padding: 20px;
}

.trust-card i {
    font-size: 2.2rem;
    color: var(--color-gold-muted);
    margin-bottom: 15px;
}

.trust-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-emerald-deep);
    margin-bottom: 8px;
}

.trust-card p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   5. المتجر الرئيسي ونظام التصفية الحي (Shop & Filter)
   ========================================================================== */
.shop-section {
    padding: 100px 0;
}

/* متحكمات الفلترة الحية */
.filter-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--color-pure-white);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-light);
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--color-emerald-deep);
    color: var(--color-pure-white);
    border-color: var(--color-emerald-deep);
}

/* شبكة عرض المواد الطبية المنتجات */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 35px;
}

.product-card {
    background-color: var(--color-pure-white);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(12, 60, 46, 0.06);
    border-color: rgba(12, 60, 46, 0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--color-gold-muted);
    color: var(--color-emerald-deep);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    z-index: 5;
}

.product-img-wrapper {
    position: relative;
    height: 320px;
    background-color: #fafafa;
    overflow: hidden;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.04);
}

.quick-view-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 60, 46, 0.75);
    color: var(--color-pure-white);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    backdrop-filter: blur(2px);
    transition: var(--transition-fast);
}

.product-card:hover .quick-view-btn {
    opacity: 1;
}

.product-info {
    padding: 22px;
    text-align: center;
    border-top: 1px solid #f8fafc;
}

.product-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-emerald-deep);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-gold-muted);
}

/* ==========================================================================
   6. السلة الطبية الجانبية (Cart Sidebar)
   ========================================================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100%;
    background-color: var(--color-pure-white);
    box-shadow: -15px 0 40px rgba(0,0,0,0.08);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 25px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-emerald-soft);
}

.cart-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-emerald-deep);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--color-emerald-deep);
}

.cart-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.empty-cart-msg {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 60px;
}

/* الكروت داخل السلة */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
    align-items: center;
}

.cart-item-img {
    width: 65px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-emerald-deep);
    margin-bottom: 3px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 0.95rem;
    color: var(--color-gold-muted);
    font-weight: 700;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 5px;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid var(--color-border-light);
    background-color: #fafbfc;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.cart-total #cartTotalValue {
    color: var(--color-emerald-deep);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 60, 46, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* ==========================================================================
   7. النوافذ المنبثقة المتطورة بنظام التبويب (Advanced Modals)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 34, 27, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--color-pure-white);
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.12);
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

.modal.open .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--color-emerald-deep);
    z-index: 10;
}

/* توزيع عناصر التبويب والمحتوى الطبي */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 40px;
}

.modal-img-side img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 4px;
}

.modal-info-side h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-emerald-deep);
    margin-bottom: 8px;
}

.modal-price {
    font-size: 1.4rem;
    color: var(--color-gold-muted);
    font-weight: 700;
    display: block;
    margin-bottom: 20px;
}

/* نظام أزرار التبويبات الفخم */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 15px;
    gap: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.tab-btn.active {
    color: var(--color-emerald-deep);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-emerald-deep);
}

.tab-content-wrapper {
    min-height: 80px;
    margin-bottom: 25px;
}

.tab-content {
    display: none;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* التحكم بالخيارات والكميات */
.product-options {
    border-top: 1px solid var(--color-border-light);
    padding-top: 20px;
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 15px;
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text-main);
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    background-color: #f8fafc;
    font-size: 0.9rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    max-width: 120px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
}

.quantity-control button {
    width: 35px;
    height: 35px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

.quantity-control button:hover {
    background-color: var(--color-border-light);
}

.quantity-control input {
    width: 50px;
    height: 35px;
    text-align: center;
    border-left: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    border-top: none;
    border-bottom: none;
    font-weight: 700;
}

/* استمارة الشحن الطبي الفاخر */
.checkout-content {
    max-width: 560px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 25px;
}

.checkout-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-emerald-deep);
}

.checkout-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fafafa;
}

.checkout-summary {
    background-color: var(--color-emerald-soft);
    border: 1px solid rgba(12, 60, 46, 0.1);
    padding: 18px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--color-text-main);
}

.checkout-summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.checkout-summary .final-total {
    border-top: 1px solid var(--color-border-light);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.checkout-summary strong {
    color: var(--color-gold-muted);
}

/* ==========================================================================
   8. أسفل الموقع (Footer)
   ========================================================================== */
.main-footer {
    background-color: #061f18;
    color: #94a3b8;
    padding: 70px 0 25px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 60px;
    border-bottom: 1px solid #0d3c2e;
    padding-bottom: 40px;
}

.footer-about h3 {
    color: var(--color-pure-white);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-about h3 span {
    color: var(--color-gold-muted);
    font-weight: 300;
}

.footer-links h4, .footer-contact h4 {
    color: var(--color-pure-white);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul a:hover {
    color: var(--color-gold-muted);
    padding-right: 4px;
}

.footer-contact p {
    margin-bottom: 12px;
}

.footer-contact i {
    color: var(--color-gold-muted);
    margin-left: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    width: 36px;
    height: 36px;
    border: 1px solid #165241;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    color: var(--color-pure-white);
}

.social-icons a:hover {
    background-color: var(--color-gold-muted);
    border-color: var(--color-gold-muted);
    color: var(--color-emerald-deep);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    font-size: 0.85rem;
    color: #64748b;
}

/* ==========================================================================
   9. التجاوب الكامل مع الشاشات والهواتف (Responsive Systems)
   ========================================================================== */
@media (max-width: 992px) {
    .hero-title { font-size: 2.8rem; }
    .trust-grid { grid-template-columns: 1fr; gap: 20px; }
    .modal-grid { grid-template-columns: 1fr; gap: 25px; }
    .modal-img-side img { height: 320px; }
    .footer-grid { grid-template-columns: 1fr; gap: 35px; }
}

@media (max-width: 768px) {
    .main-header { top: 38px; }
    .menu-toggle-btn { display: block; }
    
    .nav-menu {
        position: fixed;
        top: 88px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 88px);
        background-color: var(--color-pure-white);
        transition: var(--transition-smooth);
        padding: 40px;
        border-top: 1px solid var(--color-border-light);
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }
    
    .nav-menu ul a { font-size: 1.15rem; }
    
    .hero-section { text-align: center; justify-content: center; }
    .hero-title { font-size: 2.2rem; }
    
    .cart-sidebar { width: 100%; right: -100%; }
    .modal-content { padding: 25px; width: 95%; max-height: 90vh; }
}