/**
 * TTPixel Child Theme - Professional Header, Navigation & Mobile Search Modal Styles
 *
 * @package TTPixel_Child_Theme
 */

/* =============================================================================
   1. Header Container & Sticky Setup
   ============================================================================= */

header#masthead.ttp-header {
	background-color: #ffffff !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
	position: relative;
	z-index: 200;
	width: 100%;
}

header#masthead.ttp-header--sticky {
	position: sticky;
	top: 0;
}

/* =============================================================================
   2. Top Header Bar
   ============================================================================= */

.ttp-header__top-bar {
	padding: 12px 0;
	border-bottom: 1px solid #f1f5f9;
}

.ttp-header__top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

/* Left: Logo & Mobile Burger Toggle Group */
.ttp-header__brand-group {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.ttp-header__brand {
	display: flex;
	align-items: center;
}

.ttp-header__brand img,
.ttp-site-logo-img,
.custom-logo {
	max-width: var(--ttp-logo-w-dt, 160px) !important;
	max-height: 52px;
	height: auto;
	width: auto;
	object-fit: contain;
	display: block;
}

@media (max-width: 768px) {
	.ttp-header__brand img,
	.ttp-site-logo-img,
	.custom-logo {
		max-width: var(--ttp-logo-w-mb, 120px) !important;
		max-height: 40px;
	}
}

.ttp-site-title-link {
	text-decoration: none !important;
}

.ttp-site-title {
	font-size: 1.5rem !important;
	font-weight: 800 !important;
	color: #0f172a !important;
	letter-spacing: -0.02em;
}

/* Centered Search Bar (Desktop) */
.ttp-header__search-wrap {
	flex: 1;
	max-width: 580px;
	margin: 0 16px;
	position: relative;
}

.ttp-header-search-form {
	display: flex !important;
	align-items: center !important;
	background-color: #ffffff !important;
	border: 2px solid #2563eb !important;
	border-radius: 50px !important;
	height: 44px !important;
	padding: 3px !important;
	position: relative !important;
	width: 100% !important;
	transition: all 0.2s ease !important;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08) !important;
	margin: 0 !important;
}

.ttp-header-search-form:focus-within {
	border-color: #1d4ed8 !important;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

.ttp-header-search__cat-wrap {
	position: relative;
	display: flex;
	align-items: center;
	height: 100%;
	padding-left: 14px;
	padding-right: 10px;
	border-right: 1px solid #e2e8f0;
}

.ttp-header-search__cat-wrap select.ttp-header-search__cat-select,
.ttp-header-search__cat-select {
	border: none !important;
	outline: none !important;
	background: transparent !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #475569 !important;
	cursor: pointer !important;
	height: 100% !important;
	padding: 0 12px 0 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.ttp-header-search__input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	height: 100%;
}

.ttp-header-search__input-wrap input.ttp-header-search__input,
.ttp-header-search__input {
	width: 100% !important;
	height: 100% !important;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	padding: 0 16px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: #0f172a !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	margin: 0 !important;
}

.ttp-header-search__input::placeholder {
	color: #94a3b8 !important;
}

.ttp-header-search__btn {
	background-color: #2563eb !important;
	color: #ffffff !important;
	border: none !important;
	outline: none !important;
	width: 38px !important;
	height: 38px !important;
	border-radius: 50px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	flex-shrink: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

.ttp-header-search__btn:hover {
	background-color: #1d4ed8 !important;
	transform: scale(1.06) !important;
}

.ttp-header-search__btn svg {
	stroke: #ffffff !important;
}

/* Live Search Dropdown Results Cards */
.ttp-header-search__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background-color: #ffffff !important;
	border-radius: 12px !important;
	box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
	border: 1px solid #e2e8f0 !important;
	max-height: 400px;
	overflow-y: auto;
	z-index: 999;
	padding: 8px;
}

.ttp-search-results-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ttp-search-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 8px;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
}

.ttp-search-result-item:hover {
	background-color: #f8fafc !important;
}

.ttp-search-result-thumb img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
}

