/**
 * Nyriana Header — Premium Crown
 * Blocksy type-1 header overlay (no markup change)
 * @version 1.0.0
 */

/* ==========================================================================
   Tokens (fallback to global)
   ========================================================================== */
:root {
	--nyr-gold: var(--harvest-gold, #c9a84c);
	--nyr-gold-dark: var(--gold-dark, #a8902f);
	--nyr-cream: var(--cream, #f5f0e8);
	--nyr-dark: var(--dark, #0a0a0a);
	--nyr-glass-bg: rgba(10, 10, 10, 0.72);
	--nyr-glass-bg-fallback: rgba(10, 10, 10, 0.92);
	--nyr-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. HEADER SHELL — transparent → glass on scroll
   ========================================================================== */
.ct-header[data-id="type-1"] {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 999;
	width: 100%;
	background: transparent !important;
	border-bottom: 1px solid transparent;
	transition:
		background 0.4s var(--nyr-ease),
		border-color 0.4s var(--nyr-ease),
		transform 0.35s var(--nyr-ease);
	will-change: transform, background;
}

.ct-header[data-id="type-1"][data-row] > div,
.ct-header[data-id="type-1"] [data-row] {
	background: transparent !important;
}

/* Glass mode (after scroll > 80) */
body.nyr-header-scrolled .ct-header[data-id="type-1"] {
	background: var(--nyr-glass-bg-fallback) !important;
	border-bottom: 1px solid rgba(201, 168, 76, 0.18);
	box-shadow: 0 1px 0 rgba(201, 168, 76, 0.06), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
}
@supports (backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px)) {
	body.nyr-header-scrolled .ct-header[data-id="type-1"] {
		background: var(--nyr-glass-bg) !important;
		-webkit-backdrop-filter: blur(20px) saturate(170%);
		backdrop-filter: blur(20px) saturate(170%);
	}
}

/* Hide-on-scroll-down */
body.nyr-header-hidden .ct-header[data-id="type-1"] {
	transform: translateY(-100%);
}

/* ==========================================================================
   2. LOGO — bigger, retina, scroll-shrink
   ========================================================================== */
.ct-header[data-id="type-1"] .site-logo-container img {
	height: auto;
	max-height: var(--nyr-logo-h, 64px);
	width: auto;
	transition: max-height 0.4s var(--nyr-ease), filter 0.3s var(--nyr-ease);
}
body.nyr-header-scrolled .ct-header[data-id="type-1"] .site-logo-container img {
	max-height: var(--nyr-logo-h-scrolled, 40px);
}
.ct-header[data-id="type-1"] .site-logo-container:hover img {
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   3. NAV MENU — small-caps + gold underline reveal + olive bullet
   ========================================================================== */
.ct-header[data-id="type-1"] .header-menu-1 .menu > li > .ct-menu-link {
	position: relative;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--nyr-cream);
	padding: 14px 18px;
	transition: color 0.3s var(--nyr-ease), transform 0.4s var(--nyr-ease);
}

.ct-header[data-id="type-1"] .header-menu-1 .menu > li > .ct-menu-link::after {
	content: "";
	position: absolute;
	left: 18px; right: 18px;
	bottom: 8px;
	height: 1px;
	background: linear-gradient(90deg,
		transparent 0%,
		rgba(201, 168, 76, 0.4) 20%,
		var(--nyr-gold) 50%,
		rgba(201, 168, 76, 0.4) 80%,
		transparent 100%);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.35s var(--nyr-ease);
}

.ct-header[data-id="type-1"] .header-menu-1 .menu > li:hover > .ct-menu-link::after,
.ct-header[data-id="type-1"] .header-menu-1 .menu > li.current-menu-item > .ct-menu-link::after,
.ct-header[data-id="type-1"] .header-menu-1 .menu > li.current_page_item > .ct-menu-link::after {
	transform: scaleX(1);
}

/* Active page olive-leaf bullet */
.ct-header[data-id="type-1"] .header-menu-1 .menu > li.current-menu-item > .ct-menu-link::before,
.ct-header[data-id="type-1"] .header-menu-1 .menu > li.current_page_item > .ct-menu-link::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 50%;
	width: 10px;
	height: 10px;
	transform: translateY(-50%) rotate(-25deg);
	background: var(--nyr-gold);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C8 4 4 8 4 14c0 4 3 7 8 8 5-1 8-4 8-8 0-6-4-10-8-12z' fill='black'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C8 4 4 8 4 14c0 4 3 7 8 8 5-1 8-4 8-8 0-6-4-10-8-12z' fill='black'/></svg>") no-repeat center / contain;
	opacity: 0.9;
}

/* Satin shimmer (one-shot on hover) */
@keyframes nyrShimmer {
	0%   { background-position: -200% 0; }
	100% { background-position: 200% 0; }
}
.ct-header[data-id="type-1"] .header-menu-1 .menu > li > .ct-menu-link:hover {
	background-image: linear-gradient(
		100deg,
		transparent 30%,
		rgba(201, 168, 76, 0.12) 50%,
		transparent 70%);
	background-size: 200% 100%;
	background-repeat: no-repeat;
	animation: nyrShimmer 1.2s linear 1;
}

/* Glass mode menu adjustments */
body.nyr-header-scrolled .ct-header[data-id="type-1"] .header-menu-1 .menu > li > .ct-menu-link {
	color: var(--nyr-cream);
}

/* ==========================================================================
   4. ÜRÜNLER DROPDOWN — 3 thumbnail cards
   ========================================================================== */
.nyr-products-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	min-width: 580px;
	padding: 24px;
	background: rgba(10, 10, 10, 0.94);
	-webkit-backdrop-filter: blur(24px) saturate(180%);
	backdrop-filter: blur(24px) saturate(180%);
	border: 1px solid rgba(201, 168, 76, 0.15);
	border-radius: 12px;
	box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s var(--nyr-ease), transform 0.35s var(--nyr-ease), visibility 0s linear 0.3s;
	z-index: 1000;
}

.nyr-products-dropdown[data-open="true"],
.menu-item-object-page.menu-item-614:hover .nyr-products-dropdown {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
	transition-delay: 0s;
}

.nyr-products-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
}

.nyr-product-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 14px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--nyr-cream);
	transition: background 0.3s var(--nyr-ease), transform 0.3s var(--nyr-ease);
}
.nyr-product-card:hover {
	background: rgba(201, 168, 76, 0.08);
	transform: translateY(-2px);
	color: var(--nyr-cream);
}
.nyr-product-card-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 12px;
	background: rgba(255, 255, 255, 0.04);
}
.nyr-product-card-title {
	font-family: "Playfair Display", Georgia, serif;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--nyr-cream);
	margin: 0 0 4px;
}
.nyr-product-card-eyebrow {
	font-size: 10px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--nyr-gold);
	font-weight: 600;
}

