/**
 * FlexiDesignX — Header, Nav & Footer (Shopee-inspired)
 *
 * @package FlexiDesignX
 * @since   1.0.0
 */

/* ==========================================================================
   Top Bar (announcement)
   ========================================================================== */

.fdx-topbar {
	background: var(--fdx-gold);
	color: var(--fdx-accent);
	font-size: 0.6875rem;
	letter-spacing: 0.01em;
}

.fdx-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 0.375rem;
	padding-bottom: 0.375rem;
}

/* Slider container */
.fdx-topbar__slider {
	flex: 1;
	text-align: center;
	position: relative;
	overflow: hidden;
	min-height: 1.25em;
}

.fdx-topbar__slide {
	display: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fdx-topbar__slide--active {
	display: block;
}

/* Prev / Next arrows */
.fdx-topbar__arrow {
	background: none;
	border: none;
	color: rgba(26, 26, 26, 0.55);
	font-size: 1rem;
	padding: 0 10px;
	cursor: pointer;
	transition: color 0.2s;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 1;
}

.fdx-topbar__arrow:hover {
	color: var(--fdx-accent);
}

/* Mobile: hide slider */
@media (max-width: 767px) {
	.fdx-topbar__slider {
		display: none;
	}
	.fdx-topbar__arrow {
		display: none;
	}
}

/* ==========================================================================
   Main Header
   ========================================================================== */

.fdx-header {
	background: var(--fdx-accent);
	padding: 0;
	position: relative; /* anchor for mega menu */
}

.fdx-header__inner {
	display: flex;
	align-items: center;
	padding: 16px 40px;
	justify-content: space-between;
}

/* Left group: Logo + Hamburger */
.fdx-header__left {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

/* Logo */
.fdx-header__logo {
	text-decoration: none;
	flex-shrink: 0;
}

.fdx-header__logo-text {
	font-size: 1.375rem;
	font-weight: 800;
	color: var(--fdx-white);
	letter-spacing: -0.02em;
}

.fdx-header__logo:hover .fdx-header__logo-text {
	color: var(--fdx-white);
}

.fdx-header__logo-img {
	max-height: 44px;
	width: auto;
	display: block;
	background: #fff;
	padding: 5px 12px;
	border-radius: 6px;
}
@media (min-width: 1025px) {
	.fdx-header__logo-img { max-height: 52px; }
}

/* Hamburger button */
.fdx-hamburger {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fdx-white);
	border-radius: 6px;
	transition: background 0.2s;
}

.fdx-hamburger:hover {
	background: rgba(255, 255, 255, 0.12);
}

/* Animated hamburger lines */
.fdx-hamburger__lines {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 22px;
	height: 18px;
	gap: 5px;
}

.fdx-hamburger__lines span {
	display: block;
	width: 100%;
	height: 2px;
	background: #fff;
	border-radius: 1px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform-origin: center;
}

/* Hover: middle line fades, top/bottom move closer (= look) */
.fdx-hamburger:hover .fdx-hamburger__lines span:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.fdx-hamburger:hover .fdx-hamburger__lines span:nth-child(1) {
	transform: translateY(3px);
}

.fdx-hamburger:hover .fdx-hamburger__lines span:nth-child(3) {
	transform: translateY(-3px);
}

/* Center nav links */
.fdx-header__nav {
	display: none;
	align-items: center;
	gap: 40px;
}

.fdx-header__nav a {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--fdx-white);
	text-decoration: none;
	transition: opacity 0.15s;
}

.fdx-header__nav a:hover {
	opacity: 0.75;
	color: var(--fdx-white);
}

@media (min-width: 768px) {
	.fdx-header__nav {
		display: flex;
	}
}

/* Search toggle button */
.fdx-header__search-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--fdx-white);
	padding: 0.35rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.fdx-header__search-toggle:hover {
	background: rgba(255,255,255,0.12);
}

/* ==========================================================================
   Mega Menu Panel
   ========================================================================== */

/* Overlay behind mega menu */
.fdx-mega-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 9998;
	display: none;
}

body.fdx-mega-open .fdx-mega-overlay {
	display: block;
}

