/* =========================================================
   Dorrin Golab — Header V1.1
   Polished desktop + mobile states
   ========================================================= */

/* =========================================================
   FONTS
   Expected files:
   /wp-content/plugins/dorrin-core/assets/fonts/
   ========================================================= */

@font-face {
	font-family: "Dorrin Pinar";
	src: url("../fonts/Pinar-DS1-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Dorrin Pinar";
	src: url("../fonts/Pinar-DS1-Medium.ttf") format("truetype");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Dorrin Pinar";
	src: url("../fonts/Pinar-DS1-SemiBold.ttf") format("truetype");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Dorrin Pinar";
	src: url("../fonts/Pinar-DS1-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}


/* =========================================================
   TOKENS
   ========================================================= */

:root {
	--dorrin-ivory: #fbf9f5;
	--dorrin-bone: #eee2d1;
	--dorrin-teal: #00625c;
	--dorrin-deep-teal: #00373a;
	--dorrin-pink: #ec608a;
	--dorrin-light-pink: #f5b3c4;

	--dorrin-header-height: 96px;
}


/* =========================================================
   RESET / BASE
   ========================================================= */

.dorrin-site-header,
.dorrin-site-header *,
.dorrin-search-overlay,
.dorrin-search-overlay *,
.dorrin-mobile-navigation,
.dorrin-mobile-navigation * {
	box-sizing: border-box;
	font-family: "Dorrin Pinar", sans-serif !important;
}

.dorrin-site-header a,
.dorrin-search-overlay a,
.dorrin-mobile-navigation a {
	text-decoration: none;
}

.dorrin-site-header button,
.dorrin-search-overlay button,
.dorrin-mobile-navigation button,
.dorrin-search-overlay input {
	font-family: "Dorrin Pinar", sans-serif !important;
}

body.dorrin-ui-lock {
	overflow: hidden;
}


/* =========================================================
   HEADER SHELL
   ========================================================= */

.dorrin-site-header {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;

	width: 100%;
	height: var(--dorrin-header-height);

	z-index: 9999;

	color: var(--dorrin-deep-teal);
	background: transparent;

	transition:
		height 360ms cubic-bezier(.2,.8,.2,1),
		transform 360ms cubic-bezier(.2,.8,.2,1),
		background-color 320ms ease,
		box-shadow 320ms ease,
		backdrop-filter 320ms ease;
}

/* WordPress admin bar */
body.admin-bar .dorrin-site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .dorrin-site-header {
		top: 46px;
	}
}

/* scroll states */
.dorrin-site-header.is-scrolled {
	--dorrin-header-height: 72px;

	background: rgba(251, 249, 245, .86);

	backdrop-filter: blur(18px) saturate(130%);
	-webkit-backdrop-filter: blur(18px) saturate(130%);

	box-shadow: 0 1px 0 rgba(0, 55, 58, .09);
}

.dorrin-site-header.is-hidden {
	transform: translateY(-110%);
}


/* =========================================================
   INNER
   ========================================================= */

.dorrin-header-inner {
	position: relative;

	width: 100%;
	max-width: 1600px;
	height: 100%;

	margin-inline: auto;
	padding-inline: 40px;

	display: flex;
	align-items: center;
}


/* =========================================================
   LOGO — exact viewport center
   ========================================================= */

.dorrin-header-brand {
	position: absolute;

	left: 50%;
	top: 50%;

	transform: translate(-50%, -50%);

	display: flex;
	align-items: center;
	justify-content: center;

	z-index: 10;

	transition:
		transform 240ms ease,
		opacity 240ms ease;
}

.dorrin-header-brand:hover {
	transform: translate(-50%, -50%) scale(1.035);
}

.dorrin-header-logo {
	display: block;

	width: 150px;
	height: auto;
	max-height: 68px;

	object-fit: contain;

	transition:
		width 330ms cubic-bezier(.2,.8,.2,1);
}

.dorrin-site-header.is-scrolled .dorrin-header-logo {
	width: 126px;
}

.dorrin-header-logo-fallback {
	font-weight: 700;
	font-size: 18px;
	color: var(--dorrin-deep-teal);
}


/* =========================================================
   MAIN NAVIGATION
   ========================================================= */

.dorrin-header-nav {
	display: flex;
	align-items: center;
	gap: 32px;
	min-width: 0;
}

.dorrin-nav-link {
	position: relative;

	height: 44px;

	display: inline-flex;
	align-items: center;
	gap: 7px;

	padding: 0;

	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;

	color: var(--dorrin-deep-teal);

	white-space: nowrap;

	transition: color 210ms ease;
}

.dorrin-nav-link::after {
	content: "";

	position: absolute;
	right: 0;
	bottom: 2px;

	width: 0;
	height: 2px;

	border-radius: 10px;
	background: var(--dorrin-pink);

	transition:
		width 240ms cubic-bezier(.2,.8,.2,1);
}

.dorrin-nav-link:hover,
.dorrin-nav-link:focus-visible {
	color: var(--dorrin-pink);
}

.dorrin-nav-link:hover::after,
.dorrin-nav-link:focus-visible::after {
	width: 100%;
}

.dorrin-nav-link svg {
	width: 13px;
	height: 13px;

	fill: none;
	stroke: currentColor;
	stroke-width: 2;

	transition: transform 210ms ease;
}

.dorrin-products-menu:hover .dorrin-products-trigger svg,
.dorrin-products-menu:focus-within .dorrin-products-trigger svg {
	transform: rotate(180deg);
}


/* =========================================================
   ACTIONS
   ========================================================= */

.dorrin-header-actions {
	margin-right: auto;

	display: flex;
	align-items: center;
	gap: 8px;
}


/* =========================================================
   ICON BUTTON
   ========================================================= */

.dorrin-header-icon {
	width: 44px;
	height: 44px;

	padding: 0;

	border: 1px solid rgba(236, 96, 138, .65);
	border-radius: 10px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	background: rgba(251, 249, 245, .3);
	color: var(--dorrin-pink);

	cursor: pointer;

	transition:
		background-color 210ms ease,
		color 210ms ease,
		border-color 210ms ease,
		transform 210ms ease;
}

.dorrin-header-icon svg {
	width: 18px;
	height: 18px;

	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;

	stroke-linecap: round;
	stroke-linejoin: round;
}

.dorrin-header-icon:hover,
.dorrin-header-icon:focus-visible {
	background: var(--dorrin-pink);
	color: #fff;
	border-color: var(--dorrin-pink);

	transform: translateY(-1px);
}


/* =========================================================
   LANGUAGE
   ========================================================= */

.dorrin-language {
	position: relative;
}

.dorrin-language-trigger {
	height: 44px;

	padding: 0 13px;

	border: 1px solid rgba(236, 96, 138, .65);
	border-radius: 10px;

	display: inline-flex;
	align-items: center;
	gap: 7px;

	background: rgba(251, 249, 245, .3);
	color: var(--dorrin-pink);

	font-size: 13px;
	font-weight: 600;

	cursor: pointer;

	transition:
		background-color 210ms ease,
		color 210ms ease,
		border-color 210ms ease,
		transform 210ms ease;
}

.dorrin-language-trigger svg {
	width: 12px;
	height: 12px;

	fill: none;
	stroke: currentColor;
	stroke-width: 2;

	transition: transform 200ms ease;
}

.dorrin-language:hover .dorrin-language-trigger,
.dorrin-language:focus-within .dorrin-language-trigger,
.dorrin-language.is-open .dorrin-language-trigger {
	background: rgba(236, 96, 138, .08);
	color: var(--dorrin-pink);
	border-color: var(--dorrin-pink);
}

.dorrin-language:hover .dorrin-language-trigger svg,
.dorrin-language:focus-within .dorrin-language-trigger svg,
.dorrin-language.is-open .dorrin-language-trigger svg {
	transform: rotate(180deg);
}

.dorrin-language-menu {
	position: absolute;

	top: calc(100% + 8px);
	left: 0;

	min-width: 142px;

	padding: 8px;

	border: 1px solid rgba(0, 55, 58, .09);
	border-radius: 16px;

	background: rgba(251, 249, 245, .98);

	box-shadow: 0 14px 36px rgba(0, 55, 58, .12);

	opacity: 0;
	visibility: hidden;

	transform: translateY(8px);

	transition:
		opacity 190ms ease,
		transform 190ms ease,
		visibility 190ms ease;
}

.dorrin-language:hover .dorrin-language-menu,
.dorrin-language:focus-within .dorrin-language-menu,
.dorrin-language.is-open .dorrin-language-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.dorrin-language-menu span {
	height: 38px;

	padding: 0 11px;

	border-radius: 10px;

	display: flex;
	align-items: center;

	font-size: 13px;

	cursor: default;

	transition:
		background-color 190ms ease,
		color 190ms ease;
}

.dorrin-language-menu span:hover {
	background: rgba(0, 98, 92, .07);
	color: var(--dorrin-teal);
}

.dorrin-language-menu .is-active {
	font-weight: 700;
}


/* =========================================================
   WHOLESALE CTA
   ========================================================= */

.dorrin-header-wholesale {
	position: relative;

	height: 46px;

	margin-right: 4px;
	padding-inline: 22px;

	border: 1px solid var(--dorrin-teal);
	border-radius: 999px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	overflow: hidden;

	background: var(--dorrin-teal);
	color: #fff;

	font-size: 14px;
	font-weight: 600;

	transition:
		transform 210ms ease,
		box-shadow 210ms ease,
		border-color 210ms ease;
}

.dorrin-header-wholesale::before {
	content: "";

	position: absolute;
	inset: 0;

	background: var(--dorrin-pink);

	transform: translateY(102%);

	transition:
		transform 270ms cubic-bezier(.2,.8,.2,1);
}

.dorrin-header-wholesale span {
	position: relative;
	z-index: 1;
}

.dorrin-header-wholesale:hover,
.dorrin-header-wholesale:focus-visible {
	color: #fff;
	border-color: var(--dorrin-pink);

	transform: translateY(-2px);

	box-shadow:
		0 10px 24px rgba(0, 98, 92, .17);
}

.dorrin-header-wholesale:hover::before,
.dorrin-header-wholesale:focus-visible::before {
	transform: translateY(0);
}


/* =========================================================
   MEGA MENU
   ========================================================= */

.dorrin-products-menu {
	position: static;
}

/*
 * The wrapper begins exactly at the bottom of the 44px trigger.
 * padding-top is the invisible hover bridge.
 */
.dorrin-mega-menu {
	position: absolute;

	top: calc(50% + 22px);
	right: 40px;
	left: 40px;

	padding-top: 10px;

	opacity: 0;
	visibility: hidden;

	transform: translateY(7px);

	pointer-events: none;

	transition:
		opacity 175ms ease,
		transform 230ms cubic-bezier(.2,.8,.2,1),
		visibility 175ms ease;
}

.dorrin-products-menu:hover .dorrin-mega-menu,
.dorrin-products-menu:focus-within .dorrin-mega-menu {
	opacity: 1;
	visibility: visible;

	transform: translateY(0);

	pointer-events: auto;
}

.dorrin-mega-menu__inner {
	width: 100%;
	max-width: 1180px;

	margin-inline: auto;
	padding: 26px;

	display: grid;

	grid-template-columns:
		1.12fr
		1fr
		1fr;

	align-items: start;
	gap: 16px;

	border: 1px solid rgba(0, 55, 58, .08);
	border-radius: 26px;

	background: rgba(251, 249, 245, .98);

	box-shadow:
		0 20px 58px rgba(0, 55, 58, .11);

	backdrop-filter: blur(22px);
	-webkit-backdrop-filter: blur(22px);
}

.dorrin-mega-column {
	min-height: 0;

	padding: 18px;

	border-radius: 18px;

	background: rgba(238, 226, 209, .30);

	transition:
		background-color 210ms ease,
		transform 210ms ease;
}

.dorrin-mega-column:hover {
	background: rgba(238, 226, 209, .48);
	transform: translateY(-2px);
}

.dorrin-mega-column__title {
	display: flex;
	align-items: center;
	justify-content: space-between;

	margin-bottom: 13px;

	font-size: 17px;
	font-weight: 700;
}

.dorrin-mega-dot {
	width: 9px;
	height: 9px;

	border-radius: 50%;
	background: var(--dorrin-pink);
}

.dorrin-mega-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dorrin-mega-item {
	min-height: 36px;

	padding: 7px 10px;

	border-radius: 11px;

	display: flex;
	align-items: center;
	justify-content: space-between;

	color: var(--dorrin-deep-teal);

	font-size: 14px;

	transition:
		background-color 190ms ease,
		color 190ms ease,
		padding 190ms ease;
}

.dorrin-mega-item > span:last-child {
	opacity: 0;
	transform: translateX(5px);

	transition:
		opacity 190ms ease,
		transform 190ms ease;
}

.dorrin-mega-item:hover,
.dorrin-mega-item:focus-visible {
	padding-right: 14px;
	background: #fff;
	color: var(--dorrin-teal);
}

.dorrin-mega-item:hover > span:last-child,
.dorrin-mega-item:focus-visible > span:last-child {
	opacity: 1;
	transform: translateX(0);
}

.dorrin-mega-submenu {
	margin:
		3px
		14px
		6px
		0;

	padding-right: 12px;

	border-right:
		1px solid rgba(0, 98, 92, .15);

	display: flex;
	flex-direction: column;
	gap: 1px;
}

.dorrin-mega-submenu a {
	padding: 5px 8px;

	border-radius: 9px;

	color: var(--dorrin-deep-teal);

	font-size: 13px;

	opacity: .7;

	transition:
		opacity 190ms ease,
		background-color 190ms ease,
		color 190ms ease;
}

.dorrin-mega-submenu a:hover,
.dorrin-mega-submenu a:focus-visible {
	opacity: 1;

	background: rgba(236, 96, 138, .07);
	color: var(--dorrin-pink);
}


/* =========================================================
   SEARCH OVERLAY
   ========================================================= */

.dorrin-search-overlay {
	position: fixed;
	inset: 0;

	z-index: 11000;

	padding:
		130px
		24px
		40px;

	display: grid;
	place-items: start center;

	background: rgba(0, 55, 58, .74);

	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);

	opacity: 0;
	visibility: hidden;

	transition:
		opacity 240ms ease,
		visibility 240ms ease;
}

.dorrin-search-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.dorrin-search-panel {
	width: min(840px, 100%);

	padding: 26px;

	border-radius: 28px;

	background: var(--dorrin-ivory);

	box-shadow:
		0 30px 100px rgba(0, 0, 0, .18);

	transform: translateY(-12px);

	transition:
		transform 290ms cubic-bezier(.2,.8,.2,1);
}

.dorrin-search-overlay.is-open .dorrin-search-panel {
	transform: translateY(0);
}

.dorrin-search-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;

	margin-bottom: 18px;
}