.ttp-search-result-title {
	color: #0f172a !important;
	font-weight: 600 !important;
	font-size: 14px !important;
}

.ttp-search-result-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
}

.ttp-search-result-badge {
	font-size: 10px !important;
	font-weight: 700 !important;
	padding: 2px 6px !important;
	background: #2563eb !important;
	color: #ffffff !important;
	border-radius: 4px !important;
}

.ttp-search-result-price {
	color: #16a34a !important;
	font-weight: 700 !important;
	font-size: 13px !important;
}

.ttp-search-no-results {
	padding: 16px;
	text-align: center;
	color: #64748b !important;
	font-size: 14px !important;
}

/* Action Icons */
.ttp-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ttp-icon-btn {
	background: transparent !important;
	border: none !important;
	outline: none !important;
	width: 42px !important;
	height: 42px !important;
	border-radius: 50% !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #0f172a !important;
	position: relative;
	text-decoration: none !important;
	cursor: pointer;
	transition: all 0.2s ease !important;
}

.ttp-icon-btn svg {
	color: #0f172a !important;
	stroke: #0f172a !important;
	stroke-width: 2px !important;
	transition: all 0.2s ease !important;
}

.ttp-icon-btn:hover {
	background-color: #f1f5f9 !important;
	color: #2563eb !important;
}

.ttp-icon-btn:hover svg {
	color: #2563eb !important;
	stroke: #2563eb !important;
}

.ttp-badge-count {
	position: absolute;
	top: -2px;
	right: -2px;
	background-color: #ef4444 !important;
	color: #ffffff !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	height: 18px !important;
	min-width: 18px !important;
	border-radius: 999px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 4px !important;
	line-height: 1 !important;
	border: 2px solid #ffffff !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.ttp-wishlist-count {
	background-color: #8b5cf6 !important;
}

.ttp-cart-count {
	background-color: #2563eb !important;
}

.ttp-mobile-toggle {
	display: none !important;
}

.ttp-mobile-search-trigger {
	display: none !important;
}

/* =============================================================================
   3. Bottom Navigation Bar
   ============================================================================= */

.ttp-header__nav-bar {
	background-color: #ffffff !important;
	border-bottom: 1px solid #e2e8f0;
}

.ttp-header__nav {
	display: flex;
	align-items: center;
}

.ttp-primary-menu {
	display: flex;
	align-items: center;
	gap: 32px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ttp-primary-menu > li {
	position: relative;
}

.ttp-primary-menu > li > a {
	display: inline-flex;
	align-items: center;
	padding: 14px 0;
	color: #1e293b !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	transition: color 0.15s ease;
	position: relative;
}

.ttp-primary-menu > li > a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #2563eb;
	transform: scaleX(0);
	transition: transform 0.2s ease;
	transform-origin: bottom right;
}

.ttp-primary-menu > li:hover > a,
.ttp-primary-menu > li.current-menu-item > a,
.ttp-primary-menu > li.current-menu-ancestor > a {
	color: #2563eb !important;
}

.ttp-primary-menu > li:hover > a::after,
.ttp-primary-menu > li.current-menu-item > a::after {
	transform: scaleX(1);
	transform-origin: bottom left;
}

/* Primary Menu Sub-menu Dropdown Chevron Indicator (Desktop) */
.ttp-primary-menu > li.menu-item-has-children > a,
.ttp-primary-menu > li.page_item_has_children > a {
	gap: 6px;
}

.ttp-primary-menu > li.menu-item-has-children > a::before,
.ttp-primary-menu > li.page_item_has_children > a::before {
	content: '';
	display: inline-block;
	width: 5px;
	height: 5px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
	margin-left: 4px;
	order: 2;
	position: relative;
	top: -2px;
}

.ttp-primary-menu > li.menu-item-has-children:hover > a::before,
.ttp-primary-menu > li.page_item_has_children:hover > a::before {
	transform: rotate(225deg);
	top: 1px;
}


