/* =========================
   Top Bar
========================= */
.top-bar {
    background: var(--k-topbar-bg);
    color: #fff;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar p {
    margin: 0;
    flex: 1;
    text-align: center;
}

.top-bar-lang {
    flex-shrink: 0;
}

/* =========================
   Header Search Row
========================= */
.header-search-row {
    background: #fdfdfd;
    padding: 8px 15px;
    border-bottom: 1px solid #f4f4f4;
}

.header-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-field {
    width: 100%;
    padding: 12px 20px;
    padding-inline-start: 50px;
    border: 1px solid #eaeaea;
    border-radius: 999px;
    background: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    direction: rtl;
}

.search-field:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.15);
}

.search-submit {
    position: absolute;
    inset-inline-start: 4px;
    top: 4px;
    bottom: 4px;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.search-submit:hover {
    background: #000;
}

/* =========================
   Main Header
========================= */
.site-header {
    width: 100%;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
}

.main-header {
    padding: 10px 15px;
    position: relative;
    background: #fff;
}

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

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    max-height: 42px;
    width: auto;
}

.text-logo {
    text-decoration: none;
    color: #000;
}

.text-logo h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

/* Navigation - Centered */
.header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
}

.main-menu li {
    position: relative;
}

.main-menu a {
    text-decoration: none;
    color: #2b2b2b;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 0;
    transition: color 0.2s;
}

.main-menu a:hover {
    color: #0d9488;
}

/* Dropdown Menu Support */
.main-menu li ul {
    position: absolute;
    top: calc(100% + 15px); /* Add some space so it doesn't touch the header instantly */
    right: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Create a transparent bridge so the hover doesn't break when moving mouse down */
.main-menu li ul::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

/* Level 3 Submenus */
.main-menu li ul li {
    position: relative; /* So the child UL is positioned relative to this LI */
}

.main-menu li ul li ul {
    top: -10px;
    right: 100%; /* For RTL, open to the left of the parent */
    left: auto;
    margin-right: 5px; /* Spacing between the dropdowns */
}

.main-menu li ul li ul::before {
    top: 0;
    right: -10px;
    height: 100%;
    width: 10px;
    left: auto;
}

.main-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu li ul li {
    width: 100%;
    margin: 0;
}

.main-menu li ul a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 14.5px;
    color: #444;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f9f9f9;
}

.main-menu li ul li:last-child a {
    border-bottom: none;
}

.main-menu li ul a:hover {
    background: #FFF0F2;
    color: #0d9488;
    padding-right: 28px; /* Move text slightly to the left on hover in RTL */
}

/* Remove default WP menu border if any */
.main-menu li ul li a:focus {
    outline: none;
}

.main-menu .has-children > a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-menu .has-children > a::after,
.main-menu .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-top: -3px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.main-menu .has-children:hover > a::after,
.main-menu .menu-item-has-children:hover > a::after {
    transform: rotate(135deg);
    margin-top: 2px;
}

/* Mega Menu Support */
.main-menu .mega-menu-content {
    position: absolute;
    top: 100%;
    right: -150px;
    background: #fff;
    width: 640px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    gap: 20px;
    cursor: default;
}

.main-menu li.mega-menu-item:hover > .mega-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-cats {
    flex: 0 0 180px;
    border-left: 1px solid #f4f4f4;
    padding-left: 15px;
}

.mega-menu-cats ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    width: 100%;
    min-width: 0;
}

