/**
 * ==========================================
 * GSTORE HEADER - REFATORADO
 * ==========================================
 * CSS limpo e sem conflitos com WordPress Block Theme
 * 
 * NOTA: Este arquivo substitui os estilos de header do style.css
 * Os seletores usam alta especificidade para garantir prioridade
 */

/* ========================================
   RESET WORDPRESS BLOCK THEME - ALTA PRIORIDADE
   ======================================== */

/* Reset agressivo para todo o header shell */
header.Gstore-header-shell,
header.Gstore-header-shell.wp-block-group,
.Gstore-header-shell,
.Gstore-header-shell.wp-block-group {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Reset de margens em todos os elementos do header */
header.Gstore-header-shell *,
header.Gstore-header-shell .wp-block-group,
.Gstore-header-shell *,
.Gstore-header-shell .wp-block-group {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* ========================================
   TOP BAR
   ======================================== */

.Gstore-top-bar {
	background-color: var(--gstore-color-bg-dark, #0a0a0a);
	color: var(--gstore-color-text-light, #fff);
	font-size: var(--gstore-font-size-sm);
}

.Gstore-top-bar__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 4px 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.Gstore-top-bar__contacts,
.Gstore-top-bar__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
}

.Gstore-top-bar__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--gstore-color-text-light, #fff);
	text-decoration: none;
	transition: color 0.2s ease;
}

.Gstore-top-bar__link:hover {
	color: var(--gstore-color-accent, #ff5c00);
}

.Gstore-top-bar__link .Gstore-icon {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* ========================================
   HEADER PRINCIPAL
   ======================================== */

.Gstore-header-shell {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	transition: transform 0.3s ease-in-out;
	will-change: transform;
}

.Gstore-header-shell.is-hidden {
	transform: translateY(-100%);
}

.Gstore-header-shell.is-visible {
	transform: translateY(0);
}

/* Compensação de espaço para o header fixo */
body:has(.Gstore-header-shell) {
	/* O padding será aplicado via JavaScript no .wp-site-blocks */
}

.wp-site-blocks {
	/* Padding será aplicado dinamicamente via JavaScript */
	transition: padding-top 0.3s ease-in-out;
}

.Gstore-header {
	background-color: var(--gstore-color-bg-dark, #0a0a0a);
}

.Gstore-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 6px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

/* Logo */
.Gstore-header__logo {
	font-size: var(--gstore-font-size-3xl);
	font-weight: var(--gstore-font-weight-bold);
	color: var(--gstore-color-text-light, #fff) !important;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: var(--gstore-letter-spacing-tight);
	white-space: nowrap;
	display: flex;
	align-items: center;
}

/* Logo com imagem (quando configurada) */
.Gstore-header__logo img {
	max-height: 36px;
	max-width: 180px;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
}

/* Site Logo Block - quando há logo configurada */
.Gstore-header__logo.wp-block-site-logo {
	display: flex;
	align-items: center;
}

.Gstore-header__logo.wp-block-site-logo img {
	max-height: 36px;
	max-width: 180px;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* Esconde o título quando há logo configurada (site-logo existe) */
.Gstore-header__content:has(.wp-block-site-logo) .Gstore-header__logo-text {
	display: none !important;
}

/* Mostra o título apenas quando não há logo */
.Gstore-header__logo-text {
	display: block;
}

.Gstore-logo-highlight {
	color: var(--gstore-color-accent, #ff5c00);
}

/* Barra de Pesquisa */
.Gstore-header__search-wrapper {
	flex: 1;
	max-width: 500px;
	margin: 0 20px;
}

.Gstore-header__search {
	width: 100%;
}

.Gstore-header__search .wp-block-search__inside-wrapper {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	overflow: hidden;
}

.Gstore-header__search .wp-block-search__input {
	background: transparent !important;
	border: none !important;
	color: var(--gstore-color-text-light, #fff) !important;
	padding: 10px 14px !important;
	font-size: var(--gstore-font-size-xs) !important;
}

.Gstore-header__search .wp-block-search__input::placeholder {
	color: var(--gstore-color-white-60) !important;
}

.Gstore-header__search .wp-block-search__button {
	background: var(--gstore-color-accent, #ff5c00) !important;
	border: none !important;
	padding: 10px 14px !important;
	color: var(--gstore-color-black) !important;
}

.Gstore-header__search .wp-block-search__button svg {
	fill: var(--gstore-color-black) !important;
	width: 18px;
	height: 18px;
}

/* Actions (carrinho + atendimento) */
.Gstore-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.Gstore-header__btn-atendimento {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	color: var(--gstore-color-text-light, #fff) !important;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	font-size: var(--gstore-font-size-sm);
	transition: all 0.2s ease;
}

.Gstore-header__btn-atendimento:hover {
	border-color: var(--gstore-color-accent, #ff5c00);
	color: var(--gstore-color-accent, #ff5c00) !important;
}

.Gstore-header__btn-atendimento .Gstore-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Menu Toggle (Hamburger) */
.Gstore-header__menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	padding: 4px;
	background: none;
	border: none;
	cursor: pointer;
}

.Gstore-header__menu-toggle span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: var(--gstore-color-accent, #ff5c00);
	transition: all 0.3s ease;
}

.Gstore-header__menu-toggle:focus {
	outline: none;
}

/* Animação do botão hamburger para X quando ativo */
@media (max-width: 767px) {
	.Gstore-header__menu-toggle.is-active span:nth-child(1) {
		transform: rotate(45deg) translate(7px, 7px);
	}

	.Gstore-header__menu-toggle.is-active span:nth-child(2) {
		opacity: 0;
		transform: translateX(-10px);
	}

	.Gstore-header__menu-toggle.is-active span:nth-child(3) {
		transform: rotate(-45deg) translate(7px, -7px);
	}
}

/* Mini Cart */
.Gstore-header__mini-cart {
	display: flex;
	align-items: center;
}

.Gstore-header__mini-cart .wc-block-mini-cart__button {
		background-color: var(--gstore-color-accent, #ff5c00) !important;
	border: none !important;
	border-radius: 4px !important;
	padding: 8px 12px !important;
}

/* ========================================
   NAVEGAÇÃO
   ======================================== */

.Gstore-nav-shell {
	background-color: var(--gstore-color-bg-darker, #1a1a1a);
	border-bottom: 1px solid var(--gstore-color-white-10);
}

.Gstore-nav__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

.Gstore-nav {
	width: 100%;
}

.Gstore-nav .wp-block-navigation__container {
	justify-content: center;
	gap: 32px;
}

.Gstore-nav .wp-block-navigation-item__content {
	color: var(--gstore-color-text-light, #fff) !important;
	padding: 12px 0;
	font-size: var(--gstore-font-size-sm);
	text-decoration: none;
	position: relative;
}

.Gstore-nav .wp-block-navigation-item__content::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--gstore-color-accent, #ff5c00);
	transition: width 0.2s ease;
}

.Gstore-nav .wp-block-navigation-item__content:hover::after {
	width: 100%;
}

.Gstore-nav__mobile-link {
	display: none;
}

/* ========================================
   MOBILE (até 767px)
   ======================================== */

@media (max-width: 767px) {
	/* Top bar escondida no mobile */
	.Gstore-top-bar {
		display: none;
	}
	
	/* Header principal */
	.Gstore-header__inner {
		padding: 6px 16px;
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-areas: "toggle logo actions";
		align-items: center;
		gap: 12px;
	}
	
	/* Menu toggle visível */
	.Gstore-header__menu-toggle {
		display: flex;
		grid-area: toggle;
	}
	
	/* Logo centralizada */
	.Gstore-header__logo,
	.Gstore-header__logo-text {
		grid-area: logo;
		justify-self: center;
		font-size: var(--gstore-font-size-2xl);
	}
	
	/* Logo image no mobile */
	.Gstore-header__logo.wp-block-site-logo {
		grid-area: logo;
		justify-self: center;
	}
	
	.Gstore-header__logo img,
	.Gstore-header__logo.wp-block-site-logo img {
		max-height: 32px;
		max-width: 140px;
	}
	
	/* Esconde barra de pesquisa no mobile */
	.Gstore-header__search-wrapper {
		display: none;
	}
	
	/* Actions */
	.Gstore-header__actions {
		grid-area: actions;
		gap: 8px;
	}
	
	/* Esconde botão de atendimento no mobile */
	.Gstore-header__btn-atendimento {
		display: none;
	}
	
	/* Mini cart ajustado */
	.Gstore-header__mini-cart .wc-block-mini-cart__button {
		padding: 6px 10px !important;
	}
	
	/* Navegação mobile - esconde navegação desktop no mobile */
	.Gstore-nav-shell {
		display: none;
	}

	
	.Gstore-nav__mobile-link .Gstore-icon {
		width: 18px;
		height: 18px;
		fill: currentColor;
	}
}

/* ========================================
   MOBILE DRAWER MENU
   ======================================== */

/* Drawer Container - Escondido por padrão */
.Gstore-mobile-drawer {
	display: none;
}

@media (max-width: 767px) {
	/* Mostra drawer apenas no mobile */
	.Gstore-mobile-drawer {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		z-index: var(--gstore-z-overlay, 300);
		pointer-events: none;
	}

	/* Overlay/Backdrop */
	.Gstore-mobile-drawer__overlay {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		backdrop-filter: blur(2px);
		opacity: 0;
		transition: opacity var(--gstore-transition-base, 250ms ease-in-out);
		pointer-events: none;
	}

	/* Drawer Content */
	.Gstore-mobile-drawer__content {
		position: absolute;
		top: 0;
		left: 0;
		width: 320px;
		max-width: 85vw;
		height: 100%;
		background-color: var(--gstore-color-bg-darker, #1a1a1a);
		box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
		transform: translateX(-100%);
		transition: transform var(--gstore-transition-base, 250ms ease-in-out);
		display: flex;
		flex-direction: column;
		overflow-y: auto;
		overflow-x: hidden;
		z-index: 301;
		pointer-events: auto;
	}

	/* Drawer aberto */
	.Gstore-mobile-drawer.is-open {
		pointer-events: auto;
	}

	.Gstore-mobile-drawer.is-open .Gstore-mobile-drawer__overlay {
		opacity: 1;
		pointer-events: auto;
	}

	.Gstore-mobile-drawer.is-open .Gstore-mobile-drawer__content {
		transform: translateX(0);
	}

	/* Drawer Header */
	.Gstore-mobile-drawer__header {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding: 16px;
		border-bottom: 1px solid var(--gstore-color-white-10, rgba(255, 255, 255, 0.1));
		flex-shrink: 0;
	}

	.Gstore-mobile-drawer__close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		background: none;
		border: none;
		cursor: pointer;
		color: var(--gstore-color-text-light, #fff);
		padding: 0;
		transition: color var(--gstore-transition-fast, 150ms ease);
	}

	.Gstore-mobile-drawer__close:hover,
	.Gstore-mobile-drawer__close:focus {
		color: var(--gstore-color-accent, #ff5c00);
		outline: none;
	}

	.Gstore-mobile-drawer__close .Gstore-icon {
		width: 24px;
		height: 24px;
		fill: currentColor;
	}

	/* Drawer Search */
	.Gstore-mobile-drawer__search {
		padding: 16px;
		border-bottom: 1px solid var(--gstore-color-white-10, rgba(255, 255, 255, 0.1));
		flex-shrink: 0;
	}

	.Gstore-mobile-drawer__search .Gstore-nav__search {
		width: 100%;
		max-width: 100%;
	}

	.Gstore-mobile-drawer__search .wp-block-search__inside-wrapper {
		display: flex;
		align-items: stretch;
		width: 100%;
		border: none;
		border-radius: 0;
		overflow: visible;
		background-color: transparent;
		gap: 0 !important;
		margin: 0 !important;
	}

	.Gstore-mobile-drawer__search .wp-block-search__input {
		flex: 1;
		padding: 10px 14px !important;
		background-color: var(--gstore-color-bg-dark, #0a0a0a) !important;
		border: 1px solid var(--gstore-color-border, rgba(255, 255, 255, 0.2)) !important;
		border-right: none !important;
		border-radius: 4px 0 0 4px !important;
		color: var(--gstore-color-text-light, #fff) !important;
		font-size: 0.875rem !important;
		outline: none !important;
		transition: border-color var(--gstore-transition-fast, 150ms ease);
		margin: 0 !important;
	}

	.Gstore-mobile-drawer__search .wp-block-search__input::placeholder {
		color: var(--gstore-color-text-secondary, rgba(255, 255, 255, 0.6));
	}

	.Gstore-mobile-drawer__search .wp-block-search__input:focus {
		border-color: var(--gstore-color-accent, #ff5c00) !important;
	}

	.Gstore-mobile-drawer__search .wp-block-search__button {
		padding: 10px 14px !important;
		background-color: var(--gstore-color-accent, #ff5c00) !important;
		border: 1px solid var(--gstore-color-accent, #ff5c00) !important;
		border-left: 1px solid var(--gstore-color-accent, #ff5c00) !important;
		border-radius: 0 4px 4px 0 !important;
		color: var(--gstore-color-bg-dark, #0a0a0a) !important;
		cursor: pointer;
		transition: all var(--gstore-transition-fast, 150ms ease);
		display: flex !important;
		align-items: center;
		justify-content: center;
		min-width: auto !important;
		margin: 0 !important;
	}

	.Gstore-mobile-drawer__search .wp-block-search__button:hover,
	.Gstore-mobile-drawer__search .wp-block-search__button:focus {
		background-color: var(--gstore-color-accent-hover, #ff6500) !important;
		outline: none;
		transform: translateY(-1px);
	}

	.Gstore-mobile-drawer__search .wp-block-search__button svg {
		width: 20px;
		height: 20px;
		fill: currentColor;
	}

	/* Drawer Navigation */
	.Gstore-mobile-drawer__nav {
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
	}

	.Gstore-mobile-drawer__nav .Gstore-nav {
		width: 100%;
	}

	.Gstore-mobile-drawer__nav .Gstore-nav .wp-block-navigation__container,
	.Gstore-mobile-drawer__nav .Gstore-nav--mobile .wp-block-navigation__container {
		flex-direction: column;
		gap: 0;
		width: 100%;
	}

	.Gstore-mobile-drawer__nav .wp-block-navigation-item {
		width: 100%;
	}

	.Gstore-mobile-drawer__nav .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		padding: 14px 16px;
		border-bottom: 1px solid var(--gstore-color-white-10, rgba(255, 255, 255, 0.1));
		color: var(--gstore-color-text-light, #fff) !important;
		text-decoration: none;
		font-size: var(--gstore-font-size-sm, 0.875rem);
		transition: background-color var(--gstore-transition-fast, 150ms ease);
	}

	.Gstore-mobile-drawer__nav .wp-block-navigation-item__content:hover,
	.Gstore-mobile-drawer__nav .wp-block-navigation-item__content:focus {
		background-color: var(--gstore-color-bg-dark, #0a0a0a);
		color: var(--gstore-color-accent, #ff5c00) !important;
		outline: none;
	}

	.Gstore-mobile-drawer__nav .wp-block-navigation-item__content::after {
		display: none;
	}

	/* Drawer Footer */
	.Gstore-mobile-drawer__footer {
		flex-shrink: 0;
		border-top: 1px solid var(--gstore-color-white-10, rgba(255, 255, 255, 0.1));
	}

	.Gstore-mobile-drawer__footer .Gstore-nav__mobile-link {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		padding: 14px 16px;
		color: var(--gstore-color-text-light, #fff) !important;
		text-decoration: none;
		background: var(--gstore-color-accent-10, rgba(255, 92, 0, 0.1));
		transition: background-color var(--gstore-transition-fast, 150ms ease);
	}

	.Gstore-mobile-drawer__footer .Gstore-nav__mobile-link:hover,
	.Gstore-mobile-drawer__footer .Gstore-nav__mobile-link:focus {
		background: var(--gstore-color-accent-20, rgba(255, 92, 0, 0.2));
		outline: none;
	}

	.Gstore-mobile-drawer__footer .Gstore-nav__mobile-link .Gstore-icon {
		width: 18px;
		height: 18px;
		fill: currentColor;
	}

	/* Prevenir scroll do body quando drawer está aberto */
	body.drawer-open {
		overflow: hidden;
		position: fixed;
		width: 100%;
	}
}

/* ========================================
   MOBILE PEQUENO (até 480px)
   ======================================== */

@media (max-width: 480px) {
	.Gstore-header__inner {
		padding: 6px 12px;
	}
	
	.Gstore-header__logo {
		font-size: var(--gstore-font-size-xl);
	}
}

/* ==========================================
 * SEARCH AUTOCOMPLETE (Sugestões)
 * ========================================== */
.Gstore-search-form--suggest .wp-block-search__inside-wrapper {
	position: relative;
	/* Permite o dropdown (position:absolute) aparecer fora do wrapper */
	overflow: visible !important;
}

.Gstore-search-suggest {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 9999;
	background: var(--gstore-color-bg, #ffffff);
	color: var(--gstore-color-text, #0a0a0a);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
	max-height: 320px;
	overflow: auto;
	padding: 8px;
}

.Gstore-search-suggest__title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: rgba(0, 0, 0, 0.6);
	padding: 8px 10px 6px;
}

.Gstore-search-suggest__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 8px;
	cursor: pointer;
}

.Gstore-search-suggest__item:hover,
.Gstore-search-suggest__item.is-active {
	background: rgba(0, 0, 0, 0.06);
}

.Gstore-search-suggest__left {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	overflow: hidden;
	border-radius: 8px;
}

.Gstore-search-suggest__img {
	/* Força thumbnail mesmo que existam regras globais de img */
	display: block !important;
	width: 44px !important;
	height: 44px !important;
	max-width: 44px !important;
	max-height: 44px !important;
	border-radius: 8px !important;
	object-fit: cover !important;
	background: rgba(0, 0, 0, 0.05);
}

.Gstore-search-suggest__img--placeholder {
	background: rgba(0, 0, 0, 0.06);
}

.Gstore-search-suggest__mid {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.Gstore-search-suggest__name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.Gstore-search-suggest__price {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.65);
}

.Gstore-search-suggest__item--category .Gstore-search-suggest__cat-icon {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.06);
	flex: 0 0 44px;
}

.Gstore-search-suggest__item--category .Gstore-search-suggest__cat-icon svg {
	width: 20px;
	height: 20px;
	opacity: 0.8;
}

/* Drawer (tema escuro) */
.Gstore-mobile-drawer .Gstore-search-suggest {
	background: var(--gstore-color-bg-dark, #0a0a0a);
	color: var(--gstore-color-text-light, #ffffff);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.Gstore-mobile-drawer .Gstore-search-suggest__title {
	color: rgba(255, 255, 255, 0.7);
}

.Gstore-mobile-drawer .Gstore-search-suggest__item:hover,
.Gstore-mobile-drawer .Gstore-search-suggest__item.is-active {
	background: rgba(255, 255, 255, 0.08);
}

.Gstore-mobile-drawer .Gstore-search-suggest__price {
	color: rgba(255, 255, 255, 0.7);
}