/* =========================================================================
   Joom - Premium header style
   Loaded only when Customizer > Header Settings > Header Style = Premium
   (body.joom-header-premium). Everything follows the Customizer colours:
   --header-text-color, --header-hover-text-color, --primary-color,
   --border-color, --mm-* (Mega Menu section).
   ========================================================================= */

body.joom-header-premium {
	--jp-ink: var(--header-text-color, #0f172a);
	--jp-hover: var(--header-hover-text-color, var(--primary-color, #FA3434));
	--jp-line: var(--border-color, #e7e5e4);
	--jp-muted: var(--light-text-color, #78716c);
	--jp-soft: color-mix(in srgb, var(--jp-ink) 5%, #ffffff);
	--jp-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
	--jp-nav-h: 54px;
}

/* --- Top bar: slimmer, quieter ------------------------------------------- */
body.joom-header-premium .header-top-wrapper {
	min-height: 38px;
}

body.joom-header-premium .header-top .top-link,
body.joom-header-premium .header-top .top-center {
	font-size: 12px;
	letter-spacing: 0.04em;
}

/* --- Header row ------------------------------------------------------------ */
body.joom-header-premium .site-header {
	border-bottom: 1px solid var(--jp-line);
	box-shadow: none;
}

body.joom-header-premium .header-wrapper {
	padding-top: 14px;
	padding-bottom: 14px;
}

/* Search: one soft pill, the submit becomes a round icon button inside it. */
body.joom-header-premium .site-header .search-bar-wrapper {
	position: relative;
	max-width: 520px;
}

body.joom-header-premium .site-header .search-bar-wrapper input[type="text"],
body.joom-header-premium .site-header .search-bar-wrapper input[type="search"] {
	height: 46px;
	padding: 0 56px 0 22px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--jp-soft);
	box-shadow: none;
	color: var(--jp-ink);
	font-size: 14px;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

body.joom-header-premium .site-header .search-bar-wrapper input[type="text"]:focus,
body.joom-header-premium .site-header .search-bar-wrapper input[type="search"]:focus {
	border-color: color-mix(in srgb, var(--jp-ink) 30%, transparent);
	background: #ffffff;
}

body.joom-header-premium .site-header .search-bar-wrapper .search-button,
body.joom-header-premium .site-header .search-bar-wrapper button[type="submit"] {
	position: absolute;
	top: 5px;
	right: 5px;
	flex: none;
	width: 36px;
	min-width: 0;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--primary-color, #0f172a);
	box-shadow: none;
	color: transparent;
	font-size: 0;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

body.joom-header-premium .site-header .search-bar-wrapper .search-button::before {
	content: "";
	width: 16px;
	height: 16px;
	background: var(--btn-text-color, #ffffff);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.joom-header-premium .site-header .search-bar-wrapper .search-button:hover {
	background: var(--jp-hover);
	transform: scale(1.05);
}

/* Account / wishlist / cart: line icons with a small label, no grey discs. */
body.joom-header-premium .header-icons-wrapper {
	gap: 26px;
}

body.joom-header-premium .header-icon {
	gap: 9px;
	padding: 4px 0;
	border-radius: 0;
	background: transparent;
}

body.joom-header-premium .header-icon:hover {
	background: transparent;
}

body.joom-header-premium .header-icon .icon-wrapper {
	width: 26px;
	height: 26px;
	border: 0;
	background: transparent;
	box-shadow: none;
}

body.joom-header-premium .header-icon:hover .icon-wrapper {
	background: transparent;
}

body.joom-header-premium .header-icon svg {
	width: 22px;
	height: 22px;
	stroke: var(--jp-ink);
	stroke-width: 1.5;
}

body.joom-header-premium .header-icon:hover svg {
	stroke: var(--jp-hover);
}

body.joom-header-premium .header-icon .icon-label {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--jp-ink);
}

body.joom-header-premium .header-icon:hover .icon-label {
	color: var(--jp-hover);
}

body.joom-header-premium .site-header .woosw-count.mobile-badge,
body.joom-header-premium .site-header .cart-count.mobile-badge,
body.joom-header-premium .header-icon .icon-badge {
	top: -6px;
	right: -9px;
	min-width: 17px;
	height: 17px;
	border: 2px solid var(--site-header-bg-color, #ffffff);
	background: var(--primary-color, #0f172a);
	box-shadow: none;
	font-size: 9.5px;
	line-height: 13px;
}

/* =========================================================================
   Desktop navigation + mega menu
   ========================================================================= */
@media (min-width: 1025px) {
	body.joom-header-premium .navigation-main-wrapper {
		position: relative;
		z-index: 999;
		border-bottom: 1px solid var(--jp-line);
		box-shadow: none;
	}

	body.joom-header-premium .nav-content {
		gap: 0;
		min-height: var(--jp-nav-h);
		padding-top: 0;
		padding-bottom: 0;
	}

	/* "All categories": quiet text button with a divider, not a dark pill. */
	body.joom-header-premium .all-categories-btn {
		height: var(--jp-nav-h);
		margin-right: 12px;
		padding: 0 24px 0 0;
		border: 0;
		border-right: 1px solid var(--jp-line);
		border-radius: 0;
		background: transparent !important;
		box-shadow: none;
		color: var(--jp-ink) !important;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.14em;
		text-transform: uppercase;
	}

	body.joom-header-premium .all-categories-btn:hover,
	body.joom-header-premium .all-categories-btn[aria-expanded="true"] {
		background: transparent !important;
		box-shadow: none;
		color: var(--jp-hover) !important;
		transform: none;
	}

	/* Top-level links: small caps, fine underline that draws in from the left. */
	body.joom-header-premium .joom-primary-menu-list > li > .menu-link {
		height: var(--jp-nav-h);
		padding: 0 16px;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: var(--jp-ink);
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.14em;
		text-transform: uppercase;
		transform: none;
		opacity: 1;
	}

	body.joom-header-premium .joom-primary-menu-list > li > .menu-link::before {
		display: none;
	}

	body.joom-header-premium .joom-primary-menu-list > li > .menu-link::after {
		content: "";
		position: absolute;
		right: 16px;
		bottom: 14px;
		left: 16px;
		width: auto;
		height: 1px;
		border-radius: 0;
		background: currentColor;
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	body.joom-header-premium .joom-primary-menu-list > li:hover > .menu-link,
	body.joom-header-premium .joom-primary-menu-list > li:focus-within > .menu-link,
	body.joom-header-premium .joom-primary-menu-list > li > .menu-link.current-cat {
		background: transparent;
		color: var(--jp-hover);
	}

	body.joom-header-premium .joom-primary-menu-list > li:hover > .menu-link::after,
	body.joom-header-premium .joom-primary-menu-list > li:focus-within > .menu-link::after,
	body.joom-header-premium .joom-primary-menu-list > li > .menu-link.current-cat::after {
		transform: scaleX(1);
	}

	body.joom-header-premium .joom-primary-menu-list > li > .menu-link .fa-chevron-down {
		margin-left: 2px !important;
		font-size: 8px !important;
		opacity: 0.55;
		transition: transform 0.3s ease;
	}

	body.joom-header-premium .joom-primary-menu-list > li:hover > .menu-link .fa-chevron-down {
		transform: rotate(180deg);
	}

	/* "Highlight" items (e.g. Sale) keep the accent but the same weight. */
	body.joom-header-premium .joom-primary-menu-list > li > .menu-link.highlight,
	body.joom-header-premium .joom-primary-menu-list > li.outlet-link > .menu-link {
		color: var(--sale-price-color, var(--jp-hover));
	}

	/* Badge (NEW, SALE...): a small square tag beside the label, no speech tail. */
	body.joom-header-premium .joom-primary-menu-list > li > .menu-link strong {
		position: static;
		margin: 0 0 0 6px;
		padding: 3px 6px 2px;
		border-radius: 2px;
		box-shadow: none;
		font-size: 8.5px;
		letter-spacing: 0.1em;
		line-height: 1.2;
		transform: none;
	}

	body.joom-header-premium .joom-primary-menu-list > li > .menu-link strong::after {
		display: none;
	}

	/* --- Mega panel: full-bleed sheet under the nav bar ------------------- */
	body.joom-header-premium .joom-primary-menu-list > li.has-mega-menu {
		position: static;
	}

	body.joom-header-premium .mega-menu-panel,
	body.joom-header-premium .mega-menu-panel[data-mm-width-mode] {
		top: 100%;
		right: auto;
		left: calc(50% - 50vw); /* JS replaces this with the exact offset */
		width: 100vw;
		max-width: none;
		max-height: calc(100vh - 160px);
		margin-top: 0;
		padding: 44px 0 52px;
		border: 0;
		border-top: 1px solid var(--jp-line);
		border-radius: 0;
		background: var(--mm-bg-color, #ffffff);
		box-shadow: 0 40px 60px -32px rgba(12, 10, 9, 0.28);
		transform: translateY(-6px);
		transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.28s ease;
	}

	/* Invisible bridge over the nav bar's padding so the panel stays open while
	   the pointer travels from the link down into it. */
	body.joom-header-premium .mega-menu-panel::before {
		content: "";
		position: absolute;
		right: 0;
		bottom: 100%;
		left: 0;
		height: 18px;
	}

	body.joom-header-premium .joom-primary-menu-list > li.has-mega-menu:hover > .mega-menu-panel,
	body.joom-header-premium .joom-primary-menu-list > li.has-mega-menu:focus-within > .mega-menu-panel {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
		transition-delay: 0.08s;
	}

	body.joom-header-premium .mega-menu-columns {
		flex-wrap: nowrap;
		gap: clamp(32px, 4vw, 72px);
		max-width: 1300px;
		margin: 0 auto;
		padding: 0 1.5rem;
	}

	body.joom-header-premium .mega-menu-column {
		min-width: 150px;
	}

	/* Photo / product cards sit together on the right-hand side. */
	body.joom-header-premium .mega-menu-column:not(.mega-menu-column-feature) + .mega-menu-column-feature {
		margin-left: auto;
	}

	body.joom-header-premium .mega-menu-column.divider {
		padding-left: clamp(32px, 4vw, 72px);
	}

	body.joom-header-premium .mega-menu-column-title {
		margin-bottom: 22px;
		color: var(--jp-muted);
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.2em;
	}

	body.joom-header-premium a.mega-menu-column-title:hover {
		color: var(--jp-ink);
	}

	body.joom-header-premium .mega-menu-links {
		gap: 13px;
	}

	body.joom-header-premium .mega-menu-links a,
	body.joom-header-premium .mega-menu-links span {
		padding-bottom: 2px;
		background-image: linear-gradient(currentColor, currentColor);
		background-position: 0 100%;
		background-repeat: no-repeat;
		background-size: 0 1px;
		color: var(--jp-ink);
		font-size: 15px;
		font-weight: 400;
		transition: background-size 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s ease;
	}

	body.joom-header-premium .mega-menu-links a:hover,
	body.joom-header-premium .mega-menu-links a:focus-visible {
		background-size: 100% 1px;
		color: var(--jp-ink);
	}

	body.joom-header-premium .mega-menu-links a.highlight {
		color: var(--sale-price-color, var(--jp-hover));
		font-weight: 500;
	}

	/* Image card: a tall photo with the caption set on the picture. */
	body.joom-header-premium .mega-menu-column-feature {
		flex: 0 0 auto;
		width: 250px;
		min-width: 0;
		max-width: none;
	}

	body.joom-header-premium .mega-menu-feature-image {
		position: relative;
		display: block;
		overflow: hidden;
		aspect-ratio: 4 / 5;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: var(--jp-soft);
	}

	body.joom-header-premium .mega-menu-feature-image a {
		position: absolute;
		inset: 0;
		display: block;
		color: #ffffff;
	}

	body.joom-header-premium .mega-menu-feature-image img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		border-radius: 0;
		object-fit: cover;
		transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	body.joom-header-premium .mega-menu-feature-image a::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(0deg, rgba(12, 10, 9, 0.62) 0%, transparent 55%);
	}

	body.joom-header-premium .mega-menu-feature-image:hover img {
		transform: scale(1.05);
	}

	body.joom-header-premium .mega-menu-feature-caption {
		position: absolute;
		right: 20px;
		bottom: 18px;
		left: 20px;
		z-index: 1;
		color: #ffffff;
		font-family: var(--jp-serif);
		font-size: 24px;
		font-weight: 500;
		line-height: 1.1;
	}

	body.joom-header-premium .mega-menu-feature-image a:hover .mega-menu-feature-caption {
		color: #ffffff;
	}

	/* Product card: portrait image, name and price, no box around it. */
	body.joom-header-premium .mega-menu-feature-product {
		overflow: visible;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		color: var(--jp-ink);
	}

	body.joom-header-premium .mega-menu-feature-product:hover {
		box-shadow: none;
	}

	body.joom-header-premium .mega-menu-product-image {
		overflow: hidden;
		aspect-ratio: 4 / 5;
		background: var(--jp-soft);
	}

	body.joom-header-premium .mega-menu-product-image img {
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
		object-fit: cover;
		transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	body.joom-header-premium .mega-menu-feature-product:hover .mega-menu-product-image img {
		transform: scale(1.05);
	}

	body.joom-header-premium .mega-menu-product-badge {
		top: 12px;
		left: 12px;
		padding: 4px 7px 3px;
		border-radius: 2px;
		background: var(--jp-ink);
		font-size: 9px;
		letter-spacing: 0.12em;
	}

	body.joom-header-premium .mega-menu-product-title {
		padding: 14px 0 4px;
		font-size: 14px;
		font-weight: 500;
	}

	body.joom-header-premium .mega-menu-product-price {
		padding: 0;
		color: var(--jp-ink);
		font-size: 13px;
		font-weight: 600;
	}

	body.joom-header-premium .mega-menu-product-price ins {
		color: var(--sale-price-color, var(--jp-ink));
	}

	/* Page behind an open mega menu is dimmed (class set by main.js). */
	body.joom-header-premium::after {
		content: "";
		position: fixed;
		inset: 0;
		z-index: 998;
		background: rgba(12, 10, 9, 0.32);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	body.joom-header-premium.joom-mm-open::after {
		opacity: 1;
		visibility: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.joom-header-premium .mega-menu-panel,
	body.joom-header-premium .mega-menu-feature-image img,
	body.joom-header-premium .mega-menu-product-image img {
		transition: none;
	}
}

/* --- Search wrapper: no outer ring around the pill ------------------------ */
body.joom-header-premium .site-header .search-bar-wrapper {
	height: auto;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
}

/* --- Text logo (used when no logo image is uploaded): a clean wordmark ---- */
body.joom-header-premium .site-logo .logo-text {
	gap: 0;
	color: var(--jp-ink);
	font-size: 25px;
	font-weight: 700;
	letter-spacing: 0.26em;
	line-height: 1;
}

body.joom-header-premium .site-logo .logo-first-letter,
body.joom-header-premium .site-logo .logo-remaining {
	width: auto;
	height: auto;
	padding: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	transform: none;
}

body.joom-header-premium .site-logo:hover .logo-text,
body.joom-header-premium .site-logo:hover .logo-first-letter {
	color: var(--jp-ink);
	box-shadow: none;
	transform: none;
}

/* =========================================================================
   Simple dropdowns + "All categories" flyout (desktop)
   ========================================================================= */
@media (min-width: 1025px) {
	body.joom-header-premium .joom-primary-menu-list .sub-menu {
		min-width: 230px;
		margin: 0;
		padding: 14px 0;
		border: 0;
		border-top: 1px solid var(--jp-line);
		border-radius: 0;
		background: var(--mm-bg-color, #ffffff);
		box-shadow: 0 28px 44px -18px rgba(12, 10, 9, 0.24);
		transform: translateY(-6px);
	}

	body.joom-header-premium .joom-primary-menu-list li:hover > .sub-menu,
	body.joom-header-premium .joom-primary-menu-list li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}

	body.joom-header-premium .joom-primary-menu-list .sub-menu .sub-menu {
		top: -14px;
		margin-left: 0;
	}

	body.joom-header-premium .joom-primary-menu-list .sub-menu .menu-link {
		padding: 10px 26px;
		color: var(--jp-ink);
		font-size: 14.5px;
		font-weight: 400;
		letter-spacing: 0;
		text-transform: none;
	}

	body.joom-header-premium .joom-primary-menu-list .sub-menu .menu-link::before {
		display: none;
	}

	body.joom-header-premium .joom-primary-menu-list .sub-menu .menu-link:hover {
		padding-left: 26px;
		background: var(--jp-soft);
		color: var(--jp-ink);
	}

	/* "All categories" flyout: same flat sheet as the mega menu. */
	body.joom-header-premium .categories-dropdown {
		top: 100%;
		border: 0;
		border-top: 1px solid var(--jp-line);
		border-radius: 0;
		box-shadow: 0 40px 60px -32px rgba(12, 10, 9, 0.28);
		transform: translateY(-6px);
	}

	body.joom-header-premium .joom-mega-menu-sidebar li {
		border-radius: 0;
	}

	body.joom-header-premium .joom-mega-menu-sidebar li.active {
		box-shadow: none;
		background: var(--jp-soft);
	}

	body.joom-header-premium .j-cat-icon,
	body.joom-header-premium .j-cat-icon img {
		border-radius: 50%;
	}

	body.joom-header-premium .j-subcat-card {
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
	}

	body.joom-header-premium .j-subcat-card:hover {
		background: var(--jp-soft);
		box-shadow: none;
		transform: none;
	}

	body.joom-header-premium .j-subcat-img {
		width: 64px;
		height: 80px;
		border: 0;
		border-radius: 0;
		background: var(--jp-soft);
	}

	body.joom-header-premium .j-subcat-img img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	body.joom-header-premium .j-subcat-name {
		font-size: 15px;
		font-weight: 500;
	}
}

/* --- Mobile: plain menu button ---------------------------------------- */
body.joom-header-premium .menu-toggle {
	border: 0;
	background: transparent;
	box-shadow: none;
}

@media (min-width: 1025px) {
	body.joom-header-premium .joom-mega-menu-sidebar {
		background: var(--jp-soft);
	}

	body.joom-header-premium .joom-mega-menu-sidebar li.active {
		background: var(--mm-bg-color, #ffffff);
	}

	/* The "All categories" flyout dims the page too. */
	body.joom-header-premium:has(.nav-content.is-categories-open)::after {
		opacity: 1;
		visibility: visible;
	}
}

@media (min-width: 1025px) {
	/* Elementor template panels bring their own spacing. */
	body.joom-header-premium .mega-menu-panel--template {
		padding: 0;
	}
}

/* --- Phones: a quiet search field instead of the grey pill ---------------- */
@media (max-width: 1024px) {
	body.joom-header-premium .site-header .search-bar-wrapper input[type="text"],
	body.joom-header-premium .site-header .search-bar-wrapper input[type="search"] {
		height: 40px;
		padding: 0 44px 0 14px;
		border: 1px solid var(--jp-line);
		border-radius: 0;
		background: #ffffff;
		font-size: 13.5px;
	}

	body.joom-header-premium .site-header .search-bar-wrapper .search-button,
	body.joom-header-premium .site-header .search-bar-wrapper button[type="submit"] {
		top: 2px;
		right: 2px;
		width: 36px;
		height: 36px;
		border-radius: 0;
		background: transparent;
	}

	body.joom-header-premium .site-header .search-bar-wrapper .search-button::before {
		background: var(--jp-ink);
	}

	body.joom-header-premium .site-header .search-bar-wrapper .search-button:hover {
		background: transparent;
		transform: none;
	}
}