/* Sub-menu Dropdowns */
.ttp-primary-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background-color: #ffffff !important;
	border-radius: 8px !important;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
	border: 1px solid #e2e8f0 !important;
	padding: 8px 0;
	list-style: none;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all 0.2s ease;
	z-index: 100;
}

.ttp-primary-menu > li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ttp-primary-menu .sub-menu a {
	display: block;
	padding: 8px 18px;
	color: #334155 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	transition: all 0.15s ease;
}

.ttp-primary-menu .sub-menu a:hover {
	background-color: #f8fafc !important;
	color: #2563eb !important;
}

/* =============================================================================
   4. Mobile Off-Canvas Drawer & Mobile Search Modal
   ============================================================================= */

/* Mobile Off-Canvas Navigation Drawer */
.ttp-mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 9999;
	visibility: hidden;
	opacity: 0;
	transition: all 0.25s ease;
}

.ttp-mobile-drawer.is-active {
	visibility: visible;
	opacity: 1;
}

.ttp-mobile-drawer__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
}

.ttp-mobile-drawer__content {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 300px;
	max-width: 85vw;
	background-color: #ffffff;
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
}

.ttp-mobile-drawer.is-active .ttp-mobile-drawer__content {
	transform: translateX(0);
}

.ttp-mobile-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
}

.ttp-mobile-drawer__body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.ttp-mobile-menu {
	list-style: none;
	margin: 0 0 24px 0;
	padding: 0;
}

.ttp-mobile-menu li {
	margin-bottom: 4px;
}

.ttp-mobile-menu a {
	display: block;
	padding: 10px 12px;
	font-size: 15px;
	font-weight: 500;
	color: #1e293b !important;
	text-decoration: none !important;
	border-radius: 6px;
	transition: all 0.15s ease;
}

.ttp-mobile-menu a:hover {
	background-color: #f1f5f9 !important;
	color: #2563eb !important;
}

/* Mobile Sub-menu Accordions */
.ttp-mobile-menu .menu-item-has-children,
.ttp-mobile-menu .page_item_has_children {
	position: relative;
}

.ttp-mobile-menu .menu-item-has-children > a,
.ttp-mobile-menu .page_item_has_children > a {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
}

.ttp-mobile-menu .menu-item-has-children > a::after,
.ttp-mobile-menu .page_item_has_children > a::after {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 2px solid #64748b;
	border-bottom: 2px solid #64748b;
	transform: rotate(45deg);
	transition: transform 0.25s ease, border-color 0.2s ease;
	margin-left: 8px;
}

.ttp-mobile-menu .menu-item-has-children.is-open > a::after,
.ttp-mobile-menu .page_item_has_children.is-open > a::after {
	transform: rotate(225deg);
	border-color: #2563eb;
}

.ttp-mobile-menu .sub-menu {
	display: none;
	list-style: none;
	padding-left: 14px;
	margin: 4px 0 8px 0;
	border-left: 2px solid #e2e8f0;
}

.ttp-mobile-menu .menu-item-has-children.is-open > .sub-menu,
.ttp-mobile-menu .page_item_has_children.is-open > .sub-menu {
	display: block;
}


.ttp-mobile-quick-actions {
	border-top: 1px solid #e2e8f0;
	padding-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ttp-mobile-action-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	color: #334155 !important;
	text-decoration: none !important;
	font-weight: 500;
	font-size: 14px;
	border-radius: 6px;
	background: #f8fafc;
}

/* Mobile Search Modal Popup */
.ttp-search-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	visibility: hidden;
	opacity: 0;
	transition: all 0.25s ease;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 50px;
}

.ttp-search-modal.is-active {
	visibility: visible;
	opacity: 1;
}

.ttp-search-modal__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(6px);
}

.ttp-search-modal__container {
	position: relative;
	z-index: 2;
	width: 90%;
	max-width: 580px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	transform: translateY(-20px);
	transition: transform 0.25s ease;
}

.ttp-search-modal.is-active .ttp-search-modal__container {
	transform: translateY(0);
}

.ttp-search-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #f1f5f9;
}

.ttp-search-modal__title {
	font-weight: 700;
	font-size: 16px;
	color: #0f172a;
}

