/*
 * serviNec Header — snec-* namespace.
 * Importado desde assets/css/sections/header.css y cargado desde inc/enqueue.php.
 */

/* ── Variables propias del header ───────────────────────────────────────── */
:root {
	--snec-brand-blue: #0d65e9;
	--snec-brand-dark: #1b1b1b;
	--snec-brand-gray: #60646c;
	--snec-brand-light: #f2f3f5;
	--snec-brand-badge: #ffc107;
	--snec-topbar-h: 36px;
	--snec-mainbar-h: 80px;
	--snec-navbar-h: 48px;
	--snec-total-h: calc(var(--snec-topbar-h) + var(--snec-mainbar-h) + var(--snec-navbar-h));
}

/* ── Reset del header ────────────────────────────────────────────────────── */
.snec-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
	transition: box-shadow 0.25s ease;
}

.snec-header.snec-header--scrolled {
	box-shadow: 0 4px 12px rgba(0,0,0,.09);
}

/* Soporte para barra de administración de WordPress */
.admin-bar .snec-header {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar .snec-header {
		top: 46px;
	}
}

/* ── 1. Topbar ───────────────────────────────────────────────────────────── */
.snec-topbar {
	width: 100%;
	background: var(--snec-brand-dark);
	color: #fff;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: .02em;
	text-align: center;
	padding: 7px 16px;
	line-height: 1.4;
	box-sizing: border-box;
	max-height: 50px;
	opacity: 1;
	overflow: hidden;
	visibility: visible;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.25s ease,
	            padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0.3s ease;
}

/* Ocultar barra superior al hacer scroll */
.snec-header.snec-header--scrolled .snec-topbar,
body.is-scrolled .snec-topbar {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	visibility: hidden;
	pointer-events: none;
}

/* ── 2. Main bar ─────────────────────────────────────────────────────────── */
.snec-mainbar {
	background: #fff;
	border-bottom: 1px solid #f1f1f0;
}
.snec-mainbar__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: var(--snec-mainbar-h);
	max-width: 1280px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 40px);
}

/* Logo */
.snec-logo {
	flex-shrink: 0;
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	text-decoration: none;
	line-height: 1;
}
.snec-logo__servi {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 28px;
	font-weight: 900;
	font-style: italic;
	letter-spacing: -1px;
	color: #565f6c;
}
.snec-logo__nec {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 28px;
	font-weight: 900;
	font-style: italic;
	letter-spacing: -1px;
	color: var(--snec-brand-blue);
}
/* Custom logo image (cuando se configura en Apariencia → Personalizar) */
.snec-logo--image {
	display: flex;
	align-items: center;
	text-decoration: none;
}
/* WP genera su propio <a> con the_custom_logo(); lo neutralizamos */
.snec-logo--image .custom-logo-link {
	display: contents;
}
.snec-logo--image img,
.snec-logo--image .custom-logo {
	display: block;
	max-height: 52px;
	width: auto;
	object-fit: contain;
}

.snec-logo__bar {
	display: block;
	height: 3px;
	width: 100%;
	background: var(--snec-brand-blue);
	border-radius: 99px;
	margin-top: 3px;
}

