/**
 * Header Styles
 * Carlos6 Theme
 */

/* ====================================
   Main Header
==================================== */
.site-header {
    background-color: #0B1728;
    padding: 20px 48px;
    position: relative;
    z-index: 1001;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 40px;
}

/* ====================================
   Column 1: Main Navigation
==================================== */
.header-nav-column {
    display: flex;
    align-items: center;
}

.main-navigation {
    width: 100%;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-navigation li {
    position: relative;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%; /* 24px */
    
    display: flex;
    align-items: center;
    text-align: center;
    
    color: #FFFFFF;
    text-decoration: none;
    
    transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation li.current-menu-item > a,
.main-navigation li.current-menu-ancestor > a {
    color: #8C52FF;
}

/* Submenu Arrow */
.main-navigation .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 9px;
    height: 5px;
    margin-left: 10px;
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='5' viewBox='0 0 9 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.75 0.75L4.25 4.25L7.75 0.75' stroke='%238C52FF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transform: rotate(-180deg);
    transition: transform 0.3s ease;
}

.main-navigation .menu-item-has-children:hover > a::after {
    transform: rotate(0deg);
}

/* ====================================
   Column 2: Logo
==================================== */
.header-logo-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 10px;
    width: 150px;
    height: 50px;
}

.site-branding img {
    max-width: 150px;
    max-height: 50px;
    height: auto;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 24px;
}

.site-title a {
    color: #FFFFFF;
    text-decoration: none;
}