/* ==========================================================================
   5. RIGHT CLUSTER — cart label hide, badge, pulse
   ========================================================================== */
.ct-header[data-id="type-1"] .ct-cart-item .ct-label[data-price] {
	display: none !important;
}
.ct-header[data-id="type-1"] .ct-cart-item {
	position: relative;
	padding: 10px 14px;
}
.ct-header[data-id="type-1"] .ct-dynamic-count-cart {
	position: absolute;
	top: 4px; right: 4px;
	min-width: 16px; height: 16px;
	line-height: 16px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 600;
	color: var(--nyr-dark);
	background: var(--nyr-gold);
	border-radius: 999px;
	text-align: center;
	transform: scale(1);
	transition: transform 0.3s var(--nyr-ease);
}
.ct-header[data-id="type-1"] .ct-dynamic-count-cart[data-count="0"] {
	opacity: 0;
	transform: scale(0);
}

@keyframes nyrCartPulse {
	0%   { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.7); }
	70%  { box-shadow: 0 0 0 14px rgba(201, 168, 76, 0); }
	100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
}
.ct-header[data-id="type-1"] .ct-dynamic-count-cart.nyr-pulse {
	animation: nyrCartPulse 0.9s var(--nyr-ease) 1;
}

.ct-header[data-id="type-1"] .ct-cart-item:hover svg,
.ct-header[data-id="type-1"] .ct-account-item:hover svg {
	color: var(--nyr-gold);
}

/* ==========================================================================
   6. MINI-CART DRAWER (slide-in right)
   ========================================================================== */