/* Search */
.snec-search {
	flex: 1;
	max-width: 520px;
	margin-inline: auto;
}
.snec-search form {
	position: relative;
	width: 100%;
}
.snec-search__input {
	width: 100%;
	background: var(--snec-brand-light);
	color: #374151;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	border: none;
	border-radius: 999px;
	padding: 10px 44px 10px 20px;
	outline: none;
	transition: box-shadow .18s ease, background .18s ease;
	-webkit-appearance: none;
}
.snec-search__input::placeholder { color: #9ca3af; }
.snec-search__input:focus {
	background: #fff;
	box-shadow: 0 0 0 2px var(--snec-brand-blue);
}
.snec-search__btn {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #9ca3af;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color .15s;
}
.snec-search__btn:hover { color: #374151; }

/* Right side */
.snec-mainbar__right {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 20px;
}
.snec-help {
	color: #374151;
	display: flex;
	align-items: center;
	transition: color .15s;
}
.snec-help:hover { color: var(--snec-brand-blue); }
.snec-phone {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #111827;
	text-decoration: none;
	transition: color .15s;
}
.snec-phone:hover { color: var(--snec-brand-blue); }
.snec-phone__number {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -.3px;
	white-space: nowrap;
}

/* ── Shared icon size ────────────────────────────────────────────────────── */
.snec-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

/* ── 3. Navbar (blue) ────────────────────────────────────────────────────── */
.snec-navbar {
	background: var(--snec-brand-blue);
	position: relative;
}
.snec-navbar__inner {
	display: flex;
	align-items: center;
	height: var(--snec-navbar-h);
	max-width: 1280px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 40px);
	gap: 16px;
}

/* Nav menu links (desktop) */
.snec-navbar__nav {
	flex: 1;
	display: flex;
	justify-content: center;
}
.snec-nav {
	display: flex;
	align-items: center;
	gap: clamp(16px, 3vw, 36px);
	list-style: none;
	margin: 0;
	padding: 0;
}
.snec-nav li { margin: 0; }
.snec-nav a {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: rgba(255,255,255,.93);
	text-decoration: none;
	letter-spacing: .01em;
	padding: 4px 0;
	display: block;
	border-bottom: 2px solid transparent;
	transition: color .15s, border-color .15s;
}
.snec-nav a:hover,
.snec-nav .current-menu-item > a,
.snec-nav .current-page-ancestor > a {
	color: #fff;
	border-bottom-color: rgba(255,255,255,.6);
}

/* Action icons (right) */
.snec-navbar__actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 18px;
}
.snec-action {
	color: rgba(255,255,255,.9);
	display: flex;
	align-items: center;
	transition: color .15s;
	position: relative;
}
.snec-action:hover { color: #fff; }

/* Cart badge */
.snec-cart__badge {
	position: absolute;
	top: -6px;
	right: -8px;
	background: var(--snec-brand-badge);
	color: var(--snec-brand-dark);
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 10px;
	font-weight: 700;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* Hamburger */
.snec-hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: #fff;
}
.snec-hamburger__bar {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform .25s ease, opacity .2s ease;
}

/* ── Mobile drawer ───────────────────────────────────────────────────────── */
.snec-drawer {
	display: none;
	background: var(--snec-brand-blue);
	border-top: 1px solid rgba(255,255,255,.15);
	padding: 16px clamp(16px, 4vw, 40px) 20px;
}
.snec-drawer.is-open {
	display: block;
}
.snec-drawer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.snec-drawer__list a {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: rgba(255,255,255,.9);
	text-decoration: none;
	display: block;
	padding: 10px 4px;
	border-bottom: 1px solid rgba(255,255,255,.1);
	transition: color .15s;
}
.snec-drawer__list li:last-child a { border-bottom: none; }
.snec-drawer__list a:hover { color: #fff; }

/* Sub-menus mobile */
.snec-drawer__list ul {
	list-style: none;
	padding: 0 0 0 16px;
	margin: 4px 0 0;
}
.snec-drawer__list ul a {
	font-size: 14px;
	padding: 7px 4px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	/* Hide desktop nav + show hamburger */
	.snec-navbar__nav { display: none; }
	.snec-hamburger { display: flex; }

	/* Reorder: hamburger left, actions right */
	.snec-navbar__inner { justify-content: space-between; }
}

@media (max-width: 640px) {
	/* Shrink main bar */
	.snec-mainbar__inner { gap: 12px; }
	.snec-phone__number { display: none; }        /* hide phone number, keep icon */
	.snec-search { max-width: 100%; }
}

@media (max-width: 480px) {
	/* Full-width search, hide help icon */
	.snec-help { display: none; }
	.snec-logo__servi,
	.snec-logo__nec { font-size: 22px; }
}