.fdx-mega-menu {
	position: fixed;
	top: 0;
	left: 0;
	width: 60%;
	max-width: 820px;
	height: 100vh;
	background: #fff;
	z-index: 9999;
	display: none;
	box-shadow: 8px 0 40px rgba(0, 0, 0, 0.1);
	overflow-y: auto;
}

body.fdx-mega-open .fdx-mega-menu {
	display: flex;
	flex-direction: column;
}

.fdx-mega-menu__header {
	display: flex;
	align-items: center;
	padding: 16px 40px;
	border-bottom: 1px solid #f0f0f0;
}

.fdx-mega-menu__close {
	font-size: 1.5rem;
	background: none;
	border: none;
	cursor: pointer;
	margin-right: 24px;
	color: #333;
	line-height: 1;
	padding: 4px;
	transition: color 0.15s;
}

.fdx-mega-menu__close:hover {
	color: #000;
}

.fdx-mega-menu__nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.fdx-mega-menu__nav a {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 8px 16px;
	color: #333;
	text-decoration: none;
	border-radius: 4px;
	transition: background 0.15s, color 0.15s;
}

.fdx-mega-menu__nav a:hover {
	background: #f5f5f5;
	color: #111;
}

.fdx-mega-menu__body {
	display: flex;
	padding: 32px 40px;
	gap: 40px;
}

.fdx-mega-menu__categories {
	flex: 1;
	max-width: 300px;
}

.fdx-mega-menu__categories a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	font-size: 0.95rem;
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid #f5f5f5;
	transition: color 0.15s;
}

.fdx-mega-menu__categories a:hover {
	color: var(--fdx-gold);
}

.fdx-mega-menu__categories a span {
	font-size: 1.1rem;
	flex-shrink: 0;
	width: 24px;
	text-align: center;
}

.fdx-mega-menu__categories h4 {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: #999;
	margin: 16px 0 8px;
	padding: 0;
}

.fdx-mega-menu__links {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.fdx-mega-menu__links a {
	border-bottom: none;
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--fdx-gold);
	padding: 8px 0;
}

.fdx-mega-menu__links a:hover {
	color: var(--fdx-gold-hover);
}

.fdx-mega-menu__featured {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.fdx-mega-menu__featured-item {
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	height: 220px;
	display: block;
	text-decoration: none;
}

.fdx-mega-menu__featured-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s;
}

.fdx-mega-menu__featured-item:hover img {
	transform: scale(1.03);
}