.nyr-drawer-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s var(--nyr-ease), visibility 0s linear 0.3s;
	z-index: 9998;
}
.nyr-drawer-overlay[data-open="true"] {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.nyr-mini-cart {
	position: fixed;
	top: 0; right: 0; bottom: 0;
	width: min(420px, 100vw);
	background: rgba(15, 15, 15, 0.96);
	-webkit-backdrop-filter: blur(28px);
	backdrop-filter: blur(28px);
	border-left: 1px solid rgba(201, 168, 76, 0.18);
	color: var(--nyr-cream);
	transform: translateX(100%);
	transition: transform 0.4s var(--nyr-ease);
	z-index: 9999;
	display: flex;
	flex-direction: column;
}
.nyr-mini-cart[data-open="true"] {
	transform: translateX(0);
}
.nyr-mini-cart-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 22px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nyr-mini-cart-title {
	font-family: "Playfair Display", Georgia, serif;
	font-size: 20px;
	font-weight: 500;
	margin: 0;
	color: var(--nyr-cream);
}
.nyr-mini-cart-close {
	background: transparent; border: 0;
	color: var(--nyr-cream);
	width: 36px; height: 36px;
	cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%;
	transition: background 0.2s var(--nyr-ease);
}
.nyr-mini-cart-close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--nyr-gold);
}
.nyr-mini-cart-body {
	flex: 1; overflow-y: auto;
	padding: 12px 24px;
}
.nyr-mini-cart-foot {
	padding: 18px 24px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.nyr-mini-cart-foot .button,
.nyr-mini-cart-foot a.checkout {
	display: block;
	width: 100%;
	text-align: center;
	padding: 14px 20px;
	background: var(--nyr-gold);
	color: var(--nyr-dark) !important;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	border: 0;
	border-radius: 4px;
	transition: background 0.3s var(--nyr-ease), transform 0.2s var(--nyr-ease);
}
.nyr-mini-cart-foot .button:hover,
.nyr-mini-cart-foot a.checkout:hover {
	background: var(--nyr-gold-dark);
	transform: translateY(-1px);
}
.nyr-mini-cart .woocommerce-mini-cart-item img,
.nyr-mini-cart .mini_cart_item img {
	width: 64px; height: 64px;
	object-fit: cover;
	border-radius: 4px;
}
.nyr-mini-cart .woocommerce-mini-cart__empty-message {
	text-align: center;
	padding: 60px 20px;
	color: rgba(245, 240, 232, 0.6);
}

/* ==========================================================================
   7. MOBILE — full-screen offcanvas (overlay on existing #offcanvas)
   ========================================================================== */
@media (max-width: 999px) {
	.ct-header[data-id="type-1"] .site-logo-container img {
		max-height: 48px;
	}
	body.nyr-header-scrolled .ct-header[data-id="type-1"] .site-logo-container img {
		max-height: 36px;
	}

	/* Add cart icon to mobile header (always visible) */
	.nyr-mobile-cart-trigger {
		display: inline-flex !important;
		align-items: center;
		position: relative;
		padding: 10px;
		margin-right: 4px;
		background: transparent;
		border: 0;
		color: var(--nyr-cream);
		cursor: pointer;
	}
	.nyr-mobile-cart-trigger svg {
		width: 22px; height: 22px;
	}
	.nyr-mobile-cart-trigger .nyr-mobile-cart-count {
		position: absolute;
		top: 4px; right: 2px;
		min-width: 16px; height: 16px;
		line-height: 16px;
		padding: 0 4px;
		font-size: 10px;
		font-weight: 600;
		color: var(--nyr-dark);
		background: var(--nyr-gold);
		border-radius: 999px;
		text-align: center;
	}
	.nyr-mobile-cart-trigger[data-count="0"] .nyr-mobile-cart-count {
		display: none;
	}

	/* Hamburger refinement */
	.ct-header[data-id="type-1"] .ct-header-trigger {
		width: 44px; height: 44px;
		color: var(--nyr-gold);
	}
	.ct-header[data-id="type-1"] .ct-header-trigger svg rect:nth-child(1) { width: 14px; }
	.ct-header[data-id="type-1"] .ct-header-trigger svg rect:nth-child(3) { width: 10px; }

	.nyr-products-dropdown {
		display: none;
	}
}

/* ==========================================================================
   8. ACCESSIBILITY — reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.ct-header[data-id="type-1"],
	.ct-header[data-id="type-1"] *,
	.nyr-mini-cart,
	.nyr-products-dropdown {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
	.ct-header[data-id="type-1"] .header-menu-1 .menu > li > .ct-menu-link:hover {
		animation: none;
		background-image: none;
	}
}

/* Focus rings — keyboard accessibility */
.ct-header[data-id="type-1"] a:focus-visible,
.ct-header[data-id="type-1"] button:focus-visible,
.nyr-mini-cart a:focus-visible,
.nyr-mini-cart button:focus-visible {
	outline: 2px solid var(--nyr-gold);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Body padding so fixed header doesn't overlap non-hero pages */
body:not(.home):not(.page-template-page-nyriana) {
	padding-top: 0; /* hero page already absorbs; other pages get inline-handled */
}
