/**
 * السوق الإلكتروني للحرف والصناعات التقليدية - ولاية ميلة
 * الهوية البصرية والتصميم الجزائري التراثي الأصيل
 */

:root {
    --primary: #9d3c19;         /* طين ميلة الفخاري الأصيل Terracotta */
    --primary-dark: #7b290b;    /* بني فخاري عميق */
    --primary-light: #fbeee8;   /* وردي فخاري ناعم للخلفيات */
    --accent-olive: #385e38;    /* أخضر زيتي جزائري تقليدي */
    --accent-gold: #c68a35;     /* ذهبي نحاسي للمنتجات والشهادات */
    --accent-gold-light: #fef8ee;
    --dark-text: #222629;       /* لون النصوص الداكنة */
    --muted-text: #6c757d;      /* نصوص توضيحية */
    --body-bg: #fbf9f5;         /* بيج ناعم مريح للعين */
    --card-bg: #ffffff;
    --border-color: #ede4d8;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(157, 60, 25, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--body-bg);
    color: var(--dark-text);
    direction: rtl;
    text-align: right;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* حل مشكلة انقلاب الأرقام والهواتف والأسعار */
[dir="ltr"], .phone-number, .price-val, .order-code, .stat-value, .num-ltr {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    display: inline-block;
}

input[type="tel"],
input[type="number"] {
    direction: ltr !important;
    text-align: right;
    unicode-bidi: isolate;
}

h1, h2, h3, h4, .font-traditional {
    font-family: 'Amiri', 'Tajawal', serif;
    letter-spacing: -0.2px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.25s ease;
}
a:hover {
    color: var(--primary-dark);
}

/* ---------------- Top Announcement & Services Bar ---------------- */
.top-notice-bar {
    background: linear-gradient(135deg, #102a1d 0%, #1c4731 100%);
    color: #fff;
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 2px solid #c59b27;
}
.top-notice-bar a {
    color: #fff;
    text-decoration: none;
}
.top-service-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.top-service-badge:hover, .top-service-badge.active {
    background: #c59b27;
    color: #102a1d !important;
    border-color: #c59b27;
    box-shadow: 0 2px 6px rgba(197, 155, 39, 0.3);
}
.top-service-badge:hover i, .top-service-badge.active i {
    color: #102a1d !important;
}
.top-phone-link {
    color: #e2e8f0;
    text-decoration: none;
    font-family: monospace;
    font-weight: 700;
    transition: color 0.2s;
}
.top-phone-link:hover {
    color: #c59b27;
}

/* ---------------- Navbar & Header ---------------- */
.main-navbar {
    background: #ffffff;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-official-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 2px;
    border: 1.5px solid var(--accent-gold);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}
.brand-logo-seal {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--accent-gold));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(157, 60, 25, 0.25);
    flex-shrink: 0;
}
.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
    margin: 0;
}
.brand-subtitle {
    font-size: 0.75rem;
    color: var(--muted-text);
    margin: 0;
}

.search-header-box {
    max-width: 420px;
    width: 100%;
}
.search-header-box .form-control {
    border-radius: 50px;
    padding-right: 20px;
    padding-left: 45px;
    border-color: var(--border-color);
    background-color: #faf6f0;
}
.search-header-box .form-control:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(157, 60, 25, 0.15);
}
.search-header-box .search-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Navigation Links */
.nav-category-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0 0;
    position: relative;
}
/* غلاف التمرير مع تأثير التلاشي الجانبي لبيان وجود محتوى إضافي */
.nav-scroll-wrapper {
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
}
.nav-scroll-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0));
    pointer-events: none;
    z-index: 2;
}
.nav-scroll-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), rgba(255,255,255,0));
    pointer-events: none;
    z-index: 2;
}
/* إخفاء شريط التمرير كلياً مع الحفاظ على السحب والتمرير السلس */
.nav-scroll-container {
    overflow-x: auto !important;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE / Edge */
    padding-bottom: 4px;
}
.nav-scroll-container::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Edge, Opera */
    width: 0 !important;
    height: 0 !important;
}
/* أزرار الأسهم الأنيقة للتمرير السلس على أطراف الشريط */
.nav-scroll-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e0d7c7;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
}
.nav-scroll-arrow:hover {
    background: #1c4731;
    color: #ffd257;
    border-color: #1c4731;
    transform: scale(1.08);
}
@media (max-width: 767.98px) {
    .nav-scroll-arrow {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        background: #fdfaf4;
        border-color: #c59b27;
        color: #1c4731;
    }
    .nav-category-pill {
        padding: 5px 11px !important;
        font-size: 0.8rem !important;
    }
}
.nav-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #495057;
    border-radius: 50px;
    transition: all 0.2s;
    text-decoration: none !important;
    white-space: nowrap;
}
.nav-category-pill:hover, .nav-category-pill.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}
.nav-category-pill i {
    color: var(--accent-gold);
}

