/**
 * Estilos del Header Público de Bersoft Theme (header.css)
 *
 * Arquitectura modular y desacoplada para tiendas, catálogos y sitios corporativos.
 * Dirección visual Makaha Surf: DM Sans, estética surf/lifestyle, proporciones compactas,
 * buscador tipo pill, Mega Drawer desktop de 2 paneles y Navegación Móvil Jerárquica Multinivel (Sección 45).
 *
 * @package Bersoft_Theme
 * @since   0.8.0
 */

:root {
	--bs-header-font: 'DM Sans', system-ui, -apple-system, sans-serif;
	--bs-header-bg: #ffffff;
	--bs-header-text: #0f172a;
	--bs-header-border: #f1f5f9;
	--bs-header-accent: #0071F9;
	--bs-header-badge: #FF5A1F;
}

/* ==========================================================================
   1. ESTRUCTURA GLOBAL DEL HEADER
   ========================================================================== */

.site-header.bs-header-composer {
	position: relative;
	background-color: var(--bs-header-bg);
	color: var(--bs-header-text);
	font-family: var(--bs-header-font);
	width: 100%;
	z-index: 1000;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.site-header.bs-header-composer.has-sticky-desktop {
	position: sticky;
	top: 0;
}

.site-header.bs-header-composer.is-scrolled {
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.bs-header-row {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
}

.bs-header-row.has-border-bottom {
	border-bottom: 1px solid var(--bs-header-border);
}

.bs-row-topbar {
	font-size: 12px;
	min-height: var(--bs-row-height, 36px);
}

.bs-row-main {
	min-height: var(--bs-row-height, 72px);
	padding: var(--bs-row-padding-y, 10px) 0;
}

.bs-row-bottom {
	min-height: var(--bs-row-height, 42px);
	background: #fafafa;
}

.bs-row-inner {
	width: 100%;
	max-width: 1280px;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
}

.bs-container-full .bs-row-inner {
	max-width: 100%;
	padding: 0 24px;
}

.bs-container-custom .bs-row-inner {
	max-width: var(--bs-row-max-w, 1280px);
}

.bs-header-zone {
	display: flex;
	align-items: center;
}

.bs-zone-left {
	flex: 0 0 auto;
}

.bs-zone-center {
	flex: 1 1 auto;
}

.bs-zone-right {
	flex: 0 0 auto;
}

/* ==========================================================================
   2. ELEMENTOS DEL HEADER
   ========================================================================== */

/* Logo */
.site-branding.bs-header-logo-wrap {
	display: flex;
	align-items: center;
	line-height: 1;
}

.site-branding.bs-header-logo-wrap img {
	max-height: 48px;
	width: auto;
	object-fit: contain;
	display: block;
}

.site-title-text {
	font-size: 20px;
	font-weight: 700;
	color: var(--bs-header-text);
	text-decoration: none;
	letter-spacing: -0.02em;
}

/* Botón Hamburguesa "Menú" */
.bs-menu-toggle-wrap {
	display: flex;
	align-items: center;
}

.bs-hamburger-btn {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 8px 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: #0f172a;
	font-family: var(--bs-header-font);
	font-size: 13px;
	font-weight: 600;
	transition: all 0.15s ease;
}

.bs-hamburger-btn:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: var(--bs-header-accent);
}

.bs-hamburger-icon {
	display: flex;
	flex-direction: column;
	gap: 3px;
	width: 16px;
}

.bs-hamburger-icon span {
	display: block;
	height: 2px;
	width: 100%;
	background: currentColor;
	border-radius: 1px;
}

/* Buscador Flexible Tipo Pill */
.bs-search-wrap {
	position: relative;
	width: 100%;
	max-width: 650px;
}

.bs-search-style-pill .bs-search-input-box {
	display: flex;
	align-items: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 9999px;
	padding: 4px 6px 4px 16px;
	transition: all 0.2s ease;
}

.bs-search-style-pill .bs-search-input-box:focus-within {
	background: #ffffff;
	border-color: var(--bs-header-accent);
	box-shadow: 0 0 0 3px rgba(0, 113, 249, 0.12);
}

.bs-search-field {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	font-family: var(--bs-header-font);
	font-size: 13px;
	color: #0f172a;
	padding: 6px 0;
}

.bs-search-field::placeholder {
	color: #94a3b8;
}

.bs-search-btn {
	background: var(--bs-header-accent);
	border: none;
	color: #ffffff;
	border-radius: 9999px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bs-search-btn:hover {
	background: #005fd1;
}

/* Resultados Predictivos AJAX */
.bs-search-results-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
	z-index: 1001;
	max-height: 380px;
	overflow-y: auto;
	padding: 8px;
}

.bs-search-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border-radius: 8px;
	text-decoration: none;
	color: #0f172a;
	transition: background 0.15s ease;
}