.fdx-mega-menu__featured-item span {
	position: absolute;
	bottom: 16px;
	left: 16px;
	color: #fff;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Mobile: tighten header padding */
@media (max-width: 767px) {
	.fdx-header__inner {
		padding: 8px 12px;
	}

	.fdx-mega-menu {
		width: 85%;
	}

	.fdx-mega-menu__header {
		padding: 12px 16px;
	}

	.fdx-mega-menu__body {
		flex-direction: column;
		padding: 24px 16px;
		gap: 24px;
	}

	.fdx-mega-menu__categories {
		max-width: none;
	}

	.fdx-mega-menu__featured {
		display: none;
	}
}

/* ==========================================================================
   AJAX Live Search Dropdown
   ========================================================================== */

.fdx-search {
	position: relative;
}

.fdx-search__results {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--fdx-white, #fff);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 400px;
	overflow-y: auto;
	z-index: 100;
	margin-top: 4px;
}

.fdx-search__item {
	display: flex;
	align-items: center;
	padding: 12px;
	border-bottom: 1px solid var(--fdx-grey-200, #e5e7eb);
	text-decoration: none;
	color: inherit;
	transition: background 0.15s;
}

.fdx-search__item:last-child {
	border-bottom: none;
}

.fdx-search__item:hover {
	background: #f5f5f5;
}

.fdx-search__thumb {
	width: 50px;
	height: 50px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
}

.fdx-search__info {
	flex: 1;
	margin-left: 12px;
	min-width: 0;
}

.fdx-search__name {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--fdx-grey-900, #111827);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.35;
}

.fdx-search__price {
	font-size: 0.8rem;
	color: var(--fdx-gold);
	font-weight: 600;
	margin-top: 2px;
}

.fdx-search__empty {
	padding: 24px;
	text-align: center;
	color: #999;
	font-size: 0.875rem;
}

/* ==========================================================================
   Full-Screen Search Overlay
   ========================================================================== */

.fdx-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #fff;
	z-index: 10000;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

body.fdx-search-open .fdx-search-overlay {
	display: block;
	opacity: 1;
}

body.fdx-search-open {
	overflow: hidden;
}

.fdx-search-overlay__inner {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
	padding: 80px 24px 40px;
}

.fdx-search-overlay__close {
	position: absolute;
	top: 24px;
	right: 24px;
	font-size: 2rem;
	background: none;
	border: none;
	cursor: pointer;
	color: #222;
	line-height: 1;
	padding: 4px;
}

.fdx-search-overlay__close:hover {
	color: var(--fdx-gold);
}

.fdx-search-overlay__form {
	display: flex;
	gap: 12px;
	margin-bottom: 32px;
}

.fdx-search-overlay__input {
	flex: 1;
	height: 56px;
	border: none;
	border-bottom: 2px solid #222;
	font-size: 0.9rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: transparent;
	padding: 0 4px;
	font-family: inherit;
}

.fdx-search-overlay__input:focus {
	border-bottom-color: var(--fdx-gold);
	outline: none;
}

.fdx-search-overlay__input::placeholder {
	color: #999;
}

.fdx-search-overlay__btn {
	background: #222;
	color: #fff;
	border: none;
	padding: 0 28px;
	height: 56px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background 0.15s;
}

.fdx-search-overlay__btn:hover {
	background: #444;
}

.fdx-search-overlay__recommended {
	margin-top: 8px;
}

.fdx-search-overlay__recommended h4 {
	font-size: 0.75rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #999;
	margin-bottom: 16px;
}

.fdx-search-overlay__recommended a {
	display: block;
	padding: 10px 0;
	color: var(--fdx-gold);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid #f0f0f0;
}

.fdx-search-overlay__recommended a:hover {
	color: var(--fdx-gold-hover);
}

/* Live search results inside overlay */
.fdx-search-overlay .fdx-search__results {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
	margin-top: 0;
	margin-bottom: 16px;
	box-shadow: none;
	border: 1px solid #f0ece9;
	border-radius: 10px;
	max-height: 50vh;
}

.fdx-search-overlay .fdx-search__item {
	gap: 12px;
	padding: 10px 14px;
}

.fdx-search-overlay .fdx-search__thumb {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	border: 1px solid #f0ece9;
}

.fdx-search-overlay .fdx-search__name {
	font-size: 0.88rem;
	font-weight: 600;
	color: #1A1A1A;
}

.fdx-search-overlay .fdx-search__price {
	font-size: 0.82rem;
	color: var(--fdx-gold, #C4A882);
	font-weight: 700;
	margin-top: 4px;
}

.fdx-search-overlay .fdx-search__item:hover {
	background: var(--fdx-gold-light, #F5F0EA);
}

.fdx-search-overlay .fdx-search__empty {
	padding: 32px 16px;
	color: #bbb;
	font-size: 0.88rem;
}

/* Header icon group */
.fdx-header__icons {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.fdx-header__icon {
	position: relative;
	color: var(--fdx-white);
	text-decoration: none;
	padding: 0.35rem;
	border-radius: 50%;
	transition: background 0.2s, opacity 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fdx-header__icon:hover {
	background: rgba(255,255,255,0.12);
	color: var(--fdx-white);
}

/* Cart icon */
.fdx-header__cart {
	position: relative;
}

.fdx-header__cart-badge {
	position: absolute;
	top: -4px;
	right: -6px;
	background: var(--fdx-gold);
	color: var(--fdx-accent);
	font-size: 10px;
	font-weight: 800;
	min-width: 18px;
	height: 18px;
	border-radius: var(--fdx-radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

/* Old .fdx-nav removed — navigation now lives inside .fdx-header__nav and .fdx-mega-menu */

/* Sticky header on scroll */
.fdx-header--sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	box-shadow: 0 2px 12px rgba(0,0,0,0.12);
	animation: fdxSlideDown 0.3s ease;
}
/* Sticky header spacing (nav is now inside header, no separate .fdx-nav) */
.admin-bar .fdx-header--sticky { top: 32px; }
@keyframes fdxSlideDown {
	from { transform: translateY(-100%); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* Funori default header is replaced entirely via child theme header.php —
   handled in fdx-parent-overrides.css */

/* ==========================================================================
   Footer
   ========================================================================== */

.fdx-footer {
	background: var(--fdx-dark-brown);
	color: rgba(255, 255, 255, 0.7);
}

.fdx-footer__main {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	padding-top: 2.5rem;
	padding-bottom: 2rem;
}

.fdx-footer__brand {
	font-size: var(--fdx-font-size-xl);
	font-weight: 800;
	color: var(--fdx-white);
	margin: 0 0 0.5rem;
}

.fdx-footer__desc {
	font-size: var(--fdx-font-size-sm);
	line-height: 1.6;
	margin: 0 0 1rem;
}

.fdx-footer__social {
	display: flex;
	gap: 0.75rem;
}

.fdx-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.7);
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.fdx-footer__social a:hover {
	background: var(--fdx-gold);
	color: #fff;
}

.fdx-footer__social a svg {
	flex-shrink: 0;
}

.fdx-footer__heading {
	font-size: var(--fdx-font-size-sm);
	font-weight: 700;
	color: var(--fdx-white);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 0.75rem;
}

.fdx-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fdx-footer__links li {
	margin-bottom: 0.375rem;
}

.fdx-footer__links a {
	font-size: var(--fdx-font-size-sm);
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: color 0.15s;
}

.fdx-footer__links a:hover {
	color: var(--fdx-white);
}

.fdx-footer__address {
	font-style: normal;
	font-size: var(--fdx-font-size-sm);
	line-height: 1.6;
}

.fdx-footer__address a {
	color: var(--fdx-gold);
	text-decoration: none;
}

.fdx-footer__address a:hover {
	text-decoration: underline;
}

/* Payment icons row */
.fdx-footer__payments {
	border-top: 1px solid rgba(255,255,255,0.08);
	padding: 1rem 0;
}
.fdx-footer__payments .fdx-container {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}
.fdx-footer__payments-label {
	font-size: 0.75rem;
	color: rgba(255,255,255,0.5);
	font-weight: 500;
}
.fdx-footer__payments-icons {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.fdx-pay-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.7);
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 0.3rem 0.6rem;
	border-radius: 4px;
	height: 28px;
}
.fdx-pay-icon--grab {
	background: rgba(255,255,255,0.12);
	padding: 0.3rem 0.5rem;
}

.fdx-footer__map {
	max-width: var(--fdx-max-width);
	margin: 0 auto;
	padding: 0 1rem 1.5rem;
}

.fdx-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 1rem 0;
	text-align: center;
	font-size: var(--fdx-font-size-xs);
}

.fdx-footer__bottom p {
	margin: 0;
}

/* Hide Storefront's default footer */
.site-footer {
	display: none;
}

/* ==========================================================================
   Tablet — 2 column footer
   ========================================================================== */

@media (min-width: 768px) {
	.fdx-footer__main {
		grid-template-columns: repeat(2, 1fr);
	}

}

/* ==========================================================================
   Desktop — 4 column footer
   ========================================================================== */

@media (min-width: 1025px) {
	.fdx-footer__main {
		grid-template-columns: 1.5fr 1fr 1fr 1fr;
	}

	.fdx-header__logo-text {
		font-size: 1.5rem;
	}

	.fdx-header__icons {
		gap: 1rem;
	}
}

/* Mobile — clean Shopee-style header: logo + cart only
   Search, Account, Wishlist available via bottom tab bar */
@media (max-width: 767px) {
	.fdx-header__inner {
		padding: 10px 12px;
	}

	/* Hide hamburger — bottom tab bar covers navigation */
	.fdx-hamburger {
		display: none;
	}

	/* Hide search toggle — available in tab bar */
	.fdx-header__search-toggle {
		display: none !important;
	}

	/* Hide account icon — available in tab bar */
	.fdx-header__icons > a[aria-label="My Account"] {
		display: none;
	}

	/* Hide wishlist — not in tab bar but accessible from account */
	.fdx-header__icon.fdx-header__icon--wishlist {
		display: none;
	}
}

/* Small screens (< 480px) — tighten further */
@media (max-width: 480px) {
	.fdx-header__inner {
		padding: 8px 10px;
	}

	.fdx-header__logo img {
		max-height: 36px;
	}
}
