/*
 * Header Styles for Cima Club Theme
 * Version: 1.0.0
 * Author: OubaaLi
 */

/* CSS Variables for easy customization */
:root {
	--top-bar-bg: #29b5e8;
	--main-header-bg: #3d3f5c;
	--dropdown-bg: #3d3f5c;
	--accent-color: #29b5e8;
	--text-white: #ffffff;
	--transition-speed: 0.3s;
	--dropdown-width: 220px;
	--font-family: 'Cairo', sans-serif;
}

/* Global Font */
* {
	font-family: var(--font-family);
}

/* Container */
.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Top Bar - Desktop Only */
.top-bar {
	background: var(--top-bar-bg);
	color: var(--text-white);
	box-shadow: 0 3px 3px #0000009e;
	padding: 20px 0;
	transition: all 0.3s ease;
	z-index: 9999;
}

/* Sticky Navigation - Desktop Only */
@media (min-width: 769px) {
	.top-bar.sticky {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
		animation: slideDownNav 0.3s ease;
	}
	
	@keyframes slideDownNav {
		from {
			transform: translateY(-100%);
		}
		to {
			transform: translateY(0);
		}
	}
	
	/* Add padding to body when nav is sticky to prevent jump */
	body.nav-sticky {
		padding-top: 50px;
	}
}

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

.top-menu ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 30px;
}

.top-menu ul li {
	position: relative;
}

.top-menu ul li a {
	color: #fff;
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	transition: opacity 0.3s;
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: 'Cairo', sans-serif;
}

.top-menu ul li a:hover {
	opacity: 0.8;
}

/* Dropdown indicator */
.top-menu ul li.menu-item-has-children > a::after {
	content: '▼';
	font-size: 9px;
	margin-right: 5px;
	transition: transform 0.3s;
}

.top-menu ul li.menu-item-has-children:hover > a::after {
	transform: rotate(180deg);
}

/* Submenu - Dropdown */
.top-menu ul ul {
	position: absolute;
	top: 100%;
	right: 0;
	background: var(--dropdown-bg);
	min-width: var(--dropdown-width);
	padding: 15px 0;
	display: none;
	box-shadow: 0 8px 20px rgba(0,0,0,0.3);
	z-index: 1000;
	border-radius: 0 0 8px 8px;
	margin-top: 0;
	animation: slideDown 0.3s ease;
}

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

.top-menu ul li:hover > ul {
	display: block;
}

