/*
 Theme Name:   XBrand Simple Theme
 Theme URI:    https://xbrand.com
 Description:  A lightweight, SEO-friendly WordPress theme with customizable header and footer, built for flexibility and future extensions.
 Author:       XBrand
 Author URI:   https://xbrand.com
 Version:      1.3.6
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  xbrand-simple-theme
 Tags:         custom-header, custom-footer, seo-friendly, elementor, woocommerce, responsive, sticky-header, rtl, wpml, ajax-search, mega-menu
 Requires at least: 6.0
 Tested up to: 6.6
 Requires PHP: 7.4
*/

/* Reset and Base Styles */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
}

article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow: visible;
    color: #333;
    padding-top: 80px; /* تعويض الهيدر العائم */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Layout */
body .site-header {
    background: linear-gradient(135deg, #E0F7FA, #FFFFFF);
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    z-index: 1001;
    top: 0;
    left: 0;
    right: 0;
    min-height: 80px; /* ارتفاع ثابت كحد أدنى */
}

body .sticky-header {
    display: none;
    background: linear-gradient(135deg, #E0F7FA, #FFFFFF);
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    z-index: 1002;
    top: 0;
    left: 0;
    right: 0;
    min-height: 80px; /* ارتفاع ثابت كحد أدنى */
}

body .sticky-header.active {
    display: block;
}

.header-top,
.header-bottom,
.sticky-header-inner,
.sticky-header-bottom {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-inner,
.sticky-header-inner {
    display: flex;
    align-items: center;
    width: 100%;
}

.site-branding,
.sticky-branding {
    flex: 0 0 auto;
    max-width: 200px;
    margin-right: auto; /* دفع الشعار إلى اليسار في LTR */
}

.site-branding img,
.sticky-branding .custom-logo-link img {
    max-height: 40px;
    width: auto;
}

.search-form-container,
.sticky-search .search-form {
    flex: 1;
    text-align: center;
    margin: 0 20px;
    max-width: 300px;
}

.social-icons,
.sticky-header .social-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    margin-left: auto; /* دفع الأيقونات إلى اليمين في LTR */
}

.social-icons .facebook-icon,
.social-icons .twitter-icon,
.social-icons .instagram-icon,
.social-icons .whatsapp-icon,
.sticky-header .social-icons .facebook-icon,
.sticky-header .social-icons .twitter-icon,
.sticky-header .social-icons .instagram-icon,
.sticky-header .social-icons .whatsapp-icon {
    font-size: 24px;
    margin-right: 10px;
}

.social-icons a,
.sticky-header .social-icons a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-icons a:hover,
.sticky-header .social-icons a:hover {
    color: #f22d12;
}

.header-actions,
.sticky-header .header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto; /* دفع الأيقونات إلى اليمين في LTR */
}

.site-header .cart-icon,
.site-header .account-icon,
.site-header .whatsapp-icon,
.sticky-header .cart-icon,
.sticky-header .account-icon {
    margin: 0;
    position: relative;
}

.site-header .cart-icon a,
.site-header .account-icon a,
.sticky-header .cart-icon a,
.sticky-header .account-icon a {
    text-decoration: none;
    font-size: 24px;
    color: #333;
    transition: color 0.3s ease;
}

.site-header .cart-icon a:hover,
.site-header .account-icon a:hover,
.sticky-header .cart-icon a:hover,
.sticky-header .account-icon a:hover {
    color: #f22d12;
}

.site-header .whatsapp-icon a,
.sticky-header .whatsapp-icon a {
    color: #25D366;
}

.site-header .whatsapp-icon a:hover,
.sticky-header .whatsapp-icon a:hover {
    color: #1DA851;
}

.mega-menu-container,
.sticky-menu .mega-menu-container {
    flex: 2;
    text-align: center;
}

.sticky-header .mega-menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

/* Navigation Styles */
.site-nav {
    flex: 1;
    text-align: center;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.site-nav ul li {
    position: relative;
    margin: 0 15px;
}

.site-nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 10px;
    display: block;
}

.site-nav ul li a:hover {
    color: #f22d12;
}

/* Mega Menu Styles */
.mega-menu-container .site-nav .menu-item-has-children > .sub-menu {
    display: none;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mega-menu-container .site-nav .mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: calc(100% - 40px);
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 999;
    padding: 20px;
    column-count: 2;
    column-gap: 20px;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateX(-50%) translateY(10px);
}

.mega-menu-container .site-nav li.menu-item-has-children:hover > .mega-menu {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-container .site-nav .mega-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.mega-menu-container .site-nav .mega-menu li {
    margin-bottom: 10px;
}

.mega-menu-link,
.mega-menu-sub-link {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.mega-menu-link:hover,
.mega-menu-sub-link:hover {
    color: #f22d12;
}

/* AJAX Search Styles */
.search-form-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 5px 0 0 5px;
    width: 250px;
    max-width: 100%;
    transition: width 0.3s ease;
}

.search-form button {
    padding: 8px 12px;
    background-color: #f22d12;
    color: #fff;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.search-form button i {
    font-size: 16px;
    color: #fff;
}

.search-form button:hover {
    background-color: #d81c0a;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 300px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 999;
}

.search-results ul {
    list-style: none;
    margin: 0;
    padding: 10px;
}

.search-results ul li {
    margin-bottom: 10px;
}

.search-results ul li a {
    text-decoration: none;
    color: #333;
}

.search-results ul li a:hover {
    color: #f22d12;
}

/* Cart Icon in Header */
.site-header .cart-icon,
.sticky-header .cart-icon {
    position: relative;
}

.site-header .cart-icon a,
.sticky-header .cart-icon a {
    text-decoration: none;
    color: #333;
    font-size: 24px;
}

.site-header .cart-icon a:hover,
.sticky-header .cart-icon a:hover {
    color: #f22d12;
}

.site-header .cart-count,
.sticky-header .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f22d12;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    line-height: 1;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .header-inner,
    .header-bottom,
    .sticky-header-inner,
    .sticky-header-bottom {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .search-form-container,
    .sticky-header .search-form-container {
        width: 100%;
        margin: 10px 0;
    }
    .social-icons,
    .sticky-header .social-icons {
        justify-content: center;
        width: 100%;
    }
    .mega-menu-container,
    .sticky-header .mega-menu-container {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100%;
        background: #fff;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1002;
        flex-direction: column;
        padding: 20px;
    }
    .mega-menu-container.active,
    .sticky-header .mega-menu-container.active {
        display: flex;
        transform: translateX(0);
    }
    .site-nav ul.menu {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav .mega-menu {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        padding: 10px 0;
        column-count: 1;
    }
    .social-icons:not(.mobile-only),
    .sticky-header .social-icons:not(.mobile-only) {
        display: none;
    }
    .social-icons.mobile-only,
    .sticky-header .social-icons.mobile-only {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }
    .header-actions:not(.mobile-only),
    .sticky-header .header-actions:not(.mobile-only) {
        display: none;
    }
    .header-actions.mobile-only,
    .sticky-header .header-actions.mobile-only {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }
    .mega-menu-toggle,
    .sticky-header .mega-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .social-icons,
    .sticky-header .social-icons,
    .header-actions,
    .sticky-header .header-actions {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    .search-form-container,
    .sticky-header .search-form-container {
        width: 100%;
    }
    .search-form input[type="search"] {
        width: 100%;
        box-sizing: border-box;
    }
    .mega-menu-container .site-nav .mega-menu {
        position: static;
        width: 100%;
        column-count: 1;
        box-shadow: none;
        border: none;
        padding: 10px 0;
        transform: none;
    }
    .mega-menu-container .site-nav li.menu-item-has-children:hover > .mega-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile Menu Toggle */
.mega-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 16px;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .mega-menu-toggle {
        display: inline-block;
    }
    .mega-menu-container .site-nav ul.menu {
        flex-direction: column;
    }
}

/* Main Content */
.site-content {
    padding: 40px 0;
}

/* Footer Styles */
.site-footer {
    background: #333;
    color: #fff;
    padding: 40px 0;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li a {
    color: #fff;
    text-decoration: none;
}

.footer-column ul li a:hover {
    color: #f22d12;
}

/* Social Icons in Footer */
.footer-social {
    margin-top: 20px;
    text-align: center;
}

.footer-social a {
    color: #fff;
    font-size: 24px;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #f22d12;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.site-footer a {
    color: #f22d12;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* WooCommerce Styles */
.woocommerce .woocommerce-products-header__title {
    font-size: 32px;
    margin-bottom: 20px;
}

.woocommerce ul.products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
}

.woocommerce ul.products li.product {
    flex: 1 0 30%;
    max-width: 30%;
    text-align: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 18px;
    margin: 10px 0;
}

.woocommerce ul.products li.product img {
    max-width: 100%;
    height: auto;
}

.woocommerce ul.products li.product .price {
    color: #f22d12;
    font-weight: 600;
    margin-bottom: 10px;
}

.woocommerce ul.products li.product .button {
    background-color: #f22d12;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #d81c0a;
}

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
    margin-bottom: 20px;
}

.woocommerce .woocommerce-pagination {
    text-align: center;
    margin-top: 20px;
}

.woocommerce .page-numbers {
    list-style: none;
    display: inline-flex;
    gap: 10px;
}

.woocommerce .page-numbers li a,
.woocommerce .page-numbers li span {
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
}

/* stylelint-disable selector-class-pattern */
.woocommerce .page-numbers .current,
.woocommerce .page-numbers a:hover {
    background-color: #f22d12;
    color: #fff;
}

/* Lazy Loading for Images */
.lazy-img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-img.loaded {
    opacity: 1;
}

/* Elementor Featured Products */
.xbrand-featured-products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.xbrand-featured-products .featured-product {
    flex: 1 0 22%;
    max-width: 22%;
    text-align: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.xbrand-featured-products .featured-product img {
    max-width: 100%;
    height: auto;
}

.xbrand-featured-products .featured-product h3 {
    font-size: 16px;
    margin: 10px 0;
}

.xbrand-featured-products .featured-product .price {
    color: #f22d12;
    font-weight: 600;
}