/* =========================================================================
   Trongemen · Header estático (Fase 2C)
   ========================================================================= */

.tm-header {
	--tm-green: #00571f;
	--tm-green-dark: #003307;
	--tm-green-heading: #004a1a;
	--tm-yellow: #ffd046;
	--tm-text: #1d1d1d;
	--tm-muted: #3d3d3d;
	--tm-radius: 18px;
	--tm-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);

	position: relative;
	z-index: 60;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background: #fff;
	font-family: "Lato", Arial, sans-serif;
	color: var(--tm-text);
}

.tm-header *,
.tm-header *::before,
.tm-header *::after { box-sizing: border-box; }

.tm-header a { text-decoration: none; }

/* ---------- Fila superior ---------- */
.tm-top {
	max-width: 1240px;
	margin: 0 auto;
	padding: 15px 24px 6px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.tm-search {
	width: 230px;
	flex: 0 0 230px;
}

/* FiboSearch dentro del header */
.tm-search .dgwt-wcas-search-wrapp,
.tm-search .dgwt-wcas-search-form,
.tm-search form {
	width: 230px !important;
	max-width: 230px !important;
	margin: 0 !important;
}

.tm-search .dgwt-wcas-sf-wrapp input[type="search"] {
	height: 40px !important;
	border-radius: 4px 0 0 4px !important;
	font-size: 13px !important;
}

.tm-search .dgwt-wcas-search-submit {
	border-radius: 0 4px 4px 0 !important;
}

.tm-logo {
	display: block;
	line-height: 0;
	flex: 0 0 auto;
}

.tm-logo img {
	height: 63px;
	width: auto;
	max-width: 340px;
	display: block;
}

.tm-catalog {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--tm-green);
	color: #fff !important;
	font-family: "Roboto", Arial, sans-serif;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	padding: 12px 22px;
	border-radius: 999px;
	white-space: nowrap;
	line-height: 1;
}

.tm-catalog:hover { background: #004a1a; }
.tm-catalog svg { width: 16px; height: 16px; }

/* ---------- Navegación ---------- */
.tm-navbar {
	position: relative;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
}

.tm-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 34px;
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 1240px;
}

.tm-nav-item { position: static; display: flex; align-items: center; flex: 0 0 auto; }

.tm-nav-item:has(> .tm-mega-contact),
.tm-nav-item.tm-contact-item { position: relative; }

.tm-nav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 16px 0;
	font-family: "Roboto", Arial, sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.2px;
	text-transform: uppercase;
	color: var(--tm-green-dark) !important;
	background: none;
	border: 0;
	cursor: pointer;
	line-height: 1.2;
	white-space: nowrap;
	margin: 0;
}

.tm-nav-toggle {
	margin: 0 !important;
	min-height: 0;
}

.tm-nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	height: 2px;
	background: var(--tm-yellow);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.tm-nav-item:hover > .tm-nav-link::after,
.tm-has-mega.is-open > .tm-nav-toggle::after { opacity: 1; }

.tm-chevron {
	width: 10px;
	height: 7px;
	transition: transform 0.18s ease;
}

.tm-has-mega.is-open > .tm-nav-toggle .tm-chevron,
.tm-has-mega:hover > .tm-nav-toggle .tm-chevron { transform: rotate(180deg); }

.tm-cyber-link { color: #b00020 !important; font-weight: 700; }

.tm-cart {
	position: relative;
	margin-left: 24px;
	color: var(--tm-green-dark) !important;
	display: grid;
	place-items: center;
	line-height: 0;
}

.tm-cart svg { width: 22px; height: 22px; }

.tm-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	background: var(--tm-green);
	color: #fff;
	font-family: "Roboto", Arial, sans-serif;
	font-size: 9px;
	font-weight: 700;
	min-width: 15px;
	height: 15px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	padding: 0 3px;
	line-height: 1;
}

.tm-burger {
	display: none;
	background: none;
	border: 0;
	padding: 8px;
	cursor: pointer;
	color: var(--tm-green-dark);
}

/* ---------- Mega menú ---------- */
.tm-mega {
	position: absolute;
	top: calc(100% - 6px);
	left: 50%;
	transform: translate(-50%, 10px);
	width: min(970px, calc(100vw - 48px));
	padding-top: 6px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	z-index: 70;
}

