/**
 * Custom Header Styles
 * Modern Arabic e-commerce header design
 */

/* Custom Header Container */
.custom-header {
    background-color: var(--custom-header-bg, #f8f9fa);
    color: var(--custom-header-text, #333333);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid #e9ecef;
}

/* Top Header Bar */
.custom-top-header {
    background-color: var(--custom-header-accent, #000000);
    color: #ffffff;
    padding: 8px 0;
    font-size: 13px;
}

.custom-top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-announcement {
    flex: 1;
    text-align: center;
}

.custom-announcement a {
    color: #ffffff;
    text-decoration: none;
}

.custom-top-header-actions {
    display: flex;
    align-items: center;
}

.custom-top-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.custom-top-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    transition: opacity 0.3s ease;
}

.custom-top-menu a:hover {
    opacity: 0.8;
}

/* Main Header */
.custom-main-header {
    height: var(--custom-header-height, 70px);
    display: flex;
    align-items: center;
}

.custom-header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.custom-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    position: relative;
    width: 100%;
}

/* Left Section - Navigation */
.custom-header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

/* Center Section - Logo */
.custom-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    flex: 0 0 auto;
    order: 2;
    display: flex;
    align-items: center;
}

/* Right Section - Actions */
.custom-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    order: 3;
}

/* Notifications Icon */
.custom-header-notifications {
    position: relative;
    margin-right: 15px;
}

.notifications-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--custom-header-text, #333333);
    transition: color 0.3s ease;
    position: relative;
}

