/*
 * Header global.
 * z-index: 70 (por encima del boton flotante de WhatsApp en 50,
 * por debajo del panel de filtros mobile del catalogo en 80).
 */

html.jt-scroll-lock,
html.jt-scroll-lock body {
	overflow: hidden;
}

.jt-site-header {
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(180%) blur(8px);
	-webkit-backdrop-filter: saturate(180%) blur(8px);
	border-bottom: 1px solid var(--jt-color-border);
	box-shadow: 0 6px 18px rgba(36, 43, 34, 0.06);
	position: sticky;
	top: 0;
	z-index: 70;
}

.jt-header-inner {
	align-items: center;
	display: grid;
	gap: 1rem;
	grid-template-columns: auto auto minmax(160px, 1fr) auto;
	margin: 0 auto;
	max-width: 1280px;
	min-height: 72px;
	padding: 0.6rem 1.25rem;
}

.jt-site-header .jt-brand {
	align-items: center;
	color: var(--jt-color-ink);
	display: inline-flex;
	gap: 0.65rem;
	min-width: 0;
	text-decoration: none;
}

.jt-site-header .custom-logo-link {
	align-items: center;
	display: inline-flex;
	flex: 0 0 auto;
	height: 46px;
	line-height: 0;
	max-width: 170px;
	width: 110px;
}

.jt-site-header .jt-brand img {
	display: block;
	height: 46px;
	max-height: 46px;
	max-width: 170px;
	object-fit: contain;
	width: 110px;
}

.jt-site-header .jt-brand-mark {
	align-items: center;
	background: #f4be78;
	border-radius: 14px;
	color: #7a481b;
	display: inline-flex;
	flex: 0 0 auto;
	height: 42px;
	justify-content: center;
	width: 42px;
}

.jt-site-header .jt-brand-mark svg {
	display: block;
	fill: none;
	height: 22px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
	width: 22px;
}

.jt-site-header .jt-brand-text {
	display: grid;
	line-height: 1.15;
}

.jt-site-header .jt-brand-text strong {
	font-size: 1.2rem;
}

.jt-site-header .jt-brand-text small {
	color: var(--jt-color-muted);
	font-size: 0.76rem;
}

/* --- Navegacion principal + dropdowns --- */

.jt-main-nav {
	min-width: 0;
}

.jt-nav-list {
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jt-nav-item {
	position: relative;
}

.jt-nav-link {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--jt-color-ink);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 800;
	gap: 0.3rem;
	padding: 0.65rem 0.55rem;
	text-decoration: none;
	transition: color 0.15s ease;
	white-space: nowrap;
}

.jt-nav-link.is-active,
.jt-nav-link:hover,
.jt-nav-link:focus-visible {
	color: var(--jt-color-orange);
}

.jt-nav-caret {
	display: block;
	fill: none;
	height: 13px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
	transition: transform 0.15s ease;
	width: 13px;
}

.jt-nav-item:hover .jt-nav-caret,
.jt-nav-item:focus-within .jt-nav-caret {
	transform: rotate(180deg);
}

.jt-dropdown {
	background: #fff;
	border: 1px solid var(--jt-color-border);
	border-radius: 16px;
	box-shadow: 0 20px 45px rgba(36, 43, 34, 0.15);
	left: 0;
	opacity: 0;
	padding: 1.15rem 1.25rem;
	position: absolute;
	top: calc(100% + 8px);
	transform: translateY(-8px);
	transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
	visibility: hidden;
	z-index: 5;
}

.jt-nav-item:hover .jt-dropdown,
.jt-nav-item:focus-within .jt-dropdown {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
}

.jt-dropdown-categories {
	min-width: 460px;
}

.jt-dropdown-ages {
	min-width: 260px;
}

.jt-dropdown-all {
	border-bottom: 1px solid var(--jt-color-border);
	color: var(--jt-color-leaf);
	display: block;
	font-weight: 800;
	margin-bottom: 0.85rem;
	padding-bottom: 0.85rem;
	text-decoration: none;
	white-space: nowrap;
}

.jt-dropdown-all:hover,
.jt-dropdown-all:focus-visible {
	color: var(--jt-color-orange);
}

