/**
 * Header comercial de Tienda Soporte73.
 *
 * La estructura y las interacciones pertenecen al Header Builder de Blocksy.
 */

#header {
	--soporte73-header-accent: #1d63ed;
	--soporte73-header-accent-hover: #164fc2;
	--soporte73-header-ink: #10213b;
	--soporte73-header-muted: #61708a;
	--soporte73-header-border: #dce3ed;
	--soporte73-header-surface: #ffffff;
	--soporte73-header-nav: #10213b;
	--soporte73-header-radius: 10px;
	--soporte73-header-shadow: 0 8px 24px rgba(16, 33, 59, 0.08);

	background: var(--soporte73-header-surface);
	box-shadow: var(--soporte73-header-shadow);
}

/* Buscador de productos */
#header .ct-header-product-search,
#header .ct-header-product-search .woocommerce-product-search {
	width: 100%;
	min-width: 0;
}

#header .ct-header-product-search .woocommerce-product-search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 48px;
	align-items: stretch;
	height: 48px;
}

#header .ct-header-product-search .search-field {
	width: 100%;
	min-width: 0;
	height: 48px;
	padding: 0 18px;
	color: var(--soporte73-header-ink);
	background: #f7f9fc;
	border: 1px solid var(--soporte73-header-border);
	border-inline-end: 0;
	border-radius: var(--soporte73-header-radius) 0 0 var(--soporte73-header-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#header .ct-header-product-search .search-field::placeholder {
	color: var(--soporte73-header-muted);
	opacity: 1;
}

#header .ct-header-product-search .search-field:hover {
	background: #ffffff;
	border-color: #bcc8d8;
}

#header .ct-header-product-search .search-field:focus {
	position: relative;
	z-index: 1;
	outline: 0;
	background: #ffffff;
	border-color: var(--soporte73-header-accent);
	box-shadow: 0 0 0 3px rgba(29, 99, 237, 0.16);
}

#header .ct-header-product-search .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-width: 48px;
	height: 48px;
	min-height: 48px;
	padding: 0;
	color: #ffffff;
	background: var(--soporte73-header-accent);
	border: 0;
	border-radius: 0 var(--soporte73-header-radius) var(--soporte73-header-radius) 0;
	box-shadow: none;
	transform: none;
	transition: background-color 0.15s ease;
}

#header .ct-header-product-search .wp-element-button:hover {
	color: #ffffff;
	background: var(--soporte73-header-accent-hover);
	transform: none;
}

#header .ct-header-product-search .wp-element-button:focus-visible {
	z-index: 2;
	outline: 3px solid rgba(29, 99, 237, 0.3);
	outline-offset: 2px;
}

#header .ct-header-product-search .wp-element-button .ct-icon,
#header .ct-header-product-search .wp-element-button svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Cuenta, carrito y disparador móvil: se conserva su comportamiento nativo. */
#header .ct-header-account .ct-account-item,
#header .ct-header-cart .ct-cart-item,
#header .ct-header-trigger {
	min-width: 44px;
	min-height: 44px;
	border-radius: 8px;
}

#header .ct-header-account .ct-account-item,
#header .ct-header-cart .ct-cart-item {
	gap: 8px;
	padding: 6px 8px;
	color: var(--soporte73-header-ink);
}

#header .ct-header-account .ct-account-item:hover,
#header .ct-header-cart .ct-cart-item:hover {
	color: var(--soporte73-header-accent);
	background: #f3f7ff;
}

#header .ct-header-account .ct-label,
#header .ct-header-cart .ct-label {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
}

#header .ct-header-account .ct-icon,
#header .ct-header-cart .ct-icon,
#header .ct-header-trigger .ct-icon {
	--theme-icon-size: 20px;
}

/* Navegación comercial de la segunda fila. */
#header [data-device="desktop"] [data-row*="bottom"] {
	color: #ffffff;
	background: var(--soporte73-header-nav);
}

#header [data-device="desktop"] [data-row*="bottom"] [class*="header-menu"],
#header [data-device="desktop"] [data-row*="bottom"] [class*="header-menu"] > .menu {
	width: 100%;
}

#header [data-device="desktop"] [data-row*="bottom"] [class*="header-menu"] > .menu {
	justify-content: space-between;
}

#header [data-device="desktop"] [data-row*="bottom"] .menu > li > .ct-menu-link {
	min-height: 44px;
	padding-inline: 10px;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

#header [data-device="desktop"] [data-row*="bottom"] .menu > li > .ct-menu-link:hover,
#header [data-device="desktop"] [data-row*="bottom"] .menu > li.current-menu-item > .ct-menu-link,
#header [data-device="desktop"] [data-row*="bottom"] .menu > li.current-menu-ancestor > .ct-menu-link {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.12);
}

