/**
 * أنماط أزرار الأقسام المتقدمة
 * @package Kora_Plus_Pro
 * @version 2.0
 */

/* متغيرات CSS للأقسام */
:root {
    --category-primary: #00A859;
    --category-secondary: #00c46e;
    --category-text: #ffffff;
    --category-font-size: 15px;
    --category-padding: 15px;
    --category-border-radius: 8px;
    --category-width: auto;
    --category-height: auto;
    --category-spacing: 10px;
}

/* الأنماط الأساسية لجميع أزرار الأقسام - أولوية عالية */
body .nav-menu > li > a,
body .main-nav .menu > li > a,
body .category-item,
body .category-card .category-link,
body .categories-grid .category-link,
body .preview-category-button {
    font-size: var(--category-font-size) !important;
    padding: var(--category-padding) calc(var(--category-padding) * 1.5) !important;
    border-radius: var(--category-border-radius) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    
    /* فرض أبعاد محددة */
    width: var(--category-width) !important;
    height: var(--category-height) !important;
    min-width: var(--category-width) !important;
    min-height: var(--category-height) !important;
    line-height: var(--category-font-size) !important;
    white-space: nowrap !important;
    margin-left: var(--category-spacing) !important;
}

/* النمط الأول - كلاسيكي أنيق */
body.category-style-style1 .nav-menu > li > a,
body.category-style-style1 .main-nav .menu > li > a,
body.category-style-style1 .category-item,
body.category-style-style1 .category-card .category-link,
body.category-style-style1 .categories-grid .category-link {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: 2px solid var(--category-primary) !important;
}

body.category-style-style1 .nav-menu > li > a:hover,
body.category-style-style1 .main-nav .menu > li > a:hover,
body.category-style-style1 .nav-menu > li.current-menu-item > a,
body.category-style-style1 .main-nav .menu > li.current-menu-item > a,
body.category-style-style1 .category-item:hover,
body.category-style-style1 .category-item.active,
body.category-style-style1 .category-card:hover .category-link,
body.category-style-style1 .categories-grid .category-card:hover .category-link {
    background: var(--category-secondary) !important;
    border-color: var(--category-secondary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,168,89,0.3) !important;
    color: var(--category-text) !important;
}

/* النمط الثاني - عصري متدرج */
body.category-style-style2 .nav-menu > li > a,
body.category-style-style2 .main-nav .menu > li > a,
body.category-style-style2 .category-item,
body.category-style-style2 .category-card .category-link,
body.category-style-style2 .categories-grid .category-link {
    background: linear-gradient(135deg, var(--category-primary), var(--category-secondary)) !important;
    color: var(--category-text) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,168,89,0.2) !important;
}

body.category-style-style2 .nav-menu > li > a:hover,
body.category-style-style2 .main-nav .menu > li > a:hover,
body.category-style-style2 .nav-menu > li.current-menu-item > a,
body.category-style-style2 .main-nav .menu > li.current-menu-item > a,
body.category-style-style2 .category-item:hover,
body.category-style-style2 .category-item.active,
body.category-style-style2 .category-card:hover .category-link,
body.category-style-style2 .categories-grid .category-card:hover .category-link {
    background: linear-gradient(135deg, var(--category-secondary), var(--category-primary)) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(0,168,89,0.4) !important;
    color: var(--category-text) !important;
}

/* النمط الثالث - فاخر بظلال */
body.category-style-style3 .nav-menu > li > a,
body.category-style-style3 .main-nav .menu > li > a,
body.category-style-style3 .category-item,
body.category-style-style3 .category-card .category-link,
body.category-style-style3 .categories-grid .category-link {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,168,89,0.3), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}

body.category-style-style3 .nav-menu > li > a::before,
body.category-style-style3 .main-nav .menu > li > a::before,
body.category-style-style3 .category-item::before,
body.category-style-style3 .category-card .category-link::before,
body.category-style-style3 .categories-grid .category-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