.bs-search-result-item:hover,
.bs-search-result-item.is-focused {
	background: #f1f5f9;
}

.bs-search-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 6px;
	background: #f8fafc;
}

.bs-search-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bs-search-title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.bs-search-price {
	font-size: 12px;
	font-weight: 600;
	color: var(--bs-header-accent);
}

.bs-search-view-all {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--bs-header-accent);
	text-decoration: none;
	border-top: 1px solid #f1f5f9;
	margin-top: 4px;
}

/* Acciones (Wishlist, Cuenta, Carrito) */
.bs-action-item {
	display: flex;
	align-items: center;
}

.bs-action-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: #0f172a;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 8px;
	border-radius: 6px;
	transition: color 0.15s ease;
}

.bs-action-link:hover {
	color: var(--bs-header-accent);
}

.bs-action-icon-box {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #334155;
}

.bs-cart-count {
	position: absolute;
	top: -6px;
	right: -8px;
	background: var(--bs-header-badge);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	height: 16px;
	min-width: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	line-height: 1;
}

/* Barra de Categorías Principales (Horizontal) */
.bs-categories-bar {
	width: 100%;
}

.bs-cat-bar-list {
	display: flex;
	align-items: center;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.bs-cat-bar-list::-webkit-scrollbar {
	display: none;
}

.bs-cat-bar-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #334155;
	text-decoration: none;
	padding: 8px 0;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.bs-cat-bar-link:hover {
	color: var(--bs-header-accent);
}

/* ==========================================================================
   3. MEGA DRAWER DESKTOP (2 PANELES)
   ========================================================================== */

.bs-header-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.4);
	backdrop-filter: blur(2px);
	z-index: 9998;
}

.bs-mega-drawer-panel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 820px;
	max-width: 90vw;
	background: #ffffff;
	z-index: 9999;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-mega-drawer-panel.is-open {
	transform: translateX(0);
}

.bs-mega-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid #e2e8f0;
}

.bs-mega-drawer-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
}

.bs-close-mega-drawer-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #64748b;
	padding: 4px;
	display: flex;
	align-items: center;
}

.bs-close-mega-drawer-btn:hover {
	color: #0f172a;
}

.bs-mega-drawer-body {
	display: flex;
	flex: 1;
	overflow: hidden;
	height: calc(100vh - 65px);
}

.bs-mega-drawer-primary-col {
	width: 250px;
	background: #f8fafc;
	border-right: 1px solid #e2e8f0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 12px 0;
}

.bs-mega-primary-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bs-mega-primary-item {
	margin: 2px 8px;
	border-radius: 6px;
	transition: background 0.15s ease;
}

.bs-mega-primary-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 500;
	color: #334155;
	text-decoration: none;
}

.bs-mega-primary-item.is-active,
.bs-mega-primary-item:hover {
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.bs-mega-primary-item.is-active .bs-mega-primary-link {
	color: var(--bs-header-accent);
	font-weight: 600;
}

.bs-mega-arrow {
	font-size: 16px;
	color: #94a3b8;
}

.bs-mega-drawer-secondary-col {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 24px;
	background: #ffffff;
}

.bs-mega-sub-panel {
	display: none;
}

.bs-mega-sub-panel.is-active {
	display: block;
}

.bs-mega-sub-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f1f5f9;
}

.bs-mega-sub-title {
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
}

.bs-mega-view-all-link {
	font-size: 13px;
	font-weight: 600;
	color: var(--bs-header-accent);
	text-decoration: none;
}

.bs-mega-sub-grid {
	display: grid;
	gap: 24px;
}

.bs-cols-1 { grid-template-columns: 1fr; }
.bs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bs-cols-4 { grid-template-columns: repeat(4, 1fr); }
.bs-cols-5 { grid-template-columns: repeat(5, 1fr); }

