/* ========================================
   i鮮屋 RWD 響應式樣式
   斷點對齊參考站: 991px / 767px / 575px
   ======================================== */

/* === 平板 <= 991px === */
@media (max-width: 991px) {
	/* 公告列 */
	.ifresh-announcement-bar {
		font-size: 12px;
		padding: 4px 16px;
	}

	/* Footer 左右改上下 */
	.ifresh-footer-content {
		flex-direction: column;
	}

	.ifresh-footer-left {
		margin-bottom: 0;
	}

	.ifresh-footer-block {
		margin-bottom: 10px;
		padding: 7px 0;
		margin-right: 0 !important;
	}

	/* 聯絡項目改為上下排列 */
	.ifresh-contact-item {
		display: block;
		border-right: none;
		padding-right: 0;
		margin-right: 0;
		line-height: 16px;
		margin-bottom: 7px;
	}

	.ifresh-contact-item span,
	.ifresh-contact-item a {
		vertical-align: top;
		line-height: 24px;
	}

	/* 社群圖示 */
	.ifresh-footer-social {
		float: none;
		margin: 20px 0 33px 0;
	}

	.ifresh-footer-social .ifresh-social-icon {
		margin-bottom: 0;
	}

	/* 右側社群區 */
	.ifresh-footer-right {
		flex: none;
		padding-bottom: 40px;
	}

	/* Footer 分類連結 */
	.ifresh-cat-nav li {
		margin-right: 0;
		margin-bottom: 7px;
		padding-right: 10px;
	}
}

/* === 小平板 <= 767px === */
@media (max-width: 767px) {
	/* Logo 高度 — 手機版 */
	.ifresh-header .ast-primary-header-bar .custom-logo {
		height: 36px;
	}

	/* 手機版 Header 工具列 — 防止購物車 badge 溢出 */
	.ifresh-header .ast-primary-header-bar {
		padding-right: 6px;
	}

	/* 手機版購物車圖示 — 縮小 padding 避免超出邊界 */
	.ifresh-header .ast-header-woo-cart {
		padding: 0 2px;
	}

	/* 購物車 badge 位置微調 — 避免被裁切 */
	.ifresh-header .ast-site-header-cart .ast-addon-cart-wrap i .count,
	.ifresh-header .ast-cart-menu-wrap .count {
		right: -4px;
		top: -4px;
	}

	/* Footer 分類改雙欄 */
	.ifresh-cat-nav {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px 12px;
	}

	.ifresh-cat-nav li {
		margin-right: 0;
		padding-right: 0;
	}

	.ifresh-cat-nav a {
		font-size: 13px;
	}

	/* Footer 社群置中 */
	.ifresh-footer-social {
		text-align: center;
	}
}

/* === 手機版選單 popup 內 — 隱藏 Astra 原生 account/search 元件和多餘選單項 === */
@media (max-width: 921px) {
	/* 隱藏 popup 內的 Astra account 和 search 區塊（已用自訂區塊取代） */
	.ast-mobile-header-content .ast-header-account,
	.ast-mobile-header-content .ast-header-search {
		display: none !important;
	}

	/* 隱藏「查詢訂單」和「會員註冊/登入」（已移至帳戶區塊） */
	#menu-item-4739,
	#menu-item-4740 {
		display: none !important;
	}
}

/* === 手機版 Account Popup（全屏覆蓋式彈窗）=== */
.ifresh-mobile-account-popup {
	display: none;
}