.dorrin-search-close {
	width: 42px;
	height: 42px;

	border: 1px solid rgba(0, 55, 58, .12);
	border-radius: 50%;

	background: transparent;
	color: var(--dorrin-deep-teal);

	font-size: 24px;

	cursor: pointer;
}

.dorrin-search-form {
	height: 68px;

	padding-inline: 18px;

	border: 1px solid rgba(0, 55, 58, .13);
	border-radius: 18px;

	display: flex;
	align-items: center;
	gap: 14px;

	background: #fff;
}

.dorrin-search-form svg {
	width: 20px;
	height: 20px;

	fill: none;
	stroke: var(--dorrin-deep-teal);
	stroke-width: 1.8;
}

.dorrin-search-form input {
	width: 100%;

	border: 0;
	outline: 0;

	background: transparent;
	color: var(--dorrin-deep-teal);

	font-size: 18px;
}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.dorrin-mobile-navigation {
	position: fixed;
	inset: 0;

	z-index: 12000;

	padding: 22px;

	overflow-y: auto;

	background: var(--dorrin-deep-teal);
	color: #fff;

	opacity: 0;
	visibility: hidden;

	transform: translateY(-12px);

	transition:
		opacity 270ms ease,
		transform 270ms ease,
		visibility 270ms ease;
}

