/* ==========================================
   CHDE — Design System (Redesign)
   هوية بصرية مستوحاة من التراث الجزائري:
   خلفية وردية/بيج ناعمة، أخضر عميق، ذهب نحاسي، وزخرفة الزليج.
   ========================================== */

:root {
    /* --- ألوان متوافقة مع لوحة الإدارة (أسماء قديمة، قيم جديدة) --- */
    --color-primary:        #2E4A38;   /* أخضر عميق - العلامة */
    --color-primary-light:  #3C5E48;
    --color-secondary:      #C39A4E;   /* ذهب نحاسي - زخرفة تقليدية */
    --color-secondary-light:#D8B978;
    --color-cream:          #FBF6F0;   /* كريمي فاتح دافئ */
    --color-dark:           #21362A;   /* أخضر شبه أسود (تذييل) */
    --color-text:           #2B2622;   /* حبر دافئ */
    --color-text-light:     #8A7C72;   /* بنّي مغبّر */
    --color-border:         #E7D8CF;   /* حدّ بلون البشرة الوردية */
    --color-success:        #2F6B4F;
    --color-error:          #A6503F;

    /* --- رموز جديدة للواجهة الأمامية --- */
    --c-blush:      #F3E7E1;   /* خلفية الصفحة المسيطرة */
    --c-blush-deep: #EAD8CF;
    --c-paper:      #FFFFFF;

    --font-heading: 'Amiri', 'Playfair Display', serif;
    --font-body:    'Cairo', 'Poppins', sans-serif;

    --radius:     16px;
    --radius-sm:  10px;
    --shadow:      0 10px 30px rgba(74, 48, 40, 0.08);
    --shadow-lift: 0 18px 44px rgba(74, 48, 40, 0.14);
    --transition:  all .28s cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--c-blush);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-primary); line-height: 1.25; font-weight: 700; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* زخرفة الزليج — عنصر التوقيع البصري (للأقسام ذات العناوين الوسطى) */
.section > .container > h2::after {
    content: "";
    display: block;
    width: 74px;
    height: 2px;
    margin: 14px auto 0;
    background:
        linear-gradient(90deg, transparent 0 24px, var(--color-secondary) 24px 26px, transparent 26px 48px, var(--color-secondary) 48px 50px, transparent 50px) center/100% 2px no-repeat;
}
.section > .container > h2::before {
    content: "";
    display: block;
    width: 10px; height: 10px;
    margin: 0 auto 12px;
    background: var(--color-secondary);
    transform: rotate(45deg);
    box-shadow: 0 0 0 4px rgba(195, 154, 78, 0.18);
}

/* ===== Header ===== */
.site-header {
    background: rgba(251, 246, 240, 0.86);
    backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 22px; gap: 24px; }
.logo {
    font-family: var(--font-heading); font-size: 27px; font-weight: 700;
    color: var(--color-primary); letter-spacing: 3px;
    display: inline-flex; align-items: center; gap: 10px;
}
.logo::before {
    content: ""; width: 12px; height: 12px; background: var(--color-secondary);
    transform: rotate(45deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6);
}
.main-nav { display: flex; gap: 30px; flex: 1; justify-content: center; }
.main-nav a { font-weight: 600; color: var(--color-text); position: relative; padding: 4px 0; transition: var(--transition); }
.main-nav a::after {
    content: ""; position: absolute; inset-inline-start: 0; bottom: -2px;
    width: 0; height: 2px; background: var(--color-secondary); transition: width .28s ease;
}
.main-nav a:hover { color: var(--color-primary); }
.main-nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switcher { display: flex; gap: 4px; font-size: 13px; }
.lang-switcher a { padding: 4px 9px; border-radius: 20px; color: var(--color-text-light); font-weight: 600; }
.lang-switcher a.active { background: var(--color-primary); color: #fff; }

/* ===== Buttons ===== */
.btn {
    display: inline-block; padding: 12px 28px; border-radius: 40px;
    font-weight: 700; font-size: 15px; cursor: pointer; border: 1.5px solid transparent;
    transition: var(--transition); font-family: inherit;
}
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 8px 20px rgba(46, 74, 56, 0.22); }
.btn-primary:hover { background: var(--color-primary-light); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46, 74, 56, 0.28); }
.btn-outline { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-lg { padding: 15px 36px; font-size: 16px; }
.btn-link { background: none; border: none; color: var(--color-text-light); cursor: pointer; font-weight: 600; font-family: inherit; }
.btn-link:hover { color: var(--color-primary); }

/* ===== Hero ===== */
.hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 96px 0 84px;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(216, 185, 120, 0.22) 0%, transparent 55%),
        linear-gradient(180deg, var(--c-blush) 0%, var(--c-blush-deep) 100%);
}
.hero-inner { position: relative; }
.hero-inner::before {
    content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 22px;
    background: var(--color-secondary); transform: rotate(45deg);
    box-shadow: 0 0 0 5px rgba(195, 154, 78, 0.18), 0 0 0 10px rgba(195, 154, 78, 0.08);
}
.hero h1 { color: var(--color-primary); font-size: 50px; max-width: 820px; margin: 0 auto 20px; line-height: 1.18; }
.hero p { color: var(--color-text); opacity: .82; font-size: 19px; max-width: 600px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 42px; flex-wrap: wrap; }
.hero-search {
    display: flex; max-width: 560px; margin: 0 auto; background: var(--c-paper);
    border-radius: 40px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--color-border);
    padding: 6px 6px 6px 8px;
}
.hero-search input { flex: 1; border: none; padding: 14px 20px; font-size: 15px; font-family: inherit; background: transparent; }
.hero-search input:focus { outline: none; }
.hero-search button {
    background: var(--color-secondary); color: #fff; border: none; padding: 0 30px;
    font-weight: 700; cursor: pointer; border-radius: 40px; font-family: inherit; transition: var(--transition);
}
.hero-search button:hover { background: var(--color-secondary-light); }

