/**
 * Mega Mag header — extracted from template-parts/header.php so it is cached
 * and parsed once instead of re-sent inline on every page.
 * Section 1: base header.  Section 2: mega menu.  Section 3: focus visibility.
 */

/* ============================================================
   1. BASE HEADER
   ============================================================ */
/* FRS CUSTOM HEADER STYLES */
.frs-custom-header { width: 100%; background: #fff; font-family: 'Open Sans', sans-serif; position: relative; }
.frs-container { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 100%; }

/* 1. TOP BAR (DESKTOP) */
.frs-top-bar { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; padding: 8px 0; font-size: 13px; }
.frs-top-menu { margin: 0; padding: 0; list-style: none; display: flex; }
.frs-top-menu li { margin-right: 25px; }
.frs-top-menu a { color: #64748b; text-decoration: none; }
.frs-top-right { margin-left: auto; display: flex; align-items: center; }
.frs-top-contacts a { margin-left: 20px; color: #64748b; text-decoration: none; }
.frs-top-contacts i { margin-right: 5px; color: #94a3b8; }

/* LANGUAGE SELECTOR FIX */
.frs-lang-selector { margin-left: 25px; position: relative; }
.frs-lang-selector .trp-language-switcher { 
    width: auto !important; height: 32px !important; background: #fff !important; 
    border: 1px solid #e2e8f0 !important; border-radius: 4px !important; 
    display: flex !important; align-items: center !important; padding: 0 !important; 
    overflow: visible !important;
}
.frs-lang-selector .trp-ls-shortcode-current-language { 
    padding: 0 10px !important; height: 100% !important; display: flex !important; 
    align-items: center !important; width: auto !important;
}
.frs-lang-selector .trp-ls-shortcode-current-language a {
    display: flex !important; align-items: center !important; gap: 8px !important;
    color: #333 !important; font-weight: 700 !important; text-decoration: none !important;
    padding: 0 !important;
}
/* Ensure flag is always visible and consistent */
.frs-lang-selector .trp-ls-shortcode-current-language a img,
.frs-lang-selector .trp-flag-image { 
    display: block !important; 
    opacity: 1 !important; 
    visibility: visible !important; 
    width: 22px !important;
    height: 15px !important;
}

.frs-lang-selector .trp-ls-shortcode-current-language a::after {
    content: "\f107"; 
    font-family: "FontAwesome"; 
    font-size: 13px; 
    color: #333; 
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

/* Hide extra arrows or indicators from TranslatePress */
.frs-lang-selector .trp-ls-shortcode-disabled-language::after,
.frs-lang-selector .trp-ls-shortcode-current-language .submenu-indicator { 
    display: none !important; 
}

.frs-lang-selector .trp-ls-shortcode-language {
    display: none !important; position: absolute !important; top: 100% !important; left: 0 !important; 
    background: #fff !important; box-shadow: 0 5px 20px rgba(0,0,0,0.1) !important; 
    z-index: 1000 !important; min-width: 50px !important; width: max-content !important;
    border: 1px solid #e2e8f0 !important; padding: 5px 0 !important; list-style: none !important; margin: 2px 0 0 0 !important;
}
.frs-lang-selector .trp-language-switcher:hover .trp-ls-shortcode-language { display: block !important; }
.frs-lang-selector .trp-ls-shortcode-language a { 
    display: flex !important; align-items: center !important; justify-content: center !important;
    padding: 8px 12px !important; color: #333 !important; text-decoration: none !important; 
}
.frs-lang-selector .trp-ls-shortcode-language a img { margin: 0 !important; }


.frs-top-user { margin-left: 25px; display: flex; align-items: center; color: #1e293b; font-weight: 600; }
.frs-top-user i { font-size: 18px; margin-right: 8px; color: #94a3b8; }
.frs-top-user a { color: inherit; text-decoration: none; }

/* 2. MAIN HEADER (DESKTOP) */
.frs-main-header { padding: 18px 0; }
.frs-logo img { max-height: 65px; width: auto; }
.frs-delivery { margin-left: 35px; font-size: 14px; line-height: 1.2; color: #334155; }
.frs-search { flex: 1; margin: 0 45px; position: relative; }
.frs-search form { display: flex; position: relative; }
.frs-search input { width: 100%; height: 48px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 30px; padding: 0 50px 0 22px; font-size: 15px; outline: none; transition: 0.3s; }
.frs-search input:focus { background: #fff; border-color: #cbd5e1; box-shadow: 0 3px 10px rgba(0,0,0,0.05); }
.frs-search button { position: absolute; right: 5px; top: 4px; width: 40px; height: 40px; border: none; background: none; font-size: 18px; color: #94a3b8; cursor: pointer; }

.frs-phone { display: flex; align-items: center; margin-right: 35px; }
.frs-phone-icon { width: 42px; height: 42px; border: 2px solid #ff4242; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #ff4242; font-size: 18px; margin-right: 12px; }
.frs-phone-text { display: flex; flex-direction: column; }
.p-small { font-size: 13px; color: #64748b; line-height: 1; }
.p-big { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1; }

.frs-actions { display: flex; align-items: center; }
.frs-action-btn { display: flex; align-items: center; margin-left: 30px; text-decoration: none; color: #1e293b; }
.frs-action-btn i { font-size: 30px; color: #ff4242; margin-right: 12px; }
.btn-info { display: flex; flex-direction: column; }
.b-top { font-size: 15px; font-weight: 700; line-height: 1.2; }
.b-bot { font-size: 12px; color: #94a3b8; }

/* 3. NAVIGATION (DESKTOP) */
.frs-nav-bar { background: #fff; border-top: 1px solid #f1f5f9; border-bottom: 3px solid #ff4242; }
.frs-catalog-wrap { position: relative; width: 260px; }
.frs-catalog-trigger { background: #5d727f; color: #fff; height: 50px; display: flex; align-items: center; padding: 0 22px; font-weight: 700; cursor: pointer; justify-content: space-between; font-size: 14px; }
.frs-catalog-trigger span { text-transform: uppercase; }






/* MOBILE STYLES (As in screenshot) */
@media (max-width: 1024px) {
    .frs-top-bar, .frs-main-header, .frs-nav-bar { display: none !important; }
    .frs-mobile-header { display: block !important; }
}
@media (min-width: 1025px) {
    .frs-mobile-header { display: none !important; }
}

.frs-mobile-header { background: #f8f9fa; border-bottom: 1px solid #eee; padding: 8px 0; position: sticky; top: 0; z-index: 1000; }
.m-header-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.m-trigger { background: none; border: none; font-size: 32px; color: #333; cursor: pointer; padding: 0; }
.m-logo img { max-height: 38px; width: auto; }

.m-actions { display: flex; align-items: center; gap: 12px; }
.m-icon, .m-search-toggle { background: none; border: none; font-size: 24px; color: #999; text-decoration: none; position: relative; display: flex; align-items: center; padding: 4px; }
.m-icon i.fa-shopping-cart, .m-icon i.fa-heart-o { color: #ff4242; font-size: 26px; }
.m-badge { position: absolute; top: -2px; right: -4px; background: #ff4242; color: #fff; font-size: 10px; font-weight: bold; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #f8f9fa; }

/* Mobile Search Dropdown */
.m-search-dropdown { display: none; padding: 10px 0; border-top: 1px solid #eee; background: #fff; position: absolute; top: 100%; left: 0; width: 100%; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.m-search-dropdown.open { display: block; }
.m-search-dropdown form { position: relative; width: 90%; margin: 0 auto; }
.m-search-dropdown input { width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 22px; padding: 0 45px 0 20px; font-size: 15px; outline: none; }
.m-search-dropdown button { position: absolute; right: 5px; top: 0; height: 44px; width: 40px; background: none; border: none; color: #999; font-size: 18px; }

/* MOBILE SIDE MENU */
.frs-mobile-drawer { position: fixed; top: 0; left: -320px; width: 300px; height: 100%; background: #fff; z-index: 2100; transition: 0.3s; overflow-y: auto; }
.frs-mobile-drawer.open { left: 0; }

.drawer-header { padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; background: #5d727f; color: #fff; }
.drawer-title { font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.drawer-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; padding: 0; }

.mobile-lang-box { padding: 15px 20px; border-bottom: 1px solid #f1f5f9; background: #fafafa; }
.mobile-lang-box .trp-language-switcher { width: fit-content !important; border: 1px solid #ddd !important; border-radius: 4px; background: #fff !important; }

.mobile-auth-drawer { padding: 15px 20px; border-bottom: 1px solid #f1f5f9; }
.mobile-auth-drawer a { display: flex; align-items: center; gap: 12px; color: #333; text-decoration: none; font-weight: 700; font-size: 14px; }
.mobile-auth-drawer i { font-size: 20px; color: #94a3b8; }

.group-title { padding: 12px 20px; font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; background: #f8fafc; border-bottom: 1px solid #f1f5f9; letter-spacing: 0.5px; }
.mobile-menu-list { list-style: none; padding: 0; margin: 0; }
.mobile-menu-list li { border-bottom: 1px solid #f1f5f9; position: relative; }
.mobile-menu-list li a { display: block; padding: 14px 50px 14px 20px; color: #333; text-decoration: none; font-weight: 600; font-size: 14px; }

/* Arrow Toggle Button */
.m-submenu-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-left: 1px solid #f1f5f9;
    color: #94a3b8;
    transition: 0.3s;
}
.m-submenu-toggle i { transition: transform 0.3s; }
.m-submenu-toggle.active i { transform: rotate(180deg); color: #ff4242; }

/* Submenu Styling - Hidden by default */
.mobile-menu-list ul.sub-menu { 
    list-style: none; 
    padding: 0; 
    background: #fafafa; 
    display: none; 
}
.mobile-menu-list li.open > ul.sub-menu { display: block; }

.mobile-menu-list ul.sub-menu li { border-bottom: 1px solid #f1f5f9; border-top: none; }
.mobile-menu-list ul.sub-menu li a { padding: 12px 20px 12px 40px; font-weight: 500; font-size: 13px; color: #64748b; position: relative; }
.mobile-menu-list ul.sub-menu li a::before { content: ""; position: absolute; left: 25px; top: 50%; width: 5px; height: 1px; background: #cbd5e1; }

.mobile-contact-section { padding: 25px 20px; display: flex; flex-direction: column; gap: 15px; background: #f8fafc; }
.mobile-contact-section a { color: #475569; text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 12px; font-weight: 500; }
.mobile-contact-section a i { color: #ff4242; font-size: 16px; }

.owl-carousel.owl-item {
    min-height: 100%!important;
}
    

/* ============================================================
   2. MEGA MENU
   ============================================================ */
/**
 * Mega menu — two-pane catalog panel (desktop) / accordion (mobile drawer).
 * Palette follows the existing header: #ff4242 accent, #5d727f trigger.
 */

/* ---------- Trigger ---------- */
.frs-catalog-trigger {
	width: 100%;
	border: 0;
	font-family: inherit;
	text-align: left;
}
.frs-catalog-trigger:focus-visible {
	outline: 3px solid #ff4242;
	outline-offset: -3px;
}

/* ---------- Panel shell ---------- */
.frs-mega-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	display: none;
	width: 1080px;
	max-width: calc(100vw - 40px);
	min-height: 340px;
	background: #fff;
	border: 1px solid #f1f5f9;
	box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

/* Mouse opens it with CSS alone. Keyboard cannot: a display:none subtree is
   not focusable, so :focus-within can never fire from inside the panel — the
   trigger button (which sits outside it) toggles .is-open instead. */
.frs-catalog-wrap:hover .frs-mega-panel,
.frs-catalog-wrap.is-open .frs-mega-panel {
	display: block;
}

/* ---------- Left rail ---------- */
.frs-mega {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	width: 260px;
}
.frs-mega > li {
	position: static; /* panes position against .frs-mega-panel */
}
.frs-mega > li > a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 18px;
	font-size: 14px;
	font-weight: 600;
	color: #334155;
	text-decoration: none;
	border-left: 3px solid transparent;
}
.frs-mega > li > a:hover,
.frs-mega > li > a:focus-visible,
.frs-mega > li:hover > a,
.frs-mega > li:focus-within > a {
	background: #f8fafc;
	color: #ff4242;
	border-left-color: #ff4242;
}
.frs-mega__icon {
	flex: 0 0 22px;
	width: 22px;
	font-size: 17px;
	color: #94a3b8;
	text-align: center;
}
.frs-mega__icon--img {
	height: 22px;
	object-fit: contain;
}
.frs-mega > li:hover > a .frs-mega__icon,
.frs-mega > li:focus-within > a .frs-mega__icon {
	color: #ff4242;
}
.frs-mega__label {
	flex: 1;
}
.frs-mega__chevron {
	color: #cbd5e1;
	font-size: 15px;
}

/* ---------- Right pane ---------- */
.frs-mega__pane {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 260px;
	display: none;
	padding: 22px 28px 26px;
	overflow-y: auto;
	border-left: 1px solid #f1f5f9;
	background: #fff;
}
.frs-mega > li:hover > .frs-mega__pane,
.frs-mega > li:focus-within > .frs-mega__pane {
	display: block;
}

.frs-mega__all {
	display: inline-block;
	margin-bottom: 16px;
	font-size: 13px;
	font-weight: 700;
	color: #ff4242;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .3px;
}
.frs-mega__all:hover,
.frs-mega__all:focus-visible {
	text-decoration: underline;
}
.frs-mega__count {
	color: #94a3b8;
	font-weight: 600;
}

.frs-mega__sub {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 2px 28px;
}
.frs-mega__sub a {
	display: block;
	padding: 7px 0;
	font-size: 14px;
	color: #475569;
	text-decoration: none;
}
.frs-mega__sub a:hover,
.frs-mega__sub a:focus-visible {
	color: #ff4242;
}

/* ---------- Drawer must be inert when it is not on screen ----------
   The theme only slides the drawer to left:-320px, so its copy of the menu
   stayed focusable and tab-trappable — on desktop too, where it can never be
   opened. Hide it outright above the breakpoint, and make the closed state
   invisible below it. */
.frs-mobile-drawer:not(.open) {
	visibility: hidden;
}
.frs-mobile-drawer.open {
	visibility: visible;
}
@media (min-width: 1025px) {
	.frs-mobile-drawer,
	.frs-mobile-overlay {
		display: none !important;
	}
}

/* ---------- Mobile: same markup, accordion inside the drawer ---------- */
@media (max-width: 1024px) {
	#frs-mobile-drawer .frs-mega {
		width: auto;
		padding: 0;
	}
	#frs-mobile-drawer .frs-mega > li {
		position: relative;
		border-bottom: 1px solid #f1f5f9;
	}
	#frs-mobile-drawer .frs-mega > li > a {
		padding: 14px 46px 14px 20px;
		border-left: 0;
	}
	#frs-mobile-drawer .frs-mega__chevron {
		display: none; /* the injected .m-submenu-toggle owns this affordance */
	}

	#frs-mobile-drawer .frs-mega__pane {
		position: static;
		display: none;
		padding: 4px 20px 14px;
		border-left: 0;
		background: #fafafa;
		overflow: visible;
	}
	/* Hover must not open panes on touch. */
	#frs-mobile-drawer .frs-mega > li:hover > .frs-mega__pane,
	#frs-mobile-drawer .frs-mega > li:focus-within > .frs-mega__pane {
		display: none;
	}
	#frs-mobile-drawer .frs-mega > li.open > .frs-mega__pane {
		display: block;
	}

	#frs-mobile-drawer .frs-mega__sub {
		grid-template-columns: 1fr;
		gap: 0;
	}
	#frs-mobile-drawer .frs-mega__sub a {
		padding: 11px 0 11px 34px;
		font-size: 13px;
		color: #64748b;
		position: relative;
	}
	#frs-mobile-drawer .frs-mega__sub a::before {
		content: "";
		position: absolute;
		left: 18px;
		top: 50%;
		width: 5px;
		height: 1px;
		background: #cbd5e1;
	}
	#frs-mobile-drawer .frs-mega__all {
		margin: 8px 0 6px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.frs-mega-panel,
	.frs-mega__pane {
		transition: none !important;
	}
}


/* ============================================================
   3. FOCUS VISIBILITY
   Keyboard users need to see where they are. Mouse users never
   see these, so nothing changes visually for them.
   ============================================================ */
.frs-custom-header a:focus-visible,
.frs-custom-header button:focus-visible,
.frs-custom-header input:focus-visible {
	outline: 3px solid #ff4242;
	outline-offset: 2px;
	border-radius: 2px;
}
.frs-mega > li > a:focus-visible,
.frs-mega__sub a:focus-visible,
.frs-mega__all:focus-visible {
	outline-offset: -2px;
}
.frs-custom-header .frs-search input:focus-visible {
	outline-offset: 0;
}

/* Skip-to-content, shown only when focused. */
.frs-skip-link {
	position: absolute;
	left: -9999px;
	z-index: 3000;
	padding: 12px 20px;
	background: #ff4242;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}
.frs-skip-link:focus {
	left: 8px;
	top: 8px;
}

/* ============================================================
   4. LIVE SEARCH RESULTS
   Injected by header.js; no markup exists without JS.
   ============================================================ */
.frs-custom-header form[role="search"] {
	position: relative;
}
.frs-sr {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 1200;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}
.frs-sr[hidden] {
	display: none;
}
.frs-sr__head {
	padding: 10px 16px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: #94a3b8;
}
.frs-sr__item,
.frs-sr__cat,
.frs-sr__all {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 16px;
	color: #334155;
	text-decoration: none;
	font-size: 14px;
}
.frs-sr__item:hover, .frs-sr__item.is-active,
.frs-sr__cat:hover,  .frs-sr__cat.is-active,
.frs-sr__all:hover,  .frs-sr__all.is-active {
	background: #f8fafc;
	color: #ff4242;
}
.frs-sr__thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	object-fit: contain;
	background: #f8fafc;
	border-radius: 6px;
}
.frs-sr__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.frs-sr__title {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.frs-sr__title mark {
	background: #fff1f1;
	color: inherit;
	font-weight: 700;
	padding: 0;
}
.frs-sr__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}
.frs-sr__price {
	font-weight: 700;
	color: #ff4242;
}
.frs-sr__was {
	color: #94a3b8;
}
.frs-sr__oos {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #94a3b8;
}
.frs-sr__cat {
	justify-content: space-between;
	border-top: 1px solid #f8fafc;
}
.frs-sr__count {
	color: #94a3b8;
	font-size: 13px;
}
.frs-sr__all {
	justify-content: center;
	border-top: 1px solid #e2e8f0;
	font-weight: 700;
	color: #ff4242;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: .3px;
}
.frs-sr__empty {
	padding: 18px 16px;
	color: #94a3b8;
	font-size: 14px;
	text-align: center;
}
/* Announcer for screen readers only. */
.frs-sr__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Inline category icons (assets/icons/*.svg) — inherit colour from the link. */
.frs-mega__icon--svg {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	color: #94a3b8;
}
.frs-mega__icon--svg svg {
	width: 22px;
	height: 22px;
	display: block;
}
.frs-mega > li:hover > a .frs-mega__icon--svg,
.frs-mega > li:focus-within > a .frs-mega__icon--svg,
.frs-mega > li > a:hover .frs-mega__icon--svg {
	color: #ff4242;
}

/* ============================================================
   5. LAYOUT SHIFT — un-initialised carousels
   Field CLS is 0.16 while lab CLS is 0, i.e. a shift real users
   hit that Lighthouse does not. Observed cause: before owl-carousel
   initialises, every slide renders stacked — page height measured
   21,230px, collapsing to 4,674px once .owl-loaded is applied.
   Everything below the carousel jumps up by that difference.

   Clamping the un-initialised state removes the collapse. The
   carousel sets its own height once loaded, so this only ever
   applies during the gap before its JS runs.
   ============================================================ */
.products.woocommerce-carousel:not(.owl-loaded) {
	max-height: 430px;
	overflow: hidden;
}
/* Only the first row can be visible before init anyway. */
.products.woocommerce-carousel:not(.owl-loaded) > li:nth-child(n + 5) {
	display: none;
}
@media (max-width: 1024px) {
	.products.woocommerce-carousel:not(.owl-loaded) > li:nth-child(n + 4) { display: none; }
}
@media (max-width: 640px) {
	.products.woocommerce-carousel:not(.owl-loaded) { max-height: 360px; }
	.products.woocommerce-carousel:not(.owl-loaded) > li:nth-child(n + 3) { display: none; }
}
