/**
 * 移动端菜单样式
 * 从 Shopify mobile-menu.css 迁移
 *
 * @package Laifen_Russia
 * @since 1.0.0
 */

/* ========== Header Section 定位 ========== */
.header-section,
.mobile-toggle-wrapper {
    position: relative;
}

/* ========== 移动端菜单抽屉 ========== */
.mobile-menu .sub-menu {
    transition: all 0.25s cubic-bezier(0.104, 0.204, 0.492, 1);
}

.mobile-menu-drawer {
	position: fixed;
    top: 57px; /* 从 header 下方开始 */
    left: 0;
    width: 100vw;
    height: calc(100vh - 57px); /* 减去 header 高度 */
    background: var(--color-header-bg, #fff);
    display: block;
    overflow-x: hidden;
	overflow-y: auto;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    will-change: opacity, transform;
    transform: translateY(-100%);
    transition: opacity 0.3s cubic-bezier(0.104, 0.204, 0.492, 1), 
                transform 0.3s cubic-bezier(0.104, 0.204, 0.492, 1),
                visibility 0.3s;
    scrollbar-width: none;
    z-index: 9998;
}

@media only screen and (min-width: 1024px) {
    .mobile-menu-drawer {
        top: 70px;
        height: calc(100vh - 70px);
}
}

.mobile-menu-drawer::-webkit-scrollbar {
    display: none;
}

@supports (height: 100dvh) {
    .mobile-menu-drawer {
        height: calc(100dvh - 60px);
    }
    
    @media only screen and (min-width: 1024px) {
        .mobile-menu-drawer {
            height: calc(100dvh - 70px);
        }
    }
}

.mobile-menu-drawer.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* 确保 header 在菜单展开时保持在上层 */
body.mobile-menu-open .header-section {
    z-index: 10000 !important;
    position: relative;
}

body.mobile-menu-open .header {
    z-index: 10001 !important;
    position: relative;
    background: var(--color-header-bg, #fff);
}

/* 确保汉堡菜单按钮可以点击 */
body.mobile-menu-open .mobile-menu-toggle {
    z-index: 10002 !important;
    position: relative;
}

.mobile-menu-drawer--inner {
    min-height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
}

/* 产品菜单容器 */
.mobile-menu__products--container {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 24px;
	padding: 20px 15px;
}

/* 单个产品菜单项 */
.mobile-menu__product-item {
	display: flex;
	align-items: center;
	padding: 16px;
	border-radius: 12px;
	background: linear-gradient(180deg, #F8F8F8 0%, #D6D6D6 100%);
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	min-height: 120px;
	position: relative;
	overflow: hidden;
}

.mobile-menu__product-item:hover,
.mobile-menu__product-item:active {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 产品图片 */
.mobile-menu__product-image {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	margin-right: 16px;
}

.mobile-menu__product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* 产品内容 */
.mobile-menu__product-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* 产品标题 */
.mobile-menu__product-title {
	font-size: 18px;
	font-weight: 600;
	color: #000;
	margin: 0 0 4px 0;
	line-height: 1.3;
}

/* 产品描述 */
.mobile-menu__product-desc {
	font-size: 13px;
	color: #666;
	margin: 0;
	line-height: 1.4;
}

/* CTA 模块 */
.mobile-menu__cta {
	margin: 24px 0;
	padding: 20px 15px;
	border-top: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
}

.mobile-menu__cta-button {
	display: block;
	width: 100%;
	padding: 14px 24px;
	background: #000;
	color: #fff;
	text-align: center;
	text-decoration: none;
	border-radius: 25px;
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 12px;
	transition: background 0.2s ease;
}

.mobile-menu__cta-button:hover {
	background: #333;
	color: #fff;
}

.mobile-menu__guarantee {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: #666;
	font-size: 13px;
}

.mobile-menu__guarantee svg {
	flex-shrink: 0;
	width: 13px;
	height: 15px;
}

.mobile-menu__guarantee p {
	margin: 0;
}

/* 次级菜单 */
.mobile-secondary-menu {
	list-style: none;
	padding: 0;
	margin: 24px 0;
}

.mobile-secondary-menu li {
	margin-bottom: 8px;
}

.mobile-secondary-menu a {
	display: block;
	padding: 12px 16px;
	color: #000;
	text-decoration: none;
	font-size: 16px;
	transition: background 0.2s ease;
	border-radius: 8px;
}

.mobile-secondary-menu a:hover {
	background: #f5f5f5;
}

/* 促销区域 */
.mega-menu-promotion {
	position: relative;
	margin-top: 24px;
	border-radius: 16px;
	overflow: hidden;
}

.mega-menu-promotion img {
	width: 100%;
	height: auto;
	display: block;
}

.mega-menu-promotion--cover {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
	color: #fff;
}

.mega-menu-promotion--cover .heading-font {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 8px 0;
}

.mega-menu-promotion--cover .text-button {
	display: inline-block;
	padding: 8px 16px;
	background: #fff;
	color: #000;
	text-decoration: none;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.2s ease;
}

.mega-menu-promotion--cover .text-button:hover {
	background: #f0f0f0;
}

/* 背景遮罩 */
body.mobile-menu-open::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* 响应式调整 */
@media (max-width: 374px) {
	.mobile-menu__product-image {
		height: 96px;
		margin-right: 12px;
	}
	
	.mobile-menu__product-title {
		font-size: 16px;
	}
	
	.mobile-menu__product-desc {
		font-size: 12px;
	}
	
	.mobile-menu__product-item {
		min-height: 100px;
		padding: 12px;
	}
}

@media (min-width: 1280px) {
	.mobile-menu-drawer {
		display: none;
	}
	
	.mobile-menu-toggle {
		display: none;
	}
}