/* ===== Sections ===== */
.section { padding: 74px 0; }
.section:nth-of-type(even) { background: var(--c-blush); }
.section:nth-of-type(odd)  { background: var(--color-cream); }
.section h2 { font-size: 33px; margin-bottom: 34px; text-align: center; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.section-head h2 { margin: 0; text-align: start; font-size: 30px; position: relative; padding-bottom: 12px; }
.section-head h2::after {
    content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
    width: 52px; height: 3px; border-radius: 2px; background: var(--color-secondary);
}
.section-head a { color: var(--color-primary); font-weight: 700; white-space: nowrap; }
.section-head a:hover { color: var(--color-secondary); }
.section-subtitle { text-align: center; color: var(--color-text-light); max-width: 580px; margin: -20px auto 40px; font-size: 15.5px; }

/* ===== Grid & Cards ===== */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.design-card, .project-card {
    background: var(--c-paper); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: var(--transition); border: 1px solid rgba(231, 216, 207, 0.7);
}
.design-card:hover, .project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.design-card img, .project-card img { width: 100%; height: 210px; object-fit: cover; }
.design-card h3, .project-card h3 { font-size: 18px; padding: 16px 18px 4px; color: var(--color-primary); }
.design-style { display: block; padding: 0 18px 18px; color: var(--color-text-light); font-size: 13px; }

.category-card, .occasion-card {
    background: var(--c-paper); border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 26px 22px; text-align: center; font-weight: 700; color: var(--color-primary); transition: var(--transition);
}
.category-card:hover, .occasion-card:hover {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: translateY(-4px);
}

.style-card {
    background: var(--c-paper); border: 1px solid var(--color-border); border-top: 3px solid var(--color-secondary);
    border-radius: var(--radius); padding: 26px 22px; text-align: center; font-weight: 700;
    color: var(--color-primary); transition: var(--transition);
}
.style-card:hover { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); transform: translateY(-4px); }

.empty-state { color: var(--color-text-light); text-align: center; grid-column: 1/-1; padding: 44px 0; }

