/*
Theme Name: Terroir Bio Morocco - Multilingual Pro
Author: Custom Dev
Description: ثيم ووردبريس ووكومرس احترافي للمنتجات المجالية المغربية يدعم العربية (RTL) والفرنسية والإنجليزية (LTR) مع حقول ترجمة مدمجة ولوحة تحكم شاملة لميزة صمّم باقتك
Version: 4.0
Text Domain: terroir-bio
*/

:root {
    --primary: #111A14;
    --secondary: #1DB954;
    --accent: #E0A84B;
    --bg-light: #F7F8F7;
    --text-dark: #161C18;
    --text-muted: #5C6660;
    --white: #FFFFFF;
    --radius: 14px;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
    line-height: 1.65;
    overflow-x: hidden;
}

body.ltr-lang {
    font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
    direction: ltr;
    text-align: left;
}

.container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
}

/* شريط الثقة العلوي */
.top-bar {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 9px 15px;
    font-size: 0.88rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* الهيدر والقائمة الرئيسية */
.site-header {
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
}

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

.logo {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--secondary); }
.custom-logo-link img { max-height: 52px; width: auto; display: block; }

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 6px 10px;
    border-radius: 8px;
    transition: 0.2s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--secondary);
    background: rgba(29, 185, 84, 0.08);
}

.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* مبدل اللغات */
.lang-switcher {
    display: inline-flex;
    background: var(--bg-light);
    border: 1px solid #E0E4E1;
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}
.lang-switcher a {
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}
.lang-switcher a.active-lang {
    background: var(--secondary) !important;
    color: var(--white) !important;
}
.lang-switcher a:hover {
    background: var(--primary);
    color: var(--white);
}

/* البانر الرئيسي Hero */
.hero-section {
    background: radial-gradient(circle at top left, #1E2E23 0%, var(--primary) 75%);
    color: var(--white);
    padding: 65px 0 85px;
    border-radius: 0 0 28px 28px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 45px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.28;
    margin-bottom: 16px;
}

.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    background: var(--secondary);
    color: var(--white);
    padding: 14px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 800;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    font-size: 0.98rem;
}
.btn-primary:hover { filter: brightness(0.92); transform: translateY(-2px); }

.btn-ghost {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.2);
    transition: 0.3s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.16); }

.hero-bundle-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    padding: 32px 26px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.14);
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* شريط المميزات */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius);
    margin-top: -42px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
    position: relative;
    z-index: 10;
}
.trust-item { text-align: center; }
.trust-item h4 { color: var(--primary); margin-bottom: 4px; font-weight: 800; }
.trust-item p { font-size: 0.85rem; color: var(--text-muted); }

/* العناوين الموحدة للأقسام */
.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 38px;
}
.section-tag {
    display: inline-block;
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.section-title {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 8px;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 1. أزرار تصفية المنتجات التفاعلية */
.products-section { padding: 65px 0; }

.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
}
.filter-btn {
    background: var(--white);
    border: 1.5px solid #E0E4E1;
    color: var(--text-dark);
    padding: 9px 20px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.25s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 26px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #ECEFED;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.product-card.hidden-item { display: none; }

.badge-discount {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: #D9381E;
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    z-index: 2;
}

.badge-origin {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    background: rgba(17, 26, 20, 0.82);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.product-img {
    width: 100%;
    height: 235px;
    object-fit: cover;
    background: #eef1ef;
}

.product-info {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 700;
}
.product-cat a { color: var(--secondary); text-decoration: none; }

.product-title {
    display: block;
    font-size: 1.1rem;
    margin: 5px 0 10px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 800;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 14px;
}

.btn-order {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--primary);
    color: var(--white);
    padding: 11px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s;
}
.btn-order:hover { background: var(--secondary); }

/* 2. قسم صانع الباقة المخصصة + متغيرات التخصيص من لوحة التحكم */
.bundle-builder-section {
    background: var(--bb-section-bg, var(--white));
    padding: 70px 0;
    border-top: 1px solid #EAECEB;
    border-bottom: 1px solid #EAECEB;
}
.bundle-builder-section .section-tag {
    color: var(--bb-accent, var(--secondary));
}
.bundle-builder-section .section-title {
    color: var(--bb-title-color, var(--primary));
}
.bundle-builder-section .section-subtitle {
    color: var(--bb-subtitle-color, var(--text-muted));
}

.builder-wrapper {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 30px;
    align-items: start;
}

.builder-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 15px;
}

.builder-item {
    border: 2px solid var(--bb-card-border, #E5E8E6);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--bb-card-bg, var(--bg-light));
    position: relative;
    user-select: none;
}
.builder-item:hover { border-color: var(--bb-selected-border, var(--secondary)); }
.builder-item.selected {
    border-color: var(--bb-selected-border, var(--secondary));
    background: var(--bb-selected-bg, #F0FAF3);
}
.builder-item .check-mark {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #C5CCC7;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: transparent;
    z-index: 2;
}
.builder-item.selected .check-mark {
    background: var(--bb-selected-border, var(--secondary));
    border-color: var(--bb-selected-border, var(--secondary));
    color: #fff;
}
.builder-item-thumb {
    width: 100%;
    height: 115px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #eef1ef;
}
.builder-item h5 { font-size: 0.98rem; margin-bottom: 4px; color: var(--primary); padding-inline-end: 24px; }
.builder-item .b-meta { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 6px; }
.builder-item .b-price { font-weight: 800; color: var(--primary); font-size: 0.95rem; }

.builder-summary-box {
    background: var(--bb-summary-bg, var(--primary));
    color: var(--bb-summary-text, var(--white));
    padding: 26px;
    border-radius: 16px;
    position: sticky;
    top: 90px;
}
.builder-summary-box h3 { margin-bottom: 12px; font-size: 1.3rem; color: var(--bb-accent, var(--accent)); }
.discount-meter {
    background: rgba(255,255,255,0.1);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    transition: 0.25s;
}
.selected-list {
    list-style: none;
    margin-bottom: 16px;
    min-height: 70px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 12px;
}
.selected-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.builder-totals p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.builder-totals .final-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--bb-btn-bg, var(--secondary));
    margin-top: 8px;
}
.bundle-builder-section #order-custom-bundle {
    background: var(--bb-btn-bg, var(--secondary));
    color: var(--bb-btn-text, #FFFFFF);
}

/* الصفحات الداخلية وصفحة اتصل بنا والصفحات القانونية */
.page-wrapper { padding: 50px 0; }
.content-card {
    background: var(--white);
    padding: 38px;
    border-radius: 18px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.04);
    border: 1px solid #EAECEB;
}
.content-card h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bg-light);
}
.content-card h2 {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 24px 0 10px;
}
.content-card p, .content-card li {
    color: #363F3A;
    margin-bottom: 12px;
    font-size: 0.98rem;
}
.content-card ul {
    padding-inline-start: 22px;
    margin-bottom: 16px;
}