body.category-style-style3 .nav-menu > li > a:hover::before,
body.category-style-style3 .main-nav .menu > li > a:hover::before,
body.category-style-style3 .nav-menu > li.current-menu-item > a::before,
body.category-style-style3 .main-nav .menu > li.current-menu-item > a::before,
body.category-style-style3 .category-item:hover::before,
body.category-style-style3 .category-item.active::before,
body.category-style-style3 .category-card:hover .category-link::before,
body.category-style-style3 .categories-grid .category-card:hover .category-link::before {
    left: 100%;
}

body.category-style-style3 .nav-menu > li > a:hover,
body.category-style-style3 .main-nav .menu > li > a:hover,
body.category-style-style3 .nav-menu > li.current-menu-item > a,
body.category-style-style3 .main-nav .menu > li.current-menu-item > a,
body.category-style-style3 .category-item:hover,
body.category-style-style3 .category-item.active,
body.category-style-style3 .category-card:hover .category-link,
body.category-style-style3 .categories-grid .category-card:hover .category-link {
    background: var(--category-secondary) !important;
    box-shadow: 0 6px 25px rgba(0,196,110,0.4), inset 0 1px 0 rgba(255,255,255,0.3) !important;
    transform: translateY(-2px) !important;
    color: var(--category-text) !important;
}

/* النمط الرابع - إبداعي مشع */
body.category-style-style4 .nav-menu > li > a,
body.category-style-style4 .main-nav .menu > li > a,
body.category-style-style4 .category-item,
body.category-style-style4 .category-card .category-link,
body.category-style-style4 .categories-grid .category-link {
    background: transparent !important;
    color: var(--category-primary) !important;
    border: 2px solid var(--category-primary) !important;
}

body.category-style-style4 .nav-menu > li > a::before,
body.category-style-style4 .main-nav .menu > li > a::before,
body.category-style-style4 .category-item::before,
body.category-style-style4 .category-card .category-link::before,
body.category-style-style4 .categories-grid .category-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--category-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    z-index: -1;
}

body.category-style-style4 .nav-menu > li > a:hover::before,
body.category-style-style4 .main-nav .menu > li > a:hover::before,
body.category-style-style4 .nav-menu > li.current-menu-item > a::before,
body.category-style-style4 .main-nav .menu > li.current-menu-item > a::before,
body.category-style-style4 .category-item:hover::before,
body.category-style-style4 .category-item.active::before,
body.category-style-style4 .category-card:hover .category-link::before,
body.category-style-style4 .categories-grid .category-card:hover .category-link::before {
    width: 300px;
    height: 300px;
}

body.category-style-style4 .nav-menu > li > a:hover,
body.category-style-style4 .main-nav .menu > li > a:hover,
body.category-style-style4 .nav-menu > li.current-menu-item > a,
body.category-style-style4 .main-nav .menu > li.current-menu-item > a,
body.category-style-style4 .category-item:hover,
body.category-style-style4 .category-item.active,
body.category-style-style4 .category-card:hover .category-link,
body.category-style-style4 .categories-grid .category-card:hover .category-link {
    color: var(--category-text) !important;
    border-color: var(--category-secondary) !important;
    box-shadow: 0 0 20px rgba(0,168,89,0.5) !important;
}

/* النمط الخامس - ديناميكي حيوي */
body.category-style-style5 .nav-menu > li > a,
body.category-style-style5 .main-nav .menu > li > a,
body.category-style-style5 .category-item,
body.category-style-style5 .category-card .category-link,
body.category-style-style5 .categories-grid .category-link {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: none !important;
}

body.category-style-style5 .nav-menu > li > a::after,
body.category-style-style5 .main-nav .menu > li > a::after,
body.category-style-style5 .category-item::after,
body.category-style-style5 .category-card .category-link::after,
body.category-style-style5 .categories-grid .category-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--category-secondary) 0%, transparent 50%, var(--category-secondary) 100%);
    opacity: 0;
    transition: all 0.3s ease;
}

body.category-style-style5 .nav-menu > li > a:hover::after,
body.category-style-style5 .main-nav .menu > li > a:hover::after,
body.category-style-style5 .nav-menu > li.current-menu-item > a::after,
body.category-style-style5 .main-nav .menu > li.current-menu-item > a::after,
body.category-style-style5 .category-item:hover::after,
body.category-style-style5 .category-item.active::after,
body.category-style-style5 .category-card:hover .category-link::after,
body.category-style-style5 .categories-grid .category-card:hover .category-link::after {
    opacity: 0.3;
    animation: shimmer 1s infinite;
}