/* ===== Why Choose CHDE (Features) ===== */
.features-section { background: var(--color-primary) !important; }
.features-section h2 { color: #fff; }
.features-section .section-subtitle { color: rgba(255, 255, 255, 0.78); }
.features-section > .container > h2::before { background: var(--color-secondary-light); box-shadow: 0 0 0 4px rgba(216, 185, 120, 0.2); }
.features-section > .container > h2::after {
    background:
        linear-gradient(90deg, transparent 0 24px, var(--color-secondary-light) 24px 26px, transparent 26px 48px, var(--color-secondary-light) 48px 50px, transparent 50px) center/100% 2px no-repeat;
}
.feature-card { text-align: center; padding: 14px; }
.feature-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 74px; height: 74px;
    border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--color-secondary-light);
    margin-bottom: 20px; border: 1px solid rgba(216, 185, 120, 0.35);
}
.feature-icon svg { width: 34px; height: 34px; }
.feature-card h3 { font-size: 19px; margin-bottom: 10px; color: #fff; }
.feature-card p { color: rgba(255, 255, 255, 0.72); font-size: 14.5px; line-height: 1.75; }

/* ===== Testimonials ===== */
.testimonial-card {
    background: var(--c-paper); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 30px; display: flex; flex-direction: column; gap: 15px; border: 1px solid rgba(231, 216, 207, 0.7);
    position: relative;
}
.testimonial-card::before {
    content: "\201D"; position: absolute; top: 10px; inset-inline-end: 22px;
    font-family: var(--font-heading); font-size: 64px; line-height: 1; color: rgba(195, 154, 78, 0.22);
}
.testimonial-rating { color: var(--color-border); font-size: 16px; letter-spacing: 2px; }
.testimonial-rating .star.filled { color: var(--color-secondary); }
.testimonial-comment { color: var(--color-text); font-style: italic; line-height: 1.85; flex: 1; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.author-name { font-weight: 700; color: var(--color-primary); }

/* ===== Contact Teaser ===== */
.contact-teaser {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-dark) 100%);
    color: #fff;
}
.contact-teaser-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact-teaser-text h2 { color: #fff; text-align: start; margin-bottom: 10px; }
.contact-teaser-text p { color: rgba(255, 255, 255, 0.82); max-width: 520px; }
.contact-teaser-info { list-style: none; display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.contact-teaser-info li { color: #fff; font-weight: 700; }
.contact-teaser-info li::before { content: "\2713"; color: var(--color-secondary-light); margin-inline-end: 6px; }
.contact-teaser .btn-primary { background: var(--color-secondary); flex-shrink: 0; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.contact-teaser .btn-primary:hover { background: var(--color-secondary-light); }

/* ===== جداول ومكوّنات مشتركة (واجهة + عميل + إدارة) ===== */
.admin-table { width: 100%; border-collapse: collapse; background: var(--c-paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--color-border); }
.admin-table th { background: #F3EBDF; font-size: 13px; text-transform: uppercase; letter-spacing: .3px; color: var(--color-primary); }
.admin-table tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-received { background: #E4EEE6; color: #2c5c42; }
.badge-in_progress { background: #FBF0D6; color: #9a7412; }
.badge-completed { background: #E6F4EC; color: var(--color-success); }
.badge-cancelled { background: #F7E4E0; color: var(--color-error); }
.badge-review, .badge-contact, .badge-preparing, .badge-waiting_approval { background: #FBF0D6; color: #9a7412; }
.badge-delivered { background: #E4EEE6; color: #2c5c42; }

.existing-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.existing-image { position: relative; width: 100px; display: block; }
.existing-image img { width: 100px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }

/* ===== Forms / Auth ===== */
.auth-page { display: flex; justify-content: center; padding: 70px 20px; }
.auth-card { background: var(--c-paper); padding: 42px; border-radius: var(--radius); box-shadow: var(--shadow-lift); max-width: 444px; width: 100%; border: 1px solid var(--color-border); }
.auth-card h1 { text-align: center; margin-bottom: 26px; font-size: 28px; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 700; font-size: 14px; margin-top: 10px; }
.form input, .form select, .form textarea {
    padding: 13px 15px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 15px; background: #fff; transition: var(--transition);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(195, 154, 78, 0.15); }
.form-row-between { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 10px 0; }
.checkbox { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--color-text-light); }
.auth-switch a { color: var(--color-secondary); font-weight: 700; }

/* ===== Alerts ===== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px auto; max-width: 1180px; font-weight: 600; }
.alert-success { background: #E6F4EC; color: var(--color-success); border: 1px solid #B8DCC5; }
.alert-error { background: #F7E4E0; color: var(--color-error); border: 1px solid #E7C3BA; }

/* ===== Footer ===== */
.site-footer { background: var(--color-dark); color: #C9D4CD; padding: 56px 0 26px; margin-top: 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-brand h3 { color: #fff; font-size: 25px; margin-bottom: 10px; letter-spacing: 2px; }
.footer-brand p { max-width: 320px; color: rgba(255, 255, 255, 0.66); }
.footer-links { display: flex; gap: 22px; align-items: flex-start; }
.footer-links a { color: #C9D4CD; transition: var(--transition); }
.footer-links a:hover { color: var(--color-secondary-light); }
.footer-copy { width: 100%; text-align: center; margin-top: 34px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 22px; font-size: 13px; color: rgba(255, 255, 255, 0.55); }

.error-page { text-align: center; padding: 110px 0; }
.error-page h1 { font-size: 84px; color: var(--color-secondary); }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .main-nav { display: none; }
    .hero h1 { font-size: 40px; }
}

@media (max-width: 600px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .hero { padding: 70px 0 60px; }
    .hero h1 { font-size: 31px; }
    .hero p { font-size: 16px; }
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .section { padding: 54px 0; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .contact-teaser-inner { flex-direction: column; align-items: flex-start; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .design-card:hover, .project-card:hover, .btn-primary:hover,
    .category-card:hover, .occasion-card:hover, .style-card:hover { transform: none; }
}