/* Mega menu: tarjetas de categoria en 2 columnas */
.jt-megamenu-grid {
	display: grid;
	gap: 0.35rem 0.75rem;
	grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.jt-category-card {
	align-items: center;
	border-radius: 12px;
	color: var(--jt-color-ink);
	display: flex;
	gap: 0.65rem;
	padding: 0.55rem;
	text-decoration: none;
	transition: background 0.15s ease;
}

.jt-category-card:hover,
.jt-category-card:focus-visible {
	background: #f5eadc;
}

.jt-category-icon {
	align-items: center;
	background: #edf5e9;
	border-radius: 10px;
	color: var(--jt-color-leaf);
	display: inline-flex;
	flex: 0 0 auto;
	height: 34px;
	justify-content: center;
	width: 34px;
}

.jt-category-icon svg {
	display: block;
	fill: none;
	height: 18px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
	width: 18px;
}

.jt-category-card:hover .jt-category-icon,
.jt-category-card:focus-visible .jt-category-icon {
	color: var(--jt-color-orange);
}

.jt-category-info {
	display: grid;
	line-height: 1.25;
	min-width: 0;
}

.jt-category-info strong {
	font-size: 0.86rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jt-category-info small {
	color: var(--jt-color-muted);
	font-size: 0.74rem;
}

/* Dropdown de edades */
.jt-dropdown-heading {
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.03em;
	margin: 0 0 0.35rem;
	text-transform: uppercase;
}

.jt-dropdown-list {
	display: grid;
	gap: 0.2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jt-age-link {
	align-items: baseline;
	border-radius: 10px;
	color: inherit;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.5rem 0.6rem;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

a.jt-age-link:hover,
a.jt-age-link:focus-visible {
	background: #f5eadc;
}

.jt-age-link[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.7;
}

.jt-age-link strong {
	color: var(--jt-color-ink);
	font-size: 0.85rem;
	opacity: 0.65;
}

.jt-age-link small {
	font-size: 0.72rem;
}

.jt-age-tag {
	background: var(--jt-color-border);
	border-radius: 999px;
	color: var(--jt-color-muted);
	font-size: 0.66rem;
	font-weight: 800;
	margin-left: auto;
	padding: 0.15rem 0.5rem;
	text-transform: uppercase;
}

/* --- Buscador --- */

.jt-header-search {
	min-width: 0;
}

.jt-header-search form,
.woocommerce-product-search {
	align-items: center;
	background: #f3f1ec;
	border: 1px solid transparent;
	border-radius: 999px;
	display: flex;
	height: 50px;
	overflow: hidden;
	padding: 0 4px 0 1.1rem;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.jt-header-search form:focus-within,
.woocommerce-product-search:focus-within {
	background: #fff;
	border-color: var(--jt-color-leaf);
	box-shadow: 0 0 0 3px rgba(80, 122, 91, 0.15);
}

.jt-header-search input[type="search"],
.jt-header-search .search-field {
	align-items: center;
	background: transparent;
	border: 0;
	display: flex;
	flex: 1 1 auto;
	font-size: 0.95rem;
	height: 100%;
	line-height: normal;
	padding: 0;
	width: 100%;
}

.jt-header-search button,
.woocommerce-product-search button {
	align-items: center;
	background: var(--jt-color-orange);
	border: 0;
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	flex: 0 0 auto;
	height: 40px;
	justify-content: center;
	padding: 0 1.05rem;
}

/* --- Iconos --- */

.jt-header-icons {
	align-items: center;
	display: flex;
	gap: 0.25rem;
}

.jt-icon-link {
	align-items: center;
	border-radius: 999px;
	color: var(--jt-color-ink);
	display: inline-flex;
	height: 42px;
	justify-content: center;
	position: relative;
	text-decoration: none;
	width: 42px;
}

.jt-icon-link svg {
	display: block;
	fill: none;
	flex-shrink: 0;
	height: 21px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	width: 21px;
}

a.jt-icon-link:hover,
a.jt-icon-link:focus-visible,
button.jt-icon-link:hover,
button.jt-icon-link:focus-visible {
	background: #f5eadc;
	color: var(--jt-color-orange);
}

.jt-favorite-link[aria-disabled="true"] {
	color: var(--jt-color-muted);
	cursor: not-allowed;
	opacity: 0.55;
}

.jt-icon-link[data-tooltip]::after {
	background: var(--jt-color-ink);
	border-radius: 6px;
	color: #fff;
	content: attr(data-tooltip);
	font-size: 0.72rem;
	font-weight: 600;
	margin-top: 8px;
	opacity: 0;
	padding: 0.3rem 0.6rem;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 100%;
	transition: opacity 0.15s ease;
	visibility: hidden;
	white-space: nowrap;
}

.jt-icon-link[data-tooltip]:hover::after,
.jt-icon-link[data-tooltip]:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

.jt-cart-badge {
	align-items: center;
	background: var(--jt-color-orange);
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	font-size: 0.66rem;
	font-weight: 700;
	height: 1.1rem;
	justify-content: center;
	min-width: 1.1rem;
	padding: 0 0.22rem;
	position: absolute;
	right: 2px;
	top: 2px;
}

.jt-search-toggle {
	display: none;
}

.jt-menu-toggle {
	background: transparent;
	border: 0;
	display: none;
	height: 42px;
	padding: 0;
	width: 42px;
}

.jt-menu-toggle span:not(.screen-reader-text) {
	background: var(--jt-color-ink);
	display: block;
	height: 2px;
	margin: 6px auto;
	width: 22px;
}

/* --- Panel mobile --- */

.jt-mobile-panel {
	background: var(--jt-color-surface);
	border-top: 1px solid var(--jt-color-border);
	display: none;
	max-height: calc(100vh - 72px);
	overflow-y: auto;
	padding: 0.5rem 1.25rem 1.5rem;
}

.jt-mobile-panel.is-open {
	display: block;
}

.jt-mobile-account {
	align-items: center;
	color: var(--jt-color-ink);
	display: flex;
	font-weight: 800;
	gap: 0.6rem;
	padding: 0.85rem 0.25rem;
	text-decoration: none;
}

.jt-mobile-account svg {
	display: block;
	fill: none;
	height: 22px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	width: 22px;
}

.jt-mobile-dropdown {
	border-top: 1px solid var(--jt-color-border);
	padding: 0.25rem 0;
}

.jt-mobile-dropdown summary {
	cursor: pointer;
	font-weight: 800;
	list-style: none;
	padding: 0.85rem 0.25rem;
	position: relative;
}

.jt-mobile-dropdown summary::-webkit-details-marker {
	display: none;
}

.jt-mobile-dropdown summary::after {
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	content: "";
	display: inline-block;
	height: 8px;
	position: absolute;
	right: 0.5rem;
	top: 1.15rem;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
	width: 8px;
}

.jt-mobile-dropdown[open] summary::after {
	transform: rotate(-135deg);
}

.jt-mobile-dropdown .jt-megamenu-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding-left: 0.25rem;
}

.jt-mobile-dropdown .jt-dropdown-all {
	padding-left: 0.25rem;
}

.jt-mobile-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jt-mobile-links .jt-nav-link {
	border-top: 1px solid var(--jt-color-border);
	display: block;
	padding: 0.85rem 0.25rem;
	width: 100%;
}

/* ==================== TABLET (reduccion progresiva) ==================== */
@media (max-width: 1200px) {
	.jt-header-inner {
		gap: 0.75rem;
		grid-template-columns: auto auto minmax(120px, 1fr) auto;
	}

	.jt-site-header .jt-brand-text small {
		display: none;
	}

	.jt-nav-link {
		font-size: 0.82rem;
		padding: 0.65rem 0.4rem;
	}

	.jt-header-search form,
	.woocommerce-product-search {
		height: 46px;
	}
}

@media (max-width: 1000px) {
	.jt-nav-list {
		gap: 0;
	}

	.jt-nav-link {
		padding: 0.65rem 0.3rem;
	}
}

/* ==================== MOBILE ==================== */
@media (max-width: 880px) {
	.jt-header-inner {
		grid-template-columns: auto 1fr auto;
	}

	.jt-site-header .custom-logo-link,
	.jt-site-header .jt-brand img {
		max-width: 140px;
		width: 90px;
	}

	.jt-site-header .custom-logo-link,
	.jt-site-header .jt-brand img {
		height: 42px;
		max-height: 42px;
	}

	.jt-main-nav {
		display: none;
	}

	.jt-header-search {
		display: none;
		grid-column: 1 / -1;
		grid-row: 2;
		padding-bottom: 0.6rem;
	}

	.jt-header-search.is-open {
		display: block;
	}

	.jt-search-toggle {
		display: inline-flex;
	}

	.jt-favorite-link {
		display: none;
	}

	.jt-menu-toggle {
		display: inline-block;
	}

	.jt-cart-badge {
		right: -2px;
		top: -2px;
	}
}

@media (min-width: 881px) {
	.jt-mobile-panel {
		display: none !important;
	}
}