.top-menu ul ul li {
	padding: 0;
	border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.top-menu ul ul li a {
	padding: 12px 25px;
	display: block;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.3s;
	position: relative;
	font-family: 'Cairo', sans-serif;
}

.top-menu ul ul li a:hover {
	background: rgba(41,181,232,0.1);
	padding-right: 30px;
	color: var(--accent-color);
}

.top-menu ul ul li a::before {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 100%;
	background: #29b5e8;
	transition: width 0.3s;
}

.top-menu ul ul li a::before {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 100%;
	background: var(--accent-color);
	transition: width var(--transition-speed);
}

.top-menu ul ul li a:hover::before {
	width: 3px;
}

/* Third level submenu (if exists) */
.top-menu ul ul ul {
	right: 100%;
	top: 0;
	margin-top: 0;
	margin-right: 0;
	border-radius: 8px;
}

.top-menu ul ul li.menu-item-has-children > a::after {
	content: '◀';
	font-size: 10px;
	margin-right: 0;
	position: absolute;
	left: 15px;
}

.top-menu ul ul li:hover > ul {
	display: block;
}

/* Active/Current menu item styling */
.top-menu .current-menu-item > a,
.top-menu .current_page_item > a {
	opacity: 1;
	font-weight: 600;
}

.top-menu ul ul .current-menu-item > a {
	color: var(--accent-color);
	background: rgba(41,181,232,0.1);
}

/* Main Header */
.main-header {
	background: #33365a;
	padding: 15px 0;
	position: relative;
}

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

/* Logo */
.site-logo {
	flex: 0 0 auto;
}

.site-logo a {
	display: inline-block;
	text-decoration: none;
}

.logo-text {
	font-size: 32px;
	font-weight: 800;
	letter-spacing: 1px;
	font-family: 'Cairo', sans-serif;
}

.logo-cima {
	color: #fff;
}

.logo-club {
	color: var(--accent-color);
}

/* Logo Site Name (when using site name from settings) */
.logo-site-name {
	color: #fff;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 0.5px;
	font-family: 'Cairo', sans-serif;
}

/* Custom Logo Image */
.site-logo .custom-logo {
	max-height: 60px;
	width: auto;
	display: block;
}

/* Header Right */
.header-right {
	display: flex;
	align-items: center;
	gap: 50px;
}

/* Search Form - Desktop */
.header-search {
	flex: 1;
	max-width: 350px;
}

.header-search .search-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

.header-search .search-field {
	flex: 1;
	padding: 10px 20px;
	background: rgba(0, 0, 0, .75);
	border: none;
	border-radius: 25px;
	color: #ffffff;
	font-size: 14px;
	outline: none;
	font-family: inherit;
	transition: box-shadow 0.3s;
}

.header-search .search-field:focus {
	box-shadow: 0 0 0 2px rgba(41,181,232,0.3);
}

.header-search .search-field::placeholder {
	color: #999;
	font-size: 13px;
}

.header-search .search-submit {
	padding: 10px 20px;
	background: rgba(0, 0, 0, .75);
	border: none;
	border-radius: 25px;
	color: #ffffff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	transition: all 0.3s;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 5px;
}

.header-search .search-submit:hover {
	background: var(--accent-color);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-search .search-submit svg {
	width: 16px;
	height: 16px;
}

/* Social Icons */
.social-icons {
	display: flex;
	gap: 15px;
}

.social-icons a {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	transition: all 0.3s;
	text-decoration: none;
}

.social-icons a:hover {
	background: var(--accent-color);
	transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 5px;
	z-index: 1001;
}

.mobile-menu-toggle span {
	width: 25px;
	height: 3px;
	background: #fff;
	border-radius: 2px;
	transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
	transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
	transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Search Toggle */
.mobile-search-toggle {
	display: none;
	background: var(--accent-color);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 5px;
	font-size: 14px;
	cursor: pointer;
	font-family: inherit;
}

/* Mobile Search Form */
.mobile-search-form {
	display: none;
}

.mobile-search-form .search-form {
	display: flex;
	gap: 8px;
	align-items: center;
	max-width: 600px;
	margin: 0 auto;
}

.mobile-search-form .search-field {
	flex: 1;
	padding: 12px 20px;
	background: #fff;
	border: none;
	border-radius: 25px;
	color: #333;
	font-size: 15px;
	outline: none;
	font-family: inherit;
}

.mobile-search-form .search-field::placeholder {
	color: #999;
}

.mobile-search-form .search-submit {
	padding: 12px 20px;
	background: #fff;
	border: none;
	border-radius: 25px;
	color: #3d3f5c;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.mobile-search-form .search-submit svg {
	width: 16px;
	height: 16px;
}

/* Mobile Menu Sidebar */
.mobile-menu-sidebar {
	position: fixed;
	top: 0;
	right: -100%;
	width: 300px;
	height: 100vh;
	z-index: 9999;
	transition: right 0.3s ease;
}

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

.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0,0,0,0.7);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s;
	z-index: -1;
}

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

.mobile-menu-content {
	position: relative;
	width: 100%;
	height: 100%;
	background: var(--main-header-bg);
	padding: 80px 30px 30px;
	overflow-y: auto;
	z-index: 1;
}

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

.mobile-menu-content ul li {
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-content ul li a {
	display: block;
	padding: 15px 0;
	color: #fff;
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	transition: color 0.3s;
}

.mobile-menu-content ul li a:hover {
	color: var(--accent-color);
}

/* Mobile submenu */
.mobile-menu-content ul ul {
	padding-right: 20px;
}

.mobile-menu-content ul ul li a {
	font-size: 14px;
	padding: 10px 0;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
	.header-search {
		max-width: 280px;
	}
	
	.header-search .search-field {
		padding: 9px 18px;
		font-size: 13px;
	}
	
	.header-search .search-submit {
		padding: 9px 16px;
		font-size: 13px;
	}
	
	.header-search .search-submit span {
		display: none;
	}
	
	.header-search .search-submit svg {
		width: 18px;
		height: 18px;
	}
	
	.top-menu ul {
		gap: 20px;
	}
}

/* Sticky Header Effect */
.site-header.scrolled {
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.site-header.scrolled .main-header {
	padding: 10px 0;
	transition: padding 0.3s;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
	/* Hide desktop elements */
	.top-bar {
		display: none;
	}
	
	.header-search {
		display: none;
	}
	
	.mobile-search-toggle {
		display: none;
	}
	
	/* Main header container */
	.main-header .container {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}
	
	/* First row: Menu toggle + Logo + Social icons */
	.header-content {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		position: relative;
	}
	
	/* Menu toggle - Right side */
	.mobile-menu-toggle {
		display: flex;
		order: 1;
		z-index: 10;
	}
	
	/* Logo - Center */
	.site-logo {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		order: 2;
		z-index: 5;
	}
	
	.logo-text {
		font-size: 28px;
	}
	
	.logo-site-name {
		font-size: 24px;
	}
	
	.site-logo .custom-logo {
		max-height: 50px;
	}
	
	/* Social icons - Left side */
	.header-right {
		order: 3;
		gap: 0;
	}
	
	.social-icons {
		gap: 10px;
		background: rgba(0,0,0,0.3);
		padding: 8px;
		border-radius: 20px;
	}
	
	.social-icons a {
		width: 32px;
		height: 32px;
	}
	
	/* Second row: Mobile search form */
	.mobile-search-form {
		display: block;
		width: 100%;
		padding: 0 20px;
	}
	
	.mobile-search-form .search-form {
		max-width: 450px;
		margin: 0 auto;
	}
	
	.mobile-search-form .search-field {
		font-size: 14px;
		padding: 10px 18px;
	}
	
	.mobile-search-form .search-submit {
		padding: 10px 16px;
		font-size: 13px;
	}
	
	.mobile-search-form .search-submit svg {
		width: 14px;
		height: 14px;
	}
	
	.main-header {
		padding: 12px 0;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 0 15px;
	}
	
	.logo-text {
		font-size: 24px;
	}
	
	.logo-site-name {
		font-size: 20px;
	}
	
	.site-logo .custom-logo {
		max-height: 40px;
	}
	
	.social-icons a {
		width: 28px;
		height: 28px;
	}
	
	.social-icons svg {
		width: 14px;
		height: 14px;
	}
	
	.mobile-menu-sidebar {
		width: 280px;
	}
	
	/* تصغير خانة البحث للشاشات الصغيرة */
	.mobile-search-form {
		padding: 0 15px;
	}
	
	.mobile-search-form .search-form {
		max-width: 350px;
	}
	
	.mobile-search-form .search-field {
		font-size: 13px;
		padding: 9px 16px;
	}
	
	.mobile-search-form .search-submit {
		padding: 9px 14px;
		font-size: 12px;
	}
	
	.mobile-search-form .search-submit span {
		display: none;
	}
	
	.mobile-search-form .search-submit svg {
		width: 16px;
		height: 16px;
	}
}
