/* ========================================
   i鮮屋 Header 樣式
   對齊參考站 farmaroundyou.com 排版
   ======================================== */

/* === 公告列 === */
.ifresh-announcement-bar {
	color: #fff;
	text-align: center;
	padding: 4px 24px;
	font-size: 12px;
	line-height: 1.4;
	position: relative;
	z-index: 1001;
	letter-spacing: 0;
}

.ifresh-announcement-inner {
	max-width: 1350px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.ifresh-announcement-text {
	margin: 0;
	font-weight: 500;
	font-size: 20px;
}

@media (max-width: 767px) {
	.ifresh-announcement-text {
		font-size: 14px;
	}
}

.ifresh-announcement-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
	flex-shrink: 0;
}

.ifresh-announcement-close:hover {
	color: #fff;
}

/* 公告列隱藏狀態 */
.ifresh-announcement-bar.is-hidden {
	display: none;
}

/* === Astra Header 覆蓋 — Logo === */
.ifresh-header .ast-primary-header-bar {
	border-bottom: none;
	box-shadow: none;
}

/* Logo 區域 padding & 高度 */
.ifresh-header .ast-primary-header-bar .site-branding {
	padding: 15px 0;
}

.ifresh-header .ast-primary-header-bar .custom-logo {
	height: 56px;
	width: auto;
}

/* Primary Header — 確保三欄平衡 */
.ifresh-header .ast-builder-grid-row-container.ast-builder-grid-row-3-equal {
	grid-template-columns: 1fr auto 1fr;
}

/* 右側工具列 — 對齊右邊，緊湊排列 */
.ifresh-header .site-header-primary-section-right {
	justify-content: end;
	gap: 2px;
	padding: .5em;
}

/* 右側工具圖示間距 — 緊湊排列 */
.ifresh-header .ast-header-woo-cart,
.ifresh-header .ast-header-account-wrap,
.ifresh-header .ast-header-search {
	padding: 0 4px;
}

/* TW|TWD 文字區塊間距 */
.ifresh-header .ast-header-html-2 {
	padding: 0 4px;
}

/* Astra 預設 padding 覆蓋 */
.ifresh-header .ast-header-account {
	padding: 0 4px;
}

/* === Below Header 導航列 === */
.ifresh-header .ast-below-header-bar {
	border-top: none;
	border-bottom: none;
	box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.2);
}

/* 導航列高度 */
.ifresh-header .ast-below-header .ast-builder-grid-row {
	min-height: 40px;
}

/* 導航選單置中 */
.ifresh-header .ast-below-header .main-header-menu {
	justify-content: center;
}

.ifresh-header .ast-below-header .menu-item > a {
	font-size: 14px;
	font-weight: 500;
	color: #1e293b;
	padding: 8px 20px;
	letter-spacing: 0.3px;
	transition: color 0.2s;
}

.ifresh-header .ast-below-header .menu-item > a:hover,
.ifresh-header .ast-below-header .current-menu-item > a {
	color: #c5601f;
}

/* === Sticky Header === */
.ifresh-header-is-sticky .ifresh-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	animation: ifresh-slide-down 0.3s ease;
}

@keyframes ifresh-slide-down {
	from {
		transform: translateY(-100%);
	}
	to {
		transform: translateY(0);
	}
}

/* Sticky 時隱藏公告列 */
.ifresh-header-is-sticky .ifresh-announcement-bar {
	display: none;
}

/* Sticky 時的 body padding 補償 */
body.ifresh-header-is-sticky {
	padding-top: var(--ifresh-header-height, 130px);
}

/* === WooCommerce 購物車 Badge === */
.ifresh-header .ast-cart-menu-wrap .count {
	background-color: #c5601f;
	color: #fff;
	font-size: 11px;
	min-width: 18px;
	height: 18px;
	line-height: 18px;
	border-radius: 50%;
	text-align: center;
}

/* === Account Dropdown（參考農場晃晃 farmaroundyou.com）=== */

/* 讓 account wrap 成為 dropdown 的定位參考，並確保圖示垂直置中 */
.ifresh-header .ast-header-account-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

/* 修正帳號圖示整條 DOM 鏈的垂直對齊 — 覆蓋 Astra line-height/baseline 偏移 */
.ifresh-header .ast-header-account-inner-wrap {
	display: flex;
	align-items: center;
	line-height: 1;
}