#header [data-device="desktop"] [data-row*="bottom"] .menu > li > .ct-menu-link:focus-visible {
	outline-color: #ffffff;
	outline-offset: -3px;
}

/* Composición de escritorio: logo | buscador | cuenta y carrito. */
@media (min-width: 1000px) {
	#header [data-device="desktop"].soporte73-has-fixed-menu {
		padding-bottom: var(--soporte73-fixed-menu-height, 0px);
	}

	#header [data-device="desktop"] [data-row*="bottom"].soporte73-menu-is-fixed {
		position: fixed;
		top: var(--admin-bar, 0px);
		left: var(--theme-frame-size, 0px);
		right: calc(var(--theme-frame-size, 0px) + var(--scrollbar-width, 0px));
		z-index: 100;
	}

	#header [data-device="desktop"] [data-row*="bottom"] .soporte73-sticky-menu-logo {
		display: none;
	}

	#header [data-device="desktop"] [data-row*="bottom"].soporte73-menu-is-fixed [class*="header-menu"] {
		display: flex;
		align-items: center;
		gap: clamp(16px, 2vw, 28px);
	}

	#header [data-device="desktop"] [data-row*="bottom"].soporte73-menu-is-fixed .soporte73-sticky-menu-logo {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 105px;
		width: 105px;
		line-height: 0;
	}

	#header [data-device="desktop"] [data-row*="bottom"].soporte73-menu-is-fixed .soporte73-sticky-menu-logo img {
		display: block;
		width: 105px;
		height: auto;
		max-height: 50px;
		object-fit: contain;
	}

	#header [data-device="desktop"] [data-row*="bottom"].soporte73-menu-is-fixed [class*="header-menu"] > .menu {
		flex: 1 1 auto;
		min-width: 0;
	}

	#header [data-device="desktop"] [data-row*="middle"]:has(.ct-header-product-search)[data-column-set="3"] > div {
		grid-template-columns: minmax(150px, 0.7fr) minmax(360px, 2.3fr) minmax(190px, 0.9fr);
		column-gap: clamp(18px, 2.5vw, 38px);
	}

	#header [data-device="desktop"] [data-row*="middle"] .ct-header-product-search {
		--margin: 0;
	}

	#header [data-device="desktop"] [data-row*="middle"]:has(.ct-header-product-search) [data-column="middle"],
	#header [data-device="desktop"] [data-row*="middle"]:has(.ct-header-product-search) [data-column="middle"] > [data-items] {
		width: 100%;
		min-width: 0;
	}
}

/* Tablet y móvil: buscador en una fila completa. */
@media (max-width: 999.98px) {
	#header {
		--soporte73-header-shadow: 0 5px 18px rgba(16, 33, 59, 0.09);
	}

	#header [data-device="mobile"] [data-row]:has(.ct-header-product-search) > div {
		display: block;
		width: 100%;
		padding-block: 10px;
	}

	#header [data-device="mobile"] [data-row]:has(.ct-header-product-search) [data-column],
	#header [data-device="mobile"] [data-row]:has(.ct-header-product-search) [data-items],
	#header [data-device="mobile"] .ct-header-product-search {
		width: 100%;
		min-width: 0;
	}

	#header [data-device="mobile"] .ct-header-product-search {
		--margin: 0;
	}

	#header [data-device="mobile"] [data-row*="middle"][data-column-set="3"] > div {
		grid-template-columns: 44px minmax(0, 1fr) 44px;
		column-gap: 10px;
	}

	#header [data-device="mobile"] [data-row*="middle"] [data-column="start"] [data-items],
	#header [data-device="mobile"] [data-row*="middle"] [data-column="end"] [data-items] {
		justify-content: center;
	}

	#header [data-device="mobile"] [data-row*="middle"] [data-column="middle"] [data-items] {
		justify-content: center;
	}

	#header [data-device="mobile"] .ct-header-trigger,
	#header [data-device="mobile"] .ct-header-cart .ct-cart-item {
		padding: 8px;
	}

	#header [data-device="mobile"] .ct-header-cart .ct-label {
		display: none;
	}
}

@media (max-width: 689.98px) {
	#header .ct-header-product-search .woocommerce-product-search,
	#header .ct-header-product-search .search-field,
	#header .ct-header-product-search .wp-element-button {
		height: 46px;
		min-height: 46px;
	}

	#header .ct-header-product-search .woocommerce-product-search {
		grid-template-columns: minmax(0, 1fr) 46px;
	}

	#header .ct-header-product-search .wp-element-button {
		width: 46px;
		min-width: 46px;
	}

	#header .ct-header-product-search .search-field {
		padding-inline: 14px;
		font-size: 16px;
	}
}