/* ---------------- Hero Section ---------------- */
.hero-craft-section {
    position: relative;
    background: radial-gradient(circle at 10% 20%, #832709 0%, #461102 90%);
    color: #fff;
    padding: 65px 0 75px;
    overflow: hidden;
    margin-bottom: 40px;
}
.hero-craft-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
}
.hero-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffd8a8;
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    backdrop-filter: blur(5px);
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 18px;
}
.hero-title span {
    color: #f7ba65;
}
.hero-desc {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 580px;
    margin-bottom: 30px;
}
.hero-seal-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* ---------------- Buttons ---------------- */
.btn-primary-craft {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    transition: all 0.25s;
}
.btn-primary-craft:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(157, 60, 25, 0.3);
}

.btn-accent-gold {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
}
.btn-accent-gold:hover {
    background-color: #ad7427;
    color: #fff;
    transform: translateY(-2px);
}

.btn-whatsapp-direct {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-whatsapp-direct:hover {
    background-color: #1eb954;
    border-color: #1eb954;
    color: #fff;
}

/* ---------------- Product Cards ---------------- */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: #d8c3b0;
}
.product-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #f4eee7;
    overflow: hidden;
}
.product-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .product-card-img-wrap img {
    transform: scale(1.05);
}
.product-badge-stack {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}
.badge-traditional {
    background: rgba(157, 60, 25, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}
.badge-custom-made {
    background: rgba(56, 94, 56, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
}

.product-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-category-tag {
    font-size: 0.78rem;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}
.product-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--dark-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 48px;
}
.product-artisan-line {
    font-size: 0.82rem;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.product-artisan-line i {
    color: var(--primary);
}
.product-price-box {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.original-price {
    font-size: 0.88rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

/* ---------------- Artisan Profile Cards ---------------- */
.artisan-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.artisan-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--accent-gold);
}
.artisan-avatar-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 14px;
    border: 3px solid var(--accent-gold);
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}
.artisan-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artisan-card-badge {
    background-color: #f7f2eb;
    color: #634320;
    border: 1px solid #dfcfbc;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 10px;
}

/* ---------------- Chamber Authenticity Seal ---------------- */
.chamber-seal-card {
    background: linear-gradient(135deg, #fefbf7 0%, #f9f1e6 100%);
    border: 2px dashed var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 30px 0;
}
.chamber-seal-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
}

/* ---------------- Features Bar ---------------- */
.features-strip {
    background: #fff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 28px 0;
    margin-bottom: 40px;
}
.feature-box {
    display: flex;
    align-items: center;
    gap: 15px;
}
.feature-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ---------------- Checkout & Cart ---------------- */
.cart-floating-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1040;
    background: var(--primary);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 10px 25px rgba(157, 60, 25, 0.4);
    transition: all 0.3s;
}
.cart-floating-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: scale(1.08);
}
.cart-badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #222;
    color: #fff;
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.checkout-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.order-summary-box {
    background: #fdfbf8;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

/* ---------------- Footer ---------------- */
.site-footer {
    background: #1e1713;
    color: #d1c7bd;
    margin-top: auto;
    padding-top: 55px;
    border-top: 4px solid var(--primary);
}
.site-footer h5, .footer-col-title {
    color: #fff;
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
.site-footer h5::after, .footer-col-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 2px;
    background: var(--accent-gold);
}
.site-footer a {
    color: #c0b5a9;
    text-decoration: none;
    transition: all 0.2s ease;
}
.site-footer a:hover {
    color: #f7ba65;
    padding-right: 4px;
}
.footer-social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff !important;
}
.footer-social-btn:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    padding-right: 0 !important;
}
.footer-links li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-bottom {
    background: #140f0c;
    padding: 16px 0;
    margin-top: 40px;
    font-size: 0.88rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.developer-box {
    transition: all 0.2s ease;
}
.developer-box:hover {
    border-color: rgba(255, 193, 7, 0.4) !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

/* ---------------- أقسام الصفحة الرئيسية الجديدة ---------------- */

/* 1. شريط إحصائيات وأرقام الغرفة */
.impact-counter-section {
    background: linear-gradient(135deg, #1b1613 0%, #2b1f17 100%);
    border-top: 1px solid rgba(198, 138, 53, 0.25);
    border-bottom: 1px solid rgba(198, 138, 53, 0.25);
    padding: 38px 0;
    color: #fff;
    margin: 40px 0;
}
.impact-stat-item {
    text-align: center;
    position: relative;
    padding: 10px;
}
.impact-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-gold);
    font-family: 'Tajawal', sans-serif;
    line-height: 1;
    margin-bottom: 6px;
    display: inline-block;
}
.impact-stat-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f7ede2;
    margin-bottom: 2px;
}
.impact-stat-desc {
    font-size: 0.78rem;
    color: #c0b5a9;
}