.notifications-btn:hover {
    color: var(--custom-header-accent, #000000);
}

.notifications-btn svg {
    width: 18px;
    height: 18px;
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #ff4444;
    color: #ffffff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Mobile Menu Toggle - Left Side */
.custom-header-mobile-toggle {
    display: flex;
    align-items: center;
    order: 0;
    flex: 0 0 auto;
}

.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    margin-right: 15px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--custom-header-text, #333333);
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn:hover .hamburger-line {
    background-color: var(--custom-header-accent, #000000);
}

/* Navigation Menu - Left Side */
.custom-header-nav {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.custom-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    align-items: center;
}

.custom-nav-menu li {
    position: relative;
}

.custom-nav-menu a {
    color: var(--custom-header-text, #333333);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    transition: color 0.3s ease;
    display: block;
}

.custom-nav-menu a:hover {
    color: var(--custom-header-accent, #000000);
}

/* Logo/Brand - Center */
.custom-header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.custom-header-logo img {
    max-height: var(--custom-logo-size, 35px);
    width: auto;
}

.custom-logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--custom-header-text, #333333);
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 1px;
}

.custom-logo-text:hover {
    color: var(--custom-header-accent, #000000);
}

/* Header Actions - Right Side */
.custom-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Icon */
.custom-header-search-icon {
    display: flex;
    align-items: center;
}

.search-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--custom-header-text, #333333);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon-btn:hover {
    color: var(--custom-header-accent, #000000);
}

.search-icon-btn svg {
    width: 18px;
    height: 18px;
}

.custom-header-wishlist,
.custom-header-account {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--custom-header-accent, #000000);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.custom-header-wishlist:hover,
.custom-header-account:hover {
    background-color: var(--custom-header-text, #333333);
    transform: scale(1.05);
}

.custom-header-wishlist svg,
.custom-header-account svg {
    color: #ffffff;
    width: 18px;
    height: 18px;
}

/* Shopping Cart */
.custom-header-cart {
    position: relative;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--custom-header-accent, #000000);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 60px;
    justify-content: center;
}

.cart-btn:hover {
    background-color: var(--custom-header-text, #333333);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cart-text {
    font-size: 12px;
    font-weight: 500;
}

.cart-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 1px;
}

.cart-icon svg {
    color: var(--custom-header-accent, #000000);
    width: 10px;
    height: 10px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff4444;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Search Bar */
.custom-header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--custom-header-bg, #ffffff);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 999;
}

.custom-header-search.active {
    display: block;
}

.search-input-group {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-field {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    border-color: var(--custom-header-accent, #000000);
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: var(--custom-header-accent, #000000);
    transition: color 0.3s ease;
}

.search-submit:hover {
    color: var(--custom-header-text, #333333);
}

/* Mobile Menu Overlay */
.custom-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.custom-mobile-menu-overlay.active {
    display: block;
}

.custom-mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-color: #ffffff;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.custom-mobile-menu-overlay.active .custom-mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--custom-header-text, #333333);
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #e0e0e0;
}

.mobile-nav-menu a {
    display: block;
    padding: 15px 0;
    color: var(--custom-header-text, #333333);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.mobile-nav-menu a:hover {
    color: var(--custom-header-accent, #000000);
}

/* Responsive Design */
/* Mobile Layout - Simplified */
@media (max-width: 768px) {
    .custom-header-container {
        padding: 0 15px;
    }
    
    /* Reduce header height on mobile */
    .custom-header {
        height: 60px !important;
    }
    
    /* Hide top header on mobile */
    .custom-top-header {
        display: none;
    }
    
    /* Hide navigation on mobile */
    .custom-header-nav {
        display: none;
    }
    
    /* Mobile layout: Left (Hamburger) | Center (Logo) | Right (Cart) */
    .custom-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100%;
    }
    
    /* Left Section - Hamburger Menu */
    .custom-header-left {
        display: flex;
        align-items: center;
        order: 1;
        flex: 0 0 auto;
    }
    
    /* Center Section - Logo */
    .custom-header-center {
        position: static;
        transform: none;
        flex: 1;
        text-align: center;
        order: 2;
    }
    
    /* Right Section - Cart Only */
    .custom-header-right {
        display: flex;
        align-items: center;
        order: 3;
        flex: 0 0 auto;
    }
    
    /* Show only hamburger menu on mobile */
    .custom-header-mobile-toggle {
        display: flex;
    }
    
    /* Hide all other icons on mobile */
    .custom-header-notifications,
    .custom-header-search-icon,
    .custom-header-wishlist,
    .custom-header-account {
        display: none;
    }
    
    /* Show only cart on mobile */
    .custom-header-cart {
        display: flex;
    }
    
    /* Cart button styling for mobile */
    .cart-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
    }
    
    .cart-text {
        display: none;
    }
    
    .cart-icon {
        width: 16px;
        height: 16px;
    }
    
    .cart-icon svg {
        width: 14px;
        height: 14px;
    }
    
    /* Hamburger menu styling for mobile */
    .mobile-menu-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 3px;
        width: 36px;
        height: 36px;
        justify-content: center;
        align-items: center;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
        background-color: var(--custom-header-text, #333333);
        transition: all 0.3s ease;
    }
    
    /* Logo sizing for mobile */
    .custom-header-logo img {
        max-height: 35px;
    }
    
    .custom-header-logo .custom-logo-text {
        font-size: 20px;
    }
}

/* Extra Small Mobile - Simplified */
@media (max-width: 480px) {
    .custom-header-container {
        padding: 0 10px;
    }
    
    /* Even smaller header height for very small screens */
    .custom-header {
        height: 50px !important;
    }
    
    /* Smaller hamburger menu */
    .mobile-menu-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .hamburger-line {
        width: 18px;
        height: 2px;
    }
    
    /* Smaller cart button */
    .cart-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .cart-icon svg {
        width: 12px;
        height: 12px;
    }
    
    /* Smaller logo */
    .custom-header-logo img {
        max-height: 30px;
    }
    
    .custom-header-logo .custom-logo-text {
        font-size: 18px;
    }
}

/* Hide Edit Icons and WordPress Admin Elements */
.custom-header .edit-icon,
.custom-header .wp-admin-bar,
.custom-header .customize-partial-edit-shortcut,
.custom-header .customize-partial-edit-shortcut-button,
.custom-header .customize-partial-edit-shortcut-visible,
.custom-header .wp-customizer .customize-partial-edit-shortcut,
.custom-header .wp-customizer .customize-partial-edit-shortcut-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide any edit buttons that might appear */
.custom-header [class*="edit"],
.custom-header [class*="customize"],
.custom-header [class*="shortcut"] {
    display: none !important;
}

/* Top Header Styles */
.custom-top-header {
    background-color: #f8f9fa;
    color: #666666;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid #e9ecef;
}

.custom-top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.custom-top-header-left,
.custom-top-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-top-header a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.custom-top-header a:hover {
    color: #000000;
}

/* Custom Header Styles - Static CSS Only */

.custom-header-container {
    padding: 0 var(--custom-header-padding);
}

.custom-header-logo img {
    max-height: var(--custom-logo-size);
    width: auto;
}

/* Sticky Header */
.custom-header.sticky-enabled {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.custom-header.sticky-enabled.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}