.dorrin-mobile-navigation.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.dorrin-mobile-navigation__top {
	display: flex;
	align-items: center;
	justify-content: space-between;

	margin-bottom: 54px;
}

.dorrin-mobile-navigation__close {
	width: 44px;
	height: 44px;

	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 50%;

	background: transparent;
	color: #fff;

	font-size: 24px;

	cursor: pointer;
}

.dorrin-mobile-links {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.dorrin-mobile-links > a,
.dorrin-mobile-products-trigger {
	padding: 13px 0;

	border: 0;
	border-bottom:
		1px solid rgba(255,255,255,.11);

	background: transparent;
	color: #fff;

	text-align: right;

	font-size:
		clamp(28px, 8vw, 42px);

	font-weight: 600;
}

.dorrin-mobile-products-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;

	cursor: pointer;
}

.dorrin-mobile-categories {
	display: none;

	padding:
		18px
		0
		24px;

	grid-template-columns:
		1fr
		1fr;

	gap: 24px;
}

.dorrin-mobile-categories.is-open {
	display: grid;
}

.dorrin-mobile-categories strong {
	display: block;
	margin-bottom: 8px;

	color: var(--dorrin-light-pink);
}

.dorrin-mobile-categories a {
	display: block;

	padding: 6px 0;

	color: #fff;

	font-size: 14px;

	opacity: .78;
}