/* 2. بطاقات التسوق حسب المناسبة */
.occasion-card {
    background: #fff;
    border: 1px solid #eaded2;
    border-radius: 18px;
    padding: 24px 18px;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.occasion-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(168, 66, 24, 0.12);
    border-color: var(--primary);
}
.occasion-icon-wrap {
    font-size: 2.6rem;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.occasion-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2b1f17;
    margin-bottom: 6px;
    font-family: 'Amiri', serif;
}
.occasion-examples {
    font-size: 0.76rem;
    color: #7d7168;
    line-height: 1.4;
}

/* 3. ودجت المعرض أو الصالون القادم */
.exhibition-spotlight-card {
    background: linear-gradient(135deg, #1b3327 0%, #284b39 100%);
    border-radius: 20px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(27, 51, 39, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.exhibition-spotlight-img {
    height: 100%;
    min-height: 250px;
    object-fit: cover;
    width: 100%;
}

/* 4. قسم حرفي وسفير التراث الميلي للأسبوع */
.artisan-week-card {
    background: #fff;
    border: 1px solid #ebd9c5;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(168, 66, 24, 0.06);
    overflow: hidden;
}
.artisan-week-header {
    background: linear-gradient(135deg, #2b1f17 0%, #462c1d 100%);
    color: #fff;
    padding: 16px 24px;
}

/* 5. بانر استكشاف خريطة الورشات */
.map-cta-banner {
    background: linear-gradient(135deg, #a84218 0%, #873310 100%);
    border-radius: 22px;
    color: #fff;
    box-shadow: 0 12px 30px rgba(168, 66, 24, 0.25);
    overflow: hidden;
    position: relative;
}
.map-cta-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.08;
    background-image: radial-gradient(#fff 2px, transparent 2px);
    background-size: 24px 24px;
}

/* 6. شريط شركاء الدعم والمؤسسات الرسمية */
.partners-section {
    background: #fbf9f6;
    padding: 35px 0;
    border-top: 1px solid #eee5dc;
    border-bottom: 1px solid #eee5dc;
}
.partner-logo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #eaded2;
    border-radius: 14px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}
.partner-logo-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}
.partner-logo-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

/* ---------------- Responsive tweaks ---------------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.95rem;
    }
    .hero-desc {
        font-size: 1rem;
    }
    .search-header-box {
        max-width: 100%;
        margin-top: 10px;
    }
}