.ifresh-header .ast-header-account-link {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.ifresh-header .ast-header-account-link .ahfb-svg-iconset {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

/* 手機版帳號圖示微調對齊 */
@media (max-width: 991px) {
	.ifresh-header .ast-header-account-type-icon .ahfb-svg-iconset {
		margin-top: 1px;
	}
}

/* 帳號圖示大小統一與購物車對齊 — 購物車用 font-size: 1.3em (=20.8px)，此處同步 */
.ifresh-header .ast-header-account-type-icon .ahfb-svg-iconset,
.ifresh-header .ast-header-account-type-icon .ahfb-svg-iconset svg {
	width: 1.3em;
	height: 1.3em;
}

/* 讓 account icon 可點擊切換 dropdown */
.ifresh-header .ast-header-account-wrap .ast-header-account-link {
	cursor: pointer;
}

/* Dropdown 面板 — 隱藏狀態（與 Astra 購物車 dropdown 完全一致） */
.ifresh-account-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	width: 280px;
	z-index: 999999;
	background: #fff;
	border: 1px solid var(--ast-border-color, #d1d5db);
	padding: 20px;
	left: -999em;
	opacity: 0;
	visibility: hidden;
	transition: 0.3s;
	margin-top: 10px;
}

/* 三角箭頭 — 外框（border 色） */
.ifresh-account-dropdown::before,
.ifresh-account-dropdown::after {
	bottom: 99.9%;
	left: auto;
	right: 8px;
	border: solid transparent;
	content: " ";
	height: 0;
	width: 0;
	position: absolute;
	pointer-events: none;
	transition: 0.3s;
}

.ifresh-account-dropdown::before {
	border-color: rgba(230, 230, 230, 0);
	border-bottom-color: var(--ast-border-color, #d1d5db);
	border-width: 7px;
	right: 7px;
}

/* 三角箭頭 — 白色填充 */
.ifresh-account-dropdown::after {
	border-color: rgba(255, 255, 255, 0);
	border-bottom-color: #fff;
	border-width: 6px;
	right: 8px;
	margin-bottom: -0.3px;
}

/* Dropdown 面板 — 顯示狀態（僅點擊 toggle） */
.ifresh-header .ast-header-account-wrap.is-active .ifresh-account-dropdown {
	left: auto;
	right: 0;
	opacity: 1;
	visibility: visible;
}

/* === 覆蓋 Astra 購物車 hover/focus dropdown — 改為僅點擊觸發 === */
.ast-site-header-cart:hover .widget_shopping_cart,
.ast-site-header-cart:focus .widget_shopping_cart,
.woocommerce .ast-site-header-cart:hover .widget_shopping_cart,
.woocommerce .ast-site-header-cart:focus .widget_shopping_cart {
	left: -999em !important;
	opacity: 0 !important;
	visibility: hidden !important;
}

/* 購物車 dropdown — 點擊顯示 */
.ast-site-header-cart.is-active .widget_shopping_cart,
.woocommerce .ast-site-header-cart.is-active .widget_shopping_cart {
	left: auto !important;
	right: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
}

/* 登入/註冊按鈕區 */
.ifresh-account-buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* 主要按鈕（會員登入）— 品牌色填滿 */
.ifresh-btn {
	display: block;
	width: 100%;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
	line-height: 1.4;
	box-sizing: border-box;
}

.ifresh-btn-primary {
	background-color: #c5601f;
	color: #fff;
	border: 1px solid #c5601f;
}

.ifresh-btn-primary:hover {
	background-color: #a84e17;
	border-color: #a84e17;
	color: #fff;
}

/* 次要按鈕（註冊新會員）— 外框樣式 */
.ifresh-btn-outline {
	background-color: transparent;
	color: #1e293b;
	border: 1px solid #d1d5db;
}

.ifresh-btn-outline:hover {
	border-color: #c5601f;
	color: #c5601f;
}

/* 分隔線 */
.ifresh-account-divider {
	border-top: 1px solid #e5e7eb;
	margin: 16px 0;
}

/* 已登入問候語 */
.ifresh-account-greeting {
	font-size: 14px;
	color: #1e293b;
	line-height: 1.5;
}

.ifresh-account-name {
	font-weight: 600;
}

/* 選單連結列表 */
.ifresh-account-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ifresh-account-menu li {
	padding: 8px 4px;
	border-radius: 5px;
	transition: background-color 0.15s ease;
}

.ifresh-account-menu li:hover {
	background-color: #f3f4f6;
}

.ifresh-account-menu li a {
	color: #1e293b;
	font-size: 14px;
	text-decoration: none;
	display: block;
	width: 100%;
	font-weight: 400;
}

.ifresh-account-menu li a:hover {
	color: #c5601f;
}

/* === WooCommerce 錯誤/成功通知 — icon 與文字不重疊 === */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
	padding-left: 44px !important;
}

/* === WooCommerce 通知滾動偏移 — sticky header 啟用時避免遮蔽 === */
body.ifresh-header-is-sticky .woocommerce-NoticeGroup,
body.ifresh-header-is-sticky .woocommerce-error,
body.ifresh-header-is-sticky .woocommerce-message,
body.ifresh-header-is-sticky .woocommerce-info {
	scroll-margin-top: calc(var(--ifresh-header-height, 130px) + 20px);
}

/* === 頁面標題對齊 — 與 entry-content 內容寬度一致 === */
.entry-header.ast-no-thumbnail .entry-title {
	max-width: 1440px;
	margin-left: auto;
	margin-right: auto;
}

/* === Elementor 全寬背景 — 突破 boxed 容器限制 === */
.elementor-element-a7baaf3,
.elementor-element-e4612be {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
}