/* ====================================
   Column 3: Header Actions
==================================== */
.header-actions-column {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

/* سنضيف العناصر الثلاثة لاحقاً */

/* ====================================
   Mega Menu
==================================== */
.mega-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #0B1728;
    padding: 40px;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.main-navigation .menu-item-has-children:hover .mega-menu-wrapper {
    display: block;
    opacity: 1;
    visibility: visible;
}

.mega-menu-container {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 357px;
    gap: 40px;
}

/* ====================================
   Mega Menu - Columns Section
==================================== */
.mega-menu-columns {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    grid-template-rows: repeat(2, auto);
    gap: 70px;
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
}

/* Column Header */
.mega-menu-column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mega-menu-column-icon {
    width: 16.59px;
    height: 16.59px;
    flex-shrink: 0;
}

.mega-menu-column-icon svg,
.mega-menu-column-icon img {
    width: 100%;
    height: 100%;
    color: #8C52FF;
    fill: #8C52FF;
}

.mega-menu-column-title {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%; /* 24px */
    text-align: right;
    color: #FFFFFF;
    margin: 0;
}

/* Column Divider */
.mega-menu-column-divider {
    width: 105.59px;
    height: 0px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

/* Column Links */
.mega-menu-column-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mega-menu-column-links li {
    margin: 0;
    padding: 0;
}

.mega-menu-column-links a {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 150%; /* 21px */
    display: flex;
    align-items: center;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mega-menu-column-links a:hover {
    color: #8C52FF;
}

/* View All Button (8th column) */
.mega-menu-view-all {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 1px;
    width: 117.59px;
    height: 162px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.mega-menu-view-all:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.mega-menu-view-all-text {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%; /* 24px */
    display: flex;
    align-items: center;
    text-align: center;
    color: #8C52FF;
    margin-bottom: 10px;
}

.mega-menu-view-all-icon {
    width: 25px;
    height: 25px;
    background: #8C52FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu-view-all-icon svg {
    width: 25px;
    height: 25px;
}

/* ====================================
   Mega Menu - Slider Section
==================================== */
.mega-menu-slider {
    position: relative;
    width: 357px;
    height: 417px;
}

.mega-menu-slide {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    display: none;
}

.mega-menu-slide.active {
    display: block;
}

.mega-menu-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.mega-menu-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Slider Pagination */
.mega-menu-pagination {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 9px;
    gap: 8px;
    
    position: absolute;
    width: 68px;
    height: 30px;
    left: calc(50% - 68px/2);
    bottom: 15.38px;
    
    background: rgba(18, 18, 18, 0.3);
    border-radius: 100px;
    backdrop-filter: blur(10px);
}

.mega-menu-pagination-dot {
    width: 10px;
    height: 10px;
    background: #FFFFFF;
    opacity: 0.3;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.3s ease;
    border: none;
    padding: 0;
}

.mega-menu-pagination-dot.active {
    opacity: 1;
}

.mega-menu-pagination-dot:hover {
    opacity: 0.7;
}

/* ====================================
   Mobile Menu Toggle
==================================== */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 2px;
    background: #FFFFFF;
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: #FFFFFF;
    left: 0;
    transition: transform 0.3s ease;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

/* ====================================
   Responsive Design
==================================== */

/* Tablet */
@media screen and (max-width: 1024px) {
    .site-header {
        padding: 20px 30px;
    }
    
    .header-container {
        gap: 20px;
    }
    
    .main-navigation ul {
        gap: 15px;
    }
    
    .main-navigation a {
        font-size: 15px;
    }
    
    .mega-menu-columns {
        grid-template-columns: repeat(3, 120px);
        gap: 40px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    
    #back-to-top{
            bottom: 90px  !important;
    }
    .site-header {
        padding: 15px 20px;
    }
    
    .header-container {
        grid-template-columns: auto 1fr auto;
    }
    
    .menu-toggle {
        display: block;
        order: 1;
    }
    
    .header-logo-column {
        order: 2;
        justify-content: center;
    }
    
    .header-actions-column {
        order: 3;
    }
    
    .header-nav-column {
        order: 4;
        grid-column: 1 / -1;
    }
    
    .main-navigation {
        display: none;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 20px 0;
    }
    
    .mega-menu-wrapper {
        position: static;
        padding: 20px;
    }
    
    .mega-menu-container {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mega-menu-slider {
        width: 100%;
        height: 300px;
    }
}

/* ====================================
   RTL Support
==================================== */
[dir="rtl"] .main-navigation .menu-item-has-children > a::after {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .mega-menu-column-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .mega-menu-column-title {
    text-align: left;
}

/* ====================================
   Accessibility
==================================== */
.main-navigation a:focus,
.mega-menu-column-links a:focus,
.mega-menu-view-all:focus {
    outline: 2px solid #8C52FF;
    outline-offset: 2px;
}

/* ====================================
   Performance
==================================== */
.mega-menu-wrapper {
    will-change: opacity, visibility;
}

.mega-menu-slide {
    will-change: display;
}


/* ====================================
   Sticky Header
==================================== */
.site-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    z-index: 1001;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ====================================
   Back To Top (Border Progress)
==================================== */

#back-to-top {

position: fixed;

bottom: 30px;
right: 30px;

width: 48px;
height: 48px;

display: none;
align-items: center;
justify-content: center;

background: transparent;
border: none;

cursor: pointer;

z-index: 999;

}

#back-to-top.show {
display: flex;
}


/* SVG */

.progress-ring {

position: absolute;
top: 0;
left: 0;

transform: rotate(-90deg);

}


/* white border */

.progress-ring-bg {

fill: none;

stroke: #ffffff;

stroke-width: 1.5;

opacity: 0.25;

}


/* progress border */

.progress-ring-progress {

fill: none;

stroke: #8C52FF;

stroke-width: 1.5;

stroke-linecap: round;

transition: stroke-dashoffset 0.1s linear;

}


/* icon */

#back-to-top img {

width: 18px;
height: 18px;

position: relative;

z-index: 2;

}


/* hover */

#back-to-top:hover {

transform: translateY(-4px);

}


/* RTL */

[dir="rtl"] #back-to-top {

right: auto;
left: 30px;

}


/* mobile */

@media (max-width:768px) {

#back-to-top {
bottom: 90px;
}

}