.dorrin-mobile-subcategories {
	padding-right: 14px;

	border-right:
		1px solid rgba(255,255,255,.15);
}

.dorrin-mobile-navigation__footer {
	margin-top: 46px;
	padding-top: 22px;

	border-top:
		1px solid rgba(255,255,255,.12);

	display: flex;
	flex-wrap: wrap;
	align-items: center;

	gap: 12px;
}

.dorrin-mobile-search-trigger {
	border:
		1px solid rgba(255,255,255,.18);

	border-radius: 999px;

	padding: 10px 16px;

	background: transparent;
	color: #fff;
}

.dorrin-mobile-wholesale {
	padding:
		12px
		18px;

	border-radius:
		999px;

	background: var(--dorrin-pink);
	color: #fff;
}


/* =========================================================
   RESPONSIVE VISIBILITY
   ========================================================= */

.dorrin-mobile-only {
	display: none !important;
}

@media (max-width: 1180px) {

	.dorrin-header-inner {
		padding-inline: 28px;
	}

	.dorrin-header-nav {
		gap: 22px;
	}

	.dorrin-nav-link {
		font-size: 14px;
	}

	.dorrin-mega-menu {
		right: 28px;
		left: 28px;
	}

}

@media (max-width: 940px) {

	:root {
		--dorrin-header-height: 82px;
	}

	.dorrin-site-header.is-scrolled {
		--dorrin-header-height: 70px;
	}

	.dorrin-desktop-only {
		display: none !important;
	}

	.dorrin-mobile-only {
		display: inline-flex !important;
	}

	.dorrin-header-inner {
		padding-inline: 18px;
	}

	.dorrin-header-actions {
		gap: 4px;
	}

	.dorrin-header-logo {
		width: 118px;
		max-height: 58px;
	}

	.dorrin-site-header.is-scrolled .dorrin-header-logo {
		width: 108px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.dorrin-site-header,
	.dorrin-site-header *,
	.dorrin-search-overlay,
	.dorrin-search-overlay *,
	.dorrin-mobile-navigation,
	.dorrin-mobile-navigation * {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