.tm-has-mega:hover > .tm-mega,
.tm-has-mega.is-open > .tm-mega {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.tm-mega-inner {
	background: #fff;
	border-radius: var(--tm-radius);
	box-shadow: var(--tm-shadow);
	padding: 26px 34px 30px;
	display: flex;
	gap: 34px;
	min-height: 380px;
}

.tm-tabs {
	width: 250px;
	flex: 0 0 250px;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding-top: 6px;
}

.tm-tab {
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.25;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	text-align: center;
	padding: 10px 0;
	margin: 0 0 4px;
	font-family: "Lato", Arial, sans-serif;
	font-size: 18px;
	font-weight: 500;
	color: var(--tm-green-dark);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.tm-tab:hover { color: var(--tm-green); }
.tm-tab.is-active { border-bottom-color: var(--tm-yellow); }

.tm-panels { flex: 1; min-width: 0; }
.tm-panel { display: none; }
.tm-panel.is-active { display: block; }

.tm-cat-grid {
	column-count: 4;
	column-gap: 30px;
}

.tm-cat {
	break-inside: avoid;
	page-break-inside: avoid;
	margin: 0 0 16px;
}

.tm-cat h3 {
	position: relative;
	margin: 0 0 6px;
	padding-left: 13px;
	font-family: "Roboto", Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.1px;
	text-transform: uppercase;
	color: var(--tm-green-heading);
}

.tm-cat h3::before {
	content: "";
	position: absolute;
	left: 0;
	top: 5px;
	width: 6px;
	height: 6px;
	background: #f0b429;
}

.tm-cat h3 a { color: inherit !important; }
.tm-cat h3 a:hover { text-decoration: underline; }

.tm-cat ul {
	list-style: none;
	margin: 0;
	padding: 0 0 0 13px;
}

.tm-cat li { margin: 0 0 3px; }

.tm-cat li a {
	font-family: "Lato", Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: var(--tm-muted) !important;
	line-height: 1.35;
}

.tm-cat li a:hover { color: var(--tm-green) !important; text-decoration: underline; }

/* Contacto */
.tm-mega-contact {
	width: 380px;
	left: auto;
	right: 0;
	transform: translateY(10px);
}

.tm-has-mega:hover > .tm-mega-contact,
.tm-has-mega.is-open > .tm-mega-contact { transform: translateY(0); }

.tm-mega-contact .tm-mega-inner {
	min-height: 0;
	padding: 26px 30px;
	display: block;
}

.tm-contact-list { display: flex; flex-direction: column; gap: 12px; }

.tm-contact-list a {
	font-family: "Lato", Arial, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: var(--tm-green-dark) !important;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
}

.tm-contact-list a:last-child { border-bottom: 0; }
.tm-contact-list a:hover { color: var(--tm-green) !important; text-decoration: underline; }

/* ---------- Carrito lateral ---------- */
.tm-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 390px;
	max-width: 94vw;
	height: 100%;
	background: #fff;
	z-index: 300;
	transform: translateX(100%);
	transition: transform 0.24s ease;
	overflow-y: auto;
	padding: 20px;
	box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
}

.tm-cart-drawer.is-open { transform: translateX(0); }

.tm-cart-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 14px;
	border-bottom: 2px solid var(--tm-green);
	font-family: "Roboto", Arial, sans-serif;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--tm-green-dark);
}

.tm-cart-close {
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--tm-green-dark);
}

.tm-cart-body .widget_shopping_cart_content { font-family: "Lato", Arial, sans-serif; }
.tm-cart-body .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; }
.tm-cart-body .woocommerce-mini-cart-item { padding: 10px 0; border-bottom: 1px solid #eee; }
.tm-cart-body .woocommerce-mini-cart__total { display: flex; justify-content: space-between; padding: 12px 0; font-weight: 700; }
.tm-cart-body .woocommerce-mini-cart__buttons { display: flex; flex-direction: column; gap: 8px; }
.tm-cart-body .button { text-align: center; }

.tm-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.42);
	z-index: 290;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s;
}

.tm-cart-overlay.is-open { opacity: 1; visibility: visible; }

/* ---------- Móvil ---------- */
.tm-mobile {
	position: fixed;
	inset: 0;
	background: #fff;
	z-index: 400;
	transform: translateX(100%);
	transition: transform 0.22s ease;
	overflow-y: auto;
	padding: 18px 20px 40px;
	display: block;
}

.tm-mobile.is-open { transform: translateX(0); }

.tm-mobile-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 6px;
	border-bottom: 2px solid var(--tm-green);
	font-family: "Roboto", Arial, sans-serif;
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--tm-green-dark);
}

.tm-mobile-close {
	background: none;
	border: 0;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: var(--tm-green-dark);
}

.tm-m-section { border-bottom: 1px solid #ececec; }

.tm-mobile a,
.tm-m-link,
.tm-m-toggle,
.tm-m-contact a,
.tm-cart-drawer a { text-decoration: none; }

.tm-m-link,
.tm-m-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 15px 0;
	background: none;
	border: 0;
	text-align: left;
	font-family: "Roboto", Arial, sans-serif;
	font-size: 13.5px;
	font-weight: 500;
	letter-spacing: 0.2px;
	text-transform: uppercase;
	color: var(--tm-green-dark);
	cursor: pointer;
}

.tm-m-toggle .tm-chevron { transition: transform 0.18s ease; }
.tm-m-section.is-open .tm-m-toggle .tm-chevron { transform: rotate(180deg); }

.tm-m-body { display: none; padding: 0 0 14px; }
.tm-m-section.is-open .tm-m-body { display: block; }

.tm-m-tabtitle {
	font-family: "Lato", Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: var(--tm-green);
	margin: 16px 0 8px;
}

.tm-m-cats .tm-cat-grid { column-count: 1; }
.tm-m-cats .tm-cat { margin-bottom: 14px; }
.tm-m-cats .tm-cat h3 { font-size: 13px; }
.tm-m-cats .tm-cat li a { font-size: 14px; }

.tm-m-contact { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.tm-m-contact a {
	font-family: "Lato", Arial, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: var(--tm-green-dark);
	padding: 8px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.tm-nav { gap: 22px; }
	.tm-nav-link { font-size: 12px; }
}

@media (max-width: 1024px) {
	.tm-top {
		padding: 12px 16px;
		justify-content: center;
	}

	.tm-search,
	.tm-catalog { display: none; }

	.tm-logo img { height: 46px; max-width: 260px; }

	.tm-navbar {
		justify-content: space-between;
		padding: 0 12px;
		min-height: 46px;
		border-top: 1px solid #f0f0f0;
	}

	.tm-nav { display: none; }
	.tm-burger { display: inline-flex; }
	.tm-cart { position: relative; right: auto; top: auto; transform: none; margin-left: 0; margin-right: 6px; }
	.tm-cart-count { right: -6px; }

	.tm-mega { display: none; }
}