/* الفوتر الاحترافي */
.site-footer {
    background: var(--primary);
    color: var(--white);
    padding: 55px 0 25px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h4 { color: var(--accent); margin-bottom: 14px; font-size: 1.1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.92rem; transition: 0.2s; }
.footer-col a:hover { color: var(--secondary); }
.footer-bottom { text-align: center; padding-top: 20px; font-size: 0.85rem; opacity: 0.8; }

/* صفحة المنتج وصندوق الطلب السريع */
.single-product .woocommerce-breadcrumb {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 22px;
    background: var(--white);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid #EAECEB;
}
.single-product .woocommerce-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}
.single-product div.product {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 40px;
    background: var(--white);
    padding: 34px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #EAECEB;
    align-items: start;
}
.single-product div.product .woocommerce-product-gallery,
.single-product div.product div.summary {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}
.single-product .product_title {
    font-size: 1.95rem !important;
    font-weight: 900 !important;
    color: var(--primary) !important;
    margin-bottom: 10px !important;
}
.single-product .price-trust-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ECEFED;
}
.single-product p.price {
    font-size: 1.75rem !important;
    font-weight: 900 !important;
    color: var(--secondary) !important;
    margin: 0 !important;
}
.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EAF9EF;
    color: #15803D;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 50px;
}
.single-product form.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid #E2E7E3;
}
.single-product form.cart .quantity input.qty {
    width: 68px;
    height: 46px;
    border: 1.5px solid #D5DDD7;
    border-radius: 10px;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    background: var(--white);
}
.single-product form.cart button.single_add_to_cart_button {
    flex: 1;
    height: 46px;
    background: var(--primary) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    cursor: pointer;
}
.terroir-cod-box {
    background: #FBFDFB;
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    margin-top: 6px;
}
.cod-header {
    text-align: center;
    margin-bottom: 18px;
    border-bottom: 1px dashed #D8DFDA;
    padding-bottom: 14px;
}
.cod-badge {
    display: inline-block;
    background: #FDF3E3;
    color: #B47B1B;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 6px;
}
.terroir-cod-form .cod-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.terroir-cod-form .cod-field { margin-bottom: 12px; }
.terroir-cod-form .cod-field.full-width { grid-column: 1 / -1; }
.terroir-cod-form label { display: block; font-size: 0.88rem; font-weight: 800; margin-bottom: 5px; }
.terroir-cod-form input[type="text"],
.terroir-cod-form input[type="tel"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #D5DDD7;
    border-radius: 10px;
    font-family: inherit;
    background: var(--white);
}
.cod-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border: 1.5px solid #E5E8E6;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.qty-stepper { display: inline-flex; align-items: center; background: var(--bg-light); border-radius: 8px; border: 1px solid #D5DDD7; }
.qty-stepper button { background: none; border: none; width: 34px; height: 34px; font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.qty-stepper input { width: 46px; border: none !important; background: transparent !important; text-align: center; font-weight: 800; }
.cod-summary { background: #F2F5F3; padding: 14px 16px; border-radius: 11px; margin-bottom: 16px; font-size: 0.92rem; }
.summary-line { display: flex; justify-content: space-between; margin-bottom: 7px; }
.summary-line.grand-total { margin-bottom: 0; padding-top: 8px; border-top: 1px dashed #CBD4CE; font-size: 1.08rem; font-weight: 900; }
.summary-line.grand-total strong { color: var(--secondary); font-size: 1.2rem; }
.cod-submit-btn {
    width: 100%;
    background: var(--secondary);
    color: #FFFFFF;
    border: none;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: inherit;
    border-radius: 11px;
    cursor: pointer;
}
.product-mini-guarantees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.mini-g-item { background: var(--bg-light); padding: 8px 6px; border-radius: 9px; font-size: 0.78rem; font-weight: 700; border: 1px solid #EAECEB; }
.single-product .woocommerce-tabs { grid-column: 1 / -1; margin-top: 25px; border-top: 1px solid #EAECEB; padding-top: 25px; }

/* زر واتساب العائم */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    inset-inline-end: 25px;
    background: #25D366;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
}

@media (max-width: 960px) {
    .mobile-menu-toggle { display: inline-block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; }
    .hero-grid, .builder-wrapper, .footer-grid, .single-product div.product, .terroir-cod-form .cod-fields-grid { grid-template-columns: 1fr; }
    .hero-grid { text-align: center; }
    .hero-btns { justify-content: center; }
    .hero-title { font-size: 1.9rem; }
}