.ttp-search-modal__close {
	background: none;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 4px;
}

.ttp-search-modal__body {
	padding: 20px;
}

.ttp-search-modal-input-wrap {
	display: flex;
	align-items: center;
	border: 2px solid #2563eb;
	border-radius: 50px;
	padding: 4px 16px;
	background: #ffffff;
}

.ttp-search-modal-icon {
	color: #2563eb;
	flex-shrink: 0;
	margin-right: 10px;
}

.ttp-modal-search-input {
	flex: 1;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	font-size: 15px;
	color: #0f172a;
	padding: 8px 0;
	box-shadow: none !important;
}

.ttp-modal-search-results {
	margin-top: 16px;
	max-height: 350px;
	overflow-y: auto;
}

/* =============================================================================
   5. Responsive Breakpoints
   ============================================================================= */

@media (max-width: 991.98px) {
	.ttp-header__nav-bar {
		display: none;
	}

	.ttp-mobile-toggle {
		display: inline-flex !important;
		width: 36px !important;
		height: 36px !important;
		padding: 0 !important;
	}

	.ttp-mobile-toggle svg,
	.ttp-icon-burger {
		width: 20px !important;
		height: 20px !important;
	}

	/* Hide Search Icon & Wishlist Icon from Header on Mobile (as they are in Bottom Nav) */
	.ttp-mobile-search-trigger,
	.ttp-header__actions .ttp-mobile-search-trigger,
	.ttp-header__actions .ttp-wishlist-btn {
		display: none !important;
	}

	.ttp-header__search-wrap {
		display: none !important;
	}

	.ttp-header__top-bar {
		padding: 10px 0;
	}
}

@media (max-width: 480px) {
	.ttp-header__brand img {
		max-height: 36px;
	}
}

/* =============================================================================
   6. FLOATING WHATSAPP BUTTON COMPONENT
   ============================================================================= */

.ttp-whatsapp-float {
	position: fixed;
	bottom: 24px;
	z-index: 99998;
	display: flex;
	align-items: center;
	transition: bottom 0.3s ease, transform 0.2s ease;
}

.ttp-whatsapp-float--left {
	left: 24px;
}

.ttp-whatsapp-float--right {
	right: 24px;
}

.ttp-whatsapp-float__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	border-radius: 50%;
	box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
	text-decoration: none !important;
	transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.25s ease;
}

.ttp-whatsapp-float__btn:hover {
	transform: scale(1.1) translateY(-2px);
	box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55);
}

.ttp-whatsapp-float__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	z-index: 2;
}

/* Tooltip Badge on Hover */
.ttp-whatsapp-float__tooltip {
	position: absolute;
	white-space: nowrap;
	background-color: #0f172a;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 20px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
	z-index: 3;
}

.ttp-whatsapp-float--left .ttp-whatsapp-float__tooltip {
	left: calc(100% + 12px);
	transform: translateX(-8px);
}

.ttp-whatsapp-float--right .ttp-whatsapp-float__tooltip {
	right: calc(100% + 12px);
	transform: translateX(8px);
}

.ttp-whatsapp-float__btn:hover .ttp-whatsapp-float__tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* Pulse Ripple Animation */
.ttp-whatsapp-float.has-pulse .ttp-whatsapp-float__pulse {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid #25D366;
	animation: ttp-wa-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
	pointer-events: none;
}

@keyframes ttp-wa-pulse {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}
	70% {
		transform: scale(1.45);
		opacity: 0;
	}
	100% {
		transform: scale(1.45);
		opacity: 0;
	}
}

/* Mobile & Tablet Adjustments: lift button above sticky bottom navigation bar */
@media (max-width: 991.98px) {
	.ttp-whatsapp-float {
		bottom: 80px;
	}

	.ttp-whatsapp-float__btn {
		width: 50px;
		height: 50px;
	}

	.ttp-whatsapp-float__icon svg {
		width: 28px;
		height: 28px;
	}

	.ttp-whatsapp-float__tooltip {
		display: none;
	}
}

