@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* الأساسيات والخلفية */
* {
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: #faf8f5; 
    color: #1a1a1a; 
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* الهيدر والشريط العلوي */
.topbar, .store-header {
    display: flex;
    align-items: center;
    padding: 0 40px; 
    height: 75px; /* ارتفاع ثابت وأنيق */
    background: #111111; 
    color: #d4af37; 
    border-bottom: 1px solid #2a2a2a;
    position: relative;
}

.topbar nav {
    display: flex;
    gap: 20px;
    margin-inline-start: auto; /* دفع الروابط للجهة المعاكسة للوجو */
    align-items: center;
}

.store-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-inline-start: auto;
}

/* =========================================
   تنسيقات اللوجو الاحترافية (يافطة فخمة متدلية)
   ========================================= */
.brand {
    background: #faf8f5; 
    padding: 10px 25px 15px; 
    border-radius: 0 0 24px 24px; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(212, 175, 55, 0.4); 
    border-top: none;
    
    /* السر هنا: اللوجو متحرر من حجم الهيدر ومتعلق منه */
    position: absolute;
    top: 0;
    inset-inline-start: 40px; /* بيظبط يمين في العربي ويسار في الإنجليزي */
    z-index: 1001;

    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 110px; 
    width: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
    filter: drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.08)); 
}

.logo-img:hover {
    transform: scale(1.08) translateY(-3px); 
}

/* الأزرار */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 24px;
    border-radius: 4px; 
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.btn-sm {
    min-height: 36px;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-primary {
    background: #d4af37;
    color: #111;
}

.btn-primary:hover {
    background: #b5952f;
}

.btn-outline {
    border: 1px solid #d4af37;
    color: #d4af37;
    background: transparent;
}

.btn-outline:hover {
    background: #d4af37;
    color: #111;
}

.btn-light {
    background: #ffffff;
    color: #111;
    border: 1px solid #e0e0e0;
}

/* الحاويات والكروت */
.container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

.card, .stat, .table-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    padding: 24px;
    border: 1px solid #f0ebe1;
}

.empty, .notice {
    background: #fdfaf2;
    border-left: 4px solid #d4af37;
    padding: 16px;
    border-radius: 4px;
    color: #554422;
}

/* النماذج وتسجيل الدخول */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #faf8f5 0%, #e8e3d8 100%);
}

.auth-card, .settings-form {
    width: min(100%, 480px);
    display: grid;
    gap: 20px;
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #d4af37;
}

.wide-form {
    width: min(100%, 980px);
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

input, textarea, select {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid #e2ddd5;
    border-radius: 4px;
    background: #fbfaf8;
    font-family: inherit;
    color: #1a1a1a;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* لوحة التحكم (الآدمن) */
.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #111111;
    color: #fff;
    padding: 30px 20px;
    display: grid;
    align-content: start;
    gap: 12px;
    border-right: 1px solid #2a2a2a;
}

.sidebar a {
    color: #a0a0a0;
    padding: 12px 16px;
    border-radius: 4px;
    font-weight: 600;
}

.sidebar a:hover {
    background: #1a1a1a;
    color: #d4af37;
    padding-left: 24px; 
}

.admin-main {
    padding: 40px;
    background: #faf8f5;
}

.stats, .admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

/* الجداول والتنسيقات الداخلية */
.heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters, .search-bar, .inline-form, .coupon-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid #f0ebe1;
    text-align: start;
    vertical-align: middle;
}