@media (max-width: 921px) {
	/* 手機版隱藏桌面 dropdown */
	.ifresh-account-dropdown {
		display: none !important;
	}

	/* 手機版 Account Popup */
	.ifresh-mobile-account-popup {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999999;
		visibility: hidden;
		opacity: 0;
		transition: opacity 0.3s, visibility 0.3s;
	}

	.ifresh-mobile-account-popup.is-open {
		visibility: visible;
		opacity: 1;
	}

	/* 半透明背景遮罩 */
	.ifresh-mobile-account-popup-overlay {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
	}

	/* 彈窗面板 — 從右側滑入 */
	.ifresh-mobile-account-popup-inner {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 85%;
		max-width: 360px;
		background: #fff;
		transform: translateX(100%);
		transition: transform 0.3s ease;
		display: flex;
		flex-direction: column;
		overflow-y: auto;
	}

	.ifresh-mobile-account-popup.is-open .ifresh-mobile-account-popup-inner {
		transform: translateX(0);
	}

	/* 彈窗 Header */
	.ifresh-mobile-account-popup-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		border-bottom: 1px solid #e5e7eb;
		flex-shrink: 0;
	}

	.ifresh-mobile-account-popup-title {
		font-size: 16px;
		font-weight: 600;
		color: #1e293b;
	}

	.ifresh-mobile-account-popup-close {
		background: none;
		border: none;
		color: #64748b;
		cursor: pointer;
		padding: 4px;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: color 0.2s;
	}

	.ifresh-mobile-account-popup-close:hover {
		color: #1e293b;
	}

	/* 彈窗 Body */
	.ifresh-mobile-account-popup-body {
		padding: 20px;
		flex: 1;
	}

	/* 彈窗內按鈕 — 繼承桌面版 .ifresh-btn 樣式 */
	.ifresh-mobile-account-popup-body .ifresh-account-buttons {
		gap: 10px;
	}

	.ifresh-mobile-account-popup-body .ifresh-account-menu li {
		padding: 10px 4px;
	}

	.ifresh-mobile-account-popup-body .ifresh-account-menu li a {
		font-size: 15px;
	}
}

/* === Astra 手機選單底部帳戶區塊 === */
.ifresh-mobile-menu-account {
	padding: 20px;
	border-top: 1px solid #e5e7eb;
	margin-top: 16px;
}

.ifresh-mobile-menu-account-title {
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
}

/* 手機選單帳戶按鈕區 */
.ifresh-mobile-menu-account-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

.ifresh-mobile-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-mobile-btn-primary {
	background-color: #c5601f;
	color: #fff;
	border: 1px solid #c5601f;
}

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

.ifresh-mobile-btn-outline {
	background-color: transparent;
	color: #1e293b;
	border: 1px solid #d1d5db;
}

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

/* 手機選單帳戶連結列表 */
.ifresh-mobile-menu-account-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ifresh-mobile-menu-account-links li {
	padding: 8px 0;
}

.ifresh-mobile-menu-account-links li a {
	color: #1e293b;
	font-size: 14px;
	text-decoration: none;
	display: block;
	transition: color 0.2s;
}

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

/* === 手機選單內搜尋框 === */
.ifresh-mobile-menu-search {
	padding: 16px 20px 20px;
	border-top: 1px solid #e5e7eb;
	margin-bottom: 16px;
}

.ifresh-mobile-menu-search-title {
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-form {
	display: flex;
	align-items: center;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	overflow: hidden;
	transition: border-color 0.2s;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-form:focus-within {
	border-color: #c5601f;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-input {
	flex: 1;
	border: none;
	padding: 10px 12px;
	font-size: 14px;
	color: #1e293b;
	background: transparent;
	outline: none;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-input::placeholder {
	color: #9ca3af;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-submit {
	background: none;
	border: none;
	padding: 10px 12px;
	cursor: pointer;
	color: #64748b;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.ifresh-mobile-menu-search .ifresh-mobile-search-submit:hover {
	color: #c5601f;
}

/* === 手機 <= 575px === */
@media (max-width: 575px) {
	/* 防止水平溢出 */
	body {
		overflow-x: hidden;
	}

	.ifresh-announcement-bar {
		font-size: 12px;
		padding: 4px 10px;
		letter-spacing: 0;
	}

	.ifresh-announcement-inner {
		gap: 8px;
	}

	/* Footer 容器 padding 縮小 */
	.ifresh-footer-container {
		padding: 0 16px;
	}

	.ifresh-custom-footer > .ifresh-footer-container {
		padding-top: 30px;
		padding-bottom: 40px;
	}

	.ifresh-footer-copyright {
		padding: 10px 0;
		font-size: 12px;
	}
}