body.category-style-style5 .nav-menu > li > a:hover,
body.category-style-style5 .main-nav .menu > li > a:hover,
body.category-style-style5 .nav-menu > li.current-menu-item > a,
body.category-style-style5 .main-nav .menu > li.current-menu-item > a,
body.category-style-style5 .category-item:hover,
body.category-style-style5 .category-item.active,
body.category-style-style5 .category-card:hover .category-link,
body.category-style-style5 .categories-grid .category-card:hover .category-link {
    background: var(--category-secondary) !important;
    transform: rotate(2deg) scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(0,196,110,0.4) !important;
    color: var(--category-text) !important;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* تأثيرات إضافية لأزرار الفوتر */
body.category-style-style1 .categories-grid .category-card,
body.category-style-style2 .categories-grid .category-card,
body.category-style-style3 .categories-grid .category-card,
body.category-style-style4 .categories-grid .category-card,
body.category-style-style5 .categories-grid .category-card {
    border: none !important;
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(10px) !important;
}

/* تطبيق المساحات والأبعاد */
.nav-menu > li:last-child,
.main-nav .menu > li:last-child {
    margin-left: 0 !important;
}

.categories-grid {
    gap: var(--category-spacing) !important;
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    :root {
        --category-font-size: 14px;
        --category-padding: 12px;
        --category-spacing: 8px;
    }
    
    .nav-menu > li > a,
    .category-item,
    .category-card .category-link {
        font-size: var(--category-font-size) !important;
        padding: var(--category-padding) calc(var(--category-padding) * 1.2) !important;
        margin-left: var(--category-spacing) !important;
    }
}

@media (max-width: 480px) {
    :root {
        --category-font-size: 13px;
        --category-padding: 10px;
    }
}

/* تأثيرات خاصة للقائمة المنسدلة */
.nav-menu .sub-menu li a {
    background: rgba(255,255,255,0.95) !important;
    color: #333 !important;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    border-radius: 0 !important;
    transform: none !important;
}

.nav-menu .sub-menu li a:hover {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    padding-right: 25px !important;
}

/* فرض إعادة تعيين للأنماط المتضاربة */
body[class*="category-style-"] .nav-menu > li > a::after,
body[class*="category-style-"] .main-nav .menu > li > a::after {
    display: none !important;
}

body[class*="category-style-"] .nav-menu > li > a:hover,
body[class*="category-style-"] .main-nav .menu > li > a:hover {
    background: var(--category-secondary) !important;
    color: var(--category-text) !important;
}

/* فرض تطبيق متغيرات CSS */
body[class*="category-style-"] {
    --category-primary: var(--category-primary, #00A859) !important;
    --category-secondary: var(--category-secondary, #00c46e) !important;
    --category-text: var(--category-text, #ffffff) !important;
}

/* تحديد أولوية عالية جداً */
html body.category-style-style1 .nav-menu > li > a,
html body.category-style-style1 .main-nav .menu > li > a {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: 2px solid var(--category-primary) !important;
}

html body.category-style-style2 .nav-menu > li > a,
html body.category-style-style2 .main-nav .menu > li > a {
    background: linear-gradient(135deg, var(--category-primary), var(--category-secondary)) !important;
    color: var(--category-text) !important;
    border: none !important;
}

html body.category-style-style3 .nav-menu > li > a,
html body.category-style-style3 .main-nav .menu > li > a {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,168,89,0.3) !important;
}

html body.category-style-style4 .nav-menu > li > a,
html body.category-style-style4 .main-nav .menu > li > a {
    background: transparent !important;
    color: var(--category-primary) !important;
    border: 2px solid var(--category-primary) !important;
}

html body.category-style-style5 .nav-menu > li > a,
html body.category-style-style5 .main-nav .menu > li > a {
    background: var(--category-primary) !important;
    color: var(--category-text) !important;
    border: none !important;
}