th {
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* حالات الطلبات (Badges) */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.status-pending { background: #fff8e1; color: #f57f17; }
.status-confirmed, .status-processing { background: #e3f2fd; color: #1565c0; }
.status-shipped { background: #e0f2f1; color: #00695c; }
.status-delivered { background: #e8f5e9; color: #2e7d32; }
.status-cancelled { background: #ffebee; color: #c62828; }

.price-stack {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid #f0ebe1;
    padding-top: 20px;
}

.price-stack div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-weight: 600;
}

.price-stack div:last-child {
    font-size: 18px;
    color: #d4af37;
    border-top: 1px dashed #e2ddd5;
    padding-top: 16px;
}

/* التجاوب مع الموبايل */
@media (max-width: 768px) {
    .admin-shell, .checkout-layout { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr 1fr; padding: 20px; }
    .store-header, .heading-row { flex-wrap: wrap; gap: 16px; padding: 20px; }
    .store-actions, .filters, .search-bar, .coupon-box { width: 100%; }
    .store-actions .btn { flex: 1; }
    .two-col { grid-template-columns: 1fr; }
    .table-card { overflow-x: auto; }
    .filters input, .filters select, .search-bar input, .coupon-box input { flex: 1; min-width: 100%; }
    .admin-main { padding: 20px; }
    
    /* تظبيط الهيدر واللوجو للموبايل */
    .topbar { padding: 0 20px; height: 65px; }
    .brand { inset-inline-start: 20px; padding: 5px 15px 10px; }
    .logo-img { height: 75px; } /* تصغير خفيف للموبايل */
}

/* =========================================
   تنسيقات صفحة الهبوط (Landing Page)
   ========================================= */

/* شريط شفاف تماماً مع تدرج لوني سينمائي ناعم جداً */
.landing .topbar {
    background: transparent !important; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* التدرج اللوني اللي بيخلي الروابط واضحة بدون صندوق مزعج */
.landing .topbar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 140px; /* بينزل بنعومة على الصورة */
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: -1;
    pointer-events: none; 
}

/* تنسيق الروابط (عربي - English) عشان تبان أنيقة */
.landing .topbar nav a {
    color: #f0f0f0;
    font-size: 15px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.landing .topbar nav a:hover, .landing .topbar nav a.active-lang {
    color: #d4af37;
    background: rgba(255, 255, 255, 0.05);
}

/* الخلفية الرئيسية للصفحة */
.landing {
    background: url('https://athar.masrofy.org/atharbackground.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* طبقة التدرج اللوني فوق الصورة (عشان الكلام يكون واضح) */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(17,17,17,0.95) 0%, rgba(42,32,20,0.6) 100%);
    z-index: 1;
    pointer-events: none; 
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px; 
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 1300px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    align-items: center;
    position: relative; 
    z-index: 2; 
}

/* ترتيب العناصر على الشاشات الكبيرة (الكلام يمين والبطاقات يسار) */
@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
    html[dir="rtl"] .hero-text-box {
        padding-left: 40px;
    }
    html[dir="ltr"] .hero-text-box {
        padding-right: 40px;
    }
}

/* نصوص الواجهة */
.hero-text-box {
    color: #ffffff;
}

.eyebrow {
    color: #d4af37;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    padding: 6px 18px;
    border-radius: 30px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.hero-text-box h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.2;
    margin: 0 0 20px;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.hero-text-box .lead {
    font-size: 1.3rem;
    color: #e8e8e8;
    margin-bottom: 20px;
}

.hero-text-box .story {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 40px;
    line-height: 1.8;
}

/* الأزرار الجديدة */
.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-glow {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.btn-outline-light {
    border: 1px solid #ffffff;
    color: #ffffff;
    background: transparent;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-outline-light:hover {
    background: #ffffff;
    color: #111111;
}

/* =========================================
   البطاقات الزجاجية (Glassmorphism Cards)
   ========================================= */
.features-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-card {
    background: rgba(255, 255, 255, 0.03); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px 20px;
    border-radius: 16px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.feature-card .icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #d4af37;
    margin: 0 0 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

.feature-card p {
    font-size: 0.9rem;
    color: #cccccc;
    margin: 0;
    line-height: 1.7;
}
/* =========================================
   تنسيقات صفحة المتجر (Shop Page)
   ========================================= */

/* جعل الهيدر في الصفحات الداخلية ثابت بلون غامق */
body:not(.landing) .topbar {
    background: #111111 !important; /* لون أسود ثابت */
    position: relative; /* غير ثابت كصفحة الهبوط */
}

/* تنسيق سلة المشتريات واللغة في الهيدر */
.lang-link { color: #a0a0a0; font-weight: 600; }
.lang-link.active-lang { color: #d4af37; }
.lang-link:hover { color: #ffffff; }

.cart-btn {
    position: relative;
    padding-inline-end: 40px !important; /* مساحة لرقم السلة */
}

.cart-badge {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #111;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 20px;
}

/* حاوية المتجر وعناوينه */
.shop-container {
    padding-top: 60px;
}

.shop-header {
    text-align: center;
    margin-bottom: 50px;
}

.shop-header h1 {
    font-size: 2.5rem;
    color: #111111;
    margin-bottom: 10px;
}

.shop-subtitle {
    color: #888;
    font-size: 1.1rem;
}

/* شبكة المنتجات (Grid) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* كارت المنتج */
.product-card {
    display: flex;
    flex-direction: column;
    padding: 0; /* مسح البادينج الأساسي للكارت لتوسيع الصورة */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8e3d8;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: #d4af37;
}

/* صورة المنتج */
.product-img-wrapper {
    width: 100%;
    height: 280px;
    background: #fdfcfb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0ebe1;
    overflow: hidden;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05); /* تكبير ناعم للصورة عند المرور */
}

.no-image-placeholder {
    color: #dce0e5;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* تفاصيل المنتج داخل الكارت */
.product-card .card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: #1a1a1a;
}

.product-card .desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* إظهار سطرين فقط من الوصف */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* البيانات (الحجم، التركيز، الخ) */
.product-card .meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.product-card .meta-list span {
    background: #f7f4ef;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #554422;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* السعر */
.product-card .price-row {
    margin-top: auto; /* دفع السعر للأسفل دائماً */
    margin-bottom: 20px;
}

.product-card .price-row strong {
    font-size: 1.6rem;
    color: #d4af37;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.product-card .price-row small {
    font-size: 0.9rem;
    color: #888;
}

/* أزرار المنتج */
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* شكل رسالة "لا توجد منتجات" */
.shop-page .empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: transparent;
    border: 2px dashed #dce0e5;
    font-size: 1.2rem;
    color: #888;
}

.empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
}