.bs-mega-group-title {
	font-size: 13px;
	font-weight: 700;
	margin: 0 0 10px 0;
}

.bs-mega-group-title a {
	color: #0f172a;
	text-decoration: none;
}

.bs-mega-grand-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bs-mega-grand-list a {
	font-size: 12px;
	color: #64748b;
	text-decoration: none;
	transition: color 0.15s ease;
}

.bs-mega-grand-list a:hover {
	color: var(--bs-header-accent);
}

.bs-mega-promo-banner {
	margin-top: 24px;
	padding: 16px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* ==========================================================================
   4. NAVEGACIÓN MÓVIL JERÁRQUICA MULTINIVEL (SECCIÓN 45)
   ========================================================================== */

.bs-mobile-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: 99999;
}

.bs-mobile-drawer .bs-drawer-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(2px);
}

.bs-mobile-drawer .bs-drawer-panel {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 88%;
	max-width: 380px;
	height: 100dvh;
	background: #ffffff;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-mobile-drawer.is-open .bs-drawer-panel {
	transform: translateX(0);
}

.bs-mobile-drawer.bs-drawer-pos-right .bs-drawer-panel {
	left: auto;
	right: 0;
	transform: translateX(100%);
}

.bs-mobile-drawer.bs-drawer-pos-right.is-open .bs-drawer-panel {
	transform: translateX(0);
}

.bs-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #f1f5f9;
}

.bs-drawer-close-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #64748b;
	padding: 4px;
}

.bs-drawer-body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bs-drawer-search .bs-search-input-wrap {
	display: flex;
	align-items: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 9999px;
	padding: 4px 8px 4px 14px;
}

.bs-mobile-multilevel-container {
	position: relative;
	width: 100%;
}

.bs-mobile-level {
	width: 100%;
}

.bs-mobile-level-head {
	padding-bottom: 10px;
	border-bottom: 1px solid #f1f5f9;
	margin-bottom: 8px;
}

.bs-mobile-level-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.bs-mobile-back-btn {
	background: none;
	border: none;
	color: var(--bs-header-accent);
	font-family: var(--bs-header-font);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.bs-mobile-category-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0 12px 0;
}

.bs-mobile-current-cat {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
}

.bs-mobile-view-all-link {
	font-size: 12px;
	font-weight: 600;
	color: var(--bs-header-accent);
	text-decoration: none;
}

.bs-mobile-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.bs-mobile-cat-item {
	border-bottom: 1px solid #f8fafc;
}

.bs-mobile-cat-trigger,
.bs-mobile-cat-link {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 4px;
	background: none;
	border: none;
	font-family: var(--bs-header-font);
	font-size: 14px;
	font-weight: 500;
	color: #1e293b;
	text-decoration: none;
	cursor: pointer;
	text-align: left;
}

.bs-mobile-cat-trigger:hover,
.bs-mobile-cat-link:hover {
	color: var(--bs-header-accent);
}

.bs-mobile-arrow {
	font-size: 18px;
	color: #94a3b8;
}

.bs-drawer-section {
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
}

.bs-drawer-section h4 {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	color: #94a3b8;
	margin: 0 0 10px 0;
	letter-spacing: 0.05em;
}

.bs-drawer-account {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bs-drawer-account-link,
.bs-drawer-wishlist-link {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	font-weight: 500;
	color: #1e293b;
	text-decoration: none;
}

.bs-drawer-contact ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bs-drawer-contact a {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #334155;
	text-decoration: none;
}

/* ==========================================================================
   5. RESPONSIVE ADAPTATIONS (Desktop, Tablet, Mobile)
   ========================================================================== */

@media (max-width: 1023px) {
	.bs-hide-tablet {
		display: none !important;
	}
	.bs-categories-bar {
		padding: 4px 0;
	}
	.bs-cat-bar-list {
		gap: 16px;
	}
}

@media (max-width: 767px) {
	.bs-hide-mobile {
		display: none !important;
	}
	.bs-row-main {
		padding: 6px 0;
		min-height: 56px;
	}
	.bs-row-inner {
		padding: 0 14px;
	}
	.bs-action-label,
	.bs-hamburger-text {
		display: none;
	}
}