.mega-menu-cats ul a {
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.mega-menu-products {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Fix product card buttons inside mega menu (both old .suggested-card and new .product-card) */
.mega-menu-products .suggested-card .button,
.mega-menu-products .suggested-card .button.add_to_cart_button,
.mega-menu-products .product-card .button,
.mega-menu-products .product-card .add_to_cart_button {
    padding: 8px;
    font-size: 12px;
}

/* ── تنسيق بطاقات المنتجات داخل الميجا منيو ── */
.mega-menu-products .product-card {
    width: 100%;
    min-width: 0;
    flex: none;
}
.mega-menu-products .product-card .product-img {
    height: 130px;
}
.mega-menu-products .product-card .product-title {
    font-size: 13px;
    -webkit-line-clamp: 1;
}
.mega-menu-products .product-card .product-price {
    font-size: 13px;
}

/* Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #2b2b2b;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
    position: relative;
}

.action-icon:hover {
    color: #0d9488;
}

.cart-icon {
    background: #f7f7f7;
    padding: 8px 14px;
    border-radius: 999px;
}

.cart-icon:hover {
    background: #fff0f2;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0d9488;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #fff;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 0;
}

/* =========================
   Responsive Mobile
========================= */
@media (max-width: 991px) {
    .header-nav {
        display: none; /* Hide on mobile, should use off-canvas toggle */
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide the actions from header on mobile to move them to sliding menu */
    .header-actions {
        display: none; 
    }

    /* تقليل ارتفاع الهيدر في الجوال بشكل أقصى */
    .top-bar {
        padding: 4px 0;
        font-size: 11px;
    }

    /* إخفاء زر اللغة من الشريط العلوي في الجوال — يظهر في القائمة الجانبية */
    .top-bar-lang {
        display: none !important;
    }
    .main-header {
        padding: 4px 10px;
    }
    .header-inner {
        gap: 10px;
    }
    .header-logo img {
        max-height: 28px;
    }
    .text-logo h2 {
        font-size: 16px;
    }
    .header-search-row {
        padding: 4px 10px;
    }
    .search-field {
        padding: 6px 12px;
        padding-inline-start: 35px;
        font-size: 13px;
        height: auto;
    }
    .search-submit {
        width: 28px;
        top: 2px;
        bottom: 2px;
    }
    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
    }
}

/* =========================
   Mobile Off-Canvas Menu
========================= */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu {
    right: 0;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-close {
    background: none;
    border: none;
    padding: 20px;
    cursor: pointer;
    text-align: right;
    color: #444;
    align-self: flex-end;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Hide mobile submenus by default */
.mobile-nav ul ul {
    display: none;
}

/* Show them when parent li has .open */
.mobile-nav li.open > ul {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #000;
    font-weight: 600;
    border-bottom: 1px solid #f4f4f4;
}

.mobile-nav ul ul a {
    padding-right: 40px;
    color: #555;
    font-weight: normal;
    background: #fafafa;
}

/* Actions Inside Mobile Menu */
.mobile-menu-actions-box {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #FFF0F2;
    margin-bottom: 15px;
}

.mobile-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #0d9488;
    font-weight: bold;
    font-size: 15px;
}

.cart-count-mobile {
    background: #0d9488;
    color: #fff;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 12px;
}

/* =========================
   Mobile Menu Overlay
========================= */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 10px;
    z-index: 10;
}

.mobile-nav {
    padding: 80px 20px 20px;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #eee;
}

.mobile-menu-list li a {
    display: block;
    padding: 15px 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mobile-menu-list li a:hover {
    color: #0d9488;
}

/* ── سهم الفتح/الإغلاق ── */
/* has-children = التابت / menu-item-has-children = ووردبريس تلقائيًا */
.mobile-menu-list .has-children > a::after,
.mobile-menu-list .menu-item-has-children > a::after {
    content: '▾';
    float: left;
    margin-left: 10px;
    font-weight: bold;
    transition: transform 0.25s;
    display: inline-block;
}

.mobile-menu-list .has-children.open > a::after,
.mobile-menu-list .menu-item-has-children.open > a::after {
    transform: rotate(180deg);
}

.mobile-menu-list .has-children .sub-menu,
.mobile-menu-list .menu-item-has-children .sub-menu {
    display: none;
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
    background: #fafafa;
    border-radius: 8px;
}

.mobile-menu-list .has-children.open > .sub-menu,
.mobile-menu-list .menu-item-has-children.open > .sub-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-menu-list .sub-menu li a {
    font-size: 14px;
    padding: 10px 12px;
    color: #555;
    border-bottom: 1px solid #eee;
}

/* =========================
   Mobile Bottom Bar
========================= */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (max-width: 991px) {
    .mobile-bottom-bar {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

@media (min-width: 992px) {
    .mobile-bottom-bar {
        display: none !important;
    }
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    transition: color 0.2s;
    position: relative;
}

.bottom-bar-item:hover {
    color: #0d9488;
}

.bottom-bar-item svg {
    margin-bottom: 4px;
}

.bottom-bar-item .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0d9488;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ══════════════════════════════════
   🌙 الوضع الليلي – الهيدر
══════════════════════════════════ */
[data-theme="dark"] .site-header {
    background: var(--k-bg-card);
    box-shadow: 0 4px 12px var(--k-shadow);
}

[data-theme="dark"] .main-header {
    background: var(--k-bg-card);
}

[data-theme="dark"] .header-search-row {
    background: var(--k-bg-soft);
    border-color: var(--k-border);
}

[data-theme="dark"] .search-field {
    background: var(--k-bg-card);
    border-color: var(--k-border);
    color: var(--k-text);
}

[data-theme="dark"] .search-field::placeholder {
    color: var(--k-text-muted);
}

[data-theme="dark"] .main-menu a {
    color: var(--k-text);
}

[data-theme="dark"] .main-menu a:hover {
    color: var(--k-accent);
}

[data-theme="dark"] .main-menu ul {
    background: var(--k-bg-card);
    box-shadow: 0 10px 30px var(--k-shadow-md);
}

[data-theme="dark"] .main-menu ul a {
    color: var(--k-text) !important;
}

[data-theme="dark"] .main-menu ul a:hover {
    background: var(--k-bg-hover);
}

[data-theme="dark"] .action-icon {
    color: var(--k-text);
}

[data-theme="dark"] .cart-icon {
    background: var(--k-bg-soft);
}

[data-theme="dark"] .cart-icon:hover {
    background: var(--k-bg-hover);
}

[data-theme="dark"] .text-logo,
[data-theme="dark"] .text-logo h2 {
    color: var(--k-text);
}

/* القائمة الجانبية – جوال */
[data-theme="dark"] .mobile-menu {
    background: var(--k-bg-card);
}

[data-theme="dark"] .mobile-menu-list li {
    border-color: var(--k-border);
}

[data-theme="dark"] .mobile-menu-list li a {
    color: var(--k-text);
}

[data-theme="dark"] .mobile-menu-list .has-children .sub-menu,
[data-theme="dark"] .mobile-menu-list .menu-item-has-children .sub-menu {
    background: var(--k-bg-soft);
}

[data-theme="dark"] .mobile-menu-list .sub-menu li a {
    color: var(--k-text-muted);
    border-color: var(--k-border);
}

[data-theme="dark"] .mobile-menu-list .sub-menu li a:hover {
    color: var(--k-accent);
}

[data-theme="dark"] .mobile-menu-actions-box {
    background: var(--k-bg-soft);
}

[data-theme="dark"] .mobile-action-item {
    color: var(--k-accent);
}

/* البار السفلي */
[data-theme="dark"] .mobile-bottom-bar {
    background: var(--k-bg-card);
    border-color: var(--k-border);
}

[data-theme="dark"] .bottom-bar-item {
    color: var(--k-text-muted);
}

[data-theme="dark"] .bottom-bar-item:hover {
    color: var(--k-accent);
}

/* ══════════════════════════════════
   🔍 اقتراحات البحث (Live Search)
══════════════════════════════════ */
.k-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--k-bg-card, #fff);
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.12);
    border: 1px solid var(--k-border, #eee);
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    max-height: 420px;
    overflow-y: auto;
}

.k-search-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* نتيجة بحث واحدة */
.k-search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--k-text, #1a1a2e);
    transition: background 0.2s;
    border-bottom: 1px solid var(--k-border-soft, rgba(0,0,0,0.03));
}

.k-search-item:last-of-type {
    border-bottom: none;
}

.k-search-item:hover {
    background: var(--k-bg-hover, #f5f5f7);
}

.k-search-item-img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--k-bg-soft, #f9f9fb);
    border: 1px solid var(--k-border-soft, rgba(0,0,0,0.03));
}

.k-search-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.k-search-item-info {
    flex: 1;
    min-width: 0;
}

.k-search-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--k-text, #1a1a2e);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.k-search-item-name mark {
    background: rgba(255, 107, 129, 0.15);
    color: #0d9488;
    border-radius: 3px;
    padding: 0 2px;
}

/* ══════════════════════════════════
   🚀 Mega Menu (WP Native Overrides)
══════════════════════════════════ */


.k-search-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #0d9488;
    margin-top: 2px;
}

.k-search-item-price del {
    color: var(--k-text-muted, #999);
    font-size: 12px;
}

/* عرض الكل */
.k-search-view-all {
    display: block;
    text-align: center;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #0d9488;
    text-decoration: none;
    border-top: 1px solid var(--k-border, #eee);
    transition: background 0.2s;
}

.k-search-view-all:hover {
    background: var(--k-bg-hover, #fdf5f7);
}

/* حالة التحميل */
.k-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    font-size: 14px;
    color: var(--k-text-muted, #888);
}

.k-search-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--k-border, #eee);
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: kSpin 0.6s linear infinite;
}

@keyframes kSpin {
    to { transform: rotate(360deg); }
}

/* لا توجد نتائج */
.k-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    font-size: 14px;
    color: var(--k-text-muted, #888);
    text-align: center;
}

.k-search-empty-icon {
    font-size: 28px;
    opacity: 0.5;
}

/* سكرول بار */
.k-search-dropdown::-webkit-scrollbar {
    width: 4px;
}

.k-search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

/* جوال */
@media (max-width: 600px) {
    .k-search-dropdown {
        border-radius: 14px;
        max-height: 350px;
    }

    .k-search-item {
        padding: 10px 14px;
        gap: 10px;
    }

    .k-search-item-img {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .k-search-item-name {
        font-size: 13px;
    }
}

/* ══════════════════════════════════
   🛒 Add to Cart Toast Notification
══════════════════════════════════ */
.k-toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    z-index: 100000;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-right: 4px solid #4CAF50;
    direction: rtl;
    max-width: 400px;
}

.k-toast-notification.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.k-toast-icon {
    width: 40px;
    height: 40px;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.k-toast-icon svg {
    width: 20px;
    height: 20px;
}

.k-toast-content {
    flex: 1;
}

.k-toast-content h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.k-toast-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.k-toast-content strong {
    color: #333;
}

.k-toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-right: auto;
    transition: color 0.2s;
    line-height: 1;
}

.k-toast-close:hover {
    color: #0d9488;
}

[data-theme="dark"] .k-toast-notification {
    background: var(--k-bg-card, #1e1e2e);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

[data-theme="dark"] .k-toast-content h4,
[data-theme="dark"] .k-toast-content strong {
    color: var(--k-text, #fff);
}

[data-theme="dark"] .k-toast-content p {
    color: var(--k-text-muted, #aaa);
}

@media (max-width: 768px) {
    .k-toast-notification {
        bottom: 80px; /* فوق القائمة السفلية للجوال */
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

/* ══════════════════════════════════
   🌐 Language Switcher - Ultra Compact
══════════════════════════════════ */
.top-bar-lang {
    display: flex;
    align-items: center;
}

/* Force minimum sizes for TranslatePress across the site */
.trp-language-switcher,
.trp-language-switcher * {
    min-width: 0 !important;
    max-width: max-content !important;
}

/* Desktop Top Bar Switcher */
.top-bar-lang .trp-language-switcher {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
}

.top-bar-lang .trp-language-switcher > div {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.top-bar-lang .trp-language-switcher a {
    padding: 0 4px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    border: none !important;
    background: transparent !important;
    color: #444 !important;
}

.top-bar-lang .trp-language-switcher img {
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile Switcher */
.lang-mobile-wrapper {
    width: auto !important;
    display: inline-flex;
    margin-top: 10px;
    background: #f8f8f8;
    padding: 4px 8px;
    border-radius: 6px;
}

.lang-mobile-wrapper .trp-language-switcher {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    gap: 8px !important;
    font-size: 11px !important;
}

.lang-mobile-wrapper .trp-language-switcher a {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 !important;
    border: none !important;
    font-size: 11px !important;
    color: #333 !important;
}

.lang-mobile-wrapper .trp-language-switcher img {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
}

/* Fallback icons */
.lang-icon-top {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #444;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.lang-icon-top svg {
    width: 12px !important;
    height: 12px !important;
}

.lang-icon-top:hover {
    color: #0d9488;
    background: #fff;
}

/* ══════════════════════════════════
   🌐 زر اللغة الجانبي العائم
══════════════════════════════════ */

/* إخفاء زر TranslatePress العائم الأصلي بجميع أشكاله */
#trp-floater-ls,
.trp-floater-ls,
div[id^="trp-floater"],
div[class*="trp-floater"],
.trp-language-switcher-shortcode-classes,
[id*="trp"][class*="float"],
[class*="trp"][style*="fixed"],
[class*="trp"][style*="bottom"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* الحاوية الجانبية */
.k-lang-floater {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    direction: ltr;
}

/* تنسيق TranslatePress داخل الزر الجانبي */
.k-lang-floater .trp-language-switcher {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.k-lang-floater .trp-language-switcher > div,
.k-lang-floater .trp-language-switcher li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.k-lang-floater .trp-language-switcher a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 34px !important;
    padding: 8px 4px !important;
    background: #fff !important;
    border-right: 3px solid #0d9488 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    color: #333 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    font-family: 'Tajawal', sans-serif !important;
    transition: all 0.2s ease !important;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1) !important;
    line-height: 1 !important;
}

.k-lang-floater .trp-language-switcher a:hover {
    background: #0d9488 !important;
    color: #fff !important;
    width: 44px !important;
}

.k-lang-floater .trp-language-switcher a:first-child {
    border-radius: 0 8px 0 0 !important;
}

.k-lang-floater .trp-language-switcher a:last-child {
    border-radius: 0 0 8px 0 !important;
}

.k-lang-floater .trp-language-switcher img {
    width: 16px !important;
    height: 16px !important;
    border-radius: 2px !important;
    margin: 0 !important;
}

/* زر الاحتياطي (بدون TranslatePress) */
.k-lang-floater-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 34px;
    padding: 10px 4px;
    background: #fff;
    border: none;
    border-right: 3px solid #0d9488;
    border-radius: 0 8px 8px 0;
    color: #333;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.12);
    font-family: 'Tajawal', sans-serif;
    transition: all 0.2s ease;
}

.k-lang-floater-btn:hover {
    background: #0d9488;
    color: #fff;
    width: 44px;
}

/* على الجوال — تصغير قليلاً لتجنب التعارض مع شريط الجوال السفلي */
@media (max-width: 768px) {
    .k-lang-floater {
        top: auto;
        bottom: 80px; /* فوق شريط الجوال السفلي */
        transform: none;
    }

    .k-lang-floater .trp-language-switcher a {
        width: 30px !important;
        padding: 6px 4px !important;
        font-size: 9px !important;
    }

    .k-lang-floater-btn {
        width: 30px;
        padding: 6px 4px;
        font-size: 9px;
    }
}

[data-theme="dark"] .k-lang-floater .trp-language-switcher a,
[data-theme="dark"] .k-lang-floater-btn {
    background: #1e1e2e !important;
    color: #e0e0e0 !important;
    border-right-color: #0d9488 !important;
    border-bottom-color: #333 !important;
}

[data-theme="dark"] .k-lang-floater .trp-language-switcher a:hover,
[data-theme="dark"] .k-lang-floater-btn:hover {
    background: #0d9488 !important;
    color: #fff !important;
}

/* =============================================
   📦 لوحة طلباتي الجانبية
   My Orders Slide-in Panel
============================================= */
.k-orders-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.k-orders-overlay.active { display: block; }

.k-orders-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    max-width: 95vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -6px 0 32px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    font-family: 'Tajawal', sans-serif;
}

.k-orders-panel.open { right: 0; }

/* ── Header ── */
.k-orders-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0ece8;
    background: #faf6f1;
    flex-shrink: 0;
}

.k-orders-panel__header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #2c2c2c;
}

.k-orders-panel__close {
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}
.k-orders-panel__close:hover { color: #333; }

/* ── Body ── */
.k-orders-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── بطاقة الطلب ── */
.k-order-card {
    background: #faf7f4;
    border: 1px solid #ece8e2;
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.k-order-card:hover {
    background: #f5f0ea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184,154,122,0.1);
}

.k-order-card__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.k-order-card__num {
    font-weight: 800;
    font-size: 14px;
    color: #2c2c2c;
}

.k-order-card__date {
    font-size: 12px;
    color: #aaa;
}

.k-order-card__status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.k-order-products-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 12px;
}

.k-order-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #ece8e2;
}

.k-order-product-item img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #f5f0ea;
}

.k-order-product-item span {
    font-size: 12px;
    color: #444;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.k-order-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.k-order-card__total {
    font-weight: 800;
    font-size: 14px;
    color: #b89a7a;
}

.k-order-card__btn {
    display: inline-block;
    background: #b89a7a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}
.k-order-card__btn:hover {
    background: #a0866a;
    color: #fff;
}

.k-orders-empty {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    padding: 30px 0;
}

/* ── نموذج بحث الضيف ── */
.k-panel-lookup {
    margin-top: 8px;
    padding: 16px;
    background: #f5f0ea;
    border-radius: 12px;
    border: 1px dashed #d4c5b2;
}

.k-panel-lookup__title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #5c4a38;
}

.k-panel-lookup__form {
    display: flex;
    gap: 8px;
}

.k-panel-lookup__form input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #ddd4c8;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    background: #fff;
    outline: none;
    direction: rtl;
}

.k-panel-lookup__form input:focus {
    border-color: #b89a7a;
}

.k-panel-lookup__form button {
    padding: 9px 16px;
    background: #b89a7a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.k-panel-lookup__form button:hover { background: #a0866a; }
.k-panel-lookup__form button:disabled { opacity: 0.6; cursor: wait; }

/* زر طلباتي في الشريط السفلي */
#k-my-orders-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

[data-theme="dark"] .k-orders-panel {
    background: var(--k-bg-card);
}
[data-theme="dark"] .k-orders-panel__header {
    background: var(--k-bg-soft);
    border-color: var(--k-border);
}
[data-theme="dark"] .k-order-card {
    background: var(--k-bg-soft);
    border-color: var(--k-border);
}
[data-theme="dark"] .k-order-product-item {
    background: var(--k-bg-card);
    border-color: var(--k-border);
}
[data-theme="dark"] .k-order-product-item img {
    border-color: var(--k-border);
}
[data-theme="dark"] .k-order-product-item span {
    color: var(--k-text);
}

/* =============================================
   JavaScript — لوحة طلباتي
============================================= */

/* ── زر طلباتي في الهيدر (ديسكتوب) ── */
.k-my-orders-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    color: #2b2b2b;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
    position: relative;
}

.k-my-orders-trigger:hover {
    color: #0d9488;
}

.k-my-orders-trigger .icon-label {
    font-size: 14px;
}

[data-theme="dark"] .k-my-orders-trigger {
    color: var(--k-text);
}
[data-theme="dark"] .k-my-orders-trigger:hover {
    color: #0d9488;
}

