﻿/* ============================================
   Mehregan Theme - Ultra Professional E-commerce
   Version: 2.2
   ============================================ */

/* ============================================
   CSS Variables - Premium Color System
   ============================================ */
:root {
    /* Primary Colors */
    --mg-primary: #2563eb;
    --mg-primary-dark: #1d4ed8;
    --mg-primary-light: #3b82f6;
    --mg-primary-rgb: 37, 99, 235;
    --mg-secondary: #7c3aed;
    --mg-secondary-dark: #6d28d9;
    --mg-secondary-rgb: 124, 58, 237;
    --mg-accent-rgb: 245, 158, 11;
    --mg-accent: #f59e0b;
    --mg-accent-light: #fbbf24;
    
    /* Neutral Colors */
    --mg-bg: #ffffff;
    --mg-surface: #f8fafc;
    --mg-surface-hover: #f1f5f9;
    --mg-text: #0f172a;
    --mg-text-muted: #64748b;
    --mg-border: #e2e8f0;
    
    /* Semantic Colors */
    --mg-success: #10b981;
    --mg-error: #ef4444;
    --mg-warning: #f59e0b;
    
    /* Gradients - Theme Aware */
    --mg-gradient-primary: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-secondary) 100%);
    --mg-gradient-vibrant: linear-gradient(135deg, var(--mg-accent) 0%, var(--mg-primary) 100%);
    --mg-gradient-ocean: linear-gradient(135deg, var(--mg-primary-light) 0%, var(--mg-accent) 100%);
    --mg-gradient-sunset: linear-gradient(135deg, var(--mg-accent) 0%, var(--mg-primary) 100%);
    --mg-gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    --mg-gradient-emerald: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-accent) 100%);
    
    /* Flash Sale Colors - Customizable */
    --mg-flash-bg-1: #0c1e3a;
    --mg-flash-bg-2: #1a4878;
    --mg-flash-glow: #dc2626;
    --mg-flash-banner-1: #ff416c;
    --mg-flash-banner-2: #ff4b2b;
    --mg-flash-accent: #fbbf24;
    --mg-home-card-height: 365px;
    --mg-home-card-height-md: 335px;
    --mg-home-card-height-sm: 290px;
    
    /* Spacing - Compact */
    --mg-spacing-xs: 0.35rem;
    --mg-spacing-sm: 0.75rem;
    --mg-spacing-md: 1rem;
    --mg-spacing-lg: 1.5rem;
    --mg-spacing-xl: 2.5rem;
    --mg-spacing-2xl: 4rem;
    --mg-widget-top-gap: clamp(1rem, 1.8vw, 1.5rem);
    --mg-widget-top-gap-mobile: clamp(0.75rem, 3vw, 1rem);
    
    /* Border Radius - Refined */
    --mg-radius: 12px;
    --mg-radius-sm: 8px;
    --mg-radius-lg: 16px;
    --mg-radius-xl: 20px;
    --mg-radius-full: 9999px;
    
    /* Shadows - Modern & Deep */
    --mg-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --mg-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
    --mg-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
    --mg-shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, 0.15);
    --mg-shadow-xl: 0 24px 60px -16px rgba(0, 0, 0, 0.2);
    --mg-shadow-glow: 0 0 40px -10px var(--mg-primary);
    --mg-shadow-colored: 0 20px 50px -15px rgba(var(--mg-primary-rgb), 0.35);
    
    /* Transitions */
    --mg-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --mg-transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --mg-transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll; /* ثابت نگه داشتن scrollbar برای جلوگیری از layout shift */
    overflow-x: clip;   /* clip به جای hidden - scroll context ایجاد نمیکنه */
    /* مخفی کردن visual اسکرول‌بار (فضایش رزرو شده ولی نمایان نیست) */
    /* مخفی‌سازی اسکرول‌بار المنت‌های داخلی (modal، منو موبایل و...) از قانون `*` در پایین فایل می‌آید */
}

input, select, textarea, button, optgroup, option {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--mg-text);
    background-color: var(--mg-bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    /* overflow-y حذف شد - html آن را مدیریت میکند تا از double scroll container جلوگیری شود */
    /* scrollbar-gutter حذف شد - با html { overflow-y: scroll } جای اسکرول‌بار رزرو می‌شه */
    width: 100%;
    max-width: 1920px;
    margin-inline: auto;
    position: relative;
}

/* بهبود Body در موبایل */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--mg-primary);
    text-decoration: none;
    transition: var(--mg-transition);
}

a:hover {
    color: var(--mg-secondary);
}

::selection {
    background-color: var(--mg-primary);
    color: #ffffff;
}

/* ============================================
   Typography - Premium
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--mg-spacing-sm);
    color: var(--mg-text);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
.mg-page-title { font-size: 1.5rem; }
.mg-page-content-inner { padding: 2rem 0; }
.wc-block-cart__empty-cart__title { font-size: 1.2rem !important; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* ============================================
   Container
   ============================================ */
.mg-container {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 2vw, 2rem);
    padding-block: 0;
    box-sizing: border-box;
    overflow-x: hidden; /* fallback for browsers without clip support */
    overflow-x: clip;   /* modern: clips without blocking sticky children */
}

@media (min-width: 1400px) {
    .mg-container {
        max-width: 1400px;
    }
}

@media (min-width: 1600px) {
    .mg-container {
        max-width: 1480px;
    }
}

/* بهبود Container در موبایل */
@media (max-width: 768px) {
    .mg-container {
        padding-inline: 1.25rem;
    }
}

@media (max-width: 576px) {
    .mg-container {
        padding-inline: 1rem;
    }
}

/* ============================================
   Sections - Premium Styling
   ============================================ */
.mg-section {
    padding: var(--mg-spacing-xl) 0;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* بهبود Section padding در موبایل */
@media (max-width: 768px) {
    .mg-section {
        padding: var(--mg-spacing-lg) 0;
    }
}

@media (max-width: 576px) {
    .mg-section {
        padding: var(--mg-spacing-md) 0;
    }
}

/* جلوگیری از overflow در تمام بخش‌ها */
.mg-section *,
.mg-container * {
    max-width: 100%;
    box-sizing: border-box;
}

/* بهبود Swiper در موبایل */
@media (max-width: 768px) {
    .swiper {
        overflow: visible;
    }
    
    .swiper-wrapper {
        overflow: visible;
    }
    
    .swiper-slide {
        width: auto;
        min-width: 0;
    }
}

.mg-section-header {
    text-align: center;
    margin-bottom: var(--mg-spacing-lg);
    position: relative;
}

/* بهبود Section Header در موبایل */
@media (max-width: 768px) {
    .mg-section-header {
        margin-bottom: var(--mg-spacing-md);
        padding: 0 var(--mg-spacing-sm);
    }
}

@media (max-width: 576px) {
    .mg-section-header {
        margin-bottom: var(--mg-spacing-sm);
    }
}

.mg-section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    margin-bottom: var(--mg-spacing-xs);
    color: var(--mg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

/* بهبود Section Title در موبایل */
@media (max-width: 768px) {
    .mg-section-title {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
        gap: 0.4rem;
    }
    
    .mg-section-title svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .mg-section-title {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }
}

.mg-section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-full);
}

.mg-section-title svg {
    width: 24px;
    height: 24px;
    color: var(--mg-primary);
}

.mg-section-subtitle {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
    margin-top: var(--mg-spacing-sm);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* بهبود Section Subtitle در موبایل */
@media (max-width: 768px) {
    .mg-section-subtitle {
        font-size: 0.85rem;
        max-width: 100%;
        padding: 0 var(--mg-spacing-sm);
    }
}

@media (max-width: 576px) {
    .mg-section-subtitle {
        font-size: 0.8rem;
    }
}

/* ============================================
   Buttons - Premium Design
   ============================================ */
.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--mg-radius-sm);
    cursor: pointer;
    transition: var(--mg-transition);
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 44px; /* حداقل اندازه برای touch target */
    min-width: 44px;
}

/* بهبود دکمه‌ها در موبایل */
@media (max-width: 768px) {
    .mg-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
}

@media (max-width: 576px) {
    .mg-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        min-height: 48px;
    }
    /* دکمه‌های داخل کارت محصول نباید full-width باشن */
    .mg-product-card .mg-btn,
    .mg-add-to-cart {
        width: auto;
        min-width: auto;
        min-height: unset;
    }
}

.mg-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: var(--mg-transition);
}

.mg-btn:hover::before {
    opacity: 1;
    /* color: floralwhite; */
}

.mg-btn-primary {
    background: var(--mg-gradient-primary);
    color: #ffffff;
    box-shadow: var(--mg-shadow-colored);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-btn-primary:hover {
    transform: scale3d(1.02, 1.02, 1) translateY(-4px);
    box-shadow: 0 25px 60px -15px rgba(var(--mg-primary-rgb), 0.5);
}

.mg-btn-primary:active {
    transform: translate3d(0, -1px, 0) scale(1);
}

.mg-btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    border-radius: var(--mg-radius);
}

.mg-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--mg-radius-sm);
}

.mg-btn-secondary {
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary-dark);
    border: 1px solid rgba(var(--mg-primary-rgb), 0.18);
    box-shadow: 0 14px 32px -28px rgba(var(--mg-primary-rgb), 0.55);
}

.mg-btn-secondary:hover {
    background: rgba(var(--mg-primary-rgb), 0.14);
    color: var(--mg-primary-dark);
    border-color: rgba(var(--mg-primary-rgb), 0.28);
    transform: translateY(-2px);
}

.mg-btn-secondary:active {
    transform: translateY(0);
}

.mg-btn-block {
    display: flex;
    width: 100%;
}

/* دکمه افزودن به سبد در موبایل - مشابه دسکتاپ */
@media (max-width: 767px) {
    .mg-add-to-cart {
        padding: 0.4rem 0.7rem;
        font-size: 0.72rem;
        width: auto;
        min-width: auto;
        border-radius: var(--mg-radius-sm);
        gap: 0.3rem;
    }
    .mg-add-to-cart svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
}

/* ============================================
   Top Bar - Sleek Design
   ============================================ */
.mg-top-bar {
    background: var(--mg-gradient-primary);
    color: #ffffff;
    padding: 0.625rem 0;
    font-size: 0.875rem;
}


.mg-top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.mg-top-bar-left,
.mg-top-bar-right {
    flex: 1;
}

.mg-top-bar-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.mg-top-bar .mg-social-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* در موبایل: دو ردیف دو ستونه (۲ آیکن بالا، ۲ آیکن پایین) */
@media (max-width: 640px) {
    .mg-top-bar .mg-social-links {
        display: grid;
        grid-template-columns: repeat(2, auto);
        grid-auto-rows: auto;
        gap: 0.25rem 0.4rem;
        justify-items: center;
    }

}

.mg-top-bar .mg-social-links .mg-social-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    padding: 0;
    border-radius: 10px;
    color: var(--mg-primary);
    background: rgba(255, 255, 255, 0.84);
    background: color-mix(in srgb, #ffffff 84%, var(--mg-primary) 16%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    opacity: 1;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mg-top-bar .mg-social-links .mg-social-icon svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.mg-top-bar .mg-social-links .mg-social-icon:hover {
    color: #ffffff;
    background: var(--mg-primary-light);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    transform: translate3d(0, -2px, 0);
}

.mg-top-bar .mg-social-links .mg-social-icon:hover svg {
    color: currentColor;
}

@media (max-width: 640px) {
    .mg-top-bar .mg-social-links .mg-social-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
}

.mg-top-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--mg-spacing-lg);
}

.mg-top-bar-phone {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0.4rem;
    color: #ffffff;
    font-weight: 500;
    transition: var(--mg-transition);
}

.mg-top-bar-phone:hover {
    opacity: 0.85;
    color: #ffffff;
}

.mg-top-bar-phone svg {
    opacity: 0.9;
}

@media (max-width: 768px) {
    /* در موبایل کل بخش تلفن (آیکن + شماره) مخفی بشه */
    .mg-top-bar-phone {
        display: none;
    }

    .mg-top-bar-right {
        gap: var(--mg-spacing-sm);
    }
}

/* ============================================
   Header - Glass Morphism
   ============================================ */
.mg-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    position: sticky;
    top: var(--mg-header-fixed-top, 0px);
    z-index: 1000;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mg-header.is-fixed {
    position: fixed;
    top: var(--mg-header-fixed-top, 0px);
    right: 0;
    left: 0;
    width: min(100%, 1920px);
    margin-inline: auto;
}

.mg-header-stick-marker {
    display: block;
    height: 0;
}

.mg-header-placeholder {
    display: none;
    height: 0;
}

.mg-header-placeholder.is-active {
    display: block;
}

body.admin-bar .mg-top-bar {
    padding-top: calc(0.625rem + var(--wp-admin--admin-bar--height, 32px));
}

body.admin-bar .mg-header {
    top: var(--mg-header-fixed-top, 0px);
}

.mg-header.scrolled {
    box-shadow: var(--mg-shadow);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Full-bleed page heroes should meet the header without a tinted seam. */
body:has(.elementor-widget-mehregan_contact_page) .mg-header,
body:has(.elementor-widget-mehregan_about_page) .mg-header {
    border-bottom-color: transparent;
}

.mg-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    gap: var(--mg-spacing-lg);
}

.mg-logo-wrapper,
.mg-header-actions {
    display: flex;
    align-items: center;
}

.mg-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mg-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--mg-transition);
}

.mg-logo:hover {
    color: var(--mg-primary);
    transform: scale(1.02);
}

.mg-custom-logo-img {
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.mg-site-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mg-text);
    transition: var(--mg-transition);
}

.mg-logo:hover .mg-site-name {
    color: var(--mg-primary);
}

@media (max-width: 768px) {
    .mg-site-name {
        font-size: 1rem;
    }
}

/* ============================================
   Navigation — Desktop
   ============================================ */
.mg-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.mg-primary-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.mg-primary-menu > li {
    position: relative;
}

/* لینک‌های اصلی منو */
.mg-primary-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 1rem;
    color: var(--mg-text);
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: var(--mg-radius);
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.mg-primary-menu > li > a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--mg-radius);
    background: var(--mg-gradient-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.mg-primary-menu > li > a:hover {
    color: var(--mg-primary);
    background: color-mix(in srgb, var(--mg-primary) 10%, transparent);
}

.mg-primary-menu > li.current-menu-item > a,
.mg-primary-menu > li.current-menu-ancestor > a {
    color: var(--mg-text);
    background: transparent;
    font-weight: 600;
}

/* نشانگر آیتم فعال */
.mg-primary-menu > li.current-menu-item > a::after,
.mg-primary-menu > li.current-menu-ancestor > a::after {
    content: none;
    display: none;
}

/* فلش dropdown */
.mg-dropdown-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    opacity: 0.6;
    flex-shrink: 0;
}

/* آیتم اصلی نوار: فلش می‌چرخد */
.mg-primary-menu > li.mg-has-dropdown:hover > a .mg-dropdown-arrow,
.mg-primary-menu > li.mg-has-dropdown.active > a .mg-dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* زیردسته‌های داخل dropdown: فلش ثابت */
.mg-submenu li.mg-has-dropdown > a .mg-dropdown-arrow {
    transition: none;
    transform: rotate(90deg);
}
.mg-submenu li.mg-has-dropdown:hover > a .mg-dropdown-arrow,
.mg-submenu li.mg-has-dropdown.active > a .mg-dropdown-arrow {
    opacity: 1;
    transform: rotate(90deg);
}

/* ============================================
   Dropdown Submenu — Desktop
   ============================================ */
.mg-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.mg-has-dropdown:hover > .mg-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mg-submenu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    color: var(--mg-text);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: calc(var(--mg-radius) - 2px);
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.mg-submenu li a:hover {
    background: color-mix(in srgb, var(--mg-primary) 10%, transparent);
    color: var(--mg-primary);
}

/* ============================================
   Header Action Icons
   ============================================ */
.mg-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 993px) {
    .mg-header-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 1.25rem;
        min-height: 60px;
    }

    .mg-logo-wrapper {
        justify-self: start;
    }

    .mg-nav {
        justify-self: center;
    }

    .mg-header-actions {
        justify-self: end;
        justify-content: flex-end;
    }

    /* Nested submenu: flyout to the side (RTL = right: 100%) */
    .mg-submenu li {
        position: relative;
    }

    .mg-submenu li.mg-has-dropdown > .mg-submenu {
        top: 0;
        right: 100%;
        left: auto;
        transform: translateX(8px);
    }

    .mg-submenu li.mg-has-dropdown:hover > .mg-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
}

.mg-search-toggle,
.mg-wishlist-link,
.mg-cart-link,
.mg-account-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-text);
    width: 40px;
    height: 40px;
    border-radius: var(--mg-radius);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.mg-search-toggle:hover,
.mg-wishlist-link:hover,
.mg-cart-link:hover,
.mg-account-link:hover {
    background: color-mix(in srgb, var(--mg-primary) 10%, transparent);
    color: var(--mg-primary);
    transform: translateY(-2px);
}

.mg-cart-count,
.mg-wishlist-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--mg-gradient-vibrant);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mg-radius-full);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ============================================
   Hamburger Button
   ============================================ */
.mg-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.45rem;
    width: 42px;
    height: 42px;
    justify-content: center;
    align-items: center;
    border-radius: var(--mg-radius);
    transition: background 0.2s ease;
    position: relative;
    z-index: 1200;
}

.mg-nav-toggle:hover {
    background: color-mix(in srgb, var(--mg-primary) 10%, transparent);
}

.mg-nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--mg-text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.2s ease;
    transform-origin: center;
}

.mg-nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--mg-primary);
}
.mg-nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mg-nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--mg-primary);
}

/* ============================================
   Mobile Nav Drawer
   ============================================ */
@media (max-width: 992px) {
    .mg-nav-toggle { display: flex; }

    .mg-nav-close-toggle {
        display: none !important;
    }

    /* آیکن‌های تکراری هدر در موبایل (به‌جای آن نوار پایین داریم) */
    .mg-cart-link,
    .mg-account-link {
        display: none;
    }

    /* Overlay پشت منو */
    body.menu-open .mg-header {
        z-index: 1000;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body.menu-open .mg-nav-close-toggle {
        display: flex !important;
        position: fixed !important;
        top: max(1rem, env(safe-area-inset-top));
        left: 1rem;
        right: auto;
        z-index: 1300;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.menu-open .mg-nav-close-toggle:hover {
        background: transparent !important;
    }

    body.menu-open .mg-nav-close-toggle span {
        background: var(--mg-primary);
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1190;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .mg-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100dvh;
        background: var(--mg-bg);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
        z-index: 1200;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
        padding: 80px 1.25rem 2rem;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important; /* override the display:none */
    }

    .mg-nav.active {
        right: 0;
    }

    /* منوی موبایل — آیتم‌های اصلی */
    .mg-primary-menu {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }

    .mg-primary-menu > li {
        border-bottom: 1px solid var(--mg-border);
    }

    .mg-primary-menu > li:last-child {
        border-bottom: none;
    }

    .mg-primary-menu > li > a {
        padding: 0.9rem 0.5rem;
        font-size: 1rem;
        font-weight: 600;
        width: 100%;
        border-radius: 0;
        justify-content: center;
    }

    .mg-primary-menu > li.mg-has-dropdown > a {
        gap: 0.35rem;
    }

    .mg-primary-menu > li.mg-has-dropdown > a .mg-dropdown-arrow {
        margin: 0;
    }

    .mg-primary-menu li.mg-has-dropdown > a .mg-dropdown-arrow,
    .mg-primary-menu li.mg-has-dropdown:hover > a .mg-dropdown-arrow,
    .mg-primary-menu li.mg-has-dropdown.active > a .mg-dropdown-arrow {
        opacity: 0.65;
        transform: rotate(0deg) !important;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    .mg-primary-menu li.mg-has-dropdown.is-open > a .mg-dropdown-arrow,
    .mg-primary-menu li.mg-has-dropdown.is-open:hover > a .mg-dropdown-arrow,
    .mg-primary-menu li.mg-has-dropdown.is-open.active > a .mg-dropdown-arrow {
        opacity: 1;
        transform: rotate(180deg) !important;
    }

    .mg-primary-menu > li > a:hover,
    .mg-primary-menu > li.current-menu-item > a {
        background: transparent;
        color: var(--mg-text);
    }

    .mg-primary-menu > li.current-menu-item > a::after {
        display: none; /* hide dot indicator on mobile */
    }

    /* Dropdown submenu — accordion on mobile */
    .mg-submenu {
        position: static;
        opacity: 1;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: var(--mg-radius);
        padding: 0;
        background: transparent;
        margin: 0;
        transition: max-height 0.3s ease, visibility 0.3s ease;
    }

    .mg-has-dropdown.is-open > .mg-submenu {
        visibility: visible;
        max-height: 400px;
        margin: 0.25rem 0 0.6rem;
    }

    .mg-submenu li a {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        border-radius: 0;
        color: var(--mg-text-muted);
        justify-content: center;
    }

    .mg-submenu li a:hover {
        background: transparent;
        color: var(--mg-primary);
    }
}

/* ============================================
   Search Modal - Premium
   ============================================ */
.mg-search-modal {
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 1.5rem;
}

.mg-search-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.mg-search-modal-content {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-xl);
    padding: var(--mg-spacing-lg);
    max-width: 720px;
    width: 90%;
    max-height: calc(100vh - 6.5rem);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    direction: rtl;
    box-shadow: var(--mg-shadow-xl);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.mg-search-modal-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    direction: ltr;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mg-search-close {
    position: static;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mg-surface);
    border: 1px solid color-mix(in srgb, var(--mg-border) 85%, transparent);
    border-radius: var(--mg-radius);
    cursor: pointer;
    color: var(--mg-text);
    transition: var(--mg-transition);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.mg-search-close:hover {
    background: var(--mg-error);
    color: #ffffff;
    transform: rotate(90deg);
}

.mg-search-form {
    position: relative;
    margin-bottom: 0;
    min-width: 0;
    direction: rtl;
}

.mg-search-modal-content > .mg-search-live {
    direction: rtl;
}

.mg-search-modal-content > .mg-search-suggestions {
    direction: rtl;
}

.mg-search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    background: var(--mg-surface);
    transition: var(--mg-transition);
}

.mg-search-input:focus {
    outline: none;
    border-color: var(--mg-primary);
    background: var(--mg-bg);
    box-shadow: 0 0 0 4px rgba(var(--mg-primary-rgb), 0.15);
}

.mg-search-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--mg-gradient-primary);
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: var(--mg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: var(--mg-transition);
}

.mg-search-btn:hover {
    transform: translate3d(0, -50%, 0) scale(1.1);
    will-change: transform;
}

.mg-search-form.is-loading .mg-search-btn {
    pointer-events: none;
    opacity: 0.92;
}

@keyframes mgSpin {
    to {
        transform: rotate(360deg);
    }
}

.mg-search-suggestions h4 {
    margin-bottom: var(--mg-spacing-sm);
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mg-search-live {
    margin-bottom: var(--mg-spacing-lg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    background: color-mix(in srgb, var(--mg-surface) 84%, var(--mg-bg));
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    min-height: 0;
}

.mg-search-live-status {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    color: var(--mg-text-muted);
    border-bottom: 1px solid var(--mg-border);
}

.mg-search-live-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.mg-search-live-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, var(--mg-primary) 24%, transparent);
    border-top-color: var(--mg-primary);
    border-radius: 50%;
    animation: mgSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.mg-search-live-status:empty {
    display: none;
}

.mg-search-live-results {
    display: flex;
    flex-direction: column;
    max-height: 48vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mg-search-live-section + .mg-search-live-section {
    border-top: 1px solid color-mix(in srgb, var(--mg-border) 70%, transparent);
}

.mg-search-live-section-title {
    padding: 0.85rem 1rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mg-text-muted);
}

.mg-search-live-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0 1rem 1rem;
}

.mg-search-live-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    background: var(--mg-bg);
    border: 1px solid color-mix(in srgb, var(--mg-border) 80%, transparent);
    transition: var(--mg-transition);
}

.mg-search-live-category:hover {
    border-color: color-mix(in srgb, var(--mg-primary) 28%, var(--mg-border));
    background: color-mix(in srgb, var(--mg-primary) 7%, var(--mg-bg));
    color: var(--mg-primary);
}

.mg-search-live-category-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.mg-search-live-category-count {
    font-size: 0.76rem;
    color: var(--mg-text-muted);
}

.mg-search-live-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0 0.6rem 0.6rem;
}

.mg-search-live-section:not(.mg-search-live-section-categories) .mg-search-live-list {
    overflow: visible;
}

.mg-search-live-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border: 1px solid color-mix(in srgb, var(--mg-border) 78%, transparent);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.58);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mg-search-live-item:last-child {
    border-bottom: none;
}

.mg-search-live-item:hover {
    background: color-mix(in srgb, var(--mg-primary) 8%, #ffffff);
    border-color: color-mix(in srgb, var(--mg-primary) 18%, var(--mg-border));
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}

.mg-search-live-item-image {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    object-fit: cover;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
}

.mg-search-live-item-image-placeholder {
    display: block;
}

.mg-search-live-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.mg-search-live-item-category {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mg-primary) 9%, transparent);
    color: var(--mg-primary);
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1;
}

.mg-search-live-item-category--post {
    background: color-mix(in srgb, var(--mg-secondary) 10%, transparent);
    color: var(--mg-secondary);
}

.mg-search-live-post-icon {
    color: var(--mg-secondary);
    background: color-mix(in srgb, var(--mg-secondary) 8%, transparent);
}

.mg-search-live-section--posts .mg-search-live-section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mg-secondary);
    margin-left: 6px;
    vertical-align: middle;
}

.mg-search-live-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-text);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-search-live-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.3rem;
}

.mg-search-live-item-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--mg-primary);
}

@media (max-width: 640px) {
    .mg-search-modal {
        padding: 4.25rem 0.5rem 1rem;
    }

    .mg-search-modal-content {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 5.25rem);
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .mg-search-modal-head {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 0.75rem;
    }

    .mg-search-close {
        width: 38px;
        height: 38px;
    }

    .mg-search-live-list {
        padding: 0 0.45rem 0.45rem;
    }

    .mg-search-live-results {
        max-height: 50vh;
    }

    .mg-search-live-item {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .mg-search-live-item-image {
        width: 60px;
        height: 60px;
        border-radius: 0.9rem;
    }

    .mg-search-live-item-title {
        font-size: 0.94rem;
    }
}

.mg-search-live-empty {
    padding: 1rem;
    font-size: 0.92rem;
    color: var(--mg-text-muted);
}

.mg-search-live-footer {
    border-top: 1px solid var(--mg-border);
    padding: 0.75rem 1rem;
    text-align: center;
}

.mg-search-live-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mg-primary);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.mg-search-live-view-all:hover {
    opacity: 0.75;
    text-decoration: underline;
}


/* ============================================
   Category Bottom Sheet (Mobile)
   ============================================ */
.mg-cat-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    backdrop-filter: blur(2px);
}

.mg-cat-sheet-overlay.active {
    display: block;
}

.mg-cat-sheet {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: var(--mg-bg);
    border-radius: 1.25rem 1.25rem 0 0;
    z-index: 1600;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.mg-cat-sheet.active {
    transform: translateY(0);
}

.mg-cat-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--mg-border);
    border-radius: 2px;
    margin: 0.875rem auto 0.5rem;
    flex-shrink: 0;
}

.mg-cat-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem 0.875rem;
    border-bottom: 1px solid var(--mg-border);
    flex-shrink: 0;
}

.mg-cat-sheet-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
}

.mg-cat-sheet-close {
    background: none;
    border: none;
    color: var(--mg-text-muted);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    border-radius: var(--mg-radius);
    transition: var(--mg-transition);
}

.mg-cat-sheet-close:hover {
    background: var(--mg-border);
    color: var(--mg-text);
}

.mg-cat-sheet-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.25rem 0 calc(64px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}

.mg-cat-sheet-item + .mg-cat-sheet-item {
    border-top: 1px solid color-mix(in srgb, var(--mg-border) 55%, transparent);
}

.mg-cat-sheet-row {
    display: flex;
    align-items: center;
}

.mg-cat-sheet-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    color: var(--mg-text);
    text-decoration: none;
    transition: background 0.15s ease;
    min-width: 0;
}

.mg-cat-sheet-link:hover {
    background: color-mix(in srgb, var(--mg-primary) 5%, var(--mg-bg));
}

.mg-cat-sheet-img {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 1px solid var(--mg-border);
    flex-shrink: 0;
}

.mg-cat-sheet-img-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--mg-border) 60%, var(--mg-bg));
    flex-shrink: 0;
}

.mg-cat-sheet-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-cat-sheet-count {
    font-size: 0.78rem;
    color: var(--mg-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.mg-cat-sheet-toggle {
    background: none;
    border: none;
    color: var(--mg-text-muted);
    cursor: pointer;
    padding: 0.8rem 1.25rem 0.8rem 0.5rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.mg-cat-sheet-toggle:hover {
    color: var(--mg-primary);
}

.mg-cat-sheet-toggle svg {
    transition: transform 0.22s ease;
    display: block;
}

.mg-cat-sheet-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.mg-cat-sheet-children {
    background: color-mix(in srgb, var(--mg-border) 20%, var(--mg-bg));
    border-top: 1px solid color-mix(in srgb, var(--mg-border) 55%, transparent);
}

.mg-cat-sheet-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem 0.65rem 2.5rem;
    font-size: 0.88rem;
    color: var(--mg-text-muted);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--mg-border) 40%, transparent);
    transition: color 0.15s ease, background 0.15s ease;
}

.mg-cat-sheet-child:last-child {
    border-bottom: none;
}

.mg-cat-sheet-child:hover {
    color: var(--mg-primary);
    background: color-mix(in srgb, var(--mg-primary) 5%, var(--mg-bg));
}

.mg-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mg-search-tags a {
    padding: 0.625rem 1.25rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: var(--mg-transition);
}

.mg-search-tags a:hover {
    background: var(--mg-gradient-primary);
    color: #ffffff;
    transform: translate3d(0, -2px, 0);
    box-shadow: var(--mg-shadow-colored);
    will-change: transform;
}

/* ============================================
   Hero Slider - با Swiper
   ============================================ */
/* ─── Hero Slider ──────────────────────────────────────────────────── */
.mg-hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #f7f8fa;
}

.mg-hero-swiper {
    touch-action: pan-y;
}

/* Desktop ≥ 992px: full-width fixed height */
@media (min-width: 992px) {
    .mg-hero-slider {
        height: var(--hero-desktop-height, 400px);
    }
    .mg-hero-swiper {
        width: 100%;
        height: 100%;
    }
    .mg-hero-swiper .swiper-slide {
        height: 100%;
    }
    .mg-hero-slide,
    .mg-hero-bg-img {
        border-radius: 0;
    }
}

/* Mobile < 992px */
@media (max-width: 991px) {
    .mg-hero-slider {
        overflow: hidden;
        padding: 0.75rem 0;
        margin: 0;
    }
    .mg-hero-swiper {
        overflow: hidden;
        width: 100%;
        aspect-ratio: 16 / 7;
        height: auto;
        max-height: var(--hero-mobile-height, 500px);
        /* touch-action: pan-y; */
    }
    @supports not (aspect-ratio: 1) {
        .mg-hero-swiper {
            height: clamp(220px, 43.75vw, var(--hero-mobile-height, 500px));
        }
    }
    .mg-hero-swiper .swiper-slide {
        /* width: 100%; */
        height: 100%;
        overflow: hidden;
    }

    .mg-hero-slide,
    .mg-hero-bg-img {
        border-radius: 24px;
    }
}

/* common slide */
.mg-hero-slide {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.mg-hero-image-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.mg-hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
}

.mg-hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--mg-primary-rgb), var(--mg-hero-overlay, 0.4)) 0%, rgba(var(--mg-secondary-rgb), var(--mg-hero-overlay, 0.35)) 100%);
    z-index: 1;
}

.mg-hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="60" height="60" fill="url(%23grid)"/></svg>');
    z-index: 1;
}

/* Hero Parallax Image - Optimized for LCP */
.mg-hero-parallax-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    min-width: 100%;
    min-height: 100%;
    max-width: 100%;
    max-height: 100%;
    will-change: transform;
    transform: translateZ(0);
    display: block; /* اطمینان از display:block */
}

/* موبایل: border-radius برای تصویر (قبلاً در media query بالا تعریف شده) */

/* حالت contain برای تصاویر خاص */
.mg-hero-slide.mg-image-contain .mg-hero-parallax-img {
    object-fit: contain;
}

.mg-hero-content {
    position: relative;
    z-index: 10;
    color: #ffffff;
    max-width: 700px;
    /* اطمینان از نمایش - opacity و transform برای انیمیشن */
    opacity: 1;
    transform: translate3d(0, 0, 0);
    /* بهینه‌سازی برای LCP - جلوگیری از reflow */
    contain: layout style paint;
}

.mg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.625rem 1.25rem;
    border-radius: var(--mg-radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--mg-spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mg-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #ffffff;
    margin-bottom: var(--mg-spacing-sm);
    line-height: 1.15;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.mg-hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--mg-spacing-md);
    line-height: 1.6;
}

/* لینک کلیک‌پذیر روی کل اسلاید هیرو */
.mg-hero-slide-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    cursor: pointer;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;

    pointer-events: none;
}

/* click on slide is handled by JS to keep swipe fully reliable on touch devices */
.mg-hero-buttons {
    display: none !important;
}

.mg-hero-shapes {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.mg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.mg-shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
}

.mg-shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: 10%;
}

.mg-shape-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    right: -50px;
}


/* Hero Navigation - Swiper buttons */
.mg-hero-swiper .swiper-button-prev,
.mg-hero-swiper .swiper-button-next {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--mg-radius);
    color: #ffffff;
    transition: var(--mg-transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.mg-hero-swiper .swiper-button-prev::after,
.mg-hero-swiper .swiper-button-next::after {
    font-size: 1.5rem;
    font-weight: 700;
}

.mg-hero-swiper .swiper-button-prev:hover,
.mg-hero-swiper .swiper-button-next:hover {
    background: #ffffff;
    color: var(--mg-primary);
    transform: scale(1.1);
}

/* Hero Pagination - Swiper pagination */
.mg-hero-swiper .swiper-pagination {
    bottom: 40px;
    z-index: 10;
}

.mg-hero-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: var(--mg-transition);
}

.mg-hero-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
    width: 36px;
    border-radius: 6px;
}

/* Hero Progress Bar */
.mg-hero-progress {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 20;
}

.mg-progress-bar {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width linear;
}

@media (max-width: 991px) {
    .mg-hero-prev,
    .mg-hero-next,
    .mg-hero-swiper .swiper-button-prev,
    .mg-hero-swiper .swiper-button-next {
        display: none !important;
    }
    
    .mg-hero-swiper .swiper-pagination {
        display: none !important;
    }
    
    .mg-hero-content {
        max-width: 100%;
        padding: 0 var(--mg-spacing-xs);
    }
    
    .mg-hero-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: var(--mg-spacing-xs);
    }
    
    .mg-hero-title {
        font-size: clamp(1.1rem, 4.5vw, 1.8rem);
        margin-bottom: var(--mg-spacing-xs);
        line-height: 1.2;
    }
    
    .mg-hero-subtitle {
        font-size: clamp(0.75rem, 2vw, 0.95rem);
        margin-bottom: var(--mg-spacing-sm);
        line-height: 1.5;
    }
    
    /* .mg-hero-buttons hidden globally */
}

@media (max-width: 576px) {
    /* موبایل کوچک: گوشه‌ها همچنان نرم‌تر از قبل بمانند */
    .mg-hero-slide {
        border-radius: 22px;
    }
    
    .mg-hero-bg-img {
        border-radius: 22px;
    }
    
    .mg-hero-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

/* ============================================
   Promo Bar - Premium Cards
   ============================================ */
.mg-promo-bar {
    background: #f7f8fa;
    padding: var(--mg-spacing-lg) 0;
    position: relative;
}

/* بهبود Promo Bar در موبایل */
@media (max-width: 768px) {
    .mg-promo-bar {
        padding: var(--mg-spacing-md) 0;
    }
}

@media (max-width: 576px) {
    .mg-promo-bar {
        padding: var(--mg-spacing-sm) 0;
    }
}

@media (hover: none), (max-width: 991px) {
    .mg-promo-item {
        transition: transform 0.32s ease, box-shadow 0.32s ease;
    }

    .mg-promo-icon {
        transition: transform 0.32s ease;
    }
}

.mg-promo-bar::before {
    content: none;
    display: none;
}

.mg-promo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--mg-spacing-sm);
}

.mg-promo-swiper {
    display: none;
}

.mg-promo-swiper .swiper-slide {
    height: auto;
}

/* تنظیم تعداد ستون‌ها */
.mg-promo-cols-1 { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
.mg-promo-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mg-promo-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mg-promo-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mg-promo-cols-5 { grid-template-columns: repeat(5, 1fr); }
.mg-promo-cols-6 { grid-template-columns: repeat(6, 1fr); }

.mg-promo-item {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    padding: var(--mg-spacing-md);
    background: var(--mg-bg);
    border-radius: 18px;
    box-shadow: var(--mg-shadow-xs);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.mg-promo-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: var(--mg-gradient-primary);
    opacity: 0;
    transition: var(--mg-transition);
}

.mg-promo-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--mg-shadow-lg);
}

.mg-promo-item:hover::before {
    opacity: 1;
}

.mg-promo-icon {
    width: 48px;
    height: 48px;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mg-gradient-primary);
    border-radius: 14px;
    color: #ffffff;
    flex-shrink: 0;
    transition: var(--mg-transition);
}

.mg-promo-icon svg {
    width: 28px;
    height: 28px;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.mg-promo-item:hover .mg-promo-icon {
    transform: scale(1.1) rotate(5deg);
}

.mg-promo-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: var(--mg-text);
}

.mg-promo-content p {
    font-size: 0.75rem;
    color: var(--mg-text-muted);
    margin: 0;
}

@media (max-width: 992px) {
    .mg-promo-grid,
    .mg-promo-cols-3,
    .mg-promo-cols-4,
    .mg-promo-cols-5,
    .mg-promo-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .mg-promo-cols-1 { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .mg-promo-grid {
        display: none !important;
    }

    .mg-promo-swiper {
        display: block;
        height: clamp(72px, 18vw, 94px);
        overflow: hidden;
        touch-action: pan-x;
    }

    .mg-promo-swiper .swiper-wrapper {
        align-items: stretch;
    }

    .mg-promo-swiper .swiper-slide {
        height: clamp(72px, 18vw, 94px);
    }

    .mg-promo-swiper .mg-promo-item {
        width: 100%;
        height: 100%;
        margin: 0;
    }
}

@media (max-width: 576px) {
    .mg-promo-grid,
    .mg-promo-cols-2,
    .mg-promo-cols-3,
    .mg-promo-cols-4,
    .mg-promo-cols-5,
    .mg-promo-cols-6 {
        grid-template-columns: 1fr;
        gap: var(--mg-spacing-xs);
    }
    
    .mg-promo-item {
        padding: var(--mg-spacing-sm);
        gap: var(--mg-spacing-xs);
    }
    
    .mg-promo-icon {
        width: 40px;
        height: 40px;
        padding: 6px;
    }

    .mg-promo-icon svg {
        width: 23px;
        height: 23px;
    }
    
    .mg-promo-content h3 {
        font-size: 0.85rem;
    }
    
    .mg-promo-content p {
        font-size: 0.7rem;
    }
}

/* ============================================
   Categories - Circle Cards with Swiper
   ============================================ */
.mg-categories {
    background: var(--mg-bg);
}

.mg-categories-swiper {
    padding: var(--mg-spacing-md) 0 var(--mg-spacing-lg);
}

.mg-category-card-circle {
    text-align: center;
}

.mg-category-link {
    display: block;
    color: var(--mg-text);
}

.mg-category-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--mg-spacing-sm);
    border-radius: 50%;
    overflow: hidden;
    transition: var(--mg-transition);
    box-shadow: var(--mg-shadow-sm);
}

.mg-category-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 4px;
    background: var(--mg-gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--mg-transition);
}

.mg-category-card-circle:hover .mg-category-circle::before {
    opacity: 1;
}

.mg-category-card-circle:hover .mg-category-circle {
    transform: scale3d(1.08, 1.08, 1);
    box-shadow: var(--mg-shadow-lg);
    will-change: transform;
    /* استفاده از position به جای translateY برای جلوگیری از layout shift */
    position: relative;
    top: -5px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-category-image-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.mg-category-image-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--mg-transition);
}

.mg-category-card-circle:hover .mg-category-image-circle img {
    transform: scale(1.15);
}

.mg-category-overlay-circle {
    position: absolute;
    inset: 0;
    background: var(--mg-gradient-primary);
    opacity: 0;
    transition: var(--mg-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-category-card-circle:hover .mg-category-overlay-circle {
    opacity: 0.8;
}

.mg-category-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #ffffff;
    z-index: 2;
    transition: var(--mg-transition-bounce);
}

.mg-category-card-circle:hover .mg-category-icon {
    transform: translate(-50%, -50%) scale(1);
}

.mg-category-info-circle {
    padding: 0 var(--mg-spacing-sm);
}

.mg-category-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    transition: var(--mg-transition);
}

.mg-category-card-circle:hover .mg-category-name {
    color: var(--mg-primary);
}

.mg-category-count {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
}

.mg-categories-scrollbar {
    margin-top: var(--mg-spacing-md);
    height: 4px;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-full);
}

.mg-categories-scrollbar .swiper-scrollbar-drag {
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-full);
}

/* Categories - New Premium Styles */
.mg-categories-wrapper {
    position: relative;
    padding: 0;
}

.mg-category-card {
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    transform: translateY(0);
}

.mg-category-card .mg-category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    position: relative;
}

/* استایل دایره‌ای */
.mg-category-style-circle .mg-category-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    margin: 0 auto 1rem;
    border: 3px solid transparent;
    background: linear-gradient(var(--mg-surface), var(--mg-surface)) padding-box,
                var(--mg-gradient-primary) border-box;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(var(--mg-primary-rgb), 0.15);
    /* جلوگیری از layout shift - اضافه کردن padding برای فضای hover */
    margin-top: 0;
    margin-bottom: calc(1rem + 8px);
    top: 0;
}

/* استایل مربعی */
.mg-category-style-card .mg-category-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
    box-shadow: var(--mg-shadow-md);
}

/* استایل کارتی */
.mg-category-style-box .mg-category-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.mg-category-style-box .mg-category-link {
    background: var(--mg-surface);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    box-shadow: var(--mg-shadow-sm);
}

.mg-category-style-box .mg-category-info {
    padding: 1rem;
    text-align: right;
    width: 100%;
}

.mg-category-card .mg-category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mg-category-card:hover .mg-category-image-wrapper img {
    transform: scale(1.15);
}

.mg-category-card .mg-category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--mg-primary-rgb), 0.3) 0%, rgba(var(--mg-secondary-rgb), 0.4) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.mg-category-card:hover .mg-category-overlay {
    opacity: 1;
}

.mg-category-card .mg-category-hover-effect {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
    border-radius: inherit;
}

.mg-category-card:hover .mg-category-hover-effect {
    transform: scale(2);
}

.mg-category-style-circle:hover .mg-category-image-wrapper {
    transform: scale(1.05) translateY(-8px);
    box-shadow: 0 15px 40px rgba(var(--mg-primary-rgb), 0.25);
}

.mg-category-card .mg-category-info {
    text-align: center;
}

.mg-category-card .mg-category-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.mg-category-card:hover .mg-category-name {
    color: var(--mg-primary);
}

.mg-category-card .mg-category-count {
    font-size: 0.85rem;
    color: var(--mg-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.mg-category-card .mg-count-number {
    font-weight: 700;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: var(--mg-radius-full);
    font-size: 0.8rem;
}

.mg-category-card .mg-category-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10;
}

.mg-category-style-circle .mg-category-arrow {
    top: 60px;
}

.mg-category-card:hover .mg-category-arrow {
    transform: translate(-50%, -50%) scale(1);
}

.mg-category-card .mg-category-arrow,
.mg-category-card:hover .mg-category-arrow {
    display: none;
}

/* Pagination دسته‌بندی‌ها */
.mg-categories-pagination {
    position: relative !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-top: 1.5rem;
}

.mg-categories-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: var(--mg-border);
    opacity: 1 !important;
    transition: all 0.3s ease;
    border-radius: 50%;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
}

.mg-categories-pagination .swiper-pagination-bullet-active,
.mg-categories-pagination .swiper-pagination-bullet-active-main {
    background: var(--mg-primary);
}

.mg-categories-pagination .swiper-pagination-bullet-active {
    background: var(--mg-gradient-primary);
    width: 24px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .mg-category-style-circle .mg-category-image-wrapper {
        width: 90px;
        height: 90px;
    }
    
    .mg-category-card .mg-category-name {
        font-size: 0.9rem;
    }
}

/* ============================================
   Product Cards - Premium Design
   ============================================ */
.mg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--mg-spacing-lg);
}

.mg-product-card {
    background: linear-gradient(180deg, rgba(var(--mg-primary-rgb), 0.16) 0%, transparent 62%), #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    border: none;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    contain: style;
    cursor: grab;            /* کارت قابل drag است */
}
.mg-product-card:active {
    cursor: grabbing;
}

/* فقط عنوان کلیک‌پذیر است */
.mg-product-title a {
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* دکمه‌ها و اکشن‌ها کلیک‌پذیر */
.mg-product-card .mg-product-actions,
.mg-product-card .mg-add-to-cart,
.mg-product-card .mg-wishlist-btn,
.mg-product-card .mg-card-cart-btn {
    cursor: pointer;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .mg-product-card {
        border-radius: 20px;
    }
}

@media (max-width: 576px) {
    .mg-product-card {
        border-radius: 16px;
    }
}

.mg-product-card::before {
    display: none;
}

.mg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

/* تصویر اصلی (خارج از کارت) — fallback */
.mg-product-image-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--mg-surface);
}

.mg-product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.mg-product-image-wrapper:hover img,
.mg-product-image-wrapper:focus-within img {
    transform: scale(1.04);
}

/* ============================================
   نوار بالای کارت (همیشه رندر می‌شه)
   ============================================ */
.mg-card-sale-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0 0.85rem;
    background: transparent;
    height: 40px;
    flex-shrink: 0;
    gap: 0.4rem;
    overflow: hidden;
}

.mg-card-sale-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    line-height: 1;
}

.mg-sale-icon {
    width: 38px;
    height: 38px;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0 -8px;
}

/* countdown فشرده داخل strip */
.mg-card-sale-strip .mg-sale-countdown {
    flex-shrink: 0;
    margin-bottom: 0;          /* override global margin-bottom: 0.5rem */
    display: inline-flex;
    align-items: center;
}

.mg-card-sale-strip .mg-scd-units {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    direction: ltr;
    white-space: nowrap;
}

.mg-card-sale-strip .mg-scd-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3b3738;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 5px;
    padding: 0.12rem 0.3rem;
    min-width: 22px;
    font-feature-settings: "tnum";
    letter-spacing: 0.5px;
}

.mg-card-sale-strip .mg-scd-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;   /* همارتفاع با باکس‌های عدد */
    font-size: 0.62rem;
    font-weight: 900;
    color: #555;
    line-height: 1;
    width: 7px;
    flex-shrink: 0;
    padding-bottom: 1px;   /* تصحیح اپتیکال: دونقطه در فونت کمی بالاتر نشسته */
}

.mg-card-sale-strip .mg-scd-text,
.mg-card-sale-strip .mg-scd-days,
.mg-card-sale-strip .mg-scd-sep-days { display: none; }

/* ============================================
   تصویر کارت — از بغل فاصله داره، از بالا نه
   ============================================ */
.mg-product-card .mg-product-image-wrapper {
    margin: 0 8px 0;
    border-radius: 14px;
    aspect-ratio: 1 / 1;
    max-height: 170px;
    overflow: hidden;
    background: var(--mg-surface);
    position: relative;
    flex-shrink: 0;
    isolation: isolate;
}

.mg-product-card .mg-product-image-wrapper > a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    background: inherit;
}

.mg-product-card .mg-product-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.mg-product-card .mg-product-image-wrapper img.woocommerce-placeholder {
    position: absolute;
    inset: 0;
    object-fit: cover;
    padding: 0;
    opacity: 1;
    background: #f3f5f7;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
}

/* اکشن‌های سریع کارت: روی دسکتاپ فقط با هاور/فوکوس */
.mg-product-card .mg-product-image-wrapper .mg-product-actions {
    position: absolute;
    left: 0.65rem;
    right: auto;
    top: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.42rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    z-index: 4;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.mg-product-card:hover .mg-product-image-wrapper .mg-product-actions,
.mg-product-card:focus-within .mg-product-image-wrapper .mg-product-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mg-product-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    line-height: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mg-product-action svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mg-product-action:hover,
.mg-product-action:focus-visible {
    background: rgba(var(--mg-primary-rgb), 0.12);
    border-color: rgba(var(--mg-primary-rgb), 0.28);
    color: var(--mg-primary);
    box-shadow: 0 12px 26px rgba(var(--mg-primary-rgb), 0.16);
    transform: translateY(-1px);
}

.mg-product-action.mg-quickview-btn:hover,
.mg-product-action.mg-quickview-btn:focus-visible {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.28);
    color: #0284c7;
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.15);
}

.mg-product-action.active:hover,
.mg-product-action.active:focus-visible {
    background: rgba(var(--mg-primary-rgb), 0.12);
    border-color: rgba(var(--mg-primary-rgb), 0.28);
    color: var(--mg-primary);
    transform: translateY(-1px);
}

.mg-product-action.active {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.08);
    color: #111827;
}

@media (hover: none), (max-width: 768px) {
    .mg-product-card .mg-product-image-wrapper .mg-product-actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .mg-product-action {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 9px;
    }
}

/* ============================================
   Info section
   ============================================ */
.mg-product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mg-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    min-height: 1.5rem;
}

.mg-product-category {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--mg-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.mg-product-category:not(:empty) {
    background: rgba(var(--mg-primary-rgb), 0.1);
    padding: 0.15rem 0.45rem;
    border-radius: 100px;
}

.mg-product-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0.1rem 0 0;
    min-height: calc(0.95rem * 1.45 * 2);
}

.mg-product-title a {
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-product-title a:hover { color: var(--mg-primary); }

.mg-product-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    color: var(--mg-accent);
    flex-shrink: 0;
}

/* divider — خط‌چین ملایم */
.mg-card-divider {
    border: none;
    border-top: 1.5px dashed rgba(0,0,0,0.1);
    margin: 0.4rem 0 0.3rem;
}

/* ============================================
   footer کارت: قیمت + دکمه
   ============================================ */
.mg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}

.mg-card-footer .mg-card-cart-btn {
    flex-shrink: 0;
    margin-inline-start: 0.75rem;
}

/* لیبل ناموجود */
.mg-card-outofstock-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 0.75rem;
    height: 38px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    margin-inline-start: 0.75rem;
}

/* دکمه مشاهده (محصول متغیر) */
.mg-card-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.15s ease;
    margin-inline-start: 0.75rem;
}
.mg-card-view-btn:hover {
    background: #e2e8f0;
    color: #111;
}

/* ══════════════════════════════════════════════════════
   قیمت محصول — قیمت‌ها زیر هم + آیکون تومان سمت چپ
══════════════════════════════════════════════════════ */

.woocommerce-Price-currencySymbol { display: none !important; }

/* wrapper بیرونی: ستون اعداد + آیکون تومان کنارش */
.mg-price-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

/* ستون اعداد — PHP این رو inject کرده، هیچ CSS قدیمی روش نیست */
.mg-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* قیمت خط‌خورده (بالا) */
.mg-price-col del {
    display: block;
    font-size: 0.82rem;
    font-weight: 400;
    color: #bbb;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    line-height: 1.35;
}
.mg-price-col del .woocommerce-Price-amount,
.mg-price-col del bdi { font-size: inherit; color: inherit; display: inline; }

/* قیمت اصلی (پایین) */
.mg-price-col ins {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    line-height: 1.35;
}
.mg-price-col ins .woocommerce-Price-amount,
.mg-price-col ins bdi { font-size: inherit; color: inherit; display: inline; }

/* قیمت بدون تخفیف */
.mg-price-col .price,
.mg-price-col .woocommerce-Price-amount { font-size: 0.95rem; font-weight: 700; color: #111; }

/* آیکون تومان */
.mg-toman-icon {
    display: block;
    width: auto;
    height: 2.5em;
    opacity: 0.25;
    filter: brightness(0);
    flex-shrink: 0;
}

/* کارت: اندازه‌ها */
.mg-card-footer .mg-product-price { flex: 1; min-width: 0; margin: 0; }
.mg-card-footer .mg-toman-icon { height: 2.3em; }
.mg-card-footer .mg-price-col ins { font-size: 1rem; }
.mg-card-footer .mg-price-col del { font-size: 0.78rem; }

/* دکمه سبد — دایره تیره، فقط آیکون */
.mg-card-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    aspect-ratio: 1;          /* تضمین مربعی بودن دکمه (دایره کامل) */
    padding: 0;               /* صریح - جلوگیری از پدینگ پیش‌فرض <button> */
    line-height: 0;           /* جلوگیری از فضای خط برای فرزند inline-block */
    background: #3b3738;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(59,55,56,0.22);
}

.mg-card-cart-btn:hover {
    background: #504a4b;
    transform: scale(1.08);
}

.mg-card-cart-btn svg { flex-shrink: 0; }

/* حالت لودینگ دکمه سبد */
.mg-card-cart-btn.loading,
.mg-card-cart-btn:disabled {
    pointer-events: none;
    opacity: 1 !important;
}

.mg-cart-spin {
    display: block;                  /* block جلوی هرگونه vertical-align/baseline shift رو می‌گیره */
    width: 20px;
    height: 20px;
    aspect-ratio: 1;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0;                      /* صریح - بدون پدینگ */
    margin: 0;                       /* صریح - بدون margin */
    border: 2.5px solid rgba(255,255,255,0.3);   /* کمی ضخیم‌تر برای حذف artifact آنتی‌الیاسی */
    border-top-color: #fff;
    border-radius: 50%;
    transform-origin: 50% 50%;
    will-change: transform;
    -webkit-animation: mg-cart-spin 0.65s linear infinite;
    animation: mg-cart-spin 0.65s linear infinite;
}

@-webkit-keyframes mg-cart-spin {
    from { -webkit-transform: translateZ(0) rotate(0deg);   transform: translateZ(0) rotate(0deg); }
    to   { -webkit-transform: translateZ(0) rotate(360deg); transform: translateZ(0) rotate(360deg); }
}
@keyframes mg-cart-spin {
    from { transform: translateZ(0) rotate(0deg); }
    to   { transform: translateZ(0) rotate(360deg); }
}

/* حالت اضافه‌شده — دایره سبز + تیک */
.mg-card-cart-btn.added {
    background: #16a34a;
    transform: scale(1.05);
}

.mg-cart-check {
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
    -webkit-animation: mg-cart-check 0.35s ease forwards;
    animation: mg-cart-check 0.35s ease forwards;
}

@-webkit-keyframes mg-cart-check {
    to { stroke-dashoffset: 0; }
}
@keyframes mg-cart-check {
    to { stroke-dashoffset: 0; }
}

/* ═════════════════════════════════════════
   Checkout — Shipping & Payment methods
   جلوگیری از overlap بین radio و label (به‌خصوص در RTL)
═════════════════════════════════════════ */
ul.woocommerce-shipping-methods,
ul.wc_payment_methods.payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

ul.woocommerce-shipping-methods li,
ul.wc_payment_methods .wc_payment_method {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.625rem !important;
    padding: 0.75rem 1rem !important;
    margin: 0 0 0.5rem 0 !important;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    list-style: none !important;
    background-image: none !important;
    text-indent: 0 !important;
}

ul.woocommerce-shipping-methods li::before,
ul.wc_payment_methods .wc_payment_method::before {
    display: none !important;
}

ul.woocommerce-shipping-methods input[type="radio"],
ul.wc_payment_methods input[type="radio"] {
    flex: 0 0 auto !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    float: none !important;
    accent-color: var(--mg-primary);
    cursor: pointer;
    order: 1;
}

ul.woocommerce-shipping-methods label,
ul.wc_payment_methods label {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    font-weight: 600;
    color: var(--mg-text);
    line-height: 1.5;
    text-align: start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-word;
    order: 2;
}

/* logo داخل label (img که WC برای payment gateway می‌ذاره) */
ul.wc_payment_methods label img {
    max-height: 28px !important;
    width: auto !important;
    flex-shrink: 0;
    margin: 0 0 0 0.25rem !important;
}

/* توضیح زیر گزینه پرداخت */
ul.wc_payment_methods .payment_box {
    width: 100% !important;
    flex-basis: 100% !important;
    order: 3;
    margin: 0.5rem 0 0 !important;
    padding: 0.875rem 1rem !important;
    background: var(--mg-surface) !important;
    border-radius: var(--mg-radius);
    color: var(--mg-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}
ul.wc_payment_methods .payment_box p:last-child {
    margin-bottom: 0 !important;
}

/* selected state */
ul.wc_payment_methods .wc_payment_method input[type="radio"]:checked + label {
    color: var(--mg-primary);
}

/* ═════════════════════════════════════════
   Skeleton Loading — Element-by-element shimmer
   به‌جای overlay روی کل کارت، هر element داخل کارت (تصویر، عنوان، قیمت، دکمه)
   جداگانه shimmer می‌شود. سایر استایل‌های کارت (border-radius, padding, gap)
   حفظ می‌شوند تا layout دقیقاً مثل واقعی باشد.
═════════════════════════════════════════ */
@keyframes mg-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* shimmer gradient متغیر CSS برای reuse — رنگ روشن خاکستری */
:root {
    --mg-skel-gradient: linear-gradient(90deg, #f1f1f1 0%, #f1f1f1 40%, #fafafa 50%, #f1f1f1 60%, #f1f1f1 100%);
}

/* ─────────────────────────────────────────
   1. Swiper layout قبل از init — slides در یک خط افقی
─────────────────────────────────────────── */
html.mg-skel-pending [data-mg-loading] .swiper {
    overflow: hidden;
}
html.mg-skel-pending [data-mg-loading] .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    transform: none !important;
    gap: 18px;
}
html.mg-skel-pending [data-mg-loading] .swiper-slide {
    flex-shrink: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* عرض slide بر اساس نوع swiper (دسکتاپ default) */
html.mg-skel-pending .mg-categories-swiper .swiper-slide,
html.mg-skel-pending .mg-products-swiper .swiper-slide,
html.mg-skel-pending .mg-showcase-swiper .swiper-slide,
html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide,
html.mg-skel-pending .mg-brands-swiper .swiper-slide {
    width: calc((100% - 18px * 5) / 6) !important;
}
html.mg-skel-pending .mg-testimonials-swiper .swiper-slide {
    width: calc((100% - 18px * 2) / 3) !important;
}

/* slide های اضافی hidden تا overflow نده */
html.mg-skel-pending .mg-categories-swiper .swiper-slide:nth-child(n+7),
html.mg-skel-pending .mg-products-swiper .swiper-slide:nth-child(n+7),
html.mg-skel-pending .mg-showcase-swiper .swiper-slide:nth-child(n+7),
html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide:nth-child(n+7),
html.mg-skel-pending .mg-brands-swiper .swiper-slide:nth-child(n+7) { display: none !important; }
html.mg-skel-pending .mg-testimonials-swiper .swiper-slide:nth-child(n+4) { display: none !important; }

@media (max-width: 1199px) {
    html.mg-skel-pending .mg-categories-swiper .swiper-slide,
    html.mg-skel-pending .mg-products-swiper .swiper-slide,
    html.mg-skel-pending .mg-showcase-swiper .swiper-slide,
    html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide,
    html.mg-skel-pending .mg-brands-swiper .swiper-slide {
        width: calc((100% - 18px * 4) / 5) !important;
    }
    html.mg-skel-pending .mg-categories-swiper .swiper-slide:nth-child(n+6),
    html.mg-skel-pending .mg-products-swiper .swiper-slide:nth-child(n+6),
    html.mg-skel-pending .mg-showcase-swiper .swiper-slide:nth-child(n+6),
    html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide:nth-child(n+6),
    html.mg-skel-pending .mg-brands-swiper .swiper-slide:nth-child(n+6) { display: none !important; }
}
@media (max-width: 991px) {
    html.mg-skel-pending .mg-categories-swiper .swiper-slide,
    html.mg-skel-pending .mg-brands-swiper .swiper-slide {
        width: calc((100% - 18px * 3) / 4) !important;
    }
    html.mg-skel-pending .mg-products-swiper .swiper-slide,
    html.mg-skel-pending .mg-showcase-swiper .swiper-slide,
    html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide {
        width: calc((100% - 18px * 2) / 3) !important;
    }
    html.mg-skel-pending .mg-testimonials-swiper .swiper-slide {
        width: calc((100% - 18px) / 2) !important;
    }
    html.mg-skel-pending .mg-categories-swiper .swiper-slide:nth-child(n+5),
    html.mg-skel-pending .mg-brands-swiper .swiper-slide:nth-child(n+5),
    html.mg-skel-pending .mg-products-swiper .swiper-slide:nth-child(n+4),
    html.mg-skel-pending .mg-showcase-swiper .swiper-slide:nth-child(n+4),
    html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide:nth-child(n+4) { display: none !important; }
    html.mg-skel-pending .mg-testimonials-swiper .swiper-slide:nth-child(n+3) { display: none !important; }
}
@media (max-width: 767px) {
    html.mg-skel-pending .mg-categories-swiper .swiper-slide,
    html.mg-skel-pending .mg-brands-swiper .swiper-slide {
        width: calc((100% - 18px * 2) / 3) !important;
    }
    html.mg-skel-pending .mg-products-swiper .swiper-slide,
    html.mg-skel-pending .mg-showcase-swiper .swiper-slide,
    html.mg-skel-pending .mg-flash-sale-swiper .swiper-slide {
        width: calc((100% - 18px) / 2) !important;
    }
    html.mg-skel-pending .mg-testimonials-swiper .swiper-slide {
        width: 100% !important;
    }
    html.mg-skel-pending [data-mg-loading] .swiper-slide:nth-child(n+4) { display: none !important; }
}

/* ─────────────────────────────────────────
   2. Element-by-element shimmer روی محتوای داخل کارت‌ها
─────────────────────────────────────────── */

/* — تصویر محصول/بلاگ/بنر/برند: img hidden، wrapper shimmer — */
html.mg-skel-pending [data-mg-loading] .mg-product-image-wrapper img,
html.mg-skel-pending [data-mg-loading] .mg-blog-image img,
html.mg-skel-pending [data-mg-loading] .mg-banner-cell img,
html.mg-skel-pending [data-mg-loading] .mg-brand-logo img,
html.mg-skel-pending [data-mg-loading] .mg-category-image-wrapper img {
    visibility: hidden !important;
}
html.mg-skel-pending [data-mg-loading] .mg-product-image-wrapper,
html.mg-skel-pending [data-mg-loading] .mg-blog-image,
html.mg-skel-pending [data-mg-loading] .mg-banner-cell,
html.mg-skel-pending [data-mg-loading] .mg-brand-logo,
html.mg-skel-pending [data-mg-loading] .mg-category-image-wrapper {
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
}

/* — badges, overlays, actions روی تصویر hidden — */
html.mg-skel-pending [data-mg-loading] .mg-product-badges,
html.mg-skel-pending [data-mg-loading] .mg-product-actions,
html.mg-skel-pending [data-mg-loading] .mg-badge,
html.mg-skel-pending [data-mg-loading] .mg-category-overlay,
html.mg-skel-pending [data-mg-loading] .mg-category-arrow,
html.mg-skel-pending [data-mg-loading] .mg-category-hover-effect,
html.mg-skel-pending [data-mg-loading] .mg-banner-cell-overlay {
    display: none !important;
}

/* — متن‌های داخل کارت: shimmer روی خود element — */
html.mg-skel-pending [data-mg-loading] .mg-product-category,
html.mg-skel-pending [data-mg-loading] .mg-product-title,
html.mg-skel-pending [data-mg-loading] .mg-product-title a,
html.mg-skel-pending [data-mg-loading] .mg-product-rating,
html.mg-skel-pending [data-mg-loading] .mg-product-price,
html.mg-skel-pending [data-mg-loading] .mg-product-price *,
html.mg-skel-pending [data-mg-loading] .mg-category-name,
html.mg-skel-pending [data-mg-loading] .mg-category-count,
html.mg-skel-pending [data-mg-loading] .mg-category-count *,
html.mg-skel-pending [data-mg-loading] .mg-blog-meta,
html.mg-skel-pending [data-mg-loading] .mg-blog-meta *,
html.mg-skel-pending [data-mg-loading] .mg-blog-title,
html.mg-skel-pending [data-mg-loading] .mg-blog-title a,
html.mg-skel-pending [data-mg-loading] .mg-blog-excerpt,
html.mg-skel-pending [data-mg-loading] .mg-blog-link,
html.mg-skel-pending [data-mg-loading] .mg-feature-title,
html.mg-skel-pending [data-mg-loading] .mg-feature-desc,
html.mg-skel-pending [data-mg-loading] .mg-stat-number,
html.mg-skel-pending [data-mg-loading] .mg-stat-suffix,
html.mg-skel-pending [data-mg-loading] .mg-stat-label,
html.mg-skel-pending [data-mg-loading] .mg-testimonial-text,
html.mg-skel-pending [data-mg-loading] .mg-testimonial-name,
html.mg-skel-pending [data-mg-loading] .mg-testimonial-role,
html.mg-skel-pending [data-mg-loading] .mg-testimonial-rating,
html.mg-skel-pending [data-mg-loading] .mg-testimonial-rating *,
html.mg-skel-pending [data-mg-loading] .mg-promo-content h3,
html.mg-skel-pending [data-mg-loading] .mg-promo-content p,
html.mg-skel-pending [data-mg-loading] .mg-brand-name {
    color: transparent !important;
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-radius: 4px !important;
    text-shadow: none !important;
}

/* — دکمه‌ها: shimmer + متن transparent + svg hidden — */
html.mg-skel-pending [data-mg-loading] .mg-product-card .mg-btn,
html.mg-skel-pending [data-mg-loading] .mg-blog-card .mg-btn,
html.mg-skel-pending [data-mg-loading] .mg-product-card button,
html.mg-skel-pending [data-mg-loading] .mg-blog-card button {
    color: transparent !important;
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
html.mg-skel-pending [data-mg-loading] .mg-product-card .mg-btn svg,
html.mg-skel-pending [data-mg-loading] .mg-blog-card .mg-btn svg,
html.mg-skel-pending [data-mg-loading] .mg-product-card button svg,
html.mg-skel-pending [data-mg-loading] .mg-blog-card button svg { visibility: hidden !important; }

/* — آیکن feature و promo و stat: shimmer روی container — */
html.mg-skel-pending [data-mg-loading] .mg-feature-icon,
html.mg-skel-pending [data-mg-loading] .mg-promo-icon,
html.mg-skel-pending [data-mg-loading] .mg-stat-icon {
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-radius: 12px !important;
}
html.mg-skel-pending [data-mg-loading] .mg-feature-icon > *,
html.mg-skel-pending [data-mg-loading] .mg-promo-icon > *,
html.mg-skel-pending [data-mg-loading] .mg-stat-icon > * {
    visibility: hidden !important;
}

/* — ستاره testimonial — */
html.mg-skel-pending [data-mg-loading] .mg-testimonial-rating .mg-star {
    color: transparent !important;
}

/* — Countdown (شمارش معکوس) داخل کارت محصول و flash sale — */
html.mg-skel-pending [data-mg-loading] .mg-sale-countdown,
html.mg-skel-pending [data-mg-loading] .mg-scd-label,
html.mg-skel-pending [data-mg-loading] .mg-scd-value,
html.mg-skel-pending [data-mg-loading] .mg-scd-text,
html.mg-skel-pending [data-mg-loading] .mg-scd-sep,
html.mg-skel-pending [data-mg-loading] .mg-countdown-value,
html.mg-skel-pending [data-mg-loading] .mg-countdown-label,
html.mg-skel-pending [data-mg-loading] .mg-countdown-separator {
    color: transparent !important;
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-radius: 4px !important;
}
html.mg-skel-pending [data-mg-loading] .mg-scd-unit,
html.mg-skel-pending [data-mg-loading] .mg-countdown-item {
    background: transparent !important;
    border-color: transparent !important;
}

/* — Rating (ستاره و امتیاز) — */
html.mg-skel-pending [data-mg-loading] .mg-product-rating,
html.mg-skel-pending [data-mg-loading] .mg-product-rating .star-rating,
html.mg-skel-pending [data-mg-loading] .mg-product-rating .star-rating *,
html.mg-skel-pending [data-mg-loading] .mg-rating-count,
html.mg-skel-pending [data-mg-loading] .mg-stars-large,
html.mg-skel-pending [data-mg-loading] .mg-stars-large .mg-star,
html.mg-skel-pending [data-mg-loading] .mg-rating-info,
html.mg-skel-pending [data-mg-loading] .star-rating::before,
html.mg-skel-pending [data-mg-loading] .star-rating span::before {
    color: transparent !important;
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-radius: 4px !important;
}

/* — Flash Sale Festival Banner: خود banner بدون تغییر، فقط محتوای داخلش placeholder — */
html.mg-skel-pending [data-mg-loading] .mg-festival-logo {
    visibility: hidden !important;
}
html.mg-skel-pending [data-mg-loading] .mg-festival-btn {
    color: transparent !important;
    background: rgba(255,255,255,0.25) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
html.mg-skel-pending [data-mg-loading] .mg-festival-btn svg {
    visibility: hidden !important;
}
/* فقط lights/snow/waves animation های زینتی hidden بشن تا performance بهتر باشه */
html.mg-skel-pending [data-mg-loading] .mg-flash-lights,
html.mg-skel-pending [data-mg-loading] .mg-flash-snow,
html.mg-skel-pending [data-mg-loading] .mg-flash-snow {
    display: none !important;
}

/* — Section headers (title و subtitle بالای بخش) — */
html.mg-skel-pending [data-mg-loading] .mg-section-title,
html.mg-skel-pending [data-mg-loading] .mg-section-title a,
html.mg-skel-pending [data-mg-loading] .mg-section-subtitle,
html.mg-skel-pending [data-mg-loading] .mg-showcase-header h2,
html.mg-skel-pending [data-mg-loading] .mg-view-all {
    color: transparent !important;
    background: var(--mg-skel-gradient) !important;
    background-size: 200% 100% !important;
    animation: mg-skeleton-shimmer 2s infinite linear !important;
    border-radius: 4px !important;
}
html.mg-skel-pending [data-mg-loading] .mg-view-all svg {
    visibility: hidden !important;
}

/* — fallback min-height برای کارت‌هایی که ممکنه empty باشن — */
html.mg-skel-pending [data-mg-loading] .mg-category-image-wrapper:empty { min-height: 100px; }
html.mg-skel-pending [data-mg-loading] .mg-product-image-wrapper:empty { aspect-ratio: 1; }
html.mg-skel-pending [data-mg-loading] .mg-blog-image:empty { aspect-ratio: 16/9; }
html.mg-skel-pending [data-mg-loading] .mg-banner-cell:empty { aspect-ratio: 21/9; min-height: 180px; }
html.mg-skel-pending [data-mg-loading] .mg-brand-logo:empty { height: 60px; }

/* ─────────────────────────────────────────
   3. بعد از reveal: همه چیز برگرده عادی + transition
─────────────────────────────────────────── */
html.mg-skel-done [data-mg-loading] .mg-product-image-wrapper img,
html.mg-skel-done [data-mg-loading] .mg-blog-image img,
html.mg-skel-done [data-mg-loading] .mg-banner-cell img,
html.mg-skel-done [data-mg-loading] .mg-brand-logo img,
html.mg-skel-done [data-mg-loading] .mg-category-image-wrapper img,
html.mg-skel-done [data-mg-loading] .mg-product-card .mg-btn svg,
html.mg-skel-done [data-mg-loading] .mg-blog-card .mg-btn svg,
html.mg-skel-done [data-mg-loading] .mg-feature-icon > *,
html.mg-skel-done [data-mg-loading] .mg-promo-icon > *,
html.mg-skel-done [data-mg-loading] .mg-stat-icon > * {
    visibility: visible !important;
    transition: opacity 0.3s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.mg-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--mg-radius-full);
    z-index: 10;
    margin: 0;
}

@keyframes badgeRandomBlink {
    0%, 45%   { opacity: 1; transform: scale(1); }
    50%, 55%  { opacity: 0.15; transform: scale(0.92); }
    60%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes discountLedBlink {
    0%, 49% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(251,191,36,0.95), 0 0 18px rgba(251,191,36,0.7), 0 0 35px rgba(251,191,36,0.4);
    }
    50%, 100% {
        opacity: 0.2;
        text-shadow: none;
    }
}

.mg-badge-sale {
    display: none !important;
}

.mg-featured-product-card .mg-badge-sale-left {
    right: auto;
    left: 12px;
}

.mg-badge-featured {
    background: var(--mg-gradient-ocean);
    color: #ffffff;
}

/* حذف کامل بج‌ها از کارت‌های محصولات (ویژه/جدید/فروشگاه و ...) */
.mg-product-card .mg-badge,
.mg-featured-product-card .mg-badge-featured-premium {
    display: none !important;
}


.mg-product-price {
    margin-bottom: var(--mg-spacing-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
}

/* قیمت - همیشه در یک خط، همه المان‌ها یکسان (خارج از کارت) */
.mg-product-price .price {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
}

.mg-product-price ins,
.mg-product-price .price .from,
.mg-product-price .price .to,
.mg-product-price .price .woocommerce-Price-amount,
.mg-product-price .price bdi,
.mg-product-price .woocommerce-Price-amount,
.mg-product-price bdi {
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 0.1rem;
}

.mg-product-price ins {
    display: inline;
}

/* قیمت اصلی (خط‌خورده) */
.mg-product-price del,
.mg-product-price del bdi,
.mg-product-price del span,
.mg-product-price del .woocommerce-Price-amount {
    font-size: 0.76rem;
    font-weight: 400;
    color: #bbb;
    text-decoration: line-through;
    opacity: 1;
}

.mg-product-card .mg-btn {
    width: 100%;
    margin-top: auto;
}

/* تعداد علاقه‌مندی */
.mg-product-wishlist-count {
    display: flex;
    align-items: center;
    gap: 0.22rem;
    font-size: 0.65rem;
    color: #aaa;
    margin-top: 0.3rem;
}

.mg-product-wishlist-count svg {
    color: #e57373;
    flex-shrink: 0;
}

/* بهبود دکمه‌های Product Card در موبایل */
@media (max-width: 576px) {
    .mg-product-card .mg-btn {
        min-height: 44px;
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }
}

/* ============================================
   Featured Products Section - Premium
   ============================================ */
.mg-featured-products {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(var(--mg-primary-rgb), 0.02) 30%,
        rgba(var(--mg-secondary-rgb), 0.015) 50%,
        rgba(var(--mg-accent-rgb), 0.01) 70%,
        rgba(255, 255, 255, 0) 100%);
    padding: var(--mg-spacing-xxl) 0;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    box-shadow: 
        0 20px 60px -20px rgba(var(--mg-primary-rgb), 0.15),
        inset 0 0 100px rgba(255, 255, 255, 0.5),
        inset 0 0 200px rgba(var(--mg-primary-rgb), 0.03);
    opacity: 1 !important;
    visibility: visible !important;
}

/* بهبود Featured Products در موبایل */
@media (max-width: 768px) {
    .mg-featured-products {
        padding: 0.75rem 0;
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .mg-featured-products {
        padding: 0.5rem 0;
        margin: 0 auto;
    }
}

/* Animated Waves Background - Theme Colors */
.mg-featured-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.mg-wave-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    min-height: 200px;
    max-height: 60%;
    min-height: 600px;
}

.mg-wave-svg-2 {
    opacity: 0.8;
}

.mg-wave-svg-3 {
    opacity: 0.6;
}

.mg-wave-svg-4 {
    opacity: 0.5;
}

.mg-wave-svg-5 {
    opacity: 0.4;
    /* Prevent CLS - fixed dimensions */
    width: 100%;
    height: 60%;
    min-height: 200px;
    max-height: 60%;
}

/* Wave Colors - Matching Theme */
.mg-wave-path-primary {
    fill: rgba(var(--mg-primary-rgb), 0.15);
    transition: fill 0.3s ease;
}

.mg-wave-path-secondary {
    fill: rgba(var(--mg-secondary-rgb), 0.12);
    transition: fill 0.3s ease;
}

.mg-wave-path-accent {
    fill: rgba(var(--mg-accent-rgb), 0.1);
    transition: fill 0.3s ease;
}

/* Hover effect for waves */
.mg-featured-products:hover .mg-wave-path-primary {
    fill: rgba(var(--mg-primary-rgb), 0.2);
}

.mg-featured-products:hover .mg-wave-path-secondary {
    fill: rgba(var(--mg-secondary-rgb), 0.16);
}

.mg-featured-products:hover .mg-wave-path-accent {
    fill: rgba(var(--mg-accent-rgb), 0.13);
}

.mg-wave-svg-5 {
    width: 100% !important;
    height: 60% !important;
    min-height: 200px !important;
}

.mg-featured-products {
    background: #ffffff;
    box-shadow: none;
}

.mg-featured-waves {
    display: none;
}

/* Weather Animation Container */
.mg-weather-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

/* Snow Animation - Base styles (JavaScript will add particles) */
.mg-weather-animation[data-type="snow"] {
    /* Base container for snow - particles created by JS */
    z-index: 2;
}

@keyframes snowFall {
    0% {
        transform: translateY(-100vh) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(30px);
        opacity: 0;
    }
}

/* Rain Animation - Base styles (JavaScript will add particles) */
.mg-weather-animation[data-type="rain"] {
    /* Base container for rain - particles created by JS */
    z-index: 4;
}

@keyframes rainFall {
    0% {
        transform: translate3d(0, -120vh, 0) rotate(14deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translate3d(-32px, 120vh, 0) rotate(14deg);
        opacity: 0.15;
    }
}

/* Sun Animation */
.mg-weather-animation[data-type="sun"]::before {
    content: '☀️';
    position: absolute;
    top: 10%;
    right: 10%;
    font-size: 100px;
    opacity: 0.25;
    z-index: 3;
    pointer-events: none;
}

/* Storm Animation (Rain + Lightning) - Base styles (JavaScript will add particles) */
.mg-weather-animation[data-type="storm"] {
    /* Base container for storm - particles created by JS */
    z-index: 4;
}

@keyframes stormRain {
    0% {
        transform: translate3d(0, -120vh, 0) rotate(18deg);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    100% {
        transform: translate3d(-48px, 120vh, 0) rotate(18deg);
        opacity: 0.25;
    }
}

/* Lightning Effect for Storm */
.mg-weather-animation[data-type="storm"] {
    animation: lightning 6s ease-in-out infinite;
}

.mg-weather-animation[data-type="storm"]::before {
    content: '';
    position: absolute;
    top: -8%;
    left: 68%;
    width: 3px;
    height: 46%;
    opacity: 0;
    pointer-events: none;
    transform-origin: top center;
    transform: skewX(-12deg) scaleY(0.2);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.95) 24%,
        rgba(198, 232, 255, 0.9) 68%,
        rgba(255, 255, 255, 0) 100%
    );
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.95));
    animation: lightningFlash 6s ease-in-out infinite;
    z-index: 5;
}

@keyframes lightning {
    0%, 82%, 100% {
        background: transparent;
    }
    83%, 84% {
        background: rgba(255, 255, 255, 0.18);
    }
    85% {
        background: transparent;
    }
    86%, 87% {
        background: rgba(180, 220, 255, 0.12);
    }
    88% {
        background: transparent;
    }
}

@keyframes lightningFlash {
    0%, 82%, 100% {
        opacity: 0;
        transform: skewX(-12deg) scaleY(0.2);
    }
    83% {
        opacity: 0.95;
        transform: skewX(-12deg) scaleY(1);
    }
    84% {
        opacity: 0.35;
        transform: skewX(-14deg) scaleY(0.65);
    }
    86% {
        opacity: 0.82;
        transform: skewX(-10deg) scaleY(0.92);
    }
    87%, 88% {
        opacity: 0;
        transform: skewX(-12deg) scaleY(0.2);
    }
}

/* Additional Particles (Created by JavaScript) */
.mg-snowflake,
.mg-raindrop,
.mg-stormdrop {
    pointer-events: none;
}

.mg-snowflake {
    z-index: 2;
    /* Simple snowflake - just a white circle */
}

.mg-raindrop {
    border-radius: 0 0 3px 3px;
    z-index: 4;
}

.mg-stormdrop {
    border-radius: 0 0 3px 3px;
    filter: brightness(1.35);
    z-index: 4;
}

/* Ensure content is above animations */
.mg-featured-products .mg-container {
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0 var(--mg-spacing-md);
    box-sizing: border-box;
}

/* بهبود Container در موبایل */
@media (max-width: 768px) {
    .mg-featured-products .mg-container {
        padding: 0 var(--mg-spacing-sm);
    }
}

@media (max-width: 576px) {
    .mg-featured-products .mg-container {
        padding: 0 0.75rem;
    }
}

.mg-featured-products .mg-products-wrapper {
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    margin: 0;
    padding: 0;
}

.mg-featured-products .mg-products-swiper {
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    max-width: 100%;
    overflow: visible; /* visible به جای hidden تا hover کارت‌ها کلیپ نشه */
    margin: 0;
    padding: 12px 0 0 !important; /* padding-top برای فضای hover */
    box-sizing: border-box;
}

/* بهبود Swiper در موبایل - استفاده از padding container */
@media (max-width: 768px) {
    .mg-featured-products .mg-products-swiper {
        padding: 0 !important;
    }
    
    .mg-products-swiper {
        padding: var(--mg-spacing-sm) 0 var(--mg-spacing-lg) !important;
    }
    
    .mg-showcase-swiper {
        padding: var(--mg-spacing-md) 0 !important;
    }
    
    .mg-flash-sale-swiper {
        padding: var(--mg-spacing-md) 0 !important;
    }
}

@media (max-width: 576px) {
    .mg-featured-products .mg-products-swiper {
        padding: 0 !important;
    }
    
    .mg-products-swiper {
        padding: var(--mg-spacing-sm) 0 var(--mg-spacing-lg) !important;
    }
    
    .mg-showcase-swiper {
        padding: var(--mg-spacing-md) 0 !important;
    }
    
    .mg-flash-sale-swiper {
        padding: var(--mg-spacing-md) 0 !important;
    }
}

.mg-featured-products .swiper-wrapper {
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    width: auto;
    max-width: none;
    overflow: visible;
    display: flex;
    align-items: stretch;
}

.mg-featured-products .swiper-slide {
    position: relative;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    overflow: visible;
}


@media (max-width: 768px) {
    .mg-featured-products .mg-products-swiper {
        padding: 0 !important;
    }
}

/* Responsive adjustments for animations */
@media (max-width: 768px) {
    .mg-featured-waves {
        height: 50%;
    }
    
    .mg-weather-animation[data-type="sun"]::before {
        font-size: 50px;
        top: 5%;
        right: 5%;
    }
    
    .mg-weather-animation[data-type="sun"]::after {
        width: 60px;
        height: 60px;
        top: 5%;
        right: 5%;
    }
}


.mg-featured-header {
    margin-bottom: var(--mg-spacing-xl);
}

/* تیتر لینک‌شده محصولات ویژه */
.mg-featured-header .mg-section-title a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mg-featured-header .mg-section-title a:hover {
    color: var(--mg-primary);
}

/* همون badge زیر تیتر — روی hover لینک گسترش پیدا می‌کنه */
.mg-featured-header .mg-section-title::after {
    transition: width 0.4s ease;
}

.mg-featured-header .mg-section-title:has(a:hover)::after {
    width: 100%;
}

/* بهبود Featured Header در موبایل */
@media (max-width: 768px) {
    .mg-featured-header {
        margin-bottom: var(--mg-spacing-lg);
        padding: 0 var(--mg-spacing-sm);
    }
}

@media (max-width: 576px) {
    .mg-featured-header {
        margin-bottom: var(--mg-spacing-md);
    }
}

/* LED Blinking Effect for Featured Products Title - Broken Light Effect */
.mg-featured-header .mg-section-title {
    color: var(--mg-primary);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    position: relative;
    transition: opacity 0.1s step-end;
}


.mg-section-header-content {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-md);
    justify-content: center;
    text-align: center;
}

.mg-section-icon {
    width: 64px;
    height: 64px;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(251, 191, 36, 0.4);
    position: relative;
    overflow: hidden;
}

.mg-section-icon svg {
    width: 32px;
    height: 32px;
}

/* Featured Product Card - Premium */
.mg-featured-product-card {
    position: relative;
    border: none;
    border-radius: var(--mg-radius-lg) !important;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    min-height: 400px;
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    display: flex;
    flex-direction: column;
    top: 0;
}

@media (max-width: 768px) {
    .mg-featured-products .mg-featured-product-card {
        min-height: 360px;
    }
}

@media (max-width: 576px) {
    .mg-featured-products .mg-featured-product-card {
        min-height: 320px;
    }
}

.mg-featured-product-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-lg);
    opacity: 0;
    transition: var(--mg-transition);
    z-index: -1;
}

.mg-featured-product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: var(--mg-radius-lg);
}

.mg-featured-product-card:hover {
    transform: scale3d(1, 1, 1);
    box-shadow: 0 20px 50px -15px rgba(251, 191, 36, 0.3);
    will-change: transform;
    /* استفاده از position به جای translateY برای جلوگیری از layout shift */
    position: relative;
    top: -8px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-featured-product-card:hover::before {
    opacity: 0.1;
}

.mg-featured-product-card:hover::after {
    left: 100%;
}

/* Premium Featured Badge - Simple Style */
.mg-featured-product-card .mg-badge-featured-premium {
    display: inline-flex !important;
    align-items: center;
    gap: 0.24rem;
    background: linear-gradient(135deg, #ff7a45 0%, #ff9f1c 100%) !important;
    color: #ffffff !important;
    padding: 0.3rem 0.58rem !important;
    font-size: 0.66rem !important;
    font-weight: 600 !important;
    line-height: 1;
    letter-spacing: 0.01em;
    border-radius: 999px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18) !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 10 !important;
    overflow: visible !important;
    margin: 0 !important;
}

.mg-badge-featured-premium svg {
    width: 12px;
    height: 12px;
}

@media (max-width: 768px) {
    .mg-featured-product-card .mg-badge-featured-premium {
        top: 8px !important;
        right: 8px !important;
        padding: 0.24rem 0.48rem !important;
        font-size: 0.6rem !important;
    }

    .mg-badge-featured-premium svg {
        width: 10px;
        height: 10px;
    }
}


/* ============================================
   Products Swiper
   ============================================ */
.mg-products-swiper {
    padding: 12px 0 var(--mg-spacing-lg) !important; /* padding-top برای فضای hover کارت‌ها */
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.mg-products-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.mg-products-swiper .swiper-slide,
.mg-showcase-swiper .swiper-slide,
.mg-flash-sale-swiper .swiper-slide {
    height: auto;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* وقتی swiper قفله (watchOverflow) اسلاید نباید تمام عرض رو بگیره */
.mg-products-swiper.swiper-locked .swiper-slide,
.mg-showcase-swiper.swiper-locked .swiper-slide,
.mg-flash-sale-swiper.swiper-locked .swiper-slide {
    max-width: calc(50% - 6px);
}
@media (min-width: 768px) {
    .mg-products-swiper.swiper-locked .swiper-slide,
    .mg-showcase-swiper.swiper-locked .swiper-slide,
    .mg-flash-sale-swiper.swiper-locked .swiper-slide {
        max-width: calc(33.333% - 8px);
    }
}
@media (min-width: 992px) {
    .mg-products-swiper.swiper-locked .swiper-slide,
    .mg-showcase-swiper.swiper-locked .swiper-slide,
    .mg-flash-sale-swiper.swiper-locked .swiper-slide {
        max-width: calc(25% - 9px);
    }
}
@media (min-width: 1200px) {
    .mg-products-swiper.swiper-locked .swiper-slide,
    .mg-showcase-swiper.swiper-locked .swiper-slide {
        max-width: calc(16.666% - 10px);
    }
    .mg-flash-sale-swiper.swiper-locked .swiper-slide {
        max-width: calc(20% - 10px);
    }
}
@media (min-width: 1600px) {
    .mg-flash-sale-swiper.swiper-locked .swiper-slide {
        max-width: calc(16.666% - 11px);
    }
}

.mg-products-swiper .swiper-slide .mg-product-card {
    width: 100%;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.mg-products-scrollbar {
    margin-top: var(--mg-spacing-md);
    height: 4px;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-full);
}

.mg-products-scrollbar .swiper-scrollbar-drag {
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-full);
}

/* Products Pagination Only - Premium */
.mg-products-wrapper {
    position: relative;
    padding-bottom: 3rem;
}

.mg-products-pagination {
    position: relative !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-top: 1.5rem;
}

.mg-products-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: var(--mg-border);
    opacity: 1 !important;
    transition: all 0.3s ease;
    border-radius: 50%;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
}

.mg-products-pagination .swiper-pagination-bullet-active,
.mg-products-pagination .swiper-pagination-bullet-active-main {
    background: var(--mg-primary);
}

.mg-products-pagination .swiper-pagination-bullet-active {
    background: var(--mg-gradient-primary);
    width: 32px;
    border-radius: 6px;
}

/* ============================================
   Banners - Premium (Dynamic Grid)
   ============================================ */
/* ═════════════════════════════════════════
   mg-banners background — Pattern آیکن‌های فروشگاهی (SVG)
   آیکن‌ها به‌صورت افقی در عرض section تکرار می‌شن.
═════════════════════════════════════════ */
.mg-banners {
    position: relative;
    background: #fdfdfd;
    overflow: hidden;
    isolation: isolate;
}

/* SVG pattern با تکرار افقی (repeat-x) — ارتفاع SVG با section هماهنگ می‌شه */
.mg-banners::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('../img/banners-pattern.svg');
    background-repeat: repeat-x;
    background-position: center;
    /* ارتفاع 100% section، عرض اتومات حفظ نسبت — این باعث میشه در عرض تکرار بشه */
    background-size: auto 100%;
    opacity: 1;
}

/* دسکتاپ بزرگ — SVG کوچک‌تر تا تکرار بیشتری دیده بشه */
@media (min-width: 1400px) {
    .mg-banners::after {
        background-size: auto 90%;
    }
}

/* موبایل — SVG بزرگ‌تر چون فضا کمه */
@media (max-width: 767px) {
    .mg-banners::after {
        background-size: auto 110%;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .mg-banners .mg-container {
        padding-inline: clamp(3rem, 6vw, 7rem);
    }
}

@media (min-width: 992px) {
    .mg-banners .mg-container {
        padding-inline: clamp(12rem, 17vw, 22rem);
    }
}

.mg-banner-row {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    grid-auto-rows: 230px;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 767px) {
    .mg-banner-row {
        grid-auto-rows: 90px;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

.mg-banner-row:last-child {
    margin-bottom: 0;
}

.mg-banner-cell {
    /* height: 100%; */
    /* width: 100%; */
    grid-column: span var(--span, 1);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    display: flex;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.mg-banner-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
   
    object-position: center;
    display: block;
}

a.mg-banner-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.mg-banner-cell-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%);
    pointer-events: none;
}

.mg-banner-cell-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    line-height: 1.3;
}


/* ============================================
   Flash Sale - Soft Premium Pattern Background
   ============================================ */
.mg-flash-sale {
    background:
        radial-gradient(ellipse 55% 45% at 10% 5%, color-mix(in srgb, var(--mg-flash-glow, #dc2626) 22%, transparent) 0%, transparent 55%),
        radial-gradient(ellipse 45% 35% at 90% 90%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        linear-gradient(155deg, var(--mg-flash-bg-1, #0c1e3a) 0%, color-mix(in srgb, var(--mg-flash-bg-1, #0c1e3a) 45%, var(--mg-flash-bg-2, #1a4878)) 52%, var(--mg-flash-bg-2, #1a4878) 100%);
    background-color: var(--mg-flash-bg-1, #0c1e3a);
    position: relative;
    overflow: hidden;
    clip-path: none;
    padding-top: calc(var(--mg-spacing-lg) + 2rem) !important;
    padding-bottom: calc(var(--mg-spacing-lg) + 2rem) !important;
    margin: var(--mg-spacing-lg) 0;
}

.mg-flash-sale .mg-container {
    padding-inline: max(2.5rem, 40px);
}

.mg-flash-sale::before {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    z-index: 1;
    pointer-events: none;
}

.mg-flash-sale > .mg-container {
    z-index: 2;
    padding-top: clamp(0.85rem, 1.3vw, 1.25rem);
}

.mg-flash-sale > .mg-container > * {
    position: relative;
    z-index: 2;
}

.mg-flash-sale::after {
    content: none;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: none;
    opacity: 0;
    filter: none;
}

.mg-flash-lights {
    display: none !important;
}

.mg-flash-snow {
    display: block !important;
}

.mg-flash-sale > .mg-container::before,
.mg-flash-sale > .mg-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 768px) {
    .mg-flash-sale::after {
        background: none;
        opacity: 0;
    }
}


/* Style: Hexagon (soft) — شش‌ضلعی شیک */
.mg-flash-bg-shapes-soft > .mg-container::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.45'%3E%3Cpath d='M28 0L56 16.18V49.5L28 65.68L0 49.5V16.18Z'/%3E%3Cpath d='M28 33.66L56 49.84V83.16L28 99.34L0 83.16V49.84Z'/%3E%3Cpath d='M28 67.32L0 83.5'/%3E%3Cpath d='M0 16.18L28 33.66L56 16.18'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 56px 100px;
    background-position: 0 0;
    opacity: 0.18;
}

.mg-flash-bg-shapes-soft > .mg-container::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.6' opacity='0.3'%3E%3Cpath d='M28 0L56 16.18V49.5L28 65.68L0 49.5V16.18Z'/%3E%3Cpath d='M28 33.66L56 49.84V83.16L28 99.34L0 83.16V49.84Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 84px 150px;
    background-position: 14px 25px;
    opacity: 0.1;
}

/* Style: Wavy */
.mg-flash-bg-shapes-rings > .mg-container::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 96'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2' opacity='0.42'%3E%3Cpath d='M0 18 Q15 2 30 18 T60 18 T90 18 T120 18 T150 18 T180 18'/%3E%3Cpath d='M0 48 Q15 32 30 48 T60 48 T90 48 T120 48 T150 48 T180 48'/%3E%3Cpath d='M0 78 Q15 62 30 78 T60 78 T90 78 T120 78 T150 78 T180 78'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 180px 96px;
    background-position: 0 0;
    opacity: 0.22;
}

.mg-flash-bg-shapes-rings > .mg-container::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.9' opacity='0.32'%3E%3Cpath d='M0 16 Q12 4 24 16 T48 16 T72 16 T96 16 T120 16 T144 16'/%3E%3Cpath d='M0 40 Q12 28 24 40 T48 40 T72 40 T96 40 T120 40 T144 40'/%3E%3Cpath d='M0 64 Q12 52 24 64 T48 64 T72 64 T96 64 T120 64 T144 64'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 140px 72px;
    background-position: 20px 12px;
    opacity: 0.14;
}

/* Style: Diagonal (extra) */
.mg-flash-bg-shapes-mesh > .mg-container::before {
    background-image:
        repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px);
    background-size: 56px 56px, 56px 56px;
    background-position: 0 0, 28px 0;
    opacity: 0.22;
}

.mg-flash-bg-shapes-mesh > .mg-container::after {
    background-image:
        repeating-linear-gradient(55deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 22px);
    background-size: 68px 68px, 68px 68px;
    background-position: 10px 8px, 0 16px;
    opacity: 0.12;
}

/* Style: Dots */
.mg-flash-bg-shapes-dots > .mg-container::before {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.18) 1.4px, transparent 1.6px),
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1.2px);
    background-size: 18px 18px, 28px 28px;
    background-position: 0 0, 10px 12px;
    opacity: 0.25;
}

.mg-flash-bg-shapes-dots > .mg-container::after {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.13) 1px, transparent 1.2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.09) 0.8px, transparent 1px);
    background-size: 14px 14px, 24px 24px;
    background-position: 6px 4px, 16px 9px;
    opacity: 0.14;
}

/* Style: Grid (extra) */
.mg-flash-bg-shapes-grid > .mg-container::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 34px 34px, 34px 34px;
    background-position: 0 0;
    opacity: 0.18;
}

.mg-flash-bg-shapes-grid > .mg-container::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px, 22px 22px;
    background-position: 10px 8px;
    opacity: 0.09;
}

/* Style: none */
.mg-flash-bg-shapes-none > .mg-container::before,
.mg-flash-bg-shapes-none > .mg-container::after {
    display: none;
}

.mg-flash-container-shape-angled {
    clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
}

.mg-flash-container-shape-wave {
    clip-path: polygon(
        0 4.4%, 4% 3.3%, 9% 2.4%, 14% 2.0%, 20% 2.8%, 26% 4.2%, 32% 5.1%, 38% 4.7%, 44% 3.2%, 50% 2.1%,
        56% 2.6%, 62% 4.1%, 68% 5.2%, 74% 4.8%, 80% 3.3%, 86% 2.2%, 92% 2.4%, 96% 3.2%, 100% 4.0%,
        100% 96.0%, 96% 96.9%, 92% 97.8%, 86% 98.0%, 80% 97.2%, 74% 95.9%, 68% 95.0%, 62% 95.3%, 56% 96.8%, 50% 97.9%,
        44% 97.4%, 38% 95.8%, 32% 94.9%, 26% 95.4%, 20% 96.9%, 14% 98.0%, 9% 97.7%, 4% 96.8%, 0 96.2%
    );
}

.mg-flash-container-shape-arch {
    clip-path: polygon(
        0 8.5%, 6% 5.6%, 12% 3.4%, 20% 1.9%, 30% 1.0%, 40% 0.5%, 50% 0, 60% 0.5%, 70% 1.0%, 80% 1.9%, 88% 3.4%, 94% 5.6%, 100% 8.5%,
        100% 100%, 0 100%
    );
}

.mg-flash-container-shape-zigzag {
    clip-path: polygon(
        0 5.2%, 4% 3.2%, 10% 3.2%, 14% 5.2%, 20% 5.2%, 24% 3.2%, 30% 3.2%, 34% 5.2%, 40% 5.2%, 44% 3.2%,
        50% 3.2%, 54% 5.2%, 60% 5.2%, 64% 3.2%, 70% 3.2%, 74% 5.2%, 80% 5.2%, 84% 3.2%, 90% 3.2%, 94% 5.2%, 100% 5.2%,
        100% 100%, 0 100%
    );
}

.mg-flash-container-shape-flat,
.mg-flash-container-shape-none {
    clip-path: none;
}

@media (max-width: 768px) {
    .mg-flash-lights {
        display: none;
    }

    .mg-flash-sale > .mg-container {
        padding: 0 1rem;
    }

    .mg-light-top {
        top: 14px;
    }

    .mg-light-right[data-index="0"] {
        top: 14px;
    }

    .mg-light-left[data-index="14"] {
        top: 14px;
    }

    /* موبایل: بالا/پایین ۲ تا، چپ/راست ۵ تا */
    .mg-light-top[data-index="0"],
    .mg-light-top[data-index="1"],
    .mg-light-top[data-index="2"],
    .mg-light-top[data-index="3"],
    .mg-light-top[data-index="5"],
    .mg-light-top[data-index="6"],
    .mg-light-top[data-index="7"],
    .mg-light-top[data-index="8"],
    .mg-light-top[data-index="9"],
    .mg-light-top[data-index="11"],
    .mg-light-top[data-index="12"],
    .mg-light-top[data-index="13"],
    .mg-light-top[data-index="14"],
    .mg-light-bottom[data-index="0"],
    .mg-light-bottom[data-index="1"],
    .mg-light-bottom[data-index="2"],
    .mg-light-bottom[data-index="3"],
    .mg-light-bottom[data-index="5"],
    .mg-light-bottom[data-index="6"],
    .mg-light-bottom[data-index="7"],
    .mg-light-bottom[data-index="8"],
    .mg-light-bottom[data-index="9"],
    .mg-light-bottom[data-index="11"],
    .mg-light-bottom[data-index="12"],
    .mg-light-bottom[data-index="13"],
    .mg-light-bottom[data-index="14"],
    .mg-light-right[data-index="1"],
    .mg-light-right[data-index="2"],
    .mg-light-right[data-index="4"],
    .mg-light-right[data-index="5"],
    .mg-light-right[data-index="7"],
    .mg-light-right[data-index="8"],
    .mg-light-right[data-index="10"],
    .mg-light-right[data-index="11"],
    .mg-light-right[data-index="13"],
    .mg-light-right[data-index="14"],
    .mg-light-left[data-index="1"],
    .mg-light-left[data-index="2"],
    .mg-light-left[data-index="4"],
    .mg-light-left[data-index="5"],
    .mg-light-left[data-index="7"],
    .mg-light-left[data-index="8"],
    .mg-light-left[data-index="10"],
    .mg-light-left[data-index="11"],
    .mg-light-left[data-index="13"],
    .mg-light-left[data-index="14"] {
        display: none;
    }

    /* موبایل: animation ساده‌تر برای performance */
    .mg-flash-light {
        width: 8px;
        height: 8px;
        box-shadow: 0 0 5px rgba(251,191,36,0.7), 0 0 10px rgba(251,191,36,0.4);
        animation-duration: 3s;
    }

    .mg-flash-container-shape-wave,
    .mg-flash-container-shape-arch,
    .mg-flash-container-shape-zigzag,
    .mg-flash-container-shape-angled {
        clip-path: none !important;
    }

    .mg-flash-bg-shapes-soft > .mg-container::before {
        top: 14px;
        right: 12px;
        bottom: 18px;
        left: 12px;
        width: auto;
        height: auto;
        border-radius: 14px;
        background-size: 200px 383px;
        opacity: 0.26;
    }

    .mg-flash-bg-shapes-soft > .mg-container::after {
        display: none;
    }


    .mg-flash-bg-shapes-rings > .mg-container::before {
        top: 16px;
        right: 14px;
        bottom: 20px;
        left: 14px;
        width: auto;
        height: auto;
        border-radius: 14px;
        background-size: 56px 56px, 78px 78px;
        opacity: 0.28;
    }

    .mg-flash-bg-shapes-rings > .mg-container::after {
        top: 16px;
        right: 14px;
        bottom: 20px;
        left: 14px;
        width: auto;
        height: auto;
        border-radius: 14px;
        background-size: 52px 52px, 72px 72px;
        opacity: 0.2;
    }

    .mg-flash-bg-shapes-mesh > .mg-container::before,
    .mg-flash-bg-shapes-mesh > .mg-container::after,
    .mg-flash-bg-shapes-dots > .mg-container::before,
    .mg-flash-bg-shapes-dots > .mg-container::after,
    .mg-flash-bg-shapes-grid > .mg-container::before,
    .mg-flash-bg-shapes-grid > .mg-container::after {
        top: 16px;
        right: 14px;
        bottom: 20px;
        left: 14px;
        width: auto;
        height: auto;
        border-radius: 14px;
        opacity: 0.24;
    }

    .mg-flash-bg-shapes-mesh > .mg-container::before {
        background-size: 38px 38px, 38px 38px;
    }

    .mg-flash-bg-shapes-mesh > .mg-container::after {
        background-size: 42px 42px, 42px 42px;
        opacity: 0.16;
    }

    .mg-flash-bg-shapes-dots > .mg-container::before {
        background-size: 14px 14px, 22px 22px;
    }

    .mg-flash-bg-shapes-dots > .mg-container::after {
        background-size: 12px 12px, 18px 18px;
        opacity: 0.16;
    }

    .mg-flash-bg-shapes-grid > .mg-container::before {
        background-size: 26px 26px, 26px 26px;
    }

    .mg-flash-bg-shapes-grid > .mg-container::after {
        background-size: 16px 16px, 16px 16px;
        opacity: 0.12;
    }
}

/* Golden Lights Border */
.mg-flash-lights {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

@keyframes lightBlink {
    0%, 49% {
        opacity: 1;
        box-shadow: 0 0 7px rgba(251,191,36,0.85), 0 0 14px rgba(251,191,36,0.6), 0 0 22px rgba(251,191,36,0.4);
    }
    50%, 100% {
        opacity: 0.06;
        box-shadow: none;
    }
}

.mg-flash-light {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fbbf24 0%, #f59e0b 50%, transparent 70%);
    border-radius: 50%;
    box-shadow:
        0 0 7px rgba(251, 191, 36, 0.75),
        0 0 12px rgba(251, 191, 36, 0.5),
        0 0 18px rgba(251, 191, 36, 0.35);
}

.mg-light-even {
    animation: lightBlink 2s step-end infinite;
}

.mg-light-odd {
    animation: lightBlink 2s step-end infinite 1s;
}

/* Top lights - Horizontal, equal spacing */
.mg-light-top {
    top: 12px;
    transform: translate(-50%, -50%);
}

.mg-light-top[data-index="0"] { left: 16px; }
.mg-light-top[data-index="1"] { left: calc(16px + 1 * (100% - 32px) / 14); }
.mg-light-top[data-index="2"] { left: calc(16px + 2 * (100% - 32px) / 14); }
.mg-light-top[data-index="3"] { left: calc(16px + 3 * (100% - 32px) / 14); }
.mg-light-top[data-index="4"] { left: calc(16px + 4 * (100% - 32px) / 14); }
.mg-light-top[data-index="5"] { left: calc(16px + 5 * (100% - 32px) / 14); }
.mg-light-top[data-index="6"] { left: calc(16px + 6 * (100% - 32px) / 14); }
.mg-light-top[data-index="7"] { left: calc(16px + 7 * (100% - 32px) / 14); }
.mg-light-top[data-index="8"] { left: calc(16px + 8 * (100% - 32px) / 14); }
.mg-light-top[data-index="9"] { left: calc(16px + 9 * (100% - 32px) / 14); }
.mg-light-top[data-index="10"] { left: calc(16px + 10 * (100% - 32px) / 14); }
.mg-light-top[data-index="11"] { left: calc(16px + 11 * (100% - 32px) / 14); }
.mg-light-top[data-index="12"] { left: calc(16px + 12 * (100% - 32px) / 14); }
.mg-light-top[data-index="13"] { left: calc(16px + 13 * (100% - 32px) / 14); }
.mg-light-top[data-index="14"] { left: calc(100% - 16px); }

/* Right lights - Vertical, equal spacing */
.mg-light-right {
    right: 16px;
    transform: translate(50%, -50%);
}

.mg-light-right[data-index="0"] { top: 12px; }
.mg-light-right[data-index="1"] { top: calc(10px + 1 * (100% - 20px) / 14); }
.mg-light-right[data-index="2"] { top: calc(10px + 2 * (100% - 20px) / 14); }
.mg-light-right[data-index="3"] { top: calc(10px + 3 * (100% - 20px) / 14); }
.mg-light-right[data-index="4"] { top: calc(10px + 4 * (100% - 20px) / 14); }
.mg-light-right[data-index="5"] { top: calc(10px + 5 * (100% - 20px) / 14); }
.mg-light-right[data-index="6"] { top: calc(10px + 6 * (100% - 20px) / 14); }
.mg-light-right[data-index="7"] { top: calc(10px + 7 * (100% - 20px) / 14); }
.mg-light-right[data-index="8"] { top: calc(10px + 8 * (100% - 20px) / 14); }
.mg-light-right[data-index="9"] { top: calc(10px + 9 * (100% - 20px) / 14); }
.mg-light-right[data-index="10"] { top: calc(10px + 10 * (100% - 20px) / 14); }
.mg-light-right[data-index="11"] { top: calc(10px + 11 * (100% - 20px) / 14); }
.mg-light-right[data-index="12"] { top: calc(10px + 12 * (100% - 20px) / 14); }
.mg-light-right[data-index="13"] { top: calc(10px + 13 * (100% - 20px) / 14); }
.mg-light-right[data-index="14"] { top: auto; bottom: 10px; }

/* Bottom lights - Horizontal, equal spacing (reversed) */
.mg-light-bottom {
    bottom: 10px;
    transform: translate(-50%, 50%);
}

.mg-light-bottom[data-index="0"] { left: calc(100% - 16px); }
.mg-light-bottom[data-index="1"] { left: calc(16px + 13 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="2"] { left: calc(16px + 12 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="3"] { left: calc(16px + 11 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="4"] { left: calc(16px + 10 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="5"] { left: calc(16px + 9 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="6"] { left: calc(16px + 8 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="7"] { left: calc(16px + 7 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="8"] { left: calc(16px + 6 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="9"] { left: calc(16px + 5 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="10"] { left: calc(16px + 4 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="11"] { left: calc(16px + 3 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="12"] { left: calc(16px + 2 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="13"] { left: calc(16px + 1 * (100% - 32px) / 14); }
.mg-light-bottom[data-index="14"] { left: 16px; }

/* Left lights - Vertical, equal spacing (reversed) */
.mg-light-left {
    left: 16px;
    transform: translate(-50%, -50%);
}

.mg-light-left[data-index="0"] { top: auto; bottom: 10px; }
.mg-light-left[data-index="1"] { top: calc(10px + 13 * (100% - 20px) / 14); }
.mg-light-left[data-index="2"] { top: calc(10px + 12 * (100% - 20px) / 14); }
.mg-light-left[data-index="3"] { top: calc(10px + 11 * (100% - 20px) / 14); }
.mg-light-left[data-index="4"] { top: calc(10px + 10 * (100% - 20px) / 14); }
.mg-light-left[data-index="5"] { top: calc(10px + 9 * (100% - 20px) / 14); }
.mg-light-left[data-index="6"] { top: calc(10px + 8 * (100% - 20px) / 14); }
.mg-light-left[data-index="7"] { top: calc(10px + 7 * (100% - 20px) / 14); }
.mg-light-left[data-index="8"] { top: calc(10px + 6 * (100% - 20px) / 14); }
.mg-light-left[data-index="9"] { top: calc(10px + 5 * (100% - 20px) / 14); }
.mg-light-left[data-index="10"] { top: calc(10px + 4 * (100% - 20px) / 14); }
.mg-light-left[data-index="11"] { top: calc(10px + 3 * (100% - 20px) / 14); }
.mg-light-left[data-index="12"] { top: calc(10px + 2 * (100% - 20px) / 14); }
.mg-light-left[data-index="13"] { top: calc(10px + 1 * (100% - 20px) / 14); }
.mg-light-left[data-index="14"] { top: 12px; }


/* Snow Effect for Flash Sale */
.mg-flash-snow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    /* Prevent CLS - ensure it doesn't affect layout */
    contain: layout style paint;
    will-change: transform, opacity;
}

@keyframes flashSnowFall {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) translateX(20px);
        opacity: 0;
    }
}

.mg-flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.45rem;
    margin-bottom: var(--mg-spacing-lg);
    flex-wrap: wrap;
    gap: var(--mg-spacing-lg);
    position: relative;
    z-index: 3;
}

.mg-flash-sale .mg-section-title {
    color: #ffffff;
}

.mg-flash-sale .mg-section-title svg {
    color: var(--mg-flash-accent);
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.38));
}

.mg-flash-sale .mg-section-subtitle {
    color: rgba(255, 255, 255, 0.76);
}

.mg-flash-title-wrapper {
    flex: 1;
}

.mg-countdown {
    display: flex;
    flex-direction: row;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--mg-spacing-sm);
}

.mg-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.4rem;
    border-radius: var(--mg-radius);
    min-width: 36px;
    width: 36px;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
}

.mg-countdown-item::before {
    display: none;
}

.mg-countdown-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 2ch;
    text-align: center;
    display: block;
    position: relative;
    z-index: 1;
}

.mg-countdown-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

.mg-countdown-separator {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    animation: blink 1s step-end infinite;
    min-width: 0.5ch;
    width: 0.5ch;
    display: inline-block;
    text-align: center;
    opacity: 0.8;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Flash Sale Wrapper */
.mg-flash-sale-wrapper {
    --mg-flash-card-width: 210px;
    --mg-flash-card-height: var(--mg-home-card-height);
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: var(--mg-spacing-lg);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(2px) saturate(1.2);
    -webkit-backdrop-filter: blur(2px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    padding: var(--mg-spacing-md);
}

/* Festival Banner Fixed Container */
.mg-festival-banner-fixed {
    position: sticky;
    top: 100px;
    flex-shrink: 0;
    width: var(--mg-flash-card-width) !important;
    z-index: 20;
}

/* Flash Sale Swiper */
.mg-flash-sale-swiper {
    padding: 8px 0 !important;
    overflow-x: clip;
    overflow-y: visible;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
}

.mg-flash-sale-swiper .swiper-wrapper {
    align-items: stretch;
}

.mg-flash-sale-swiper .swiper-slide {
    height: auto;
}

/* Smooth drag/swipe in flash sale - prevent native browser drag behavior */
.mg-flash-sale-swiper,
.mg-flash-sale-swiper .swiper-wrapper,
.mg-flash-sale-swiper .swiper-slide {
    -webkit-user-select: none;
    user-select: none;
}

.mg-flash-sale-swiper a,
.mg-flash-sale-swiper img {
    -webkit-user-drag: none;
}

.mg-flash-sale-swiper .mg-product-image-wrapper img {
    pointer-events: none;
}

/* Title overlay interferes with swiper drag inside flash sale */
.mg-flash-sale-swiper .mg-product-title a::after {
    display: none;
}

.mg-flash-view-all-mobile {
    display: none;
}

/* Festival Banner */
.mg-festival-banner {
    height: var(--mg-flash-card-height);
    min-height: var(--mg-flash-card-height);
    max-height: var(--mg-flash-card-height);
    background: none;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: auto;
    z-index: 10;
}

.mg-festival-banner::before,
.mg-festival-banner::after {
    display: none;
}

.mg-festival-banner * {
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.mg-festival-banner:hover {
    transform: none;
    box-shadow: none;
}

.mg-banner-shape-wave,
.mg-banner-shape-diagonal,
.mg-banner-shape-blob,
.mg-banner-shape-zigzag,
.mg-banner-shape-flat {
    clip-path: none !important;
}

.mg-festival-content {
    flex: 1;
    padding: 1rem 0.6rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    position: relative;
    z-index: 2;
}

.mg-festival-logo {
    width: 145px;
    height: auto;
    display: block;
    margin: 0 auto var(--mg-spacing-sm);
    filter:
        drop-shadow(0 4px 8px rgba(251, 191, 36, 0.4))
        drop-shadow(0 12px 28px rgba(0, 0, 0, 0.3));
    opacity: 1;
    animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-1deg); }
}

.mg-festival-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.75rem;
    border-radius: var(--mg-radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    width: fit-content;
}

.mg-festival-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
}

.mg-festival-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.4;
    margin: 0;
}

.mg-festival-discount {
    display: none !important;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--mg-radius);
    padding: 0.7rem 1.2rem;
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.15);
}

.mg-discount-number {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.mg-discount-percent {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--mg-flash-accent);
    line-height: 1;
}

.mg-discount-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.mg-festival-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    border-radius: var(--mg-radius);
    font-weight: 700;
    font-size: 0.72rem;
    transition: var(--mg-transition);
    width: fit-content;
    backdrop-filter: blur(8px);
}

.mg-festival-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.mg-festival-btn svg,
.mg-flash-view-all-mobile svg,
.mg-view-all svg,
.mg-blog-link svg,
.mg-author-link svg,
.mg-nav-link > svg,
.mg-cp-checkout-btn svg,
.mg-cp-continue svg {
    display: none;
}

.mg-festival-image {
    display: none;
}

/* Flash Product Cards */

/* جلوگیری از نشت افقی کل سکشن فروش ویژه */
.mg-flash-sale,
.mg-flash-sale .mg-container,
.mg-flash-sale-wrapper {
    overflow: visible;
    overflow-x: clip;
}

.mg-flash-sale .swiper-slide {
    height: auto;
}

.mg-flash-product {
    width: 100%;
    height: 100%;
}

/* Flash sale cards — same style as featured/showcase */

.mg-flash-fire {
    position: absolute;
    top: var(--mg-spacing-sm);
    left: var(--mg-spacing-sm);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--mg-flash-banner-1) 0%, var(--mg-flash-banner-2) 100%);
    border-radius: var(--mg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(255, 65, 108, 0.5);
    z-index: 3;
}

.mg-flash-fire svg {
    width: 14px;
    height: 14px;
}

/* Flash Sale Pagination Only */
.mg-flash-pagination {
    position: relative !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-top: 2rem;
}

.mg-flash-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.36);
    opacity: 1 !important;
    transition: all 0.3s ease;
    border-radius: 50%;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

.mg-flash-pagination .swiper-pagination-bullet-active,
.mg-flash-pagination .swiper-pagination-bullet-active-main {
    background: linear-gradient(135deg, var(--mg-flash-banner-1) 0%, var(--mg-flash-banner-2) 100%);
    border-color: transparent;
    width: 32px;
    border-radius: 6px;
}

/* ============================================
   Performance: Pause CSS animations off-screen
   ============================================ */
.mg-section.mg-anim-paused .mg-snowflake,
.mg-section.mg-anim-paused .mg-raindrop,
.mg-section.mg-anim-paused .mg-stormdrop,
.mg-section.mg-anim-paused .mg-flash-light,
.mg-section.mg-anim-paused .mg-flash-fire,
.mg-section.mg-anim-paused .mg-lightning-flash,
.mg-section.mg-anim-paused .mg-weather-animation[data-type="storm"],
.mg-section.mg-anim-paused .mg-weather-animation[data-type="storm"]::before,
.mg-section.mg-anim-paused .mg-festival-badge,
.mg-section.mg-anim-paused .mg-countdown-value,
.mg-section.mg-anim-paused .mg-countdown-separator {
    animation-play-state: paused !important;
}

/* Flash Sale Responsive */
@media (max-width: 1200px) {
    .mg-flash-sale-wrapper {
        --mg-flash-card-width: 188px;
        --mg-flash-card-height: var(--mg-home-card-height-md);
    }

    .mg-festival-banner-fixed {
        width: var(--mg-flash-card-width) !important;
    }


}

@media (max-width: 991px) {
    .mg-flash-sale {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .mg-flash-sale .mg-container {
        padding-inline: 0;
    }

    .mg-flash-sale-wrapper {
        flex-direction: column;
        padding: 1rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(16px) saturate(1.3) !important;
        -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18),
                    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
        gap: 0.4rem !important;
    }

    .mg-flash-container-shape-wave,
    .mg-flash-container-shape-arch,
    .mg-flash-container-shape-zigzag,
    .mg-flash-container-shape-angled {
        clip-path: none !important;
    }

    .mg-festival-banner-fixed {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100%;
        margin: 0;
    }

    .mg-festival-banner {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        background: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .mg-festival-content {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 1rem !important;
        gap: 1.5rem !important;
    }

    .mg-festival-logo {
        width: 130px !important;
        margin: 0 !important;
        animation: none !important;
        filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.24));
    }

    .mg-festival-content .mg-countdown {
        margin-bottom: 0 !important;
        flex-wrap: wrap-reverse;
        justify-content: center;
        align-content: center;
        gap: 0.2rem;
        max-width: 118px;
    }

    .mg-festival-content .mg-countdown > *:nth-child(4) {
        display: none;
    }

    .mg-festival-content .mg-countdown-item {
        min-width: 44px;
        width: 44px;
        background: rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 8px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12),
                    inset 0 1px 0 rgba(255, 255, 255, 0.18);
        padding: 0.35rem 0.4rem;
    }

    .mg-festival-content .mg-countdown-value {
        font-size: 1.1rem;
    }

    .mg-festival-content .mg-countdown-label {
        font-size: 0.58rem;
    }

    .mg-festival-content .mg-countdown-separator {
        color: var(--mg-flash-accent);
        font-size: 1rem;
    }

    .mg-festival-btn {
        display: none !important;
    }

    .mg-flash-view-all-mobile {
        display: flex;
    }

    .mg-festival-image {
        display: none;
    }

    .mg-flash-sale-swiper {
        padding-top: 0 !important;
        padding-bottom: 4px !important;
    }

    .mg-product-card {
        transition: none !important;
    }

    .mg-product-card:hover {
        box-shadow: none !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .mg-flash-sale {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        overflow: hidden !important;
    }

    .mg-flash-sale .mg-container {
        padding-inline: 0;
    }

    .mg-flash-sale-wrapper {
        --mg-flash-card-width: 148px;
        --mg-flash-card-height: 260px;
        padding: 0 1rem;
        border-radius: 0;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        gap: 0.4rem !important;
    }

    .mg-flash-sale-swiper {
        padding-top: 0 !important;
        padding-bottom: 4px !important;
    }

    .mg-flash-sale-header {
        flex-direction: row;
        align-items: center;
        text-align: right;
        margin-top: 0.5rem;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }
    
    .mg-festival-banner-fixed {
        max-width: 100%;
        width: 100%;
        position: relative !important;
        top: auto !important;
    }

    .mg-festival-banner {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        background: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 1rem !important;
    }

    .mg-festival-content {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.25rem 0 !important;
        gap: 1.25rem !important;
    }

    .mg-festival-logo {
        width: 115px !important;
        margin: 0 !important;
        animation: none !important;
        filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.24));
    }

    .mg-festival-content .mg-countdown {
        margin-bottom: 0 !important;
        max-width: 130px;
    }

    .mg-festival-discount {
        display: none !important;
    }

    .mg-festival-btn {
        display: none !important;
    }

    .mg-flash-view-all-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.6rem 1.2rem;
        margin-top: 0.75rem;
        background: rgba(255, 255, 255, 0.18);
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: var(--mg-radius-full);
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 700;
        text-decoration: none;
        transition: var(--mg-transition);
    }

    .mg-flash-view-all-mobile:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.7);
        color: #ffffff;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
    
    .mg-countdown {
        justify-content: center;
        align-content: center;
        gap: 0.2rem;
        flex-wrap: wrap-reverse;
        max-width: 92px;
    }

    .mg-countdown > *:nth-child(4) {
        display: none;
    }

    .mg-countdown-item {
        min-width: 52px;
        width: 52px;
        padding: 0.25rem 0.3rem;
    }

    .mg-countdown-value {
        font-size: 1.4rem;
    }

    .mg-countdown-label {
        font-size: 0.62rem;
    }

    .mg-countdown-separator {
        font-size: 1.2rem;
        min-width: 0.35ch;
        width: 0.35ch;
    }

    .mg-countdown-label {
        font-size: 0.6rem;
        margin-top: 0.15rem;
    }
    
    .mg-flash-sale .mg-product-info {
        min-height: unset;
    }
}

/* ============================================
   Stats Section - Minimal
   ============================================ */
.mg-stats {
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    padding: 3.5rem 0;
    border-block: 1px solid rgba(226, 232, 240, 0.75);
}

.mg-stats::before {
    content: none;
}

.mg-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.mg-stat-card {
    background: #ffffff;
    padding: 1.35rem 1rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    contain: layout style paint;
}

.mg-stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--mg-primary-rgb), 0.24);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-stat-icon {
    width: 50px;
    height: 50px;
    padding: 10px;
    box-sizing: border-box;
    margin: 0 auto 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--mg-primary-rgb), 0.08);
    border-radius: 12px;
    color: var(--mg-primary);
    transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.mg-stat-icon svg {
    width: 100%;
    height: 100%;
}

.mg-stat-card:hover .mg-stat-icon {
    transform: translateY(-2px);
    background: var(--mg-primary);
    color: #ffffff;
    will-change: transform;
}

.mg-stat-content {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
    padding: 0 0.25rem;
}

.mg-stat-number {
    font-size: clamp(1.65rem, 2.2vw, 2rem);
    font-weight: 800;
    color: var(--mg-dark);
    line-height: 1;
    /* Prevent CLS - tabular numbers and min-width */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 3ch;
    text-align: center;
    display: inline-block;
}

.mg-stat-suffix {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-primary);
    /* Prevent CLS - fixed width */
    min-width: 1ch;
    display: inline-block;
}

.mg-stat-label {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    font-weight: 600;
    padding: 0 0.25rem;
    display: block;
}

@media (max-width: 992px) {
    .mg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mg-stats-grid {
        gap: var(--mg-spacing-md);
    }
    
    .mg-stat-card {
        padding: 1.25rem 0.9rem;
    }
}

@media (max-width: 576px) {
    .mg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--mg-spacing-sm);
    }
    
    .mg-stat-number {
        font-size: 1.35rem;
    }

    .mg-stat-card {
        padding: 1rem 0.55rem;
    }

    .mg-stat-icon {
        width: 42px;
        height: 42px;
        padding: 9px;
        border-radius: 10px;
    }
}

/* ============================================
   Features Grid - Premium
   ============================================ */
.mg-features {
    background: var(--mg-surface);
    position: relative;
}

.mg-features::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(var(--mg-primary-rgb), 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(var(--mg-secondary-rgb), 0.05) 0%, transparent 50%);
}

.mg-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--mg-spacing-lg);
    position: relative;
    z-index: 1;
}

.mg-feature-card {
    background: var(--mg-bg);
    padding: var(--mg-spacing-lg);
    border-radius: var(--mg-radius-lg);
    text-align: center;
    box-shadow: var(--mg-shadow-sm);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.mg-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--mg-gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mg-shadow-lg);
}

.mg-feature-card:hover::before {
    transform: scaleX(1);
}

.mg-feature-icon {
    width: 60px;
    height: 60px;
    padding: 0.55rem;
    box-sizing: border-box;
    margin: 0 auto var(--mg-spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius);
    color: #ffffff;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-feature-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mg-feature-card:hover .mg-feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--mg-shadow-colored);
}

.mg-feature-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-xs);
}

.mg-feature-desc {
    font-size: 0.8125rem;
    color: var(--mg-text-muted);
    margin: 0;
}

@media (max-width: 992px) {
    .mg-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--mg-spacing-md);
    }
}

@media (max-width: 768px) {
    .mg-feature-card {
        padding: var(--mg-spacing-md);
        padding-top: calc(var(--mg-spacing-md) + 5px);
        margin-top: -5px;
    }
    
    .mg-feature-icon {
        width: 50px;
        height: 50px;
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .mg-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .mg-feature-card {
        padding: 0.6rem 0.5rem;
        margin-top: 0;
    }

    .mg-feature-title {
        font-size: 0.8rem;
    }

    .mg-feature-desc {
        font-size: 0.7rem;
    }

    .mg-feature-icon {
        width: 42px;
        height: 42px;
        padding: 0.55rem;
    }
    
    .mg-feature-title {
        font-size: 0.95rem;
    }
    
    .mg-feature-desc {
        font-size: 0.75rem;
    }
}

/* ============================================
   Testimonials - Premium Cards
   ============================================ */
.mg-testimonials {
    background: var(--mg-bg);
    position: relative;
}

.mg-testimonials-swiper {
    padding: var(--mg-spacing-md) 0 var(--mg-spacing-xl);
}

.mg-testimonials-swiper .swiper-wrapper {
    align-items: stretch;
}

.mg-testimonials-swiper .swiper-slide {
    display: flex;
    height: auto;
}

.mg-testimonial-card {
    background: var(--mg-surface);
    padding: var(--mg-spacing-lg);
    border-radius: var(--mg-radius-lg);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 232px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-testimonial-card::before {
    content: '"';
    position: absolute;
    top: var(--mg-spacing-sm);
    right: var(--mg-spacing-md);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--mg-primary);
    opacity: 0.1;
    line-height: 1;
}

.mg-testimonial-card:hover {
    background: var(--mg-bg);
    box-shadow: var(--mg-shadow-lg);
    transform: translateY(-5px);
}

.mg-testimonial-rating {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: var(--mg-spacing-md);
}

.mg-star {
    color: var(--mg-accent);
    font-size: 1.25rem;
}

.mg-testimonial-text {
    font-size: 1.125rem;
    color: var(--mg-text);
    line-height: 1.8;
    margin-bottom: var(--mg-spacing-lg);
    font-style: italic;
    flex: 1 1 auto;
    min-height: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.mg-testimonial-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mg-testimonial-role {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
}

/* بهبود Testimonials در موبایل */
@media (max-width: 768px) {
    .mg-testimonial-card {
        padding: var(--mg-spacing-md);
        padding-top: calc(var(--mg-spacing-md) + 5px);
        margin-top: -5px;
        min-height: 210px;
    }
    
    .mg-testimonial-text {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: var(--mg-spacing-md);
    }
    
    .mg-testimonial-name {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .mg-testimonial-card {
        padding: var(--mg-spacing-sm);
        padding-top: calc(var(--mg-spacing-sm) + 5px);
        margin-top: -5px;
        min-height: 190px;
    }
    
    .mg-testimonial-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .mg-testimonial-name {
        font-size: 0.95rem;
    }
    
    .mg-testimonial-role {
        font-size: 0.8rem;
    }
    
    .mg-star {
        font-size: 1rem;
    }
}

/* ============================================
   Blog Section - Premium
   ============================================ */
.mg-blog {
    background: var(--mg-surface);
}

.mg-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--mg-spacing-lg);
}

.mg-blog--home .mg-blog-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* بهبود Blog Grid در موبایل */
@media (max-width: 992px) {
    .mg-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--mg-spacing-md);
    }

    .mg-blog--home .mg-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .mg-blog-grid {
        gap: var(--mg-spacing-sm);
    }

    .mg-blog-content {
        padding: var(--mg-spacing-sm);
    }

    .mg-blog-title {
        font-size: 0.875rem;
    }

    .mg-blog-excerpt {
        font-size: 0.8rem;
        margin-bottom: var(--mg-spacing-sm);
    }

    .mg-blog-date {
        font-size: 0.75rem;
    }

    .mg-blog-link {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .mg-blog-content {
        padding: 0.5rem;
    }

    .mg-blog-title {
        font-size: 0.82rem;
    }

    .mg-blog-excerpt {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .mg-blog-date {
        font-size: 0.7rem;
    }

    .mg-blog-meta {
        margin-bottom: 0.3rem;
    }

    .mg-blog-link {
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .mg-blog--home .mg-blog-content {
        padding: 0.65rem;
    }

    .mg-blog--home .mg-blog-excerpt {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .mg-blog--home .mg-blog-link {
        padding: 0.35rem 0.6rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .mg-blog-grid {
        grid-template-columns: 1fr;
        gap: var(--mg-spacing-sm);
    }

    .mg-blog--home .mg-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
    
    .mg-blog-card {
        border-radius: var(--mg-radius);
        min-width: 0;
    }
}

.mg-blog-card {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    box-shadow: var(--mg-shadow-sm);
    border: 1px solid rgba(16, 163, 127, 0);
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    padding-top: 0;
    margin-top: 0;
    top: 0;
    display: flex;
    flex-direction: column;
}

.mg-blog-card:hover {
    transform: translate3d(0, -3px, 0) scale3d(1.002, 1.002, 1);
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.1);
    border-color: rgba(16, 163, 127, 0.12);
    position: relative;
    top: 0;
}

.mg-blog-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f3f5f7;
}

.mg-blog-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.mg-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.mg-blog-image:hover img,
.mg-blog-image:focus-within img {
    transform: scale3d(1.025, 1.025, 1);
}

.mg-blog-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5b1;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.9), rgba(241,245,249,0.95)),
        #f3f5f7;
}

.mg-blog-image-placeholder svg {
    opacity: 0.75;
}

.mg-blog-content {
    padding: var(--mg-spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mg-blog-meta {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    margin-bottom: var(--mg-spacing-sm);
}

.mg-blog-date {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
}

.mg-blog-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-xs);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-blog-title a {
    color: var(--mg-text);
    transition: color 0.35s ease;
}

.mg-blog-title a:hover {
    color: var(--mg-primary);
}

.mg-blog-excerpt {
    font-size: 0.9375rem;
    color: var(--mg-text-muted);
    margin-bottom: var(--mg-spacing-md);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-blog-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(16, 163, 127, 0.22);
    border-radius: 999px;
    background: rgba(16, 163, 127, 0.06);
    font-weight: 600;
    color: var(--mg-primary);
    margin-top: auto;
    transition: color 0.45s ease,
                background-color 0.45s ease,
                border-color 0.45s ease,
                box-shadow 0.45s ease;
}

.mg-blog-link:hover {
    color: var(--mg-secondary);
    border-color: rgba(16, 163, 127, 0.45);
    background: rgba(16, 163, 127, 0.12);
    box-shadow: 0 8px 22px rgba(16, 163, 127, 0.12);
}

.mg-blog-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: var(--mg-spacing-lg);
}

.mg-blog-more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 0.7rem 1.4rem;
    border: 1px solid rgba(16, 163, 127, 0.28);
    border-radius: 999px;
    background: var(--mg-bg);
    color: var(--mg-primary);
    font-weight: 700;
    box-shadow: var(--mg-shadow-xs);
    transition: color 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                transform 0.3s ease;
}

.mg-blog-more-link:hover {
    color: var(--mg-bg);
    background: var(--mg-primary);
    border-color: var(--mg-primary);
    box-shadow: 0 10px 26px rgba(16, 163, 127, 0.16);
    transform: translateY(-2px);
}

@media (max-width: 992px) {
    .mg-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Brands Section - Premium
   ============================================ */
.mg-brands {
    background: var(--mg-bg);
}

.mg-brands-swiper {
    padding: var(--mg-spacing-md) 0;
}

.mg-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--mg-spacing-md);
    background: var(--mg-bg);
    border-radius: var(--mg-radius);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 100px;
    height: 100%;
    position: relative;
    top: 0;
    /* جلوگیری از layout shift در hover */
    padding-top: calc(var(--mg-spacing-md) + 5px);
    margin-top: -5px;
}

.mg-brand-item:hover {
    background: var(--mg-bg);
    box-shadow: var(--mg-shadow-md);
    transform: scale3d(1, 1, 1);
    position: relative;
    top: -5px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.mg-brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: var(--mg-transition);
}

.mg-brand-logo img {
    width: 120px;
    height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.mg-brand-item:hover .mg-brand-logo img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.mg-brand-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    text-align: center;
    transition: var(--mg-transition);
}

.mg-brand-item:hover .mg-brand-name {
    color: var(--mg-primary);
}

/* اگر فقط نام وجود داره (بدون لوگو) */
.mg-brand-logo:not(:has(img)) .mg-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .mg-badge-sale {
        display: none !important;
    }

    .mg-festival-logo {
        animation: none !important;
        filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.24));
    }

    .mg-brand-item {
        min-height: 80px;
        padding: var(--mg-spacing-sm);
    }
    
    .mg-brand-logo img {
        max-width: 100px;
        max-height: 50px;
    }
    
    .mg-brand-name {
        font-size: 0.75rem;
    }
}

/* ============================================
   App Download Section
   ============================================ */
.mg-app {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    position: relative;
    overflow: hidden;
}

.mg-app::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 40%);
}

.mg-app-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--mg-spacing-xl);
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Phone Mockup */
.mg-app-mockup {
    display: flex;
    justify-content: center;
}

.mg-phone-frame {
    width: 240px;
    height: 480px;
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 32px;
    padding: 10px;
    box-shadow: 
        0 40px 80px -15px rgba(0, 0, 0, 0.2),
        0 20px 50px -20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.mg-phone-frame::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background: #000000;
    border-radius: 20px;
}

.mg-phone-screen {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.mg-app-screen {
    padding: 60px 16px 20px;
    height: 100%;
}

.mg-app-header-mock {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.mg-app-logo-mock {
    width: 50px;
    height: 50px;
    background: var(--mg-gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.mg-app-products-mock {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mg-product-mock {
    height: 80px;
    background: linear-gradient(90deg, var(--mg-surface) 0%, var(--mg-surface) 30%, rgba(255, 255, 255, 0) 70%);
    border-radius: var(--mg-radius);
    position: relative;
    overflow: hidden;
}

.mg-product-mock::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    width: 60px;
    height: 60px;
    background: var(--mg-border);
    border-radius: var(--mg-radius-sm);
}

.mg-product-mock::after {
    content: '';
    position: absolute;
    left: 80px;
    top: 15px;
    width: 120px;
    height: 12px;
    background: var(--mg-border);
    border-radius: 4px;
}

/* App Text Content */
.mg-app-text {
    text-align: right;
}

.mg-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--mg-radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-md);
}

.mg-app-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--mg-text);
    margin-bottom: var(--mg-spacing-sm);
    line-height: 1.2;
}

.mg-app-desc {
    font-size: 1rem;
    color: var(--mg-text-muted);
    line-height: 1.7;
    margin-bottom: var(--mg-spacing-md);
}

.mg-app-features {
    display: flex;
    flex-direction: column;
    gap: var(--mg-spacing-sm);
    margin-bottom: var(--mg-spacing-xl);
}

.mg-app-feature {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    color: var(--mg-text);
    font-weight: 500;
}

.mg-app-feature svg {
    color: #10b981;
    flex-shrink: 0;
}

.mg-app-buttons {
    display: flex;
    gap: var(--mg-spacing-md);
}

.mg-app-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--mg-radius);
    font-weight: 600;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    top: 0;
    /* جلوگیری از layout shift در hover */
    padding-top: calc(0.875rem + 3px);
    margin-top: -3px;
}

.mg-app-btn-android {
    background: #111827;
    color: #ffffff;
}

.mg-app-btn-ios {
    background: #000000;
    color: #ffffff;
}

.mg-app-btn:hover {
    transform: scale3d(1, 1, 1);
    box-shadow: var(--mg-shadow-lg);
    position: relative;
    top: -3px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-app-btn svg {
    flex-shrink: 0;
}

.mg-app-btn div {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.mg-app-btn-sub {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

.mg-app-btn-main {
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 992px) {
    .mg-app-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .mg-app-text {
        text-align: center;
        order: 1;
    }
    
    .mg-app-mockup {
        order: 2;
    }
    
    .mg-app-features {
        align-items: center;
    }
    
    .mg-app-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .mg-phone-frame {
        width: 240px;
        height: 480px;
    }
    
    .mg-app-title {
        font-size: 2rem;
    }
    
    .mg-app-buttons {
        flex-direction: column;
    }
    
    .mg-app-btn {
        justify-content: center;
    }
}

/* ============================================
   Newsletter - Premium
   ============================================ */
.mg-newsletter {
    background: var(--mg-gradient-primary);
    position: relative;
    overflow: hidden;
}

.mg-newsletter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="80" height="80" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="newsletter-pattern" width="80" height="80" patternUnits="userSpaceOnUse"><circle cx="40" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="80" height="80" fill="url(%23newsletter-pattern)"/></svg>');
}

.mg-newsletter-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    color: #ffffff;
}

.mg-newsletter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.625rem 1.25rem;
    border-radius: var(--mg-radius-full);
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-md);
}

.mg-newsletter-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: var(--mg-spacing-xs);
}

.mg-newsletter-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--mg-spacing-md);
}

.mg-newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.mg-newsletter-input-wrapper {
    display: flex;
    gap: var(--mg-spacing-sm);
    background: #ffffff;
    padding: 0.5rem;
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-xl);
}

.mg-newsletter-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.mg-newsletter-input {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: none;
    background: transparent;
    color: var(--mg-text);
    direction: rtl;
    text-align: right;
}

.mg-newsletter-input:focus {
    outline: none;
}

.mg-newsletter-input:not(:placeholder-shown) {
    direction: ltr;
    text-align: left;
}

.mg-newsletter-input::placeholder {
    color: var(--mg-text-muted);
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.mg-newsletter-form .mg-btn {
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .mg-newsletter-input-wrapper {
        flex-direction: column;
    }
    
    .mg-newsletter-title {
        font-size: 2rem;
    }
}

/* ============================================
   Footer - Premium Design
   ============================================ */
.mg-footer {
    background: var(--mg-bg);
    color: var(--mg-text);
    position: relative;
}

/* Pre-Footer CTA */
.mg-footer-cta {
    background: var(--mg-gradient-primary);
    padding: var(--mg-spacing-lg) 0;
    position: relative;
    overflow: hidden;
}

.mg-footer-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="cta-dots" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="60" height="60" fill="url(%23cta-dots)"/></svg>');
}

.mg-footer-cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--mg-spacing-lg);
    position: relative;
    z-index: 1;
}

.mg-footer-cta-text h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.mg-footer-cta-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
}

.mg-footer-cta-buttons {
    display: flex;
    gap: var(--mg-spacing-md);
    flex-shrink: 0;
}

.mg-footer-cta-buttons .mg-btn-primary {
    background: #ffffff;
    color: var(--mg-primary);
}

.mg-footer-cta-buttons .mg-btn-primary {
    position: relative;
    top: 0;
    padding-top: calc(0.6rem + 3px);
    margin-top: -3px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-footer-cta-buttons .mg-btn-primary:hover {
    transform: scale3d(1, 1, 1);
    box-shadow: var(--mg-shadow-xl);
    will-change: transform;
    position: relative;
    top: -3px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mg-btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 0.875rem 1.75rem;
    border-radius: var(--mg-radius);
    font-weight: 600;
    transition: var(--mg-transition);
}

.mg-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
}

/* Main Footer */
.mg-footer-main {
    padding: var(--mg-spacing-xl) 0;
    border-bottom: 1px solid var(--mg-border);
}

.mg-footer-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) repeat(2, minmax(160px, 0.8fr)) minmax(260px, 1.1fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.75rem);
}

.mg-footer-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mg-footer-section > :last-child {
    margin-bottom: 0;
}

.mg-footer-about,
.mg-footer-newsletter {
    gap: 0.85rem;
}

/* Footer Logo & About */
.mg-footer-logo {
    margin-bottom: var(--mg-spacing-md);
    align-self: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

.mg-footer-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mg-text);
}

.mg-footer-logo .custom-logo,
.mg-footer-logo .mg-custom-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 180px);
    max-height: 60px;
    object-fit: contain;
}

.mg-footer-logo a:hover {
    color: var(--mg-primary);
}

.mg-logo-icon {
    flex-shrink: 0;
}

.mg-logo-text {
    font-weight: 800;
    font-size: 1.5rem;
}

.mg-footer-desc {
    color: var(--mg-text-muted);
    line-height: 1.8;
    margin-bottom: 0;
    max-width: 38rem;
}

/* Footer Contact Info */
.mg-footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--mg-spacing-sm);
    width: 100%;
}

.mg-footer .mg-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--mg-text-muted);
    transition: var(--mg-transition);
}

.mg-footer .mg-contact-item span {
    overflow-wrap: anywhere;
}

.mg-footer .mg-contact-item:hover {
    color: var(--mg-primary);
}

.mg-contact-icon {
    width: 36px;
    height: 36px;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-primary);
    flex-shrink: 0;
    transition: var(--mg-transition);
}

.mg-footer .mg-contact-item:hover .mg-contact-icon {
    background: var(--mg-gradient-primary);
    color: #ffffff;
}

/* Footer Section Titles */
.mg-footer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-sm);
    color: var(--mg-text);
    position: relative;
    padding-bottom: var(--mg-spacing-xs);
}

.mg-footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 2px;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-full);
}

/* Keep newsletter centered while navigation columns share one RTL start edge. */
.mg-footer-newsletter {
    align-items: center;
    text-align: center;
}

.mg-footer-newsletter .mg-footer-title {
    align-self: center;
    width: fit-content;
}

.mg-footer-newsletter .mg-footer-title::after {
    right: 50%;
    transform: translateX(50%);
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) {
    align-items: center;
    text-align: right;
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-title {
    align-self: center;
    width: fit-content;
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-title::after {
    right: 50%;
    transform: translateX(50%);
}

/* Footer Links */
.mg-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: fit-content;
    max-width: 100%;
}

.mg-footer-links li {
    margin-bottom: 0.75rem;
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links li {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.mg-footer-links a {
    color: var(--mg-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--mg-transition);
    position: relative;
    padding-right: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.mg-footer-links a::before {
    content: '←';
    opacity: 0;
    transform: translateX(10px);
    transition: var(--mg-transition);
}

.mg-footer-links a:hover {
    color: var(--mg-primary);
    padding-right: 1rem;
}

.mg-footer-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Reserve arrow space so hovering one link never shifts the centered list. */
.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links a {
    padding-right: 1rem;
}

.mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links a:hover {
    padding-right: 1rem;
    transform: translateX(-0.35rem);
}

/* Newsletter Section */
.mg-footer-newsletter-text {
    color: var(--mg-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--mg-spacing-md);
    line-height: 1.6;
}

.mg-footer-newsletter-form {
    margin-bottom: 0;
    width: 100%;
}

.mg-footer-newsletter-text,
.mg-footer-newsletter .mg-social-label {
    text-align: center;
}

.mg-newsletter-field {
    display: flex;
    background: var(--mg-surface);
    border-radius: var(--mg-radius);
    padding: 0.375rem;
    border: 2px solid transparent;
    transition: var(--mg-transition);
}

.mg-newsletter-field:focus-within {
    border-color: var(--mg-primary);
    background: var(--mg-bg);
}

.mg-newsletter-field input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--mg-text);
    direction: rtl;
    text-align: right;
}

.mg-newsletter-field input:focus {
    outline: none;
}

.mg-newsletter-field input[type="email"]:not(:placeholder-shown) {
    direction: ltr;
    text-align: left;
}

.mg-newsletter-field input::placeholder {
    color: var(--mg-text-muted);
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.mg-newsletter-btn {
    width: 44px;
    height: 44px;
    background: var(--mg-gradient-primary);
    border: none;
    border-radius: var(--mg-radius-sm);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--mg-transition);
    flex-shrink: 0;
}

.mg-newsletter-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--mg-shadow-colored);
}

/* Social Links */
.mg-footer-social {
    width: 100%;
    padding-top: var(--mg-spacing-md);
    border-top: 1px solid var(--mg-border);
}

.mg-social-label {
    display: block;
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    margin-bottom: var(--mg-spacing-sm);
}

.mg-social-icons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mg-footer-newsletter .mg-social-icons {
    justify-content: center;
}

.mg-footer .mg-social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mg-surface);
    border-radius: var(--mg-radius);
    color: var(--mg-text-muted);
    transition: var(--mg-transition);
}

.mg-footer .mg-social-icon:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: var(--mg-shadow);
    will-change: transform;
}

.mg-footer .mg-social-icon.mg-instagram:hover {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #ffffff;
}

.mg-footer .mg-social-icon.mg-telegram:hover {
    background: #0088cc;
    color: #ffffff;
}

.mg-footer .mg-social-icon.mg-whatsapp:hover {
    background: #25d366;
    color: #ffffff;
}

.mg-footer .mg-social-icon.mg-twitter:hover {
    background: #000000;
    color: #ffffff;
}

/* Trust Badges */
.mg-footer-trust {
    background: var(--mg-surface);
    padding: var(--mg-spacing-lg) 0;
}

.mg-trust-grid {
    display: flex;
    justify-content: center;
    gap: var(--mg-spacing-xl);
    flex-wrap: wrap;
}

.mg-trust-item {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    color: var(--mg-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.mg-trust-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mg-bg);
    border-radius: var(--mg-radius);
    color: var(--mg-primary);
    box-shadow: var(--mg-shadow-sm);
}

.mg-trust-icon svg {
    width: 28px;
    height: 28px;
}

/* Footer Bottom */
.mg-footer-bottom {
    padding: var(--mg-spacing-md) 0;
    background: var(--mg-surface);
}

.mg-footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--mg-spacing-md);
    flex-wrap: wrap;
}

.mg-copyright {
    color: var(--mg-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.mg-copyright a {
    color: var(--mg-primary);
    font-weight: 600;
}

.mg-payment-methods {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-md);
}

.mg-footer-bottom-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--mg-spacing-lg);
    flex-wrap: wrap;
}

.mg-payment-methods span {
    color: var(--mg-text-muted);
    font-size: 0.875rem;
}

.mg-payment-methods-label {
    flex-shrink: 0;
}

.mg-footer-certificates {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-md);
}

.mg-footer-certificates-label {
    color: var(--mg-text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.mg-footer-certificates-items {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mg-footer-certificate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 72px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--mg-border);
    border-radius: calc(var(--mg-radius) + 2px);
    box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.45);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.mg-footer-certificate:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--mg-primary) 22%, var(--mg-border));
    box-shadow: 0 18px 35px -24px rgba(15, 23, 42, 0.38);
}

.mg-footer-certificate img,
.mg-footer-certificate-image {
    display: block;
    max-width: 78px;
    max-height: 78px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mg-footer-certificate--embed {
    min-width: 0;
    padding: 0.375rem;
}

.mg-footer-certificate--embed iframe,
.mg-footer-certificate--embed img {
    max-width: 90px;
    height: auto;
}

.mg-payment-icons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mg-payment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    background: var(--mg-bg);
    border-radius: var(--mg-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    border: 1px solid var(--mg-border);
    text-decoration: none;
    transition: var(--mg-transition);
}

.mg-payment-badge:hover {
    border-color: color-mix(in srgb, var(--mg-primary) 26%, var(--mg-border));
    color: var(--mg-primary);
}

/* Footer Responsive */
@media (max-width: 992px) {
    .mg-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mg-footer-about,
    .mg-footer-newsletter {
        grid-column: 1 / -1;
    }
    
    .mg-footer-cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .mg-footer-cta-buttons {
        justify-content: center;
    }

    .mg-footer-bottom-meta {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .mg-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--mg-spacing-md);
    }

    .mg-footer-about,
    .mg-footer-newsletter {
        grid-column: 1 / -1;
    }

    .mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) {
        text-align: right;
        align-items: center;
    }

    .mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-title::after {
        right: 50%;
        left: auto;
        transform: translateX(50%);
    }

    .mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: fit-content;
        max-width: 100%;
    }

    .mg-footer-section:not(.mg-footer-about):not(.mg-footer-newsletter) .mg-footer-links a {
        justify-content: flex-start;
        text-align: right;
    }
    
    .mg-footer-bottom-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .mg-trust-grid {
        gap: var(--mg-spacing-md);
    }
    
    .mg-trust-item {
        flex-direction: column;
        text-align: center;
    }

    .mg-footer .mg-contact-item {
        align-items: flex-start;
    }
    
    .mg-footer-cta-text h3 {
        font-size: 1.5rem;
    }
    
    .mg-footer-cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .mg-footer-cta-buttons .mg-btn {
        width: 100%;
        justify-content: center;
    }

    .mg-social-icons,
    .mg-payment-icons {
        justify-content: center;
    }

    .mg-footer-bottom-meta,
    .mg-payment-methods {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .mg-footer-certificates {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .mg-footer-certificates-items {
        justify-content: center;
    }

    .mg-copyright,
    .mg-footer-desc,
    .mg-footer-newsletter-text {
        overflow-wrap: anywhere;
    }
}

/* ============================================
   Animations - Premium Effects
   ============================================ */
[data-aos] {
    transition-property: transform, opacity !important;
}

/* غیرفعال کردن کامل AOS برای صفحه single product */
body.single-product [data-aos],
.mg-single-product [data-aos],
.mg-single-product [data-aos] * {
    transition-property: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    animation: none !important;
    -webkit-animation: none !important;
    -moz-animation: none !important;
    -o-animation: none !important;
}

/* Override AOS CSS classes برای صفحه single product */
body.single-product .aos-init,
body.single-product .aos-animate,
.mg-single-product .aos-init,
.mg-single-product .aos-animate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Scroll to Top Button */
.mg-scroll-top {
    position: fixed;
    bottom: var(--mg-spacing-lg);
    left: var(--mg-spacing-lg);
    width: 50px;
    height: 50px;
    background: var(--mg-gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--mg-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--mg-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--mg-transition);
    z-index: 999;
}

.mg-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.mg-scroll-top:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: var(--mg-shadow-xl);
    will-change: transform;
}

@media (max-width: 992px) {
    .mg-scroll-top {
        bottom: calc(74px + env(safe-area-inset-bottom));
        left: var(--mg-spacing-md);
        z-index: 1301;
    }
}

/* Loading Animation */
@keyframes loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mg-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: loading 0.8s linear infinite;
}

/* WooCommerce Overrides */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: var(--mg-radius) !important;
    padding: var(--mg-spacing-md) !important;
}

/* Utility Classes */
.mg-no-products,
.mg-no-posts {
    text-align: center;
    padding: var(--mg-spacing-xl);
    color: var(--mg-text-muted);
    font-size: 1.125rem;
}

/* Showcase Section */
.mg-category-showcase {
    background: none;
    padding-bottom: 1.5rem;
}

.mg-category-showcase + .mg-stats {
    padding-top: 2rem;
}

.mg-category-showcase .mg-product-card {
    border: none;
    border-radius: var(--mg-radius-lg) !important;
}

.mg-showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--mg-spacing-lg);
}

.mg-showcase-wrapper {
    position: relative;
    padding-bottom: 1rem;
}

.mg-showcase-swiper {
    padding: var(--mg-spacing-md) 0 !important; /* استفاده از padding container */
    box-sizing: border-box;
}

.mg-showcase-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.mg-showcase-swiper .swiper-slide {
    height: auto;
}


/* Showcase Navigation - Removed (Only Pagination) */

.mg-showcase-pagination {
    position: relative !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 22px !important;
    gap: 8px;
    width: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.mg-showcase-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: var(--mg-border);
    opacity: 1 !important;
    transition: all 0.3s ease;
    border-radius: 50%;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
}

.mg-showcase-pagination .swiper-pagination-bullet-active,
.mg-showcase-pagination .swiper-pagination-bullet-active-main {
    background: var(--mg-primary);
}

.mg-showcase-pagination .swiper-pagination-bullet-active {
    background: var(--mg-gradient-primary);
    width: 32px;
    border-radius: 6px;
}

/* Keep pagination away from cards in product sliders */
.mg-products-pagination,
.mg-showcase-pagination {
    margin-top: 22px !important;
}


.mg-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(16, 163, 127, 0.25);
    border-radius: 999px;
    background: rgba(16, 163, 127, 0.06);
    font-weight: 600;
    color: var(--mg-primary);
    transition: var(--mg-transition);
}

.mg-view-all:hover {
    color: var(--mg-secondary);
    border-color: rgba(16, 163, 127, 0.5);
    background: rgba(16, 163, 127, 0.12);
    box-shadow: 0 8px 22px rgba(16, 163, 127, 0.12);
}

/* Smooth Scrollbar - مخفی کردن visual اسکرول‌بار روی همه عناصر */
/* `*` لازم است چون منوی موبایل، modal، dropdownها هم اسکرول‌بار داخلی دارند */
* {
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge legacy */
}

*::-webkit-scrollbar {           /* Chrome, Safari, Edge جدید */
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

/* ============================================
   Notifications
   ============================================ */
.mg-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--mg-shadow-xl);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 350px;
    border-right: 4px solid var(--mg-primary);
}

.mg-notification.show {
    transform: translateX(0);
}

.mg-notification-success {
    border-right-color: var(--mg-success);
}

.mg-notification-error {
    border-right-color: var(--mg-error);
}

.mg-notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mg-notification-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--mg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--mg-surface);
    color: var(--mg-primary);
    flex-shrink: 0;
}

.mg-notification-success .mg-notification-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--mg-success);
}

.mg-notification-error .mg-notification-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--mg-error);
}

.mg-notification-message {
    font-weight: 500;
    color: var(--mg-text);
}

/* ============================================
   Loading Spinner
   ============================================ */
.mg-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Custom Cursor (Desktop)
   ============================================ */
@media (hover: hover) and (pointer: fine) {
    .mg-cursor {
        position: fixed;
        left: 0;
        top: 0;
        width: 40px;
        height: 40px;
        border: 2px solid var(--mg-primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99999;
        margin-left: -20px;
        margin-top: -20px;
        transition: width 0.3s, height 0.3s, border-color 0.3s, margin 0.3s, opacity 0.3s;
        opacity: 0.5;
        will-change: transform;
    }

    .mg-cursor.hover {
        width: 60px;
        height: 60px;
        border-color: var(--mg-secondary);
        opacity: 0.3;
        margin-left: -30px;
        margin-top: -30px;
    }

    .mg-cursor-dot {
        position: fixed;
        left: 0;
        top: 0;
        width: 8px;
        height: 8px;
        background: var(--mg-primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99999;
        margin-left: -4px;
        margin-top: -4px;
        will-change: transform;
    }

    .mg-cursor-dot.hover {
        background: var(--mg-secondary);
        transform: scale(1.5);
    }
}

/* ============================================
   Scroll Animations - Lazy Loading Optimized
   ============================================ */
.mg-feature-card:not([data-aos]),
.mg-blog-card:not([data-aos]) {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.6s ease, transform 0.6s ease;
    /* بدون will-change در حالت اولیه — جلوگیری از ساخت صدها GPU layer */
}

/* If parent grid uses AOS, child cards should not be hidden by ScrollAnimations fallback */
.mg-features-grid[data-aos] .mg-feature-card,
.mg-blog-grid[data-aos] .mg-blog-card {
    opacity: 1 !important;
    transform: none;
}

/* Fallback: فقط برای کارت‌هایی که هرگز mg-visible نگرفتند */
.mg-loaded .mg-feature-card:not([data-aos]):not(.mg-visible),
.mg-loaded .mg-blog-card:not([data-aos]):not(.mg-visible) {
    animation: fadeInFallback 0.6s ease 1.5s forwards;
}

@keyframes fadeInFallback {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mg-feature-card:not([data-aos]).mg-visible,
.mg-blog-card:not([data-aos]).mg-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

@media (hover: hover) and (pointer: fine) {
    .mg-blog-card,
    .mg-blog-card:not([data-aos]).mg-visible,
    .mg-blog-grid[data-aos] .mg-blog-card,
    .mg-blog-archive-main .mg-blog-card,
    #mg-blog-results .mg-blog-card {
        transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
        transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                    box-shadow 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                    border-color 0.85s cubic-bezier(0.22, 1, 0.36, 1);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform-origin: center center;
    }

    .mg-blog-card:hover,
    .mg-blog-card:not([data-aos]).mg-visible:hover,
    .mg-blog-grid[data-aos] .mg-blog-card:hover,
    .mg-blog-archive-main .mg-blog-card:hover,
    #mg-blog-results .mg-blog-card:hover {
        transform: translate3d(0, -6px, 0) scale3d(1.004, 1.004, 1);
        transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                    box-shadow 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                    border-color 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .mg-blog-card .mg-blog-image:hover img,
    .mg-blog-card:not([data-aos]).mg-visible .mg-blog-image:hover img,
    .mg-blog-grid[data-aos] .mg-blog-card .mg-blog-image:hover img,
    .mg-blog-archive-main .mg-blog-card .mg-blog-image:hover img,
    #mg-blog-results .mg-blog-card .mg-blog-image:hover img,
    .mg-blog-card .mg-blog-image:focus-within img,
    .mg-blog-card:not([data-aos]).mg-visible .mg-blog-image:focus-within img,
    .mg-blog-grid[data-aos] .mg-blog-card .mg-blog-image:focus-within img,
    .mg-blog-archive-main .mg-blog-card .mg-blog-image:focus-within img,
    #mg-blog-results .mg-blog-card .mg-blog-image:focus-within img {
        transform: scale3d(1.025, 1.025, 1);
    }
}


/* Mobile: کارت‌های کوچک‌تر */
@media (max-width: 768px) {
    .mg-product-card .mg-product-image-wrapper {
        margin: 0 0.75rem 0.75rem;
    }
    .mg-product-card .mg-product-image-wrapper .mg-product-actions {
        display: none !important;
    }
    .mg-product-card .mg-product-info {
        padding: 1rem;
    }
    .mg-product-title {
        font-size: 0.82rem;
    }
    .mg-card-sale-strip {
        padding: 0 0.6rem;
        gap: 0.25rem;
        height: 32px;
    }
    .mg-card-sale-label {
        font-size: 0.58rem;
        gap: 2px;
    }
    .mg-sale-icon {
        width: 30px;
        height: 30px;
    }
    .mg-card-sale-strip .mg-scd-units {
        gap: 2px;
    }
    .mg-card-sale-strip .mg-scd-value {
        font-size: 0.55rem;
        min-width: 17px;
        padding: 0.1rem 0.2rem;
        border-radius: 4px;
    }
    .mg-card-sale-strip .mg-scd-sep {
        font-size: 0.5rem;
        width: 5px;
    }
}

@media (max-width: 576px) {
    .mg-product-category {
        font-size: 0.52rem;
    }
    .mg-product-title {
        font-size: 0.75rem;
        min-height: calc(0.75rem * 1.45 * 1);
    }
    .mg-product-title a {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    .mg-product-rating {
        font-size: 0.6rem;
    }
    .mg-card-footer .mg-product-price .price {
        padding-right: 18px;
    }
    .mg-card-footer .mg-product-price .price::after {
        width: 11px;
    }
    .mg-card-footer .mg-product-price ins {
        font-size: 0.8rem;
    }
    .mg-card-footer .mg-product-price del {
        font-size: 0.68rem;
    }
    .mg-card-cart-btn {
        width: 34px;
        height: 34px;
    }
}

/* Ensure all swiper slides are visible */
.mg-products-swiper .swiper-slide,
.mg-featured-products .swiper-slide,
.mg-products-wrapper .swiper-slide,
.mg-showcase-swiper .swiper-slide,
.mg-flash-sale-swiper .swiper-slide {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Ensure swiper wrapper is visible + GPU-accelerated to prevent layout jank on mobile scroll */
.mg-products-swiper .swiper-wrapper,
.mg-featured-products .swiper-wrapper,
.mg-products-wrapper .swiper-wrapper,
.mg-showcase-swiper .swiper-wrapper,
.mg-flash-sale-swiper .swiper-wrapper {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ============================================
   CRITICAL: Ensure all divs are visible by default
   ============================================ */
/* Fallback: اگر JavaScript اجرا نشد یا خطا داد، همه divها بعد از 2 ثانیه نمایش داده شوند */
body:not(.mg-loaded) .mg-feature-card:not([data-aos]),
body:not(.mg-loaded) .mg-blog-card:not([data-aos]) {
    animation: forceVisible 0.6s ease 2s forwards;
}

@keyframes forceVisible {
    to {
        opacity: 1 !important;
        transform: translateY(0) !important;
        visibility: visible !important;
    }
}

/* اطمینان از اینکه همه divهای اصلی نمایش داده می‌شوند */
.mg-container,
.mg-section,
.mg-section-header:not([data-aos]),
.mg-section-title,
.mg-section-subtitle {
    opacity: 1 !important;
    visibility: visible !important;
}

/* اطمینان از نمایش divهای محصول */
.mg-product-card,
.mg-featured-products,
.mg-products-wrapper,
.mg-products-swiper,
.mg-showcase-swiper {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Stagger animation delay */
.mg-feature-card:nth-child(1),
.mg-product-card:nth-child(1) { transition-delay: 0s; }
.mg-feature-card:nth-child(2),
.mg-product-card:nth-child(2) { transition-delay: 0.1s; }
.mg-feature-card:nth-child(3),
.mg-product-card:nth-child(3) { transition-delay: 0.2s; }
.mg-feature-card:nth-child(4),
.mg-product-card:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   Button Loading State
   ============================================ */
.mg-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.mg-btn.added {
    background: var(--mg-gradient-emerald);
}

/* ============================================
   Wishlist Button
   ============================================ */
.mg-wishlist-btn.active {
    background: var(--mg-gradient-vibrant);
    color: #ffffff;
}

.mg-wishlist-btn.active svg {
    fill: currentColor;
}

.mg-wishlist-link.is-active {
    background: transparent;
    color: var(--mg-text);
}

body.mg-modal-open {
    overflow: hidden;
}

.mg-quickview-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    z-index: 10000;
}

.mg-quickview-modal.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.mg-quickview-dialog {
    position: relative;
    width: min(980px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    background: var(--mg-bg);
    border-radius: var(--mg-radius-xl);
    box-shadow: var(--mg-shadow-xl);
}

.mg-quickview-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: var(--mg-surface);
    color: var(--mg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--mg-transition);
    z-index: 2;
}

.mg-quickview-close:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

.mg-quickview-content {
    padding: 2rem;
}

.mg-quickview-layout {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: 2rem;
    align-items: start;
}

.mg-quickview-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    background: var(--mg-surface);
}

.mg-quickview-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.mg-quickview-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.mg-quickview-image-link img.woocommerce-placeholder {
    object-fit: contain;
    padding: 1.5rem;
}

.mg-quickview-details {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.mg-quickview-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mg-primary);
}

.mg-quickview-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.3;
}

.mg-quickview-title a {
    color: inherit;
}

.mg-quickview-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--mg-primary);
}

.mg-quickview-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.mg-quickview-stock.is-in-stock {
    color: #059669;
}

.mg-quickview-stock.is-out-of-stock {
    color: #dc2626;
}

.mg-quickview-description {
    color: var(--mg-text-muted);
    line-height: 1.8;
}

.mg-quickview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.mg-quickview-loading,
.mg-quickview-error {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    color: var(--mg-text);
}

@media (max-width: 768px) {
    .mg-quickview-content {
        padding: 1.25rem;
    }

    .mg-quickview-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ============================================
   Page Loaded Animation
   ============================================ */
body:not(.mg-loaded) {
    overflow-x: hidden;
    overflow-y: auto;
    /* جلوگیری از نمایش scrollbar در ابتدا */
    scrollbar-gutter: stable;
}

/* انیمیشن محتوای هیرو - غیرفعال برای بهبود LCP */
/* body.mg-loaded .mg-hero-content {
    animation: fadeInUp 1s ease forwards;
} */

/* اطمینان از نمایش محتوا قبل از انیمیشن - بهینه‌سازی برای LCP */
.mg-hero-content {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    /* جلوگیری از reflow برای بهبود LCP */
    contain: layout style paint;
}

/* فقط در صورت وجود کلاس mg-loaded، انیمیشن اجرا شود - غیرفعال */
body:not(.mg-loaded) .mg-hero-content {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Swiper Custom Styles
   ============================================ */
.swiper-button-prev,
.swiper-button-next {
    width: 50px;
    height: 50px;
    background: var(--mg-bg);
    border-radius: var(--mg-radius);
    box-shadow: var(--mg-shadow);
    color: var(--mg-text);
    transition: var(--mg-transition);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 1rem;
    font-weight: 700;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: var(--mg-gradient-primary);
    color: #ffffff;
    transform: scale(1.1);
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: var(--mg-border);
    opacity: 1;
    transition: var(--mg-transition);
}

.swiper-pagination-bullet-active {
    background: var(--mg-primary);
    width: 30px;
    border-radius: var(--mg-radius-full);
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .mg-dark-auto {
        --mg-bg: #0f172a;
        --mg-surface: #1e293b;
        --mg-surface-hover: #334155;
        --mg-text: #f8fafc;
        --mg-text-muted: #94a3b8;
        --mg-border: #334155;
    }
}

/* ============================================
   صفحه فروشگاه با فیلتر
   ============================================ */
.mg-shop-page {
    background: var(--mg-bg);
    min-height: 100vh;
}

.mg-shop-header {
    background: var(--mg-gradient-primary);
    padding: 1.25rem 0;
    margin-bottom: 2rem;
}

.mg-shop-header-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.mg-shop-title {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.mg-shop-title svg {
    opacity: 0.9;
}

.mg-shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
}

.mg-elementor-shop-layout {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    width: min(100%, var(--mg-container-max, 1320px));
    margin-inline: auto;
    padding: 0 1rem 3rem;
}

.mg-elementor-shop-layout > .elementor-widget-mehregan_shop_filters,
.mg-elementor-shop-layout > .elementor-widget-mehregan_shop_products {
    min-width: 0;
}

.mg-elementor-shop-layout .elementor-widget-mehregan_shop_products .mg-shop-header {
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
}

.mg-shop-layout-no-sidebar {
    grid-template-columns: 1fr;
}

/* سایدبار فیلترها */
.mg-shop-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(var(--mg-primary-rgb), 0.08);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 1.5rem 1rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.mg-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mg-border);
    margin-bottom: 1.5rem;
}

.mg-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mg-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.mg-sidebar-title svg {
    color: var(--mg-primary);
}

.mg-sidebar-close {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--mg-text-muted);
}

.mg-filter-section {
    margin-bottom: 1rem;
    padding: 1rem 0.5rem;
    border: none;
    border-radius: var(--mg-radius);
    background: rgba(255, 255, 255, 0.88);
}

.mg-filter-section:last-of-type {
    margin-bottom: 0;
}

.mg-filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mg-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mg-filter-title svg {
    color: var(--mg-primary);
}

.mg-filter-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-inline-start: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--mg-primary-rgb), 0.3) transparent;
}
/* استثنا: بخش امتیازها محدود نشه (فقط ۶ آیتم داره) */
.mg-filter-content:has(.mg-rating-filter) {
    max-height: none;
    overflow: visible;
    padding-inline-start: 0;
}
.mg-filter-content::-webkit-scrollbar {
    width: 5px;
}
.mg-filter-content::-webkit-scrollbar-track {
    background: transparent;
}
.mg-filter-content::-webkit-scrollbar-thumb {
    background: rgba(var(--mg-primary-rgb), 0.25);
    border-radius: var(--mg-radius-full);
}

.mg-filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--mg-radius-sm);
    color: var(--mg-text);
    text-decoration: none;
    transition: var(--mg-transition);
    font-size: 0.9rem;
}

.mg-filter-item:hover {
    background: rgba(var(--mg-primary-rgb), 0.06);
}

.mg-filter-item.active {
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
}

.mg-filter-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--mg-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--mg-transition);
}

.mg-filter-item.active .mg-filter-checkbox {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
}

.mg-filter-item.active .mg-filter-checkbox::after {
    content: '✓';
    color: #ffffff;
    font-size: 0.7rem;
}

.mg-filter-hidden-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.mg-filter-name {
    flex: 1;
}

.mg-filter-count {
    background: rgba(var(--mg-primary-rgb), 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: var(--mg-radius-sm);
    font-size: 0.75rem;
    color: var(--mg-primary-dark);
}

/* دکمه × حذف دسته‌بندی انتخاب شده */
.mg-filter-item-clear {
    font-size: 0.7rem;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.12);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

/* بج تعداد فیلترهای فعال روی دکمه فیلتر */
.mg-filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--mg-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.mg-filter-toggle.has-active-filters {
    border-color: var(--mg-primary);
    color: var(--mg-primary);
}

/* چیپ‌های فیلترهای فعال */
.mg-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--mg-border);
    margin-bottom: 0.75rem;
}

.mg-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(var(--mg-primary-rgb), 0.18);
    transition: background 0.15s ease;
}

.mg-filter-chip:hover {
    background: rgba(var(--mg-primary-rgb), 0.15);
}

.mg-filter-chip svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.mg-filter-chip-clear {
    background: transparent;
    color: var(--mg-text-muted);
    border-color: var(--mg-border);
    font-weight: 400;
}

.mg-filter-chip-clear:hover {
    background: rgba(0,0,0,0.04);
    color: var(--mg-text);
}

/* دکمه اعمال قیمت */
.mg-price-apply-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--mg-primary);
    color: #fff;
    border: none;
    border-radius: var(--mg-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: opacity 0.15s ease;
}

.mg-price-apply-btn:hover {
    opacity: 0.88;
}

/* فیلتر قیمت */
.mg-price-range {
    position: relative;
    height: 76px;
    margin: 0 10px 0.9rem;
    padding: 0;
    box-sizing: border-box;
}

/* ریل پس‌زمینه و ریل انتخاب‌شده */
.mg-price-track {
    position: absolute;
    inset-inline: 0;
    top: 54px;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    z-index: 1;
}
.mg-price-track-bg {
    position: absolute;
    inset: 0;
    background: var(--mg-border);
    border-radius: 3px;
}
.mg-price-track-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--mg-gradient-primary);
    border-radius: 3px;
}

/* label‌های قیمت بالای اسلایدر */
.mg-price-labels {
    position: absolute;
    inset-inline: 0;
    top: 0;
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    direction: rtl;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--mg-text-muted);
}
.mg-price-min,
.mg-price-max {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* دو input range روی هم — فقط thumbs قابل کلیک */
.mg-price-slider {
    position: absolute;
    inset-inline: 0;
    top: 36px;
    width: 100%;
    height: 36px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    direction: rtl;
    z-index: 3;
}
.mg-price-slider::-webkit-slider-runnable-track {
    background: none;
    border: none;
    height: 36px;
}
.mg-price-slider::-moz-range-track {
    background: none;
    border: none;
    height: 36px;
}
.mg-price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid var(--mg-primary);
    border-radius: 50%;
    cursor: grab;
    margin-top: 8px;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(var(--mg-primary-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 5;
}
.mg-price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid var(--mg-primary);
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(var(--mg-primary-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.mg-price-slider::-webkit-slider-thumb:hover,
.mg-price-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(var(--mg-primary-rgb), 0.5);
}
.mg-price-slider:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.mg-price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mg-price-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--mg-text-muted);
    margin-bottom: 0.25rem;
}

.mg-price-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(var(--mg-primary-rgb), 0.12);
    border-radius: var(--mg-radius-sm);
    font-size: 0.85rem;
    background: var(--mg-surface);
    color: var(--mg-text);
    transition: var(--mg-transition-fast);
    direction: rtl;
    text-align: center;
}
.mg-price-hidden-input {
    display: none !important;
}

.mg-price-input:focus {
    outline: none;
    border-color: rgba(var(--mg-primary-rgb), 0.35);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--mg-primary-rgb), 0.08);
}

.mg-price-filter-btn {
    width: 100%;
}
.mg-price-filter-section .mg-filter-title svg {
    display: none !important;
}

/* چک‌باکس فیلتر */
.mg-filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--mg-radius-sm);
    background: rgba(var(--mg-primary-rgb), 0.03);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--mg-transition-fast);
}

.mg-filter-checkbox-item:hover {
    background: rgba(var(--mg-primary-rgb), 0.08);
}

.mg-filter-checkbox-item input {
    display: none;
}

.mg-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--mg-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--mg-transition);
}

.mg-filter-checkbox-item input:checked + .mg-checkmark {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
}

.mg-filter-checkbox-item input:checked + .mg-checkmark::after {
    content: '✓';
    color: #ffffff;
    font-size: 0.7rem;
}

/* فیلتر امتیاز */
.mg-rating-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mg-rating-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.7rem 0.8rem;
    border-radius: var(--mg-radius-sm);
    background: rgba(var(--mg-primary-rgb), 0.03);
    transition: var(--mg-transition-fast);
}

.mg-rating-item:hover {
    background: rgba(var(--mg-primary-rgb), 0.08);
}

.mg-rating-item input {
    display: none;
}

.mg-rating-stars {
    display: flex;
}

.mg-star {
    color: var(--mg-border);
    font-size: 1rem;
}

.mg-star.filled {
    color: var(--mg-accent);
}

.mg-rating-text {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
}

.mg-filter-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(var(--mg-primary-rgb), 0.15);
}

.mg-filter-actions .mg-btn {
    justify-content: center;
}

.mg-filter-actions .mg-btn-outline {
    background: #ffffff;
    color: var(--mg-primary-dark);
    border: 1px solid rgba(var(--mg-primary-rgb), 0.2);
    box-shadow: 0 10px 24px -22px rgba(var(--mg-primary-rgb), 0.55);
}

.mg-filter-actions .mg-btn-outline:hover {
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary-dark);
    border-color: rgba(var(--mg-primary-rgb), 0.38);
}

/* نوار ابزار فروشگاه */
.mg-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--mg-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.mg-toolbar-left,
.mg-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mg-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    color: var(--mg-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--mg-transition);
}

.mg-filter-toggle:hover {
    border-color: var(--mg-primary);
    color: var(--mg-primary);
}

.mg-result-count {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
}

.mg-sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mg-sort-label {
    font-size: 0.85rem;
    color: var(--mg-text-muted);
}

.mg-sort-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-bg);
    font-size: 0.9rem;
    color: var(--mg-text);
    cursor: pointer;
}

.mg-view-toggle {
    display: flex;
    gap: 0.25rem;
}

.mg-view-btn {
    padding: 0.5rem;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-sm);
    color: var(--mg-text-muted);
    cursor: pointer;
    transition: var(--mg-transition);
}

.mg-view-btn:hover,
.mg-view-btn.active {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
    color: #ffffff;
}

/* گرید محصولات */
.mg-shop-content .mg-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.mg-shop-content .mg-product-card {
    background: linear-gradient(180deg, rgba(var(--mg-primary-rgb), 0.16) 0%, transparent 62%), #ffffff;
}

.mg-shop-content .mg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

.mg-product-category {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.08);
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
    width: fit-content;
}

/* صفحه‌بندی */
.mg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.mg-pagination a,
.mg-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--mg-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--mg-transition);
}

.mg-pagination a {
    background: var(--mg-bg);
    color: var(--mg-text);
    box-shadow: var(--mg-shadow);
}

.mg-pagination a:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

.mg-pagination .current {
    background: var(--mg-primary);
    color: #ffffff;
}

/* حالت بارگذاری AJAX */
#mg-shop-results.is-loading,
#mg-blog-results.is-loading {
    position: relative;
    pointer-events: none;
    min-height: 240px;
}

/* پوشش شفاف */
#mg-shop-results.is-loading::after,
#mg-blog-results.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 10;
    border-radius: var(--mg-radius-md);
}

/* دایره لودر چرخنده */
#mg-shop-results.is-loading::before,
#mg-blog-results.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    margin-top: -27px;
    margin-left: -27px;
    border-radius: 50%;
    border: 4px solid rgba(var(--mg-primary-rgb), 0.15);
    border-top: 4px solid var(--mg-primary);
    border-right: 4px solid var(--mg-primary);
    box-shadow: 0 0 16px rgba(var(--mg-primary-rgb), 0.18);
    animation: mg-ajax-spin 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 11;
}

@keyframes mg-ajax-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* پنهان کردن پجینیشن وقتی lazy loading فعاله */
.mg-lazy-active .mg-pagination { display: none !important; }

/* sentinel */
.mg-lazy-sentinel {
    height: 1px;
    margin-top: 2rem;
    visibility: hidden;
}

/* وضعیت لود بیشتر */
.mg-load-status {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    min-height: 60px;
}

.mg-load-status[data-state="loading"]::after {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(var(--mg-primary-rgb), 0.15);
    border-top: 3px solid var(--mg-primary);
    border-right: 3px solid var(--mg-primary);
    animation: mg-ajax-spin 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.mg-load-status[data-state="done"]::after {
    content: 'همه محصولات نمایش داده شدند';
    display: block;
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--mg-border);
    border-radius: 2rem;
    background: var(--mg-bg);
}

/* بدون محصول */
.mg-no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
}

.mg-no-products svg {
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.mg-no-products h3 {
    font-size: 1.5rem;
    color: var(--mg-text);
    margin-bottom: 0.5rem;
}

.mg-no-products p {
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
}

/* Overlay برای موبایل */
.mg-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1300;
}

.mg-sidebar-overlay.active {
    display: block;
}

/* Badge ناموجود */
.mg-badge-outofstock {
    background: var(--mg-text-muted);
}

/* ریسپانسیو فروشگاه */
@media (max-width: 1024px) {
    .mg-shop-layout,
    .mg-elementor-shop-layout {
        grid-template-columns: 1fr;
    }
    
    .mg-shop-sidebar {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        border-radius: 0;
        z-index: 1400;
        overflow-y: auto;
        transition: right 0.3s ease;
    }
    
    .mg-shop-sidebar.active {
        right: 0;
    }
    
    .mg-sidebar-close {
        display: block;
    }
    
    .mg-filter-toggle {
        display: flex;
    }
    
    .mg-shop-content .mg-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .mg-shop-header {
        padding: 1rem 0;
    }
    
    .mg-shop-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mg-shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mg-toolbar-left,
    .mg-toolbar-right {
        justify-content: space-between;
    }
    
    .mg-shop-content .mg-products-grid {
        grid-template-columns: 1fr;
    }
    
    .mg-sort-label {
        display: none;
    }
}

/* ============================================
   صفحه محصول تکی
   ============================================ */
.mg-single-product {
    background: #ffffff;
    min-height: 100vh;
}

.mg-single-product.mg-elementor-product-main,
.mg-single-product.mg-elementor-product-gallery,
.mg-single-product.mg-elementor-product-summary,
.mg-single-product.mg-elementor-product-tabs,
.mg-single-product.mg-elementor-related-products {
    min-height: 0;
}

/* جلوگیری از اسکرول افقی در صفحه single product */
html.single-product,
body.single-product {
    background: #ffffff;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
}

.mg-single-product {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.mg-product-gallery {
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.mg-product-swiper {
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.mg-product-swiper .swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0;
}

.mg-thumbs-swiper {
    overflow: hidden !important;
    width: 100% !important;
}

.mg-breadcrumb-section {
    background: var(--mg-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--mg-border);
}

body.single-product .mg-breadcrumb-section {
    background: transparent;
    padding: 0.75rem 0 0;
    border-bottom: 0;
}

body.single-product .mg-product-main {
    padding-top: 1.75rem;
}

.mg-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.mg-breadcrumb a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--mg-text-muted);
    text-decoration: none;
    transition: var(--mg-transition);
}

.mg-breadcrumb a:hover {
    color: var(--mg-primary);
}

.mg-breadcrumb-sep {
    color: var(--mg-border);
}

.mg-breadcrumb-current {
    color: var(--mg-text);
    font-weight: 500;
}

.mg-product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2.5rem 0;
}

/* گالری محصول */
.mg-product-gallery {
    position: sticky;
    top: 100px;
}

.mg-product-swiper {
    position: relative;
    touch-action: pan-y;
}

.mg-gallery-main .mg-product-swiper,
.mg-gallery-main .swiper-wrapper,
.mg-gallery-main .swiper-slide {
    height: 100%;
}

.mg-product-swiper .swiper-slide {
    cursor: default;
}

.mg-product-swiper .swiper-slide:active {
    cursor: grabbing;
}

.mg-product-swiper .swiper-slide .mg-gallery-image {
    pointer-events: auto;
}

.mg-product-swiper .swiper-slide.swiper-no-swiping {
    pointer-events: none;
}

.mg-gallery-main {
    position: relative;
    background: transparent;
    border: 0;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    box-shadow: none;
    max-width: min(500px, 100%);
    aspect-ratio: 1;
    margin-inline: auto;
}

.mg-gallery-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.mg-gallery-badges .mg-badge {
    position: relative;
    top: auto;
    right: auto;
    font-size: 0.8rem;
    padding: 0.5rem 0.875rem;
}

.mg-gallery-badges .mg-badge-featured {
    background: linear-gradient(135deg, var(--mg-accent-light) 0%, var(--mg-accent) 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mg-sale-large {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
}

.mg-gallery-image {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    overflow: hidden;
    border-radius: var(--mg-radius-lg);
}

.mg-gallery-image img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    user-select: none;
    border-radius: var(--mg-radius);
}

.mg-gallery-thumbs {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.mg-product-gallery .mg-thumbs-swiper {
    width: min(100%, 420px) !important;
    margin-inline: auto;
    touch-action: pan-y;
}

.mg-product-gallery .mg-thumbs-swiper .swiper-wrapper {
    justify-content: center;
}

.mg-thumbs-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    aspect-ratio: 1;
    background: rgba(var(--mg-primary-rgb), 0.04);
    border-radius: var(--mg-radius);
    overflow: hidden;
    cursor: pointer;
    border: 0;
    transition: var(--mg-transition);
}

.mg-thumbs-swiper .swiper-slide:hover,
.mg-thumbs-swiper .swiper-slide-thumb-active {
    box-shadow: inset 0 0 0 2px rgba(var(--mg-primary-rgb), 0.28);
}

.mg-thumbs-swiper img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
    display: block;
}

.mg-product-gallery .mg-gallery-main {
    width: min(500px, 100%) !important;
    aspect-ratio: 1 / 1 !important;
    border: 0 !important;
    border-radius: var(--mg-radius-lg) !important;
    overflow: hidden !important;
}

.mg-product-gallery .mg-gallery-main .mg-product-swiper,
.mg-product-gallery .mg-gallery-main .swiper-wrapper,
.mg-product-gallery .mg-gallery-main .swiper-slide,
.mg-product-gallery .mg-gallery-main .mg-gallery-image {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: inherit !important;
    overflow: hidden !important;
}

.mg-product-gallery .mg-gallery-main .mg-gallery-image img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: inherit !important;
}

.mg-product-gallery .mg-thumbs-swiper .swiper-slide {
    width: 92px !important;
    height: 92px !important;
    aspect-ratio: 1 / 1 !important;
    border: 0 !important;
    border-radius: var(--mg-radius) !important;
    overflow: hidden !important;
}

.mg-product-gallery .mg-thumbs-swiper img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* The product gallery is intentionally controlled by one deterministic state.
   It avoids conflicting Swiper thumb transforms in RTL and Elementor previews. */
.mg-product-gallery .mg-product-swiper .swiper-wrapper {
    display: block !important;
    height: 100% !important;
    transform: none !important;
    transition: none !important;
}

.mg-product-gallery .mg-product-swiper .swiper-slide {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
}

.mg-product-gallery .mg-product-swiper .swiper-slide.mg-gallery-slide-active {
    display: block !important;
}

.mg-product-gallery .mg-thumbs-swiper {
    overflow: visible !important;
}

.mg-product-gallery .mg-thumbs-swiper .swiper-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    transform: none !important;
    transition: none !important;
}

.mg-product-gallery .mg-thumbs-swiper .swiper-slide {
    flex: 0 0 92px;
    margin: 0 !important;
}

/* اطلاعات محصول */
.mg-product-details {
    padding: 1rem 0;
}

.mg-product-category-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
    font-size: 0.8rem;
    border-radius: var(--mg-radius-full);
    text-decoration: none;
    margin-bottom: 1rem;
}

.mg-product-main-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.mg-product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--mg-border);
}

.mg-product-rating-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mg-stars-large {
    display: flex;
    gap: 0.1rem;
}

.mg-stars-large .mg-star {
    font-size: 1.2rem;
    color: var(--mg-border);
}

.mg-stars-large .mg-star.filled {
    color: var(--mg-accent);
}

.mg-rating-info {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
}

.mg-product-sku {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
}

.mg-product-sku strong {
    color: var(--mg-text);
}

/* ═════════════════════════════════════════
   Single product — Price card (طراحی حرفه‌ای)
═════════════════════════════════════════ */
.mg-product-price-main {
    margin-bottom: 1.5rem;
}

.mg-price-card {
    position: relative;
    background: linear-gradient(135deg, var(--mg-surface) 0%, #ffffff 100%);
    border: 2px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.4rem 1.6rem;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mg-price-card:hover {
    border-color: rgba(var(--mg-primary-rgb), 0.4);
    box-shadow: 0 4px 16px rgba(var(--mg-primary-rgb), 0.08);
}

/* حالت تخفیف‌دار: gradient ملایم قرمز/نارنجی */
.mg-price-card--sale {
    background: linear-gradient(135deg, rgba(239,68,68,0.04) 0%, rgba(245,158,11,0.04) 100%);
    border-color: rgba(239,68,68,0.25);
}
.mg-price-card--sale:hover {
    border-color: rgba(239,68,68,0.5);
    box-shadow: 0 4px 16px rgba(239,68,68,0.12);
}

/* glow effect ظریف برای حالت sale */
.mg-price-card--sale::before {
    content: '';
    position: absolute;
    top: -50%;
    inset-inline-start: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(239,68,68,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.mg-price-card > * {
    position: relative;
    z-index: 1;
}

/* head: label + discount badge */
.mg-price-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.mg-price-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    letter-spacing: 0.3px;
}
.mg-price-label svg {
    flex-shrink: 0;
    color: var(--mg-primary);
}

/* badge تخفیف — gradient قرمز/نارنجی با shadow */
.mg-price-discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.75rem;
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--mg-radius-full);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.28);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* نمایش قیمت */
.mg-price-display {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    line-height: 1.2;
    justify-content: flex-start;
}

.mg-price-card .mg-price-display .mg-price-wrap {
    align-items: flex-end;
    gap: 0.5rem;
}

.mg-price-card .mg-price-display .mg-price-col {
    align-items: flex-end;
    gap: 0.25rem;
}

.mg-price-card .mg-price-display .mg-price-col > .woocommerce-Price-amount,
.mg-price-card .mg-price-display .mg-price-col ins,
.mg-price-card .mg-price-display .mg-price-col ins .woocommerce-Price-amount {
    font-size: 1.74rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    color: var(--mg-text);
}

.mg-price-card--sale .mg-price-display .mg-price-col ins,
.mg-price-card--sale .mg-price-display .mg-price-col ins .woocommerce-Price-amount {
    font-size: 1.86rem;
}

.mg-price-card .mg-price-display .mg-price-col del {
    font-size: 0.86rem;
    line-height: 1.1;
    opacity: 0.55;
}

.mg-price-card .mg-price-display .mg-toman-icon {
    height: 2.45rem;
    opacity: 0.34;
    align-self: center;
    margin-bottom: 0;
}

.mg-price-card--sale .mg-price-display .mg-toman-icon {
    height: 3.25rem;
}

/* قیمت محصول معمولی — gradient text */
.mg-price-card:not(.mg-price-card--sale) .price {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    font-feature-settings: "tnum";
    background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--mg-primary); /* fallback */
    display: inline-block;
    filter: drop-shadow(0 2px 6px rgba(var(--mg-primary-rgb), 0.18));
}
.mg-price-card:not(.mg-price-card--sale) .price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

/* قیمت تخفیف‌دار */
.mg-price-card--sale .price {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    color: inherit;
}
.mg-price-card--sale .price ins {
    text-decoration: none;
    font-size: 5.4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    font-feature-settings: "tnum";
    color: #dc2626;
    order: 1;
    filter: drop-shadow(0 2px 8px rgba(220,38,38,0.22));
}
.mg-price-card--sale .price ins .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.mg-price-card--sale .price del {
    font-size: 2rem;
    font-weight: 500;
    color: var(--mg-text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    opacity: 0.65;
    order: 2;
    margin: 0;
    align-self: center;
}

/* badge "صرفه‌جویی می‌کنید" — سبز با border نقطه‌چین */
.mg-price-savings {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.85rem;
    padding: 0.45rem 0.8rem;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--mg-radius-sm);
    border: 1px dashed rgba(16, 185, 129, 0.4);
}
.mg-price-savings svg {
    color: #10b981;
    flex-shrink: 0;
}
.mg-price-savings .woocommerce-Price-amount {
    font-weight: 800;
    color: #047857;
    margin: 0 0.15rem;
}
.mg-price-savings .woocommerce-Price-amount::after {
    content: ' تومان';
    margin-inline-start: 0.2rem;
    font-size: 0.92em;
    font-weight: 700;
}

/* ریسپانسیو موبایل */
@media (max-width: 640px) {
    .mg-price-card { padding: 1.1rem 1.2rem; }
    .mg-price-card-head { margin-bottom: 0.7rem; }
    .mg-price-card:not(.mg-price-card--sale) .price,
    .mg-price-card--sale .price ins { font-size: 3.8rem; letter-spacing: 0; }
    .mg-price-card--sale .price del { font-size: 1.5rem; }
    .mg-price-card .mg-price-display .mg-price-col > .woocommerce-Price-amount,
    .mg-price-card .mg-price-display .mg-price-col ins,
    .mg-price-card .mg-price-display .mg-price-col ins .woocommerce-Price-amount { font-size: 1.5rem; }
    .mg-price-card--sale .mg-price-display .mg-price-col ins,
    .mg-price-card--sale .mg-price-display .mg-price-col ins .woocommerce-Price-amount { font-size: 1.62rem; }
    .mg-price-card .mg-price-display .mg-toman-icon { height: 2.15rem; }
    .mg-price-card--sale .mg-price-display .mg-toman-icon { height: 2.8rem; }
    .mg-price-discount-badge { font-size: 0.72rem; padding: 0.28rem 0.6rem; }
    .mg-price-savings { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
}

.mg-product-short-desc {
    font-size: 0.95rem;
    color: var(--mg-text-muted);
    line-height: 1.8;
    margin-top: 1.2rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0.25rem 0;
    border-top: 1px solid rgba(var(--mg-primary-rgb), 0.1);
}

.mg-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--mg-radius);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.mg-stock-status.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.mg-stock-status.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.mg-product-interest-proof {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: calc(var(--mg-radius-lg) + 2px);
    border: 1px solid rgba(var(--mg-primary-rgb), 0.18);
    background:
        radial-gradient(circle at top right, rgba(var(--mg-primary-rgb), 0.16) 0%, transparent 42%),
        linear-gradient(135deg, rgba(var(--mg-primary-rgb), 0.08) 0%, rgba(var(--mg-accent-rgb), 0.12) 100%);
    box-shadow: 0 20px 44px -28px rgba(var(--mg-primary-rgb), 0.55);
    overflow: hidden;
}

.mg-product-interest-proof::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.3) 0%, transparent 28%, transparent 72%, rgba(255, 255, 255, 0.18) 100%);
    pointer-events: none;
}

.mg-product-interest-proof.is-empty {
    border-color: var(--mg-border);
    background:
        radial-gradient(circle at top right, rgba(148, 163, 184, 0.12) 0%, transparent 40%),
        linear-gradient(135deg, #ffffff 0%, var(--mg-surface) 100%);
    box-shadow: var(--mg-shadow-sm);
}

.mg-product-interest-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--mg-primary-rgb), 0.14) 0%, rgba(var(--mg-accent-rgb), 0.18) 100%);
    color: #e11d48;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.mg-product-interest-proof.is-empty .mg-product-interest-icon {
    color: var(--mg-text-muted);
    background: rgba(148, 163, 184, 0.12);
}

.mg-product-interest-content {
    position: relative;
    z-index: 1;
}

.mg-product-interest-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--mg-primary);
}

.mg-product-interest-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(var(--mg-primary-rgb), 0.14);
}

.mg-product-interest-proof.is-empty .mg-product-interest-kicker {
    color: var(--mg-text-muted);
}

.mg-product-interest-proof.is-empty .mg-product-interest-kicker::before {
    box-shadow: none;
}

.mg-product-interest-metric {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
}

.mg-product-interest-count {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--mg-text);
}

.mg-product-interest-unit {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--mg-text-muted);
    padding-bottom: 0.18rem;
}

.mg-product-interest-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--mg-text-muted);
}

.mg-product-interest-pulse {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
}

.mg-product-interest-pulse span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--mg-primary);
    opacity: 0.6;
}

.mg-product-interest-proof.is-empty .mg-product-interest-pulse span {
    background: #94a3b8;
}

/* فرم افزودن به سبد */
.mg-add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* انتخاب ویژگی‌های محصول متغیر */
.mg-product-variations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-border);
}

.mg-variation-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mg-variation-row label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mg-text);
}

.mg-variation-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-background);
    color: var(--mg-text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--mg-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 2.5rem;
}

.mg-variation-select:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.1);
}

.mg-variation-select:hover {
    border-color: var(--mg-primary);
}

.mg-add-to-cart-form .mg-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.mg-out-of-stock-notice {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--mg-radius);
    color: #ef4444;
}

.mg-out-of-stock-notice p {
    margin: 0;
}

.mg-add-to-cart-variable[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.mg-add-to-cart-form > .mg-quantity-wrapper,
.mg-add-to-cart-form > .mg-add-to-cart-main,
.mg-add-to-cart-form > .mg-add-to-cart-variable {
    display: flex;
    align-items: center;
}

.mg-add-to-cart-form:not(:has(.mg-product-variations)) {
    flex-direction: row;
    flex-wrap: wrap;
}

.mg-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mg-quantity-wrapper label {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
}

.mg-quantity-controls {
    display: flex;
    align-items: center;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    overflow: hidden;
    position: relative;
}

.mg-qty-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--mg-text);
    transition: var(--mg-transition);
}

.mg-qty-btn:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

.mg-qty-input {
    width: 50px;
    height: 40px;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
}

.mg-qty-input::-webkit-inner-spin-button,
.mg-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mg-qty-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.mg-quantity-controls[data-qty-display] .mg-qty-input,
.mg-stepper[data-qty-display] .mg-qty-input {
    color: transparent !important;
    caret-color: transparent;
}
.mg-quantity-controls[data-qty-display]::after,
.mg-stepper[data-qty-display]::after {
    content: attr(data-qty-display);
    position: absolute;
    inset-block: 0;
    left: 40px;
    right: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-text);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}
.mg-stepper[data-qty-display]::after {
    left: 30px;
    right: 30px;
    font-size: 0.9rem;
}

.mg-add-to-cart-main,
.mg-add-to-cart-variable {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* اقدامات سریع */
.mg-product-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--mg-border);
}

.mg-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-size: 0.85rem;
    color: var(--mg-text);
    cursor: pointer;
    transition: var(--mg-transition);
}

.mg-quick-action:hover {
    border-color: var(--mg-primary);
    color: var(--mg-primary);
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action {
    gap: 0.72rem;
    padding-inline: 0.85rem 1rem;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action > svg {
    order: 1;
    flex-shrink: 0;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-label {
    order: 2;
    white-space: nowrap;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge {
    order: 3;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    height: auto;
    padding: 0 0 0 0.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: currentColor;
    box-shadow: none;
    pointer-events: none;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    opacity: 0.88;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge::before {
    content: '';
    width: 1px;
    height: 0.95rem;
    margin-inline-end: 0.55rem;
    background: currentColor;
    opacity: 0.18;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge-count {
    letter-spacing: -0.03em;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge.is-empty {
    opacity: 0.58;
}

.mg-product-quick-actions .mg-wishlist-btn.mg-quick-action.active .mg-wishlist-interest-badge {
    opacity: 0.96;
}

@media (max-width: 768px) {
    .mg-product-interest-proof {
        grid-template-columns: auto 1fr;
        gap: 0.85rem;
        padding: 0.9rem 0.95rem;
    }

    .mg-product-interest-icon {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .mg-product-interest-count {
        font-size: 1.55rem;
    }

    .mg-product-interest-text {
        font-size: 0.84rem;
        line-height: 1.7;
    }

    .mg-product-interest-pulse {
        display: none;
    }

    .mg-product-quick-actions .mg-wishlist-btn.mg-quick-action {
        gap: 0.58rem;
        padding-inline: 0.75rem 0.9rem;
    }

    .mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge {
        padding-inline-start: 0.05rem;
        font-size: 0.64rem;
    }

    .mg-product-quick-actions .mg-wishlist-btn.mg-quick-action .mg-wishlist-interest-badge::before {
        height: 0.85rem;
        margin-inline-end: 0.42rem;
    }
}

/* ویژگی‌های سریع */
.mg-product-features-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mg-feature-quick-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius);
}

.mg-feature-quick-item svg {
    flex-shrink: 0;
    color: var(--mg-primary);
}

.mg-feature-quick-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--mg-text);
    margin-bottom: 0.25rem;
}

.mg-feature-quick-item span {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
}

/* تب‌های توضیحات */
.mg-product-tabs-section {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    margin-bottom: 3rem;
    overflow: hidden;
}

.mg-tabs-header {
    display: flex;
    background: var(--mg-surface);
    border-bottom: 1px solid var(--mg-border);
}

.mg-tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 2rem;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--mg-text-muted);
    cursor: pointer;
    transition: var(--mg-transition);
    position: relative;
}

.mg-tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--mg-primary);
    transform: scaleX(0);
    transition: var(--mg-transition);
}

.mg-tab-button:hover,
.mg-tab-button.active {
    color: var(--mg-primary);
}

.mg-tab-button.active::after {
    transform: scaleX(1);
}

.mg-tabs-content {
    padding: 2rem;
}

.mg-tab-pane {
    display: none;
}

.mg-tab-pane.active {
    display: block;
}

.mg-product-description {
    line-height: 1.8;
    color: var(--mg-text);
}

.mg-product-description p {
    margin-bottom: 1rem;
}

.mg-attributes-table {
    width: 100%;
    border-collapse: collapse;
}

.mg-attributes-table tr {
    border-bottom: 1px solid var(--mg-border);
}

.mg-attributes-table th,
.mg-attributes-table td {
    padding: 1rem;
    text-align: right;
}

.mg-attributes-table th {
    width: 200px;
    background: var(--mg-surface);
    font-weight: 600;
    color: var(--mg-text);
}

.mg-attributes-table td {
    color: var(--mg-text-muted);
}

/* محصولات مرتبط */
.mg-related-products {
    margin-bottom: 3rem;
}

.mg-related-swiper {
    overflow: hidden;
    padding-top: 1rem;
    margin-top: -1rem;
    padding-bottom: 2rem;
}

.mg-related-swiper .swiper-slide {
    height: auto;
}

/* قبل از init Swiper، کارتا کامل پهن میشن — این جلوشو میگیره */
.mg-related-swiper:not(.swiper-initialized) .swiper-slide {
    width: calc(50% - 6px);
}
@media (min-width: 768px) {
    .mg-related-swiper:not(.swiper-initialized) .swiper-slide {
        width: calc(33.333% - 11px);
    }
}
@media (min-width: 992px) {
    .mg-related-swiper:not(.swiper-initialized) .swiper-slide {
        width: calc(25% - 14px);
    }
}

.mg-related-swiper .mg-product-card {
    height: 100%;
    min-height: unset;
}

/* ریسپانسیو صفحه محصول */
@media (max-width: 1024px) {
    .mg-product-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .mg-product-gallery {
        position: static;
    }
    
    .mg-product-features-quick {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mg-product-gallery .mg-gallery-main {
        width: min(340px, 90vw) !important;
        max-width: min(340px, 90vw);
    }

    .mg-product-main-title {
        font-size: 1.2rem;
    }
    
    .mg-tabs-header {
        flex-wrap: wrap;
    }
    
    .mg-tab-button {
        flex: 1;
        justify-content: center;
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .mg-tabs-content {
        padding: 1.5rem;
    }
}


/* ============================================
   صفحه تأیید سفارش (Thank You)
   ============================================ */
.mg-thankyou {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    gap: 1.5rem;
}

.mg-ty-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,.10);
    padding: 3rem 2.5rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* بخش‌های پیش‌فرض WooCommerce زیر کارت */
.mg-thankyou .woocommerce-order-details,
.mg-thankyou .woocommerce-customer-details {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    padding: 1.5rem 2rem;
}

.mg-thankyou .woocommerce-order-details__title,
.mg-thankyou .woocommerce-column__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--mg-gray-800);
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--mg-gray-100, #f1f5f9);
}

.mg-thankyou .woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.mg-thankyou .woocommerce-table--order-details th,
.mg-thankyou .woocommerce-table--order-details td {
    padding: .6rem .5rem;
    border-bottom: 1px solid var(--mg-gray-100, #f1f5f9);
    text-align: right;
}
.mg-thankyou .woocommerce-table--order-details tfoot tr:last-child td,
.mg-thankyou .woocommerce-table--order-details tfoot tr:last-child th {
    font-weight: 700;
    color: var(--mg-primary);
    border-bottom: none;
}
.mg-thankyou .woocommerce-table--order-details .woocommerce-Price-amount::after,
.mg-vo-details .woocommerce-table--order-details .woocommerce-Price-amount::after {
    content: ' تومان';
    margin-inline-start: .25rem;
    font-size: .9em;
    font-weight: inherit;
    color: inherit;
}

/* ستون‌های آدرس */
.mg-thankyou .woocommerce-columns--addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.mg-thankyou .woocommerce-column address {
    font-style: normal;
    font-size: .875rem;
    line-height: 1.8;
    color: var(--mg-gray-600);
}

@media (max-width: 600px) {
    .mg-thankyou .woocommerce-columns--addresses {
        grid-template-columns: 1fr;
    }
    .mg-thankyou .woocommerce-order-details,
    .mg-thankyou .woocommerce-customer-details {
        padding: 1.25rem;
    }
}

/* آیکون دایره‌ای */
.mg-ty-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
}

.mg-ty-icon svg { width: 100%; height: 100%; }

.mg-ty-icon--success .mg-ty-circle {
    stroke: var(--mg-success, #22c55e);
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    animation: mg-draw-circle .6s ease forwards;
}
.mg-ty-icon--success .mg-ty-check {
    stroke: var(--mg-success, #22c55e);
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: mg-draw-check .4s ease .55s forwards;
}
@keyframes mg-draw-circle {
    to { stroke-dashoffset: 0; }
}
@keyframes mg-draw-check {
    to { stroke-dashoffset: 0; }
}

.mg-ty-icon--fail svg { stroke: var(--mg-danger, #ef4444); }

.mg-ty-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    color: var(--mg-gray-900);
}

.mg-ty-sub {
    color: var(--mg-gray-500);
    font-size: .95rem;
    margin: 0 0 2rem;
    line-height: 1.7;
}

/* جزئیات سفارش */
.mg-ty-details {
    background: var(--mg-surface, #f8f9fa);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    text-align: right;
}

.mg-ty-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem 0;
    border-bottom: 1px solid var(--mg-gray-100, #f1f5f9);
    gap: 1rem;
}
.mg-ty-detail-row:last-child { border-bottom: none; }

.mg-ty-detail-label {
    color: var(--mg-gray-500);
    font-size: .875rem;
    flex-shrink: 0;
}
.mg-ty-detail-value {
    font-weight: 600;
    color: var(--mg-gray-800);
    font-size: .9rem;
}
.mg-ty-currency {
    margin-inline-start: .25rem;
    font-size: .9em;
    font-weight: inherit;
    color: inherit;
}
.mg-ty-detail-value--price {
    color: var(--mg-primary);
    font-size: 1rem;
}
.mg-ty-detail-value--original {
    text-decoration: line-through;
    color: var(--mg-gray-400);
    font-weight: 400;
}
.mg-ty-detail-value--discount {
    color: #16a34a;
    font-weight: 700;
}
.mg-ty-discount-pct {
    font-style: normal;
    font-size: .8rem;
    opacity: .85;
}
.mg-ty-detail-row--total {
    border-top: 2px solid var(--mg-gray-200, #e2e8f0);
    margin-top: .25rem;
    padding-top: .75rem;
}
.mg-ty-detail-row--total .mg-ty-detail-label {
    font-weight: 700;
    color: var(--mg-gray-800);
}

/* مراحل */
.mg-ty-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.mg-ty-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
}

.mg-ty-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mg-gray-100, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--mg-gray-200, #e2e8f0);
}
.mg-ty-step-icon svg { width: 18px; height: 18px; color: var(--mg-gray-400); }

.mg-ty-step--done .mg-ty-step-icon {
    background: #dcfce7;
    border-color: var(--mg-success, #22c55e);
}
.mg-ty-step--done .mg-ty-step-icon svg { color: var(--mg-success, #22c55e); }

.mg-ty-step--active .mg-ty-step-icon {
    background: var(--mg-primary-light, #eff6ff);
    border-color: var(--mg-primary);
    animation: mg-pulse-step 1.5s ease-in-out infinite;
}
.mg-ty-step--active .mg-ty-step-icon svg { color: var(--mg-primary); }

@keyframes mg-pulse-step {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--mg-primary-rgb, 37,99,235), .25); }
    50%       { box-shadow: 0 0 0 8px rgba(var(--mg-primary-rgb, 37,99,235), 0); }
}

.mg-ty-step span {
    font-size: .72rem;
    color: var(--mg-gray-500);
    white-space: nowrap;
}
.mg-ty-step--done span, .mg-ty-step--active span { color: var(--mg-gray-700); font-weight: 600; }

.mg-ty-step-line {
    flex: 1 1 30px;
    height: 2px;
    background: var(--mg-gray-200, #e2e8f0);
    margin: 19px 4px 0;
    min-width: 20px;
}

/* دکمه‌ها */
.mg-ty-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .mg-ty-card { padding: 2rem 1.25rem; }
    .mg-ty-step-line { min-width: 10px; flex-basis: 10px; }
    .mg-ty-step span { font-size: .62rem; }
    .mg-ty-step-icon { width: 34px; height: 34px; }
    .mg-ty-step-icon svg { width: 15px; height: 15px; }
    .mg-ty-details { padding: 1rem; }
    .mg-ty-actions { flex-direction: column; }
    .mg-ty-actions .mg-btn { width: 100%; text-align: center; }
}

/* ============================================
   صفحه تسویه حساب
   ============================================ */
.mg-checkout-page {
    background: var(--mg-surface);
    min-height: 100vh;
    padding: 0 0 2rem;
}

.mg-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.mg-checkout-form-section {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 2rem;
}

.mg-checkout-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mg-text);
}

.mg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mg-form-group {
    margin-bottom: 1rem;
}

.mg-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--mg-text);
}

.mg-form-group input,
.mg-form-group select,
.mg-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-size: 0.95rem;
    transition: var(--mg-transition);
}

.mg-form-group input:focus,
.mg-form-group select:focus,
.mg-form-group textarea:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.1);
}

/* ============================================
   صفحه حساب کاربری
   ============================================ */
.mg-account-page {
    background: var(--mg-bg);
    min-height: 100vh;
    padding: 1rem 0;
}

/* کانتینر صفحه حساب کاربری عریض‌تر — فقط دسکتاپ */
@media (min-width: 1281px) {
    .mg-account-page .mg-container {
        max-width: 1500px !important;
    }
}

.mg-account-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.mg-account-layout--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
}

.mg-account-sidebar,
.mg-account-content {
    min-width: 0;
}

.mg-account-sidebar {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 1.5rem;
}

.mg-account-page--sidebar-static .mg-account-sidebar {
    position: static;
}

.mg-account-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--mg-border);
    margin-bottom: 1rem;
}

.mg-account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--mg-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 2px;
}

.mg-account-user-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.mg-account-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-account-order-count {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mg-primary);
    margin-bottom: 0.1rem;
}

.mg-account-email {
    display: block;
    font-size: 0.68rem;
    color: var(--mg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mg-account-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mg-account-nav li {
    margin-bottom: 0.25rem;
}

.mg-account-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--mg-radius);
    color: var(--mg-text);
    text-decoration: none;
    transition: var(--mg-transition);
}

.mg-account-nav a:hover {
    background: var(--mg-surface);
}

.mg-account-nav .is-active a {
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
}

.mg-account-content {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 2rem;
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .mg-cart-layout,
    .mg-checkout-layout {
        grid-template-columns: 1fr;
    }

    .mg-cart-summary {
        position: static;
    }
}

/* حساب کاربری — یک ستون از 1280px به پایین */
@media (max-width: 1280px) {
    .mg-account-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .mg-cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .mg-cart-item-price,
    .mg-cart-item-total {
        grid-column: 2;
    }
    
    .mg-form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   استایل‌های تکمیلی صفحات
   ============================================ */

/* سبد خرید خالی */
.mg-cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
}

.mg-cart-empty svg {
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.mg-cart-empty h3 {
    font-size: 1.5rem;
    color: var(--mg-text);
    margin-bottom: 0.5rem;
}

.mg-cart-empty p {
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
}

/* هدر آیتم‌های سبد خرید */
.mg-cart-items-header {
    display: grid;
    grid-template-columns: 100px 1fr 120px 100px 120px 50px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--mg-surface);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--mg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px 100px 120px 50px;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--mg-border);
}

.mg-cart-item:last-child {
    border-bottom: none;
}

.mg-cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: var(--mg-radius);
    overflow: hidden;
    background: var(--mg-surface);
}

.mg-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-cart-item-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mg-cart-item-info h3 a {
    color: var(--mg-text);
    text-decoration: none;
}

.mg-cart-item-info h3 a:hover {
    color: var(--mg-primary);
}

.mg-cart-item-meta {
    font-size: 0.85rem;
    color: var(--mg-text-muted);
}

.mg-cart-item-price {
    font-weight: 600;
    color: var(--mg-text);
}

.mg-cart-item-total {
    font-weight: 700;
    color: var(--mg-primary);
    font-size: 1.1rem;
}

.mg-remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--mg-radius);
    color: var(--mg-text-muted);
    transition: var(--mg-transition);
}

.mg-remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.mg-cart-update {
    padding: 1.5rem;
    border-top: 1px solid var(--mg-border);
    display: flex;
    justify-content: flex-end;
}

/* ویژگی‌های سبد خرید */
.mg-cart-features {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mg-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mg-cart-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--mg-text-muted);
}

.mg-cart-feature svg {
    color: var(--mg-primary);
}

/* استایل کوپن */
.mg-coupon-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mg-border);
}

/* هدر سبد خرید و تسویه حساب */
.mg-cart-header,
.mg-checkout-header,
.mg-account-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   صفحه مشاهده سفارش
   ============================================ */
.mg-view-order { display: flex; flex-direction: column; gap: 1.25rem; }

/* هدر */
.mg-vo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--mg-gray-100, #f1f5f9);
}
.mg-vo-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--mg-gray-900);
}
.mg-vo-title span { color: var(--mg-primary); }
.mg-vo-meta { font-size: .82rem; color: var(--mg-gray-400); }
.mg-vo-sep { margin: 0 .35rem; }
.mg-vo-status {
    display: inline-block;
    padding: .3rem .85rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* کارت‌های خلاصه */
.mg-vo-cards {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.mg-vo-card {
    flex: 1 1 120px;
    background: var(--mg-surface, #f8f9fa);
    border-radius: 12px;
    padding: .85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.mg-vo-card--discount { background: #f0fdf4; }
.mg-vo-card--total    { background: var(--mg-primary-light, #eff6ff); }
.mg-vo-card-label {
    font-size: .75rem;
    color: var(--mg-gray-400);
}
.mg-vo-card-val {
    font-size: .95rem;
    font-weight: 700;
    color: var(--mg-gray-800);
}
.mg-vo-card--discount .mg-vo-card-val { color: #16a34a; }
.mg-vo-card--total    .mg-vo-card-val { color: var(--mg-primary); }
.mg-vo-card-val--strike {
    text-decoration: line-through;
    color: var(--mg-gray-400);
    font-weight: 400;
}
.mg-vo-currency {
    margin-inline-start: .25rem;
    font-size: .84em;
    font-weight: inherit;
    color: inherit;
    white-space: nowrap;
}
.mg-vo-card-val em { font-style: normal; font-size: .78rem; opacity: .8; }

/* یادداشت‌ها */
.mg-vo-section-title {
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 .75rem;
    color: var(--mg-gray-700);
}
.mg-vo-notes {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.mg-vo-notes-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.mg-vo-note { display: flex; flex-direction: column; gap: .2rem; }
.mg-vo-note-date { font-size: .75rem; color: #92400e; font-weight: 600; }
.mg-vo-note-text { font-size: .85rem; color: #78350f; }
.mg-vo-note-text p { margin: 0; }

/* جدول WooCommerce داخل view-order */
.mg-vo-details .woocommerce-order-details,
.mg-vo-details .woocommerce-customer-details {
    background: #fff;
    border: 1px solid var(--mg-gray-100, #f1f5f9);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.mg-vo-details .woocommerce-order-details:last-child,
.mg-vo-details .woocommerce-customer-details:last-child { margin-bottom: 0; }
.mg-vo-details .woocommerce-order-details__title,
.mg-vo-details .woocommerce-column__title {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--mg-gray-100);
    color: var(--mg-gray-700);
}
.mg-vo-details .woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.mg-vo-details .woocommerce-table--order-details th,
.mg-vo-details .woocommerce-table--order-details td {
    padding: .5rem .4rem;
    border-bottom: 1px solid var(--mg-gray-100);
    text-align: right;
}
.mg-vo-details .woocommerce-table--order-details tfoot tr:last-child th,
.mg-vo-details .woocommerce-table--order-details tfoot tr:last-child td {
    font-weight: 700;
    color: var(--mg-primary);
    border-bottom: none;
}
.mg-vo-details .woocommerce-columns--addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.mg-vo-details address { font-style: normal; font-size: .82rem; line-height: 1.8; color: var(--mg-gray-500); }

/* دکمه بازگشت */
.mg-vo-back { padding-top: .5rem; }
.mg-btn--sm { padding: .45rem 1rem; font-size: .82rem; display: inline-flex; align-items: center; gap: .35rem; }

@media (max-width: 600px) {
    .mg-vo-cards { flex-direction: column; }
    .mg-vo-details .woocommerce-columns--addresses { grid-template-columns: 1fr; }
}

/* ============================================
   فرم ویرایش حساب کاربری
   ============================================ */
.mg-edit-account { display: flex; flex-direction: column; gap: 1.5rem; }

.mg-eac-section {
    border: 1px solid var(--mg-gray-200, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}
.mg-eac-section--password { border-color: #e0e7ff; }

.mg-eac-section-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.5rem;
    background: var(--mg-surface, #f8f9fa);
    border-bottom: 1px solid var(--mg-gray-100, #f1f5f9);
}
.mg-eac-section--password .mg-eac-section-header { background: #f0f4ff; border-color: #e0e7ff; }

.mg-eac-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--mg-primary-light, #eff6ff);
    color: var(--mg-primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mg-eac-section-title { font-size: .95rem; font-weight: 700; margin: 0; color: var(--mg-gray-800); }

.mg-eac-section-desc {
    font-size: .8rem;
    color: var(--mg-gray-400);
    margin: 1rem 1.5rem 0;
}

.mg-eac-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    padding: 1.25rem 1.5rem 1.5rem;
}
.mg-eac-field { display: flex; flex-direction: column; gap: .35rem; }
.mg-eac-field--wide { grid-column: 1 / -1; }

.mg-eac-field label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--mg-gray-600);
}
.mg-eac-field .required { color: #ef4444; }

.mg-eac-input {
    width: 100%;
    padding: .65rem 1rem;
    border: 1.5px solid var(--mg-gray-200, #e2e8f0);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--mg-gray-800);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    font-family: inherit;
}
.mg-eac-input:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb, 37,99,235), .12);
}
.mg-eac-hint { font-size: .75rem; color: var(--mg-gray-400); margin-top: .1rem; }

/* رمز عبور با آیکون چشم */
.mg-eac-pwd-wrap { position: relative; }
.mg-eac-pwd-wrap .mg-eac-input { padding-left: 2.75rem; }
.mg-eac-eye {
    position: absolute;
    left: .8rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--mg-gray-400); padding: 0; line-height: 1;
    transition: color .15s;
}
.mg-eac-eye:hover { color: var(--mg-primary); }

.mg-eac-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0 .25rem;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .mg-eac-fields { grid-template-columns: 1fr; padding: 1rem 1.1rem 1.25rem; }
    .mg-eac-field--wide { grid-column: 1; }
    .mg-eac-section-header { padding: .85rem 1.1rem; }
    .mg-eac-section-desc { margin: .85rem 1.1rem 0; }
    .mg-eac-actions { flex-direction: column; align-items: stretch; }
    .mg-eac-actions .mg-btn { text-align: center; justify-content: center; }
}

/* ============================================
   فرم ورود / ثبت‌نام
   ============================================ */

/* مخفی کردن عنوان صفحه My account */
.woocommerce-account .mg-page-title,
.woocommerce-account .entry-title,
.woocommerce-account .page-title { display: none; }

.mg-auth-box {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--mg-gray-200, #e2e8f0);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

/* --- تب‌بار --- */
.mg-auth-tabs {
    display: flex;
    position: relative;
    background: var(--mg-gray-50, #f8fafc);
    border-bottom: 1px solid var(--mg-gray-200, #e2e8f0);
    padding: .4rem .4rem 0;
    gap: .25rem;
}

.mg-auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--mg-gray-500, #64748b);
    background: none;
    border: none;
    border-radius: .6rem .6rem 0 0;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color .2s;
}
.mg-auth-tab svg { transition: stroke .2s; }
.mg-auth-tab--active { color: var(--mg-primary, #7c3aed); }

.mg-auth-tab-pill {
    position: absolute;
    bottom: 0;
    height: 2.5px;
    background: var(--mg-primary, #7c3aed);
    border-radius: 2px 2px 0 0;
    transition: left .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
}

/* --- پنل‌ها --- */
.mg-auth-panel {
    display: none;
    animation: mgAuthFadeIn .22s ease;
}
.mg-auth-panel--active { display: block; }

@keyframes mgAuthFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mg-auth-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.mg-auth-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.mg-auth-field label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--mg-gray-600, #475569);
}
.mg-auth-field .required { color: #ef4444; }

.mg-auth-input {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--mg-gray-200, #e2e8f0);
    border-radius: .5rem;
    font-size: .9rem;
    font-family: inherit;
    color: var(--mg-gray-800, #1e293b);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    direction: rtl;
}
.mg-auth-input:focus {
    outline: none;
    border-color: var(--mg-primary, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.mg-auth-pwd-wrap { position: relative; }
.mg-auth-pwd-wrap .mg-auth-input { padding-left: 2.75rem; }
.mg-auth-eye {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mg-gray-400, #94a3b8);
    padding: .2rem;
    line-height: 1;
}
.mg-auth-eye:hover { color: var(--mg-primary, #7c3aed); }

.mg-auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}
.mg-auth-remember {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--mg-gray-600, #475569);
    cursor: pointer;
}
.mg-auth-remember input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--mg-primary, #7c3aed); }
.mg-auth-forgot {
    font-size: .8rem;
    color: var(--mg-primary, #7c3aed);
    text-decoration: none;
}
.mg-auth-forgot:hover { text-decoration: underline; }

.mg-auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: .25rem;
}

.mg-auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.mg-auth-switch {
    text-align: center;
    font-size: .82rem;
    color: var(--mg-gray-500, #64748b);
    margin: .25rem 0 0;
}
.mg-auth-switch-btn {
    background: none;
    border: none;
    color: var(--mg-primary, #7c3aed);
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mg-auth-pwd-match {
    font-size: .78rem;
    color: #ef4444;
    margin-top: .2rem;
}

.mg-auth-note {
    font-size: .8rem;
    color: var(--mg-gray-500, #64748b);
    background: var(--mg-gray-50, #f8fafc);
    border-radius: .5rem;
    padding: .6rem .9rem;
    margin: 0;
}

@media (max-width: 540px) {
    .mg-auth-box { border-radius: .75rem; margin: 0 .5rem; }
    .mg-auth-field-row { grid-template-columns: 1fr; }
}

/* ============================================
   صفحه آدرس‌ها
   ============================================ */
.mg-my-address-desc {
    font-size: .875rem;
    color: var(--mg-gray-500);
    margin-bottom: 1.25rem;
}
.mg-address-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.mg-address-card {
    border: 1px solid var(--mg-gray-200, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s;
}
.mg-address-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }

.mg-address-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.1rem;
    border-bottom: 1px solid var(--mg-gray-100, #f1f5f9);
    background: var(--mg-surface, #f8f9fa);
}
.mg-address-card-icon { color: var(--mg-primary); flex-shrink: 0; display: flex; }
.mg-address-card-title { font-size: .9rem; font-weight: 700; margin: 0; flex: 1; color: var(--mg-gray-800); }
.mg-address-card-edit {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--mg-primary);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    padding: .25rem .6rem;
    border-radius: 6px;
    transition: background .15s;
}
.mg-address-card-edit:hover { background: var(--mg-primary-light, #eff6ff); }

.mg-address-card-body { padding: 1rem 1.1rem; }
.mg-address-card-body address {
    font-style: normal;
    font-size: .85rem;
    line-height: 1.9;
    color: var(--mg-gray-600);
}
.mg-address-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem 0;
    color: var(--mg-gray-400);
    font-size: .82rem;
    text-align: center;
}

/* فرم ویرایش آدرس */
.mg-edit-address { display: flex; flex-direction: column; gap: 1.25rem; }

.mg-ea-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--mg-gray-100, #f1f5f9);
}
.mg-ea-icon {
    width: 38px; height: 38px;
    background: var(--mg-primary-light, #eff6ff);
    color: var(--mg-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mg-ea-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--mg-gray-800); }

/* فیلدهای WooCommerce */
.mg-ea-form .woocommerce-address-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
}
.mg-ea-form .form-row-wide { grid-column: 1 / -1; }
.mg-ea-form .form-row { margin: 0; }
.mg-ea-form .form-row label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--mg-gray-600);
    margin-bottom: .3rem;
    display: block;
}
.mg-ea-form .form-row .required { color: #ef4444; }
.mg-ea-form input.input-text,
.mg-ea-form select {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--mg-gray-200, #e2e8f0);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--mg-gray-800);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.mg-ea-form input.input-text:focus,
.mg-ea-form select:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb, 37,99,235), .12);
}
.mg-ea-form .woocommerce-invalid input.input-text,
.mg-ea-form .woocommerce-invalid select {
    border-color: #ef4444;
}
.mg-ea-form .woocommerce-error { font-size: .75rem; color: #ef4444; margin-top: .2rem; }

.mg-ea-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-top: .75rem;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .mg-address-cards { grid-template-columns: 1fr; }
    .mg-ea-form .woocommerce-address-fields__field-wrapper { grid-template-columns: 1fr; }
    .mg-ea-form .form-row-wide { grid-column: 1; }
}

/* ============================================ */
.mg-cart-title,
.mg-checkout-title,
.mg-account-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mg-text);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.mg-cart-title svg,
.mg-checkout-title svg,
.mg-account-page-title svg {
    color: var(--mg-primary);
}

/* مراحل خرید */
.mg-checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.mg-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mg-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mg-surface);
    border: 2px solid var(--mg-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--mg-text-muted);
    transition: var(--mg-transition);
}

.mg-step.active .mg-step-number {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
    color: #ffffff;
}

.mg-step.completed .mg-step-number {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.mg-step-text {
    font-size: 0.85rem;
    color: var(--mg-text-muted);
}

.mg-step.active .mg-step-text {
    color: var(--mg-primary);
    font-weight: 500;
}

.mg-step-line {
    width: 80px;
    height: 2px;
    background: var(--mg-border);
}

/* فرم تسویه حساب */
.mg-checkout-forms {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mg-checkout-form-section {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 2rem;
}

.mg-order-review {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.mg-checkout-trust {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mg-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mg-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--mg-text-muted);
}

.mg-trust-item svg {
    color: #10b981;
}

.mg-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
    transition: var(--mg-transition);
}

.mg-textarea:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.1);
}

/* آواتار حساب کاربری */
.mg-account-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.mg-account-avatar--bordered {
    background: none;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 0 2px var(--mg-primary);
}

/* استایل منوی حساب کاربری ووکامرس */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-MyAccount-navigation li {
    margin-bottom: 0.25rem;
}

.woocommerce-MyAccount-navigation a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--mg-radius);
    color: var(--mg-text);
    text-decoration: none;
    transition: var(--mg-transition);
}

.woocommerce-MyAccount-navigation a:hover {
    background: var(--mg-surface);
}

.woocommerce-MyAccount-navigation .is-active a {
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
    font-weight: 600;
}

.woocommerce-MyAccount-navigation .is-active a .mg-nav-icon {
    color: var(--mg-primary);
}

.mg-nav-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity var(--mg-transition);
}

.woocommerce-MyAccount-navigation a:hover .mg-nav-icon,
.woocommerce-MyAccount-navigation .is-active a .mg-nav-icon {
    opacity: 1;
}

/* آیتم خروج - قرمز */
.woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #dc2626;
}
.woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    background: rgba(220, 38, 38, 0.07);
}

/* ============================================
   داشبورد حساب کاربری
   ============================================ */

.mg-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* بنر خوش‌آمدگویی */
.mg-dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--mg-gradient-primary);
    border-radius: var(--mg-radius-lg);
    padding: 1.75rem 2rem;
    color: #fff;
}

.mg-dashboard-welcome-text h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0 0 0.25rem;
}

.mg-dashboard-welcome-text h2,
.mg-dashboard-welcome-text h2 strong {
    color: #fff !important;
}

.mg-dashboard-welcome-text p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.mg-dashboard-logout-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: var(--mg-radius);
    padding: 0.45rem 0.9rem;
    white-space: nowrap;
    transition: var(--mg-transition);
    text-decoration: none;
}
.mg-dashboard-logout-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* آمار */
.mg-dashboard-stats {
    display: flex;
    gap: 1rem;
}

.mg-dashboard-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.25rem 1.5rem;
}

.mg-dashboard-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--mg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mg-dashboard-stat-icon--orders {
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
}
.mg-dashboard-stat-icon--account {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.mg-dashboard-stat-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.mg-dashboard-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-dashboard-stat--account .mg-dashboard-stat-value {
    font-size: 0.9rem;
}

.mg-dashboard-stat-label {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
}

/* عنوان بخش */
.mg-dashboard-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mg-dashboard-section-title::before {
    content: '';
    width: 3px;
    height: 1em;
    background: var(--mg-gradient-primary);
    border-radius: 2px;
    display: inline-block;
}

/* دسترسی سریع */
.mg-dashboard-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.mg-dashboard-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 0.75rem;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    text-decoration: none;
    color: var(--mg-text);
    transition: var(--mg-transition);
    text-align: center;
}
.mg-dashboard-shortcut:hover {
    border-color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--mg-primary-rgb), 0.12);
}
.mg-dashboard-shortcut:hover .mg-dashboard-shortcut-icon {
    color: var(--mg-primary);
}

.mg-dashboard-shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--mg-radius);
    background: var(--mg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-text-muted);
    transition: var(--mg-transition);
}

.mg-dashboard-shortcut-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

/* کارت آخرین سفارش */
.mg-dashboard-order-card {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mg-dashboard-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mg-dashboard-order-meta {
    font-size: 0.88rem;
    color: var(--mg-text-muted);
}
.mg-dashboard-order-meta a {
    color: var(--mg-primary);
    font-weight: 600;
    text-decoration: none;
}

.mg-dashboard-order-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-text);
}

.woocommerce-orders-table .mg-account-order-currency {
    margin-inline-start: .25rem;
    font-size: .86em;
    font-weight: inherit;
    white-space: nowrap;
}

.woocommerce-orders-table .mg-account-order-items {
    white-space: nowrap;
}

.mg-dashboard-order-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--mg-border);
}

/* ============================================
   بج‌های وضعیت سفارش
   ============================================ */

.mg-order-status,
.woocommerce mark.order-status,
.woocommerce .woocommerce-orders-table mark.order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--mg-surface);
    color: var(--mg-text-muted);
    white-space: nowrap;
}

/* وضعیت‌ها — هر دو فرمت (WC5: .processing / WC6: .status-processing) */
.mg-order-status--processing,
.woocommerce mark.order-status.processing,
.woocommerce mark.order-status.status-processing {
    background: rgba(59,130,246,0.12) !important;
    color: #2563eb !important;
}
.mg-order-status--completed,
.woocommerce mark.order-status.completed,
.woocommerce mark.order-status.status-completed {
    background: rgba(16,185,129,0.12) !important;
    color: #059669 !important;
}
.mg-order-status--on-hold,
.woocommerce mark.order-status.on-hold,
.woocommerce mark.order-status.status-on-hold {
    background: rgba(245,158,11,0.12) !important;
    color: #d97706 !important;
}
.mg-order-status--cancelled,
.woocommerce mark.order-status.cancelled,
.woocommerce mark.order-status.status-cancelled {
    background: rgba(239,68,68,0.1) !important;
    color: #dc2626 !important;
}
.mg-order-status--refunded,
.woocommerce mark.order-status.refunded,
.woocommerce mark.order-status.status-refunded {
    background: rgba(139,92,246,0.12) !important;
    color: #7c3aed !important;
}
.mg-order-status--pending,
.woocommerce mark.order-status.pending,
.woocommerce mark.order-status.status-pending {
    background: rgba(107,114,128,0.1) !important;
    color: #4b5563 !important;
}
.mg-order-status--failed,
.woocommerce mark.order-status.failed,
.woocommerce mark.order-status.status-failed {
    background: rgba(239,68,68,0.1) !important;
    color: #dc2626 !important;
}

/* ============================================
   جدول سفارش‌ها - ریسپانسیو
   ============================================ */

.woocommerce-orders-table {
    width: 100%;
}

/* عرض کامل جدول سفارش‌ها در دسکتاپ */
@media (min-width: 992px) {
    .mg-account-content .shop_table,
    .mg-account-content table.woocommerce-orders-table,
    .mg-account-content table.woocommerce-MyAccount-orders,
    .mg-account-content table.account-orders-table,
    .woocommerce table.shop_table.woocommerce-orders-table.account-orders-table.my_account_orders {
        width: 100% !important;
        max-width: 100% !important;
        display: table !important;
        table-layout: auto !important;
    }
}

/* اسکرول افقی روی موبایل */
.mg-orders-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.woocommerce table.woocommerce-orders-table th,
.woocommerce table.woocommerce-orders-table td {
    white-space: nowrap;
    padding: 0.875rem 1rem;
}

.woocommerce table.woocommerce-orders-table th:last-child,
.woocommerce table.woocommerce-orders-table td:last-child {
    white-space: normal;
}

.woocommerce table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions {
    white-space: nowrap;
}

.woocommerce table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--mg-radius);
    font-size: 0.82rem;
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary);
    text-decoration: none;
    transition: var(--mg-transition);
    font-weight: 500;
}
.woocommerce table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions a:hover {
    background: var(--mg-primary);
    color: #fff;
}

/* هدر جدول */
.woocommerce table.shop_table.woocommerce-orders-table thead th {
    background: var(--mg-surface);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--mg-border);
}

/* استایل صفحه خالی (بدون سفارش) */
.woocommerce-account .woocommerce-info {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.5rem 1.25rem !important;
    text-align: center;
    color: var(--mg-text-muted);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    line-height: 1.8;
    overflow: hidden;
    clear: both;
}
.woocommerce-account .woocommerce-info::before { display: none; }

.woocommerce-account .woocommerce-info .button,
.woocommerce-account .woocommerce-info a.button,
.woocommerce-account .woocommerce-info .wc-forward {
    float: none !important;
    order: 2;
    position: static !important;
    transform: none !important;
    align-self: center;
    margin: 0.4rem auto 0 !important;
    white-space: nowrap;
}

/* ============================================
   سایدبار موبایل - تبدیل به تب افقی
   ============================================ */

/* ریسپانسیو حساب کاربری — تبلت و موبایل */
@media (max-width: 1280px) {
    .mg-account-page { padding: 1.5rem 0; }

    /* سایدبار: static، بالای محتوا */
    .mg-account-sidebar {
        position: static !important;
        padding: 1rem 1.25rem;
        overflow: hidden;
    }

    /* ناوبری: اسکرول افقی (tab bar) */
    .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        flex-direction: row-reverse;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.35rem;
        scrollbar-width: none;
        padding: 0 0.25rem 2px;
        margin: 0;
        justify-content: flex-start;
        direction: ltr;
        scroll-padding-inline: 0.5rem;
    }
    .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }

    .woocommerce-MyAccount-navigation li {
        direction: rtl;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .woocommerce-MyAccount-navigation a {
        padding: 0.5rem 0.875rem;
        font-size: 0.82rem;
        border: 1px solid var(--mg-border);
        border-radius: var(--mg-radius);
        gap: 0.4rem;
        background: var(--mg-surface);
        white-space: nowrap;
    }

    .woocommerce-MyAccount-navigation .is-active a {
        border-color: var(--mg-primary);
    }

    .mg-nav-label { white-space: nowrap; }

    /* داشبورد */
    .mg-dashboard-shortcut-grid { grid-template-columns: repeat(2, 1fr); }
    .mg-dashboard-welcome { flex-direction: row; flex-wrap: wrap; gap: 0.75rem; }
    .mg-dashboard-welcome-text h2 { font-size: 1.1rem; }
}

/* ریسپانسیو حساب کاربری — موبایل */
@media (max-width: 640px) {
    .mg-account-page {
        padding: 1rem 0;
        margin-inline: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }
    /* container با فاصله کوچک از لبه‌ها — تا کارت‌ها بچسبیده نباشن */
    .mg-account-page .mg-container { padding-inline: 0.625rem !important; max-width: 100% !important; }
    .mg-account-page .mg-account-layout { gap: 0.5rem; }
    .mg-account-content { padding: 1rem 0.875rem; border-radius: var(--mg-radius-lg); }
    .mg-account-sidebar { padding: 0.75rem 0.875rem; border-radius: var(--mg-radius-lg); }

    /* اطلاعات کاربر فشرده‌تر */
    .mg-account-user { gap: 0.75rem; padding-bottom: 0.875rem; margin-bottom: 0.875rem; }
    .mg-account-avatar { width: 40px; height: 40px; font-size: 1rem; }
    .mg-account-name { font-size: 0.85rem; }
    .mg-account-order-count { font-size: 0.68rem; }
    .mg-account-email { font-size: 0.63rem; }

    /* ناوبری موبایل: label کوچک‌تر */
    .woocommerce-MyAccount-navigation a {
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
        gap: 0.3rem;
    }

    /* داشبورد: یک ستون */
    .mg-dashboard { gap: 1.25rem; }
    .mg-dashboard-welcome { padding: 1.25rem; gap: 0.75rem; }
    .mg-dashboard-welcome-text h2 { font-size: 1rem; }
    .mg-dashboard-welcome-text p { font-size: 0.82rem; }

    .mg-dashboard-stat { padding: 0.875rem; gap: 0.75rem; }
    .mg-dashboard-stat-icon { width: 38px; height: 38px; }
    .mg-dashboard-stat-value { font-size: 0.95rem; }
    .mg-dashboard-stat-label { font-size: 0.75rem; }

    .mg-dashboard-shortcut-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .mg-dashboard-shortcut { padding: 0.875rem 0.5rem; gap: 0.5rem; }
    .mg-dashboard-shortcut-icon { width: 36px; height: 36px; }
    .mg-dashboard-shortcut-label { font-size: 0.78rem; }

    .mg-dashboard-order-card { padding: 1rem; }
    .mg-dashboard-order-row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .mg-dashboard-order-actions { flex-wrap: wrap; }

    /* جدول سفارش‌ها */
    .woocommerce-MyAccount-orders { font-size: 0.85rem; }
    .woocommerce table.shop_table.woocommerce-orders-table th,
    .woocommerce table.shop_table.woocommerce-orders-table td { padding: 0.6rem 0.75rem; }
}

/* صفحه‌های خیلی کوچک: متن ناوبری حساب همچنان باید قابل خواندن باشد */
@media (max-width: 400px) {
    .woocommerce-MyAccount-navigation a {
        padding: 0.5rem 0.625rem;
        gap: 0.25rem;
        font-size: 0.74rem;
    }

    .woocommerce-MyAccount-navigation .mg-nav-label {
        display: inline;
    }

    .woocommerce-MyAccount-navigation .mg-nav-icon { opacity: 1; }
}

/* ============================================
   بخش‌های داخلی اکانت — ریسپانسیو
   ============================================ */

/* جدول سفارش‌ها — اسکرول افقی همیشه */
.mg-orders-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* فرم ویرایش آدرس — همیشه تمام‌عرض */
.woocommerce-EditAddressForm .form-row-first,
.woocommerce-EditAddressForm .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    clear: both;
}


/* ============================================
   دکمه‌های کوچک داشبورد
   ============================================ */

.mg-dash-btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    border-radius: var(--mg-radius);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--mg-transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.mg-dash-btn--outline {
    border-color: var(--mg-primary);
    color: var(--mg-primary);
    background: transparent;
}
.mg-dash-btn--outline:hover {
    background: var(--mg-primary);
    color: #fff;
}

.mg-dash-btn--ghost {
    background: var(--mg-surface);
    color: var(--mg-text-muted);
    border-color: var(--mg-border);
}
.mg-dash-btn--ghost:hover {
    background: var(--mg-border);
    color: var(--mg-text);
}

/* ============================================
   محتوای داخلی اکانت (فرم ویرایش، آدرس‌ها)
   ============================================ */

.mg-account-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--mg-border);
    position: relative;
}

.mg-account-content h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--mg-gradient-primary);
    border-radius: 2px;
}

/* ============================================
   صفحه علاقه‌مندی‌ها داخل اکانت
   ============================================ */

/* بج شمارنده در منوی ناوبری */
.mg-nav-wishlist-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--mg-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    margin-right: 0.3rem;
    line-height: 1;
}

/* حالت خالی */
.mg-account-wishlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem;
    gap: 0.75rem;
}
.mg-account-wishlist-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--mg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-text-muted);
    margin-bottom: 0.5rem;
}
.mg-account-wishlist-empty h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0;
}
.mg-account-wishlist-empty p {
    font-size: 0.9rem;
    color: var(--mg-text-muted);
    margin: 0;
}

.mg-account-wishlist-empty .mg-btn-primary,
.mg-account-wishlist-empty .mg-btn-primary:hover,
.mg-account-wishlist-empty .mg-btn-primary:focus,
.mg-account-wishlist-empty .mg-btn-primary:active,
.mg-account-wishlist-empty .mg-btn-primary:visited {
    color: #ffffff;
}

/* گرید کارت‌ها */
.mg-account-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .mg-account-wishlist-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .mg-account-wishlist-grid { grid-template-columns: 1fr; }
}

/* کارت محصول */
.mg-wl-card {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    transition: var(--mg-transition);
    display: flex;
    flex-direction: column;
}
.mg-wl-card:hover {
    border-color: var(--mg-primary);
    box-shadow: 0 4px 20px rgba(var(--mg-primary-rgb), 0.1);
    transform: translateY(-2px);
}

.mg-wl-card-image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--mg-surface);
}
.mg-wl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.mg-wl-card:hover .mg-wl-card-image img { transform: scale(1.04); }

.mg-wl-badge-sale {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--mg-radius);
}

.mg-wl-card-body {
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.mg-wl-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mg-text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.mg-wl-card-title:hover { color: var(--mg-primary); }

.mg-wl-card-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--mg-text);
}
.mg-wl-card-price del { color: var(--mg-text-muted); font-weight: 400; font-size: 0.8rem; margin-left: 0.25rem; }
.mg-wl-card-price ins { text-decoration: none; color: #dc2626; }
.mg-wl-card-price .mg-price-wrap {
    align-items: center;
    gap: 0.35rem;
}
.mg-wl-card-price .mg-price-col {
    align-items: flex-end;
    gap: 0.1rem;
}
.mg-wl-card-price .mg-price-col .woocommerce-Price-amount,
.mg-wl-card-price .mg-price-col ins {
    font-size: 0.92rem;
    line-height: 1.35;
}
.mg-wl-card-price .mg-price-col del {
    font-size: 0.72rem;
    line-height: 1.25;
    margin: 0;
}
.mg-wl-card-price .mg-toman-icon {
    width: auto;
    max-width: none;
    height: 1.55rem;
    opacity: 0.25;
}

.mg-wl-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--mg-border);
}

.mg-wl-add-to-cart {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.45rem 0.75rem;
}

.mg-wl-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-border);
    background: transparent;
    color: var(--mg-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--mg-transition);
    flex-shrink: 0;
}
.mg-wl-remove-btn:hover {
    background: rgba(239,68,68,0.08);
    border-color: #ef4444;
    color: #ef4444;
}

.mg-wl-out-of-stock {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
    background: var(--mg-surface);
    border-radius: var(--mg-radius);
    padding: 0.4rem 0.75rem;
}

/* فرم ویرایش اکانت دو‌ستونی */
.woocommerce-EditAccountForm .form-row-first,
.woocommerce-EditAccountForm .form-row-last {
    width: calc(50% - 0.5rem) !important;
    float: right !important;
}
.woocommerce-EditAccountForm .form-row-first { margin-left: 1rem !important; }
.woocommerce-EditAccountForm::after { content: ''; display: table; clear: both; }
@media (max-width: 640px) {
    .woocommerce-EditAccountForm .form-row-first,
    .woocommerce-EditAccountForm .form-row-last {
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
    }
}

/* فرم فراموشی رمز */
.woocommerce form.lost_reset_password input.input-text {
    width: 100%;
    max-width: 400px;
}

/* فرم‌های ووکامرس */
.woocommerce form .form-row {
    margin-bottom: 1rem;
}

.woocommerce form .form-row label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--mg-text);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-size: 0.95rem;
    transition: var(--mg-transition);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.1);
}

.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--mg-border);
}

.woocommerce table.shop_table th {
    background: var(--mg-surface);
    font-weight: 600;
}

.woocommerce .button,
.woocommerce button.button {
    padding: 0.75rem 1.5rem;
    background: var(--mg-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--mg-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--mg-transition);
}

.woocommerce .button:hover,
.woocommerce button.button:hover {
    background: var(--mg-secondary);
}

/* ============================================
   جدول سفارش‌های حساب کاربری
   ============================================ */
.mg-orders-table-scroll {
    margin: 0 0 1.5rem;
    padding-bottom: 0.4rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    background: var(--mg-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--mg-primary-rgb), 0.4) transparent;
    touch-action: pan-x pan-y;
}
.mg-orders-table-scroll::-webkit-scrollbar { height: 6px; }
.mg-orders-table-scroll::-webkit-scrollbar-track { background: transparent; }
.mg-orders-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--mg-primary-rgb), 0.38);
    border-radius: 999px;
}

.mg-orders-table-scroll .woocommerce-orders-table {
    display: table !important;
    width: 100% !important;
    min-width: 760px;
    max-width: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: fixed !important;
    background: transparent;
}
.mg-orders-table-scroll .woocommerce-orders-table thead {
    display: table-header-group !important;
}
.mg-orders-table-scroll .woocommerce-orders-table tbody {
    display: table-row-group !important;
}
.mg-orders-table-scroll .woocommerce-orders-table tr {
    display: table-row !important;
    background: transparent;
    transition: background var(--mg-transition-fast);
}
.mg-orders-table-scroll .woocommerce-orders-table tbody tr:hover {
    background: rgba(var(--mg-primary-rgb), 0.035);
}
.mg-orders-table-scroll .woocommerce-orders-table th,
.mg-orders-table-scroll .woocommerce-orders-table td {
    display: table-cell !important;
    padding: 1rem 0.9rem !important;
    vertical-align: middle;
    text-align: center !important;
    border: 0 !important;
    border-bottom: 1px solid var(--mg-border) !important;
    white-space: nowrap;
}
.mg-orders-table-scroll .woocommerce-orders-table thead th {
    background: var(--mg-surface) !important;
    color: var(--mg-text-muted) !important;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
}
.mg-orders-table-scroll .woocommerce-orders-table thead th:first-child { border-top-right-radius: calc(var(--mg-radius-lg) - 1px); }
.mg-orders-table-scroll .woocommerce-orders-table thead th:last-child { border-top-left-radius: calc(var(--mg-radius-lg) - 1px); }
.mg-orders-table-scroll .woocommerce-orders-table tbody tr:last-child th,
.mg-orders-table-scroll .woocommerce-orders-table tbody tr:last-child td { border-bottom: 0 !important; }

.mg-orders-table-scroll .woocommerce-orders-table__header-order-number { width: 11%; }
.mg-orders-table-scroll .woocommerce-orders-table__header-order-date { width: 18%; }
.mg-orders-table-scroll .woocommerce-orders-table__header-order-status { width: 20%; }
.mg-orders-table-scroll .woocommerce-orders-table__header-order-total { width: 31%; }
.mg-orders-table-scroll .woocommerce-orders-table__header-order-actions { width: 20%; }

.mg-orders-table-scroll .woocommerce-orders-table__cell-order-number a {
    color: var(--mg-primary);
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
}
.mg-orders-table-scroll .woocommerce-orders-table__cell-order-date time {
    color: var(--mg-text);
    font-size: 0.88rem;
    font-weight: 600;
}
.mg-orders-table-scroll .woocommerce-orders-table__cell-order-total {
    color: var(--mg-text);
    font-size: 0.9rem;
    font-weight: 600;
}
.mg-orders-table-scroll .woocommerce-orders-table__cell-order-total .woocommerce-Price-amount {
    color: var(--mg-text);
    font-weight: 800;
}
.mg-orders-table-scroll .woocommerce-orders-table .mg-account-order-currency {
    color: var(--mg-text-muted);
    font-size: 0.82em;
}
.mg-orders-table-scroll .woocommerce-orders-table .mg-account-order-items {
    color: var(--mg-text-muted);
    font-size: 0.86em;
}
.mg-orders-table-scroll .woocommerce-orders-table .order-status {
    display: inline;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: var(--mg-text) !important;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}
.mg-orders-table-scroll .woocommerce-orders-table .status-processing { color: #2563eb !important; }
.mg-orders-table-scroll .woocommerce-orders-table .status-completed { color: #059669 !important; }
.mg-orders-table-scroll .woocommerce-orders-table .status-on-hold { color: #a16207 !important; }
.mg-orders-table-scroll .woocommerce-orders-table .status-cancelled,
.mg-orders-table-scroll .woocommerce-orders-table .status-failed { color: #dc2626 !important; }
.mg-orders-table-scroll .woocommerce-orders-table .status-refunded { color: #7c3aed !important; }
.mg-orders-table-scroll .woocommerce-orders-table .status-pending { color: var(--mg-text-muted) !important; }

.mg-account-content .woocommerce-pagination.woocommerce-Pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin: 1.25rem 0 0;
    padding: 0;
}
.mg-account-content .woocommerce-Pagination .woocommerce-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 96px;
    min-height: 40px;
    margin: 0 !important;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-bg);
    color: var(--mg-text);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color var(--mg-transition-fast), background var(--mg-transition-fast), color var(--mg-transition-fast), transform var(--mg-transition-fast);
}
.mg-account-content .woocommerce-Pagination .woocommerce-button--previous::before {
    content: '\2192';
    font-size: 1rem;
}
.mg-account-content .woocommerce-Pagination .woocommerce-button--next::after {
    content: '\2190';
    font-size: 1rem;
}
.mg-account-content .woocommerce-Pagination .woocommerce-button:hover {
    border-color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary);
    transform: translateY(-1px);
}
.mg-account-content .woocommerce-Pagination .woocommerce-button:focus-visible {
    outline: 2px solid var(--mg-primary);
    outline-offset: 2px;
}
.mg-orders-table-scroll .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions a {
    justify-content: center;
    min-width: 74px;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(var(--mg-primary-rgb), 0.2);
    border-radius: var(--mg-radius);
    background: rgba(var(--mg-primary-rgb), 0.07);
    font-size: 0.8rem;
    font-weight: 700;
}
.mg-orders-table-scroll .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions a:hover {
    border-color: var(--mg-primary);
    background: var(--mg-primary);
    color: #fff;
}

@media (max-width: 767px) {
    .mg-orders-table-scroll {
        margin-bottom: 1rem;
        border-radius: var(--mg-radius);
    }
    .mg-orders-table-scroll .woocommerce-orders-table {
        min-width: 740px;
    }
    .mg-orders-table-scroll .woocommerce-orders-table th,
    .mg-orders-table-scroll .woocommerce-orders-table td {
        padding: 0.85rem 0.7rem !important;
        font-size: 0.82rem;
    }
    .mg-orders-table-scroll .woocommerce-orders-table td::before {
        content: none !important;
        display: none !important;
    }
}

/* ریسپانسیو تکمیلی */
@media (max-width: 1024px) {
    .mg-cart-items-header {
        display: none;
    }
    
    .mg-cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .mg-cart-item-price,
    .mg-cart-item-quantity,
    .mg-cart-item-total {
        grid-column: 2;
    }
    
    .mg-cart-item-remove {
        position: absolute;
        top: 1rem;
        left: 1rem;
    }
    
    .mg-cart-item {
        position: relative;
    }
    
    .mg-checkout-steps {
        flex-wrap: wrap;
    }
    
    .mg-step-line {
        display: none;
    }
}

@media (max-width: 640px) {
    .mg-checkout-steps {
        justify-content: space-around;
    }
    
    .mg-step-text {
        font-size: 0.75rem;
    }
}

/* ============================================
   لایت‌باکس
   ============================================ */

/* نمای لیستی محصولات - دسکتاپ */
.mg-products-grid.mg-list-view {
    grid-template-columns: 1fr;
    gap: 0;
}

.mg-list-view .mg-product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--mg-border);
    box-shadow: none;
}

.mg-list-view .mg-product-card:first-child {
    border-top: 1px solid var(--mg-border);
}

.mg-list-view .mg-product-image-wrapper {
    height: 200px;
    border-radius: var(--mg-radius-lg) 0 0 var(--mg-radius-lg);
}

.mg-list-view .mg-product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem 1.5rem;
}

/* ============================================
   موبایل: نمای لیستی حرفه‌ای (Digikala style)
   ============================================ */
@media (max-width: 640px) {
    .mg-view-toggle { display: none; }

    .mg-shop-page { background: #eef0f4; }

    #mg-products-grid {
        grid-template-columns: 1fr !important;
        gap: 0.55rem !important;
        background: transparent !important;
        padding: 0.4rem 0.6rem !important;
    }

    /* کارت — grid: strip بالا، عکس+اطلاعات زیر */
    #mg-products-grid .mg-product-card {
        display: grid !important;
        grid-template-columns: 145px 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "strip strip"
            "image info";
    }

    #mg-products-grid .mg-card-sale-strip {
        grid-area: strip;
        padding: 0 1.1rem;
    }
    #mg-products-grid .mg-product-image-wrapper {
        grid-area: image;
        aspect-ratio: 1 / 1;
        max-height: unset;
        margin: 0 0.75rem 0.75rem 0;
        align-self: center;
    }
    #mg-products-grid .mg-product-info {
        grid-area: info;
        padding: 0.5rem 1rem;
        align-self: center;
    }

    #mg-products-grid .mg-card-divider {
        margin: 0.5rem 0 0.75rem;
    }

    #mg-products-grid .mg-card-cart-btn {
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   کانت‌داون تخفیف روی کارت محصول (mg-scd = sale card countdown)
   ============================================ */
.mg-sale-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.mg-scd-units {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    direction: ltr;
}

.mg-scd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}

.mg-scd-value {
    font-size: 0.82rem;
    font-weight: 800;
    color: #e53935;
    line-height: 1;
    min-width: 1.5rem;
    text-align: center;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.mg-scd-text {
    font-size: 0.44rem;
    color: #bbb;
    font-weight: 400;
    line-height: 1;
}

.mg-scd-sep {
    font-size: 0.65rem;
    color: #ddd;
    line-height: 1;
    padding-bottom: 0.75rem;
}

/* وقتی تخفیف زیر یک روز مانده، روز رو مخفی کن */
.mg-sale-countdown.mg-no-days .mg-scd-days,
.mg-sale-countdown.mg-no-days .mg-scd-sep-days {
    display: none;
}

/* کانت‌داون صفحه تکی محصول */
.mg-sale-countdown-sp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.6rem 0 0;
    flex-wrap: wrap;
}

.mg-sale-countdown-sp .mg-scd-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    white-space: nowrap;
}

.mg-sale-countdown-sp .mg-scd-units {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.mg-sale-countdown-sp .mg-scd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    padding: 0.25rem 0.5rem;
    min-width: 36px;
}

.mg-sale-countdown-sp .mg-scd-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #dc2626;
    line-height: 1;
}

.mg-sale-countdown-sp .mg-scd-text {
    font-size: 0.58rem;
    color: var(--mg-text-muted);
    margin-top: 0.1rem;
}

.mg-sale-countdown-sp .mg-scd-sep {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mg-text-muted);
    padding-bottom: 0.75rem;
}

/* پیام‌های اعلان */
.mg-notice {
    padding: 1rem 1.5rem;
    border-radius: var(--mg-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mg-notice-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.mg-notice-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.mg-notice-info {
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
    border: 1px solid rgba(var(--mg-primary-rgb), 0.2);
}

/* ============================================
   Single Post - Blog Article
   ============================================ */

.mg-single-post {
    padding: var(--mg-spacing-2xl) 0;
}

.mg-post-single {
    max-width: 800px;
    margin: 0 auto;
}

.mg-post-header {
    text-align: center;
    margin-bottom: var(--mg-spacing-xl);
}

.mg-post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--mg-spacing-md);
    margin-bottom: var(--mg-spacing-md);
    color: var(--mg-text-muted);
    font-size: 0.875rem;
}

.mg-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mg-post-meta svg {
    opacity: 0.7;
}

.mg-post-category a {
    color: var(--mg-primary);
    font-weight: 500;
}

.mg-post-category a:hover {
    color: var(--mg-secondary);
}

.mg-post-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: var(--mg-spacing-md);
    color: var(--mg-text);
}

.mg-post-excerpt {
    font-size: 1.125rem;
    color: var(--mg-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.mg-post-thumbnail {
    margin-bottom: var(--mg-spacing-xl);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
    box-shadow: var(--mg-shadow-lg);
}

.mg-post-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.mg-post-content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--mg-text);
}

.mg-post-content p {
    margin-bottom: 1.5em;
}

.mg-post-content h2,
.mg-post-content h3,
.mg-post-content h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.mg-post-content img {
    border-radius: var(--mg-radius);
    margin: 1.5em 0;
    max-width: 100%;
    height: auto;
}

/* WordPress image alignment classes */
.mg-post-content .aligncenter,
.mg-post-content img.aligncenter {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.mg-post-content .alignright,
.mg-post-content img.alignright {
    float: left;
    margin-right: 1.5em;
    margin-left: 0;
}

.mg-post-content .alignleft,
.mg-post-content img.alignleft {
    float: right;
    margin-left: 1.5em;
    margin-right: 0;
}

.mg-post-content .alignnone,
.mg-post-content img.alignnone {
    display: block;
}

.mg-post-content .wp-caption {
    max-width: 100%;
}

.mg-post-content .wp-caption img {
    margin: 0;
    display: block;
}

.mg-post-content .wp-caption-text {
    font-size: 0.85rem;
    color: var(--mg-text-muted);
    text-align: center;
    margin-top: 0.4em;
}

.mg-post-content::after {
    content: '';
    display: table;
    clear: both;
}

.mg-post-content blockquote {
    border-right: 4px solid var(--mg-primary);
    padding: 1.25rem 1.5rem;
    margin: 1.5em 0;
    background: var(--mg-surface);
    border-radius: 0 var(--mg-radius) var(--mg-radius) 0;
    font-style: italic;
    color: var(--mg-text-muted);
}

.mg-post-content ul,
.mg-post-content ol {
    padding-right: 1.5rem;
    margin-bottom: 1.5em;
}

.mg-post-content li {
    margin-bottom: 0.5em;
}

.mg-post-content a {
    color: var(--mg-primary);
    text-decoration: underline;
    text-decoration-color: rgba(var(--mg-primary-rgb), 0.3);
    text-underline-offset: 2px;
}

.mg-post-content a:hover {
    text-decoration-color: var(--mg-primary);
}

.mg-post-content code {
    background: var(--mg-surface);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Consolas', 'Monaco', monospace;
}

.mg-post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--mg-radius);
    overflow-x: auto;
    margin: 1.5em 0;
}

.mg-post-content pre code {
    background: transparent;
    padding: 0;
}

.mg-post-footer {
    margin-top: var(--mg-spacing-xl);
    padding-top: var(--mg-spacing-lg);
    border-top: 1px solid var(--mg-border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--mg-spacing-md);
}

.mg-post-tags {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    flex-wrap: wrap;
}

.mg-post-tags svg {
    color: var(--mg-text-muted);
}

.mg-tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mg-tags-list a {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--mg-surface);
    color: var(--mg-text-muted);
    border-radius: var(--mg-radius-full);
    font-size: 0.875rem;
    transition: var(--mg-transition);
}

.mg-tags-list a:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

.mg-post-share {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
}

.mg-share-label {
    color: var(--mg-text-muted);
    font-size: 0.875rem;
}

.mg-share-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mg-radius-sm);
    background: var(--mg-surface);
    color: var(--mg-text-muted);
    border: none;
    cursor: pointer;
    transition: var(--mg-transition);
}

.mg-share-btn:hover {
    transform: translateY(-2px);
}

.mg-share-facebook:hover {
    background: #1877f2;
    color: #ffffff;
}

.mg-share-twitter:hover {
    background: #000000;
    color: #ffffff;
}

.mg-share-linkedin:hover {
    background: #0077b5;
    color: #ffffff;
}

.mg-share-telegram:hover {
    background: #0088cc;
    color: #ffffff;
}

.mg-share-copy:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

/* Author Bio */
.mg-author-bio {
    display: flex;
    gap: var(--mg-spacing-lg);
    padding: var(--mg-spacing-xl);
    background: var(--mg-surface);
    border-radius: var(--mg-radius-lg);
    margin-top: var(--mg-spacing-xl);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.mg-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.mg-author-info {
    flex: 1;
}

.mg-author-label {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--mg-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mg-author-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mg-author-description {
    color: var(--mg-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: var(--mg-spacing-sm);
}

.mg-author-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(16, 163, 127, 0.22);
    border-radius: 999px;
    background: rgba(16, 163, 127, 0.06);
    color: var(--mg-primary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--mg-transition);
}

.mg-author-link:hover {
    color: var(--mg-secondary);
    border-color: rgba(16, 163, 127, 0.45);
    background: rgba(16, 163, 127, 0.12);
}

/* Post Navigation */
.mg-post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mg-spacing-md);
    margin-top: var(--mg-spacing-xl);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.mg-nav-previous,
.mg-nav-next {
    min-height: 82px;
}

.mg-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mg-spacing-md);
    padding: 1rem 1.25rem;
    background: var(--mg-surface);
    border: 1px solid transparent;
    border-radius: var(--mg-radius);
    transition: var(--mg-transition);
    height: 100%;
    text-align: center;
}

.mg-nav-link:hover {
    background: var(--mg-surface-hover);
    border-color: rgba(16, 163, 127, 0.32);
    transform: translateY(-2px);
    box-shadow: var(--mg-shadow);
}

.mg-nav-next .mg-nav-link {
    flex-direction: row-reverse;
    text-align: center;
}

.mg-nav-content {
    flex: 0 1 auto;
    text-align: center;
}

.mg-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--mg-text-muted);
    margin-bottom: 0.25rem;
}

.mg-nav-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--mg-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-nav-link svg {
    color: var(--mg-primary);
    flex-shrink: 0;
}

/* Related Posts */
.mg-related-posts {
    margin-top: var(--mg-spacing-2xl);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.mg-related-posts .mg-section-header {
    text-align: center;
    margin-bottom: var(--mg-spacing-xl);
}

.mg-related-posts .mg-section-title {
    font-size: 1.5rem;
}

.mg-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--mg-spacing-lg);
}

.mg-related-post-card {
    background: var(--mg-bg);
    border-radius: var(--mg-radius);
    overflow: hidden;
    box-shadow: var(--mg-shadow-sm);
    transition: var(--mg-transition);
}

.mg-related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mg-shadow);
}

.mg-related-post-image {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.mg-related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--mg-transition);
}

.mg-related-post-card:hover .mg-related-post-image img {
    transform: scale(1.05);
}

.mg-related-post-content {
    padding: var(--mg-spacing-md);
}

.mg-related-post-date {
    font-size: 0.75rem;
    color: var(--mg-text-muted);
}

.mg-related-post-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.35rem;
    line-height: 1.4;
}

.mg-related-post-title a {
    color: var(--mg-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-related-post-title a:hover {
    color: var(--mg-primary);
}

/* Reading Time */
.mg-post-reading-time {
    color: var(--mg-text-muted);
}

.mg-elementor-single-post-layout .elementor-widget,
.mg-elementor-single-post-layout .elementor-widget:not(:last-child) {
    margin-bottom: 0;
    margin-block-end: 0;
}

/* Page Links */
.mg-page-links {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-sm);
    margin-top: var(--mg-spacing-lg);
    padding-top: var(--mg-spacing-md);
    border-top: 1px solid var(--mg-border);
}

.mg-page-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.mg-page-links a:hover {
    background: var(--mg-primary);
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .mg-single-post {
        padding: var(--mg-spacing-xl) 0;
    }

    .mg-author-bio {
        flex-direction: column;
        text-align: center;
    }

    .mg-author-avatar {
        display: flex;
        justify-content: center;
    }

    .mg-post-navigation {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .mg-nav-next .mg-nav-link {
        flex-direction: row;
        text-align: center;
    }

    .mg-post-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Comments Section
   ============================================ */
.mg-comments-section {
    max-width: 800px;
    margin: var(--mg-spacing-2xl) auto 0;
}

.mg-comments-title,
.mg-comment-form-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--mg-spacing-lg);
    padding-bottom: var(--mg-spacing-sm);
    border-bottom: 2px solid var(--mg-border);
}

/* Comments List */
.mg-comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--mg-spacing-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--mg-spacing-md);
}

.mg-comments-list .children {
    list-style: none;
    padding-right: var(--mg-spacing-xl);
    margin-top: var(--mg-spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--mg-spacing-md);
}

.mg-comment-card {
    display: flex;
    gap: var(--mg-spacing-md);
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: var(--mg-spacing-lg);
    transition: var(--mg-transition);
}

.mg-comment-card:hover {
    border-color: rgba(var(--mg-primary-rgb), 0.3);
    box-shadow: var(--mg-shadow-sm);
}

.mg-comment-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--mg-border);
}

.mg-comment-body {
    flex: 1;
    min-width: 0;
}

.mg-comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--mg-spacing-sm);
}

.mg-comment-author a,
.mg-comment-author {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--mg-text);
}

.mg-comment-date {
    font-size: 0.8125rem;
    color: var(--mg-text-muted);
}

.mg-comment-pending {
    font-size: 0.75rem;
    background: rgba(var(--mg-primary-rgb), 0.1);
    color: var(--mg-primary);
    padding: 0.15rem 0.6rem;
    border-radius: var(--mg-radius-full);
}

.mg-comment-text p {
    margin: 0 0 0.75em;
    color: var(--mg-text);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.mg-comment-text p:last-child {
    margin-bottom: 0;
}

.mg-comment-footer {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-md);
    margin-top: var(--mg-spacing-sm);
}

.mg-comment-footer .comment-reply-link {
    font-size: 0.8125rem;
    color: var(--mg-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mg-comment-footer .comment-reply-link:hover {
    color: var(--mg-secondary);
}

.mg-comment-edit {
    font-size: 0.8125rem;
    color: var(--mg-text-muted);
}

.mg-comment-edit a {
    color: var(--mg-text-muted);
}

.mg-comment-edit a:hover {
    color: var(--mg-primary);
}

/* Comment Form */
.mg-comment-respond {
    margin-top: var(--mg-spacing-xl);
    padding-top: var(--mg-spacing-xl);
    border-top: 1px solid var(--mg-border);
}

.mg-comment-form-title {
    border-bottom-color: var(--mg-primary);
}

#cancel-comment-reply-link {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    font-weight: 400;
    margin-right: var(--mg-spacing-sm);
}

#cancel-comment-reply-link:hover {
    color: var(--mg-primary);
}

.mg-comment-form .logged-in-as {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    margin-bottom: var(--mg-spacing-lg);
}

.mg-comment-form .logged-in-as a {
    color: var(--mg-primary);
}

.mg-comment-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mg-spacing-md);
    margin-bottom: var(--mg-spacing-md);
}

.mg-comment-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mg-comment-field--full {
    margin-bottom: var(--mg-spacing-md);
}

.mg-comment-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mg-text);
}

.mg-comment-field label span {
    color: var(--mg-primary);
}

.mg-comment-field input,
.mg-comment-field textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-bg);
    color: var(--mg-text);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mg-comment-field input:focus,
.mg-comment-field textarea:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.12);
}

.mg-comment-field textarea {
    resize: vertical;
    min-height: 140px;
}

.mg-comment-submit-wrap {
    display: flex;
    align-items: center;
    gap: var(--mg-spacing-md);
}

/* Pagination */
.comments-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--mg-spacing-lg);
}

.comments-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--mg-radius);
    background: var(--mg-surface);
    color: var(--mg-text);
    font-size: 0.875rem;
    border: 1px solid var(--mg-border);
    transition: var(--mg-transition);
}

.comments-pagination .page-numbers.current,
.comments-pagination .page-numbers:hover {
    background: var(--mg-primary);
    color: #fff;
    border-color: var(--mg-primary);
}

/* Responsive */
@media (max-width: 640px) {
    .mg-comment-fields-row {
        grid-template-columns: 1fr;
    }

    .mg-comments-list .children {
        padding-right: var(--mg-spacing-md);
    }
}

/* ============================================
   Info Pages (FAQ, Shipping, Returns, Privacy, Terms)
   ============================================ */
.mg-info-header {
    background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-primary-dark, #1a3a6b) 100%);
    padding: var(--mg-spacing-xl) 0;
    text-align: center;
    color: #fff;
}

.mg-info-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.mg-info-body {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--mg-spacing-xl) 0;
}

.mg-info-page .mg-info-content-section {
    padding-top: 0;
}

.mg-info-page .mg-info-content-container {
    padding-top: var(--mg-widget-top-gap);
}

.mg-info-page .mg-info-body {
    padding-top: 0;
}

.mg-info-content {
    line-height: 1.9;
    color: var(--mg-text);
    font-size: 1rem;
}

.mg-info-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--mg-primary);
}

.mg-info-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--mg-text);
    margin: 1.5rem 0 0.5rem;
}

.mg-info-content p {
    margin-bottom: 1rem;
    color: var(--mg-text-muted, #666);
}

.mg-info-content ul,
.mg-info-content ol {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}

.mg-info-content li {
    margin-bottom: 0.4rem;
    color: var(--mg-text-muted, #666);
}

.mg-info-content strong {
    color: var(--mg-text);
    font-weight: 600;
}

.mg-info-content blockquote {
    border-right: 4px solid var(--mg-primary);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background: var(--mg-gray-50, #f8f9fa);
    border-radius: 0 8px 8px 0;
    color: var(--mg-text-muted, #666);
}

.mg-info-content a {
    color: var(--mg-primary);
    text-decoration: underline;
}

.mg-info-content a:hover {
    opacity: 0.8;
}

.mg-info-content hr {
    border: none;
    border-top: 1px solid var(--mg-border, #e5e7eb);
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .mg-info-header {
        padding: var(--mg-spacing-lg) 0;
    }

    .mg-info-page .mg-info-content-container {
        padding-top: var(--mg-widget-top-gap-mobile);
    }

    .mg-info-body {
        padding: var(--mg-spacing-lg) 0;
    }

    .mg-info-page .mg-info-body {
        padding-top: 0;
    }
}

/* ============================================
   Mobile Bottom Navigation Bar
   ============================================ */
.mg-mobile-bottom-nav {
    display: none;
}

@media (max-width: 992px) {
    /* نمایش نوار پایین فقط در موبایل/تبلت */
    .mg-mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 1200;
        background: var(--mg-bg);
        border-top: 1px solid var(--mg-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        height: calc(64px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        align-items: stretch;
    }

    /* فاصله پایین صفحه برای جلوگیری از پوشش توسط نوار */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .mg-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 4px;
        color: var(--mg-text-muted);
        text-decoration: none;
        transition: color 0.2s ease;
        position: relative;
        min-width: 0;
    }

    button.mg-bottom-nav-item {
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        font-size: inherit;
        -webkit-appearance: none;
        appearance: none;
    }

    .mg-bottom-nav-item:hover,
    .mg-bottom-nav-item.active {
        color: var(--mg-primary);
    }

    /* خط تاکید بالای آیتم فعال */
    .mg-bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        right: 20%;
        left: 20%;
        height: 3px;
        background: var(--mg-gradient-primary);
        border-radius: 0 0 3px 3px;
    }

    .mg-bottom-nav-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
    }

    .mg-bottom-nav-icon svg {
        width: 22px;
        height: 22px;
        transition: transform 0.2s ease;
    }

    .mg-bottom-nav-item.active .mg-bottom-nav-icon svg {
        stroke-width: 2.5;
    }

    .mg-bottom-nav-label {
        font-size: 0.65rem;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* بج تعداد سبد خرید */
    .mg-bottom-nav-badge {
        position: absolute;
        top: -4px;
        left: -4px;
        background: var(--mg-gradient-vibrant, linear-gradient(135deg, #ff416c, #ff4b2b));
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        border: 1.5px solid var(--mg-bg);
        line-height: 1;
    }

    /* تاثیر کلیک */
    .mg-bottom-nav-item:active .mg-bottom-nav-icon svg {
        transform: scale(0.88);
    }
}

/* ============================================
   صفحه ورود / ثبت‌نام (WooCommerce My Account)
   ============================================ */

/* پس‌زمینه صفحه */
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-page.woocommerce-account .woocommerce {
    max-width: 1500px;
    margin: 0 auto;
}

/* وقتی لاگ‌اوت است: هر دو فرم در یک شبکه دو‌ستونی */
.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper + .u-columns,
.woocommerce-account:not(.logged-in) .u-columns.col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .woocommerce-account:not(.logged-in) .u-columns.col2-set {
        grid-template-columns: 1fr;
    }
}

/* کارت هر ستون */
.woocommerce-account .u-columns .col-1,
.woocommerce-account .u-columns .col-2 {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-md, 0 4px 24px rgba(0,0,0,0.08));
    padding: 2.5rem;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* عنوان فرم */
.woocommerce-account .u-columns h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--mg-border);
    position: relative;
}

.woocommerce-account .u-columns h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 48px;
    height: 2px;
    background: var(--mg-gradient-primary);
    border-radius: 2px;
}

/* لیبل‌ها */
.woocommerce-account .u-columns .woocommerce-form__label,
.woocommerce-account .u-columns label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mg-text-muted);
    margin-bottom: 0.4rem;
}

/* فیلدهای ورودی */
.woocommerce-account .u-columns input[type="text"],
.woocommerce-account .u-columns input[type="email"],
.woocommerce-account .u-columns input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-surface);
    color: var(--mg-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
}

.woocommerce-account .u-columns input[type="text"]:focus,
.woocommerce-account .u-columns input[type="email"]:focus,
.woocommerce-account .u-columns input[type="password"]:focus {
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.12);
}

/* فاصله‌گذاری بین گروه‌های فرم */
.woocommerce-account .u-columns .form-row {
    margin-bottom: 1.25rem;
}

/* ردیف remember me */
.woocommerce-account .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
}

.woocommerce-account .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--mg-primary);
    cursor: pointer;
}

/* دکمه‌های فرم */
.woocommerce-account .u-columns .woocommerce-Button,
.woocommerce-account .u-columns input[type="submit"],
.woocommerce-account .u-columns button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 2rem;
    background: var(--mg-gradient-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--mg-radius);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.woocommerce-account .u-columns .woocommerce-Button:hover,
.woocommerce-account .u-columns input[type="submit"]:hover,
.woocommerce-account .u-columns button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* لینک فراموشی رمز */
.woocommerce-account .lost_password {
    text-align: left;
    margin-bottom: 1.25rem;
}

.woocommerce-account .lost_password a {
    font-size: 0.825rem;
    color: var(--mg-primary);
    text-decoration: none;
}

.woocommerce-account .lost_password a:hover {
    text-decoration: underline;
}

/* توضیح زیر فرم ثبت‌نام */
.woocommerce-account .woocommerce-privacy-policy-text {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.woocommerce-account .woocommerce-privacy-policy-text a {
    color: var(--mg-primary);
}

/* پیغام‌های WooCommerce در صفحه اکانت */
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-info {
    border-radius: var(--mg-radius);
    border-right: 4px solid var(--mg-primary);
    background: var(--mg-bg);
    padding: 1.5rem 1.25rem !important;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.woocommerce-account .woocommerce-error {
    border-right-color: #e53e3e;
    background: rgba(229, 62, 62, 0.06);
    color: #c53030;
}

.woocommerce-account .woocommerce-message {
    background: var(--mg-bg);
    color: var(--mg-primary);
}

/* صفحه ریکاوری پسورد */
.woocommerce-account .woocommerce-ResetPassword {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-md, 0 4px 24px rgba(0,0,0,0.08));
    padding: 2.5rem;
    max-width: 460px;
    margin: 2rem auto;
}

.woocommerce-account .woocommerce-ResetPassword h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 0.75rem;
}

.woocommerce-account .woocommerce-ResetPassword p {
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* ============================================
   لایوت صفحه مهمان (وقتی لاگ‌اوت است)
   ============================================ */

.mg-login-page-wrap {
    padding: 1.25rem 0 4rem;
}

/* بخش معرفی بالای فرم‌ها */
.mg-login-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.mg-login-hero-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--mg-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(var(--mg-primary-rgb), 0.3);
}

.mg-login-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--mg-text);
    margin-bottom: 0.5rem;
}

.mg-login-hero-sub {
    font-size: 1rem;
    color: var(--mg-text-muted);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

/* محفظه فرم‌ها */
.mg-login-forms-wrap {
    max-width: 960px;
    margin: 0 auto;
}

/* شبکه دو‌ستونی برای فرم ورود + ثبت‌نام */
.mg-login-forms-wrap .u-columns.col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.mg-login-forms-wrap .col-1,
.mg-login-forms-wrap .col-2 {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    padding: 2.5rem;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* عنوان هر کارت */
.mg-login-forms-wrap h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--mg-border);
    position: relative;
}

.mg-login-forms-wrap h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 44px;
    height: 2px;
    background: var(--mg-gradient-primary);
    border-radius: 2px;
}

/* لیبل */
.mg-login-forms-wrap label,
.mg-login-forms-wrap .woocommerce-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mg-text-muted);
    margin-bottom: 0.4rem;
}

/* ورودی‌ها */
.mg-login-forms-wrap input[type="text"],
.mg-login-forms-wrap input[type="email"],
.mg-login-forms-wrap input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: var(--mg-surface);
    color: var(--mg-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mg-login-forms-wrap input[type="text"]:focus,
.mg-login-forms-wrap input[type="email"]:focus,
.mg-login-forms-wrap input[type="password"]:focus {
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.12);
}

/* فاصله گروه‌های فرم */
.mg-login-forms-wrap .form-row {
    margin-bottom: 1.25rem;
}

/* remember me */
.mg-login-forms-wrap .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    margin-bottom: 1.25rem;
}

.mg-login-forms-wrap .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--mg-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* دکمه submit */
.mg-login-forms-wrap .woocommerce-Button,
.mg-login-forms-wrap input[type="submit"],
.mg-login-forms-wrap button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 2rem;
    background: var(--mg-gradient-primary);
    color: #fff !important;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: var(--mg-radius);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(var(--mg-primary-rgb), 0.3);
    -webkit-appearance: none;
    appearance: none;
}

.mg-login-forms-wrap .woocommerce-Button:hover,
.mg-login-forms-wrap input[type="submit"]:hover,
.mg-login-forms-wrap button[type="submit"]:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--mg-primary-rgb), 0.4);
}

/* لینک فراموشی رمز */
.mg-login-forms-wrap .lost_password {
    margin-bottom: 1.25rem;
}

.mg-login-forms-wrap .lost_password a {
    font-size: 0.82rem;
    color: var(--mg-primary);
    text-decoration: none;
    opacity: 0.85;
}

.mg-login-forms-wrap .lost_password a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* سیاست حریم خصوصی */
.mg-login-forms-wrap .woocommerce-privacy-policy-text {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.mg-login-forms-wrap .woocommerce-privacy-policy-text a {
    color: var(--mg-primary);
}

/* پیغام‌های خطا/موفقیت */
.mg-login-forms-wrap .woocommerce-error,
.mg-login-forms-wrap .woocommerce-message,
.mg-login-forms-wrap .woocommerce-info {
    border-radius: var(--mg-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    list-style: none;
}

.mg-login-forms-wrap .woocommerce-error {
    background: rgba(229,62,62,0.07);
    border-right: 3px solid #e53e3e;
    color: #c53030;
}

.mg-login-forms-wrap .woocommerce-error::before { display: none; }

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .mg-login-forms-wrap .u-columns.col2-set {
        grid-template-columns: 1fr;
    }

    .mg-login-forms-wrap .col-1,
    .mg-login-forms-wrap .col-2 {
        padding: 1.75rem 1.5rem;
    }

    .mg-login-hero-title {
        font-size: 1.6rem;
    }

    .mg-login-hero-icon {
        width: 72px;
        height: 72px;
    }
}

/* غیرفعال‌سازی hover کارت‌ها در موبایل/تاچ */
@media (max-width: 991px), (hover: none) and (pointer: coarse) {
    .mg-product-card:hover,
    .mg-featured-product-card:hover,
    a.mg-banner-cell:hover,
    .mg-flash-sale .mg-product-card:hover,
    .mg-stat-card:hover,
    .mg-feature-card:hover,
    .mg-testimonial-card:hover,
    .mg-blog-card:hover,
    .mg-shop-content .mg-product-card:hover,
    .mg-related-post-card:hover,
    .mg-category-card:hover,
    .mg-category-style-circle:hover .mg-category-image-wrapper {
        transform: none !important;
        top: 0 !important;
    }

    .mg-product-card:hover,
    .mg-featured-product-card:hover,
    a.mg-banner-cell:hover,
    .mg-flash-sale .mg-product-card:hover,
    .mg-stat-card:hover,
    .mg-feature-card:hover,
    .mg-testimonial-card:hover,
    .mg-blog-card:hover,
    .mg-shop-content .mg-product-card:hover,
    .mg-related-post-card:hover {
        box-shadow: var(--mg-shadow-sm) !important;
    }

    .mg-flash-sale .mg-product-card:hover {
        border-color: transparent !important;
        box-shadow: none !important;
    }

    .mg-flash-sale .mg-product-card {
        transition: none !important;
    }

    .mg-stat-card:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .mg-testimonial-card:hover {
        background: var(--mg-surface) !important;
    }

    .mg-feature-card:hover::before {
        transform: scaleX(0) !important;
    }

    .mg-product-card:hover::before,
    .mg-featured-product-card:hover::before {
        opacity: 0 !important;
    }

    .mg-featured-product-card:hover::after {
        left: -100% !important;
    }

    .mg-product-image-wrapper:hover img,
    .mg-product-image-wrapper:focus-within img,
    .mg-category-card:hover .mg-category-image-wrapper img,
    .mg-blog-image:hover img,
    .mg-blog-image:focus-within img,
    .mg-related-post-card:hover .mg-related-post-image img {
        transform: none !important;
    }

    .mg-category-card:hover .mg-category-overlay {
        opacity: 0 !important;
    }

    .mg-category-card:hover .mg-category-hover-effect {
        transform: scale(0) !important;
    }

    .mg-category-card:hover .mg-category-name {
        color: var(--mg-text) !important;
    }

    .mg-category-card:hover .mg-category-arrow {
        transform: translate(-50%, -50%) scale(0) !important;
    }

    .mg-stat-card:hover .mg-stat-icon {
        transform: none !important;
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
    }

    .mg-feature-card:hover .mg-feature-icon {
        transform: none !important;
        box-shadow: none !important;
    }

    /* promo bar */
    .mg-promo-item:hover {
        transform: translateY(-4px) !important;
        box-shadow: var(--mg-shadow-lg) !important;
        transition: transform 0.32s ease, box-shadow 0.32s ease !important;
    }

    .mg-promo-item:hover::before {
        opacity: 1 !important;
        transition: opacity 0.32s ease !important;
    }

    .mg-promo-item:hover .mg-promo-icon {
        transform: scale(1.1) rotate(5deg) !important;
        transition: transform 0.32s ease !important;
    }

    /* دکمه‌ها */
    .mg-btn-primary:hover,
    .mg-footer-cta-buttons .mg-btn-primary:hover {
        transform: none !important;
        box-shadow: var(--mg-shadow-md) !important;
        top: 0 !important;
    }

    /* wishlist کارت */
    .mg-wl-card:hover {
        transform: none !important;
        box-shadow: none !important;
        border-color: var(--mg-border) !important;
    }

    .mg-wl-card:hover .mg-wl-card-image img {
        transform: none !important;
    }

    /* price card */
    .mg-price-card:hover {
        box-shadow: none !important;
        border-color: var(--mg-border) !important;
    }
}





  
/* ==============================
   Contact Page
   ============================== */
.mg-contact-hero {
    background: var(--mg-gradient-primary);
    text-align: center;
    padding: 3rem 0 0;
    position: relative;
    margin-bottom: 2.5rem;
}

.mg-contact-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    color: #fff;
    margin-bottom: 0.875rem;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.mg-contact-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
}

.mg-contact-hero-sub {
    margin: 0;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    padding-bottom: 2rem;
}

.mg-contact-hero-wave {
    line-height: 0;
}

.mg-contact-hero-wave svg {
    display: block;
    width: 100%;
}

.mg-contact-body {
    padding-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mg-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.mg-contact-card {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.75rem;
    box-shadow: var(--mg-shadow-sm);
}

.mg-contact-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--mg-text);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mg-border);
}

.mg-contact-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: 8px;
    color: var(--mg-primary);
    flex-shrink: 0;
}

/* آیتم‌های تماس */
.mg-contact-page .mg-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--mg-border);
}

.mg-contact-page .mg-contact-item:last-of-type {
    border-bottom: none;
}

.mg-contact-page .mg-contact-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: 10px;
    color: var(--mg-primary);
    margin-top: 0.1rem;
}

.mg-contact-page .mg-contact-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mg-contact-page .mg-contact-item-body strong {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mg-contact-page .mg-contact-item-body span,
.mg-contact-page .mg-contact-item-body a {
    font-size: 0.95rem;
    color: var(--mg-text);
    word-break: break-word;
}

.mg-contact-page .mg-contact-item-body a {
    color: var(--mg-primary);
    text-decoration: none;
}

.mg-contact-page .mg-contact-item-body a:hover {
    text-decoration: underline;
}

/* شبکه‌های اجتماعی */
.mg-contact-page .mg-contact-social {
    padding-top: 1.1rem;
    margin-top: 0.25rem;
}

.mg-contact-page .mg-contact-social h3 {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mg-contact-page .mg-contact-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mg-contact-page .mg-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
    border: none;
}

.mg-contact-page .mg-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    color: #fff;
    opacity: 0.92;
}

.mg-contact-page .mg-social-instagram {
    background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
}

.mg-contact-page .mg-social-telegram {
    background: #0088cc;
}

.mg-contact-page .mg-social-whatsapp {
    background: #25d366;
}

/* نقشه */
.mg-contact-map {
    overflow: hidden;
}

.mg-contact-map-embed iframe {
    width: 100%;
    min-height: 380px;
    border: 0;
    border-radius: var(--mg-radius);
    display: block;
}

.mg-contact-hint {
    margin: 0;
    color: var(--mg-text-muted);
    font-size: 0.9rem;
}

/* ─── فرم تماس built-in ───────────────────────────────────────── */
.mg-contact-form-inner { display: flex; flex-direction: column; gap: 16px; }
.mg-cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mg-cf-field { display: flex; flex-direction: column; gap: 6px; }
.mg-cf-field label { font-size: .875rem; font-weight: 600; color: var(--mg-text); }
.mg-cf-req { color: #ef4444; }
.mg-cf-field input,
.mg-cf-field textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-size: .95rem; font-family: inherit;
    background: var(--mg-bg);
    color: var(--mg-text);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.mg-cf-field input:focus,
.mg-cf-field textarea:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.mg-cf-field textarea { resize: vertical; min-height: 120px; }
.mg-cf-actions { display: flex; justify-content: flex-end; }
.mg-cf-submit {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--mg-primary); color: #fff;
    border: none; border-radius: var(--mg-radius);
    padding: 11px 24px; font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: background .2s, transform .1s;
}
.mg-cf-submit:hover  { background: var(--mg-primary-dark, #1d4ed8); }
.mg-cf-submit:active { transform: scale(.97); }
.mg-cf-submit:disabled { opacity: .65; cursor: not-allowed; }
/* Toast notification */
.mg-toast {
    position: fixed;
    bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    display: flex; align-items: center; gap: 10px;
    padding: 14px 22px; border-radius: 12px;
    font-size: .95rem; font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    z-index: 99999; opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none; white-space: nowrap;
    direction: rtl;
}
.mg-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mg-toast-success { background: #15803d; color: #fff; }
.mg-toast-error   { background: #b91c1c; color: #fff; }
@media (max-width: 480px) {
    .mg-toast { left: 16px; right: 16px; transform: translateY(20px); width: auto; }
    .mg-toast-show { transform: translateY(0); }
}
@media (max-width: 600px) {
    .mg-cf-row { grid-template-columns: 1fr; }
    .mg-cf-submit { width: 100%; justify-content: center; }
}

.mg-contact-page-content {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 2rem;
}

@media (max-width: 900px) {
    .mg-contact-grid { grid-template-columns: 1fr; }
    .mg-contact-map-embed iframe { min-height: 280px; }
}

@media (max-width: 640px) {
    .mg-contact-hero { padding-top: 2rem; }
    .mg-contact-card { padding: 1.25rem; }
}

/* ==============================
   About Us Page
   ============================== */
.mg-about-page { padding-bottom: 4rem; }

.mg-about-hero {
    background: var(--mg-gradient-primary);
    padding: 3rem 0 0;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.mg-about-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    margin-bottom: 1rem;
}

.mg-about-title {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
}

.mg-about-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.82);
    margin: 0 0 2rem;
}

.mg-about-hero-wave {
    line-height: 0;
    margin-top: 0.5rem;
}

.mg-about-hero-wave svg {
    display: block;
    width: 100%;
}

/* بخش معرفی */
.mg-about-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--mg-shadow-sm);
}

.mg-about-image img {
    width: 100%;
    border-radius: var(--mg-radius-lg);
    object-fit: cover;
    max-height: 420px;
}

.mg-about-text-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mg-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    gap: 0.4rem;
}

.mg-about-text-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--mg-primary);
    border-radius: 2px;
}

.mg-about-text h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1rem;
    line-height: 1.4;
}

.mg-about-story-body {
    font-size: 0.95rem;
    line-height: 2;
    color: var(--mg-text-muted);
}

.mg-about-text-full { grid-column: 1 / -1; }


.mg-about-editor-content {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 2rem;
    font-size: 0.95rem;
    line-height: 2;
    box-shadow: var(--mg-shadow-sm);
}

.mg-about-section {
    margin-bottom: 2.5rem;
}

.mg-about-section-head {
    max-width: 680px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.mg-about-section-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.mg-about-section-head h2 {
    margin: 0;
    color: var(--mg-text);
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
    font-weight: 800;
    line-height: 1.5;
}

.mg-about-section-head p {
    margin: 0.5rem auto 0;
    color: var(--mg-text-muted);
    font-size: 0.95rem;
    line-height: 1.9;
}

.mg-about-stats-grid,
.mg-about-cards-grid,
.mg-about-values-grid {
    display: grid;
    gap: 1rem;
}

.mg-about-stats-grid,
.mg-about-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mg-about-values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mg-about-stat-card,
.mg-about-info-card,
.mg-about-value-card {
    background: #ffffff;
    border: 1px solid rgba(var(--mg-primary-rgb), 0.1);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-sm);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.mg-about-stat-card:hover,
.mg-about-info-card:hover,
.mg-about-value-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--mg-primary-rgb), 0.22);
    box-shadow: var(--mg-shadow);
}

.mg-about-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 112px;
    padding: 1.25rem;
}

.mg-about-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.08);
}

.mg-about-card-icon svg {
    width: 24px;
    height: 24px;
}

.mg-about-stat-card strong {
    display: block;
    color: var(--mg-primary-dark);
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.2;
}

.mg-about-stat-card span {
    display: block;
    margin-top: 0.25rem;
    color: var(--mg-text-muted);
    font-size: 0.9rem;
}

.mg-about-info-card {
    padding: 1.4rem;
}

.mg-about-info-card h3,
.mg-about-value-card h3 {
    margin: 1rem 0 0.5rem;
    color: var(--mg-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.mg-about-info-card p,
.mg-about-value-card p {
    margin: 0;
    color: var(--mg-text-muted);
    font-size: 0.9rem;
    line-height: 1.9;
}

.mg-about-value-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.35rem;
}

.mg-about-value-card h3 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .mg-about-story {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .mg-about-hero { padding-top: 2rem; }
}

@media (max-width: 992px) {
    .mg-about-stats-grid,
    .mg-about-cards-grid,
    .mg-about-values-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .mg-about-stats-grid,
    .mg-about-cards-grid,
    .mg-about-values-grid {
        grid-template-columns: 1fr;
    }

    .mg-about-stat-card,
    .mg-about-info-card,
    .mg-about-value-card {
        padding: 1.1rem;
    }
}

/* ==============================
   Sale Products Notice
   ============================== */
.mg-sale-products-notice {
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--mg-flash-banner-1, #ff416c) 0%, var(--mg-flash-banner-2, #ff4b2b) 100%);
    color: #ffffff;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   نظرات محصول
   ============================================ */

/* هدر خلاصه امتیاز */
.mg-reviews-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.75rem;
}

.mg-reviews-avg-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 90px;
}

.mg-reviews-avg-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--mg-text);
    line-height: 1;
}

.mg-reviews-avg-stars .star-rating {
    font-size: 1rem !important;
    width: 5.4em !important;
}

.mg-reviews-avg-label {
    font-size: 0.8rem;
    color: var(--mg-text-muted);
    white-space: nowrap;
}

.mg-reviews-divider {
    width: 1px;
    height: 56px;
    background: var(--mg-border);
    flex-shrink: 0;
}

.mg-reviews-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--mg-text-muted);
    font-size: 0.8rem;
}

.mg-reviews-badge svg {
    color: var(--mg-accent);
    flex-shrink: 0;
}

/* پیام بدون نظر */
.mg-no-reviews {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-lg);
    border: 2px dashed var(--mg-border);
    color: var(--mg-text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

.mg-no-reviews svg {
    opacity: 0.35;
}

.mg-no-reviews p {
    margin: 0;
    font-size: 0.95rem;
}

/* عنوان لیست ووکامرس (مخفی - در هدر summary نشان داده می‌شود) */
.mg-product-reviews .woocommerce-Reviews-title {
    display: none;
}

/* لیست نظرات */
.mg-product-reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* پاسخ‌های تودرتو */
.mg-product-reviews .commentlist .children {
    list-style: none;
    padding: 0;
    margin: .6rem 0 0 0;
    padding-right: 2.5rem;
    margin-left: 1rem;
    border-right: 2px solid color-mix(in srgb, var(--mg-primary, #7c3aed) 25%, transparent);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.mg-product-reviews .commentlist .children .comment_container {
    padding: .65rem .85rem;
    background: color-mix(in srgb, var(--mg-primary, #7c3aed) 4%, var(--mg-bg));
    border-color: color-mix(in srgb, var(--mg-primary, #7c3aed) 15%, var(--mg-border));
    border-radius: var(--mg-radius);
}

.mg-product-reviews .commentlist .children .comment_container::after {
    display: none;
}

.mg-product-reviews .commentlist .children .avatar {
    width: 28px;
    height: 28px;
}

.mg-product-reviews .commentlist .children .woocommerce-review__author {
    font-size: .78rem;
}

.mg-product-reviews .commentlist .children .woocommerce-review__date,
.mg-product-reviews .commentlist .children .woocommerce-review__verified {
    font-size: .72rem;
}

.mg-product-reviews .commentlist .children .description p {
    font-size: .8rem;
    margin: .25rem 0 0;
}

/* کارت هر نظر */
.mg-product-reviews .comment_container {
    display: flex;
    gap: 1rem;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.25rem 1.5rem;
    transition: box-shadow 0.25s, border-color 0.25s;
    position: relative;
    overflow: hidden;
}

.mg-product-reviews .comment_container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3px;
    background: var(--mg-primary);
    opacity: 0.5;
}

.mg-product-reviews .comment_container:hover {
    box-shadow: var(--mg-shadow);
    border-color: var(--mg-primary-light);
}

/* آواتار */
.mg-product-reviews .avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--mg-border);
}

/* بخش متن نظر */
.mg-product-reviews .comment-text {
    flex: 1;
    min-width: 0;
}

/* ستاره‌های نظر */
.mg-product-reviews .comment-text .star-rating {
    margin-bottom: 0.4rem;
}

/* نام و تاریخ */
.mg-product-reviews p.meta {
    margin: 0 0 0.6rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
    font-size: 0.875rem;
}

.mg-product-reviews .woocommerce-review__author {
    font-weight: 700;
    color: var(--mg-text);
}

.mg-product-reviews .woocommerce-review__dash {
    color: var(--mg-border);
}

.mg-product-reviews .woocommerce-review__published-date {
    font-size: 0.78rem;
    color: var(--mg-text-muted);
}

.mg-product-reviews .woocommerce-review__verified.verified {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    color: #15803d;
    background: #dcfce7;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-weight: 600;
}

/* متن نظر */
.mg-product-reviews .description p {
    margin: 0;
    color: var(--mg-text-muted);
    font-size: 0.9rem;
    line-height: 1.75;
}

/* ============================================
   فرم ثبت نظر
   ============================================ */
.mg-review-reply-link {
    margin-top: .6rem;
}
.mg-review-reply-link .comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--mg-primary, #7c3aed);
    background: color-mix(in srgb, var(--mg-primary, #7c3aed) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--mg-primary, #7c3aed) 20%, transparent);
    border-radius: 999px;
    padding: .25rem .75rem;
    text-decoration: none;
    transition: background .18s, border-color .18s;
}
.mg-review-reply-link .comment-reply-link:hover {
    background: color-mix(in srgb, var(--mg-primary, #7c3aed) 15%, transparent);
    border-color: color-mix(in srgb, var(--mg-primary, #7c3aed) 40%, transparent);
}

.mg-review-form-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--mg-border);
}

.mg-review-form-title,
.mg-product-reviews .comment-reply-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1.25rem;
}

.mg-product-reviews #commentform {
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.75rem;
}

/* نام و ایمیل — دو ستون در دسکتاپ */
.mg-product-reviews #commentform {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.mg-product-reviews #commentform .comment-form-rating,
.mg-product-reviews #commentform .comment-form-comment,
.mg-product-reviews #commentform .comment-form-cookies-consent,
.mg-product-reviews #commentform .form-submit {
    grid-column: 1 / -1;
}

.mg-product-reviews #commentform .comment-form-author,
.mg-product-reviews #commentform .comment-form-email {
    margin-bottom: 1.1rem;
}

.mg-product-reviews #commentform .comment-form-comment,
.mg-product-reviews #commentform .comment-form-rating {
    margin-bottom: 1.1rem;
}

.mg-product-reviews #commentform label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mg-text);
    margin-bottom: 0.4rem;
}

.mg-product-reviews #commentform .required {
    color: var(--mg-error);
    margin-inline-start: 2px;
}

.mg-product-reviews #commentform input[type="text"],
.mg-product-reviews #commentform input[type="email"],
.mg-product-reviews #commentform textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--mg-text);
    background: var(--mg-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.mg-product-reviews #commentform input[type="text"]:focus,
.mg-product-reviews #commentform input[type="email"]:focus,
.mg-product-reviews #commentform textarea:focus {
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb), 0.1);
}

.mg-product-reviews #commentform textarea {
    resize: vertical;
    min-height: 115px;
}

/* ستاره‌های انتخاب امتیاز — WooCommerce JS آن‌ها را می‌سازد */
.mg-product-reviews p.stars {
    display: flex;
    align-items: center;
    margin: 0.3rem 0 0;
}

.mg-product-reviews p.stars span {
    display: flex;
    gap: 0.1rem;
}

.mg-product-reviews p.stars a {
    width: 1.875rem;
    height: 1.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-indent: -9999px;
    position: relative;
    color: #d1d5db;
    font-size: 0;
    transition: color 0.15s, transform 0.12s;
}

.mg-product-reviews p.stars a::before {
    content: '★';
    font-size: 1.5rem;
    text-indent: 0;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-product-reviews p.stars:hover a,
.mg-product-reviews p.stars a.active {
    color: var(--mg-accent);
}

.mg-product-reviews p.stars a:hover ~ a {
    color: #d1d5db;
}

.mg-product-reviews p.stars.selected a.active ~ a {
    color: #d1d5db;
}

.mg-product-reviews p.stars a:hover {
    transform: scale(1.2);
}

/* دکمه ثبت نظر */
.mg-product-reviews .form-submit {
    margin: 0.25rem 0 0;
}

.mg-product-reviews .form-submit input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2.25rem;
    background: var(--mg-primary);
    color: #fff;
    border: none;
    border-radius: var(--mg-radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.mg-product-reviews .form-submit input[type="submit"]:hover {
    background: var(--mg-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--mg-primary-rgb), 0.35);
}

/* must-log-in */
.mg-product-reviews .must-log-in {
    text-align: center;
    padding: 1.25rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-lg);
    border: 1px solid var(--mg-border);
    color: var(--mg-text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.mg-product-reviews .must-log-in a {
    color: var(--mg-primary);
    font-weight: 600;
    text-decoration: none;
}

.mg-product-reviews .must-log-in a:hover {
    text-decoration: underline;
}

/* تایید خرید الزامی */
.mg-verification-required {
    text-align: center;
    padding: 1.25rem;
    background: var(--mg-surface);
    border-radius: var(--mg-radius-lg);
    border: 1px solid var(--mg-border);
    color: var(--mg-text-muted);
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* موبایل */
@media (max-width: 640px) {
    .mg-reviews-header {
        padding: 1.25rem;
        gap: 1rem;
    }

    .mg-reviews-avg-score {
        font-size: 2.25rem;
    }

    .mg-reviews-badge span {
        display: none;
    }

    .mg-product-reviews .comment_container {
        padding: 1rem 1.1rem;
    }

    .mg-product-reviews #commentform {
        padding: 1.25rem;
    }

    .mg-product-reviews #commentform {
        grid-template-columns: 1fr;
    }
    .mg-product-reviews #commentform .comment-form-author,
    .mg-product-reviews #commentform .comment-form-email {
        grid-column: 1 / -1;
    }
}

/* ==========================================
   امتیاز جمع‌وجور محصول (★ 4.0)
   ========================================== */
.mg-product-rating .star-rating {
    overflow: visible;
    width: auto !important;
    height: auto;
    font-family: inherit;
    font-size: 0.78rem !important;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.5;
    position: static;
    float: none;
    vertical-align: middle;
}

.mg-product-rating .star-rating::before {
    content: "\2605";
    position: static;
    float: none;
    color: #f59e0b;
    font-size: 0.88rem;
    line-height: 1;
}

.mg-product-rating .star-rating > span {
    position: static !important;
    float: none !important;
    font-size: 0;
    overflow: visible;
    padding-top: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    display: inline;
}

.mg-product-rating .star-rating > span > strong.rating {
    font-size: 0.6rem;
    font-weight: 600;
    color: #b45309;
    display: inline;
}
.mg-product-rating .mg-rating-count {
    font-size: 0.6rem;
    color: var(--mg-text-muted);
}
.mg-product-rating .star-rating::before {
    font-size: 0.6rem;
}

.mg-product-rating .star-rating > span::before {
    content: none !important;
}

/* ==========================================
   بخش دانلودها — حساب کاربری
   ========================================== */

.mg-downloads-section {
    padding: 0;
}

.mg-downloads-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--mg-border);
    position: relative;
}

.mg-downloads-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.mg-download-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    transition: var(--mg-transition);
}

.mg-download-card:hover {
    border-color: var(--mg-primary);
    box-shadow: 0 2px 12px rgba(var(--mg-primary-rgb), 0.08);
}

/* تصویر محصول */
.mg-download-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--mg-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-download-thumb-icon {
    color: var(--mg-text-muted);
    opacity: 0.6;
}

/* اطلاعات */
.mg-download-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mg-download-product {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mg-download-product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mg-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.mg-download-product-name:hover {
    color: var(--mg-primary);
}

.mg-download-filename {
    font-size: 0.75rem;
    color: var(--mg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-download-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mg-download-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.mg-download-badge--remaining {
    background: rgba(var(--mg-primary-rgb), 0.08);
    color: var(--mg-primary);
}

.mg-download-badge--expires {
    background: var(--mg-surface);
    color: var(--mg-text-muted);
    border: 1px solid var(--mg-border);
}

/* دکمه دانلود */
.mg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--mg-gradient-primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--mg-radius);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
}

.mg-download-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

/* موبایل */
@media (max-width: 640px) {
    .mg-download-card {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.875rem;
    }

    .mg-download-thumb {
        width: 48px;
        height: 48px;
    }

    .mg-download-info {
        flex: 1;
        min-width: 0;
    }

    .mg-download-btn {
        width: 100%;
        justify-content: center;
        padding: 0.55rem 1rem;
    }
}

/* ============================================
   بلاگ آرشیو — صفحه لیست مقالات
   ============================================ */

.mg-blog-archive-header {
    background: var(--mg-surface);
    border-bottom: 1px solid var(--mg-border);
    padding: 2.5rem 0 2rem;
    margin-bottom: 0;
}

.mg-blog-archive-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mg-text);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.mg-blog-archive-desc {
    color: var(--mg-text-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

/* آرشیو + سایدبار */
.mg-blog-archive-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.mg-blog-archive-with-sidebar {
    grid-template-columns: 1fr 280px;
    align-items: start;
}

.mg-blog-archive-main {
    min-width: 0;
}

.mg-blog-archive-main .mg-blog-grid {
    align-items: stretch;
}

.mg-blog-archive-main .mg-blog-card {
    min-width: 0;
    height: 100%;
}

.mg-blog-archive-main .mg-blog-image {
    margin: 0;
}

.mg-blog-archive-main .mg-blog-meta {
    flex-wrap: wrap;
    row-gap: 0.45rem;
}

/* ستون‌های گرید */
.mg-blog-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.mg-blog-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.mg-blog-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* حالت لیست */
.mg-blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mg-blog-card--list {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.mg-blog-card--list .mg-blog-image {
    width: 240px;
    flex-shrink: 0;
    aspect-ratio: unset;
    min-height: 160px;
}

.mg-blog-card--list .mg-blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* متا: نویسنده و دسته‌بندی */
.mg-blog-author {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--mg-text-muted);
}

.mg-blog-category {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.08);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
}

.mg-blog-category:hover {
    background: rgba(var(--mg-primary-rgb), 0.16);
}

/* ============================================
   سایدبار بلاگ
   ============================================ */

.mg-blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 100px;
}

.mg-blog-sidebar-widget {
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    padding: 1.25rem;
}

.mg-blog-sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--mg-border);
    position: relative;
}

.mg-blog-sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 36px;
    height: 2px;
    background: var(--mg-primary);
    border-radius: 2px;
}

/* فرم جستجو */
.mg-blog-search-wrap {
    display: flex;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    overflow: hidden;
    background: var(--mg-surface);
}

.mg-blog-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    color: var(--mg-text);
    outline: none;
    font-family: inherit;
}

.mg-blog-search-btn {
    background: var(--mg-primary);
    color: #fff;
    border: none;
    padding: 0 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.mg-blog-search-btn:hover { opacity: 0.85; }

/* لیست دسته‌بندی */
.mg-blog-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mg-blog-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border-radius: var(--mg-radius-sm);
    color: var(--mg-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.15s;
}

.mg-blog-cat-list li a:hover,
.mg-blog-cat-list li.current-cat a {
    background: rgba(var(--mg-primary-rgb), 0.07);
    color: var(--mg-primary);
}

.mg-blog-cat-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mg-primary);
    background: rgba(var(--mg-primary-rgb), 0.1);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

/* آخرین مقالات */
.mg-blog-recent-posts {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.mg-blog-recent-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.mg-blog-recent-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--mg-radius);
    overflow: hidden;
    flex-shrink: 0;
    display: block;
}

.mg-blog-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-blog-recent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mg-blog-recent-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mg-text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-blog-recent-title:hover { color: var(--mg-primary); }

.mg-blog-recent-date {
    font-size: 0.72rem;
    color: var(--mg-text-muted);
}

/* ریسپانسیو */
@media (max-width: 1100px) {
    .mg-blog-archive-with-sidebar {
        grid-template-columns: 1fr 240px;
    }
}

@media (max-width: 900px) {
    .mg-blog-archive-with-sidebar {
        grid-template-columns: 1fr;
    }

    .mg-blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .mg-blog-archive-layout {
        gap: 1.25rem;
    }

    .mg-blog-archive-main .mg-blog-grid,
    .mg-blog-archive-main .mg-blog-grid--cols-2,
    .mg-blog-archive-main .mg-blog-grid--cols-3,
    .mg-blog-archive-main .mg-blog-grid--cols-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mg-blog-archive-main .mg-blog-card {
        border-radius: 18px;
    }

    .mg-blog-archive-main .mg-blog-image {
        aspect-ratio: 16 / 9;
    }

    .mg-blog-archive-main .mg-blog-content {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .mg-blog-archive-title { font-size: 1.35rem; }
    .mg-blog-archive-header { padding: 1.5rem 0 1.25rem; }

    .mg-blog-grid--cols-2,
    .mg-blog-grid--cols-3,
    .mg-blog-grid--cols-4 { grid-template-columns: 1fr; }

    .mg-blog-card--list {
        flex-direction: column;
    }

    .mg-blog-card--list .mg-blog-image {
        width: 100%;
        min-height: unset;
        aspect-ratio: 16/9;
    }

    .mg-blog-archive-main .mg-blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .mg-blog-archive-main .mg-blog-date,
    .mg-blog-archive-main .mg-blog-category {
        white-space: nowrap;
    }

    .mg-blog-archive-main .mg-blog-author {
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mg-blog-archive-main .mg-blog-link {
        width: 100%;
    }

    .mg-blog-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   اکانت کاربری — ریسپانسیو فرم‌ها و صفحات داخلی
   (اینجا بعد از base CSS است تا درست override کند)
   ============================================ */

@media (max-width: 768px) {
    /* فرم لاگین/ثبت‌نام: دو ستون → یک ستون */
    .woocommerce-account:not(.logged-in) .u-columns.col2-set,
    .mg-login-forms-wrap .u-columns.col2-set {
        grid-template-columns: 1fr !important;
    }

    /* پدینگ کارت‌های فرم */
    .woocommerce-account .u-columns .col-1,
    .woocommerce-account .u-columns .col-2,
    .mg-login-forms-wrap .col-1,
    .mg-login-forms-wrap .col-2 {
        padding: 1.75rem 1.5rem !important;
    }

    /* لاگین هرو */
    .mg-login-hero-title { font-size: 1.6rem; }
    .mg-login-hero-icon { width: 72px; height: 72px; }
}

@media (max-width: 640px) {
    /* پدینگ کمتر */
    .woocommerce-account .u-columns .col-1,
    .woocommerce-account .u-columns .col-2,
    .mg-login-forms-wrap .col-1,
    .mg-login-forms-wrap .col-2 {
        padding: 1.25rem !important;
    }

    /* ریست پسورد */
    .woocommerce-account .woocommerce-ResetPassword {
        padding: 1.25rem !important;
        margin: 0.5rem auto;
    }

    /* فهرست آدرس‌ها: دو ستون → یک ستون */
    .woocommerce-Addresses .woocommerce-Address {
        width: 100% !important;
        float: none !important;
        margin: 0 0 1.25rem !important;
    }

    /* لاگین هرو کوچک‌تر */
    .mg-login-hero-title { font-size: 1.35rem; }
    .mg-login-hero-icon { width: 60px; height: 60px; }
    .mg-login-hero-sub { font-size: 0.88rem; }
    .mg-login-page-wrap { padding: 1rem 0 2rem; }
    .mg-login-hero { margin-bottom: 1.5rem; }

    /* پدینگ داخلی محتوای اکانت */
    .mg-account-content { padding: 1.25rem !important; }
}



/* ============================================
   Cart Page
   ============================================ */

/* Page */
.mg-cart-page {
    background: #f8fafc;
    min-height: 80vh;
}

.mg-cart-page--header {
    min-height: 0;
}

.mg-cart-page--header .mg-cp-banner {
    margin-bottom: 0;
}

.mg-cart-page--content {
    padding-top: 2rem;
}

/* Gradient banner header — matches shop page style */
.mg-cp-banner {
    background: var(--mg-gradient-primary);
    padding: 1.1rem 0;
    margin-bottom: 2rem;
}
.mg-cp-banner .mg-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mg-cp-banner-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.mg-cp-banner-title svg {
    opacity: 0.9;
}
.mg-cp-badge {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--mg-radius-full);
    line-height: 1.6;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Two-column layout */
.mg-cp-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 1.5rem;
    align-items: start;
    padding-bottom: 3.5rem;
}

.mg-cp-layout--no-summary {
    grid-template-columns: minmax(0, 1fr);
}

/* Main column */
.mg-cp-main {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    border: 1px solid var(--mg-border);
    overflow: hidden;
    box-shadow: var(--mg-shadow-sm);
}

/* Table wrapper */
.mg-cp-table { width: 100%; max-height: 380px; overflow-y: overlay; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.18) transparent; }
.mg-cp-table::-webkit-scrollbar { width: 4px; }
.mg-cp-table::-webkit-scrollbar-track { background: transparent; }
.mg-cp-table::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 4px; min-height: 32px; }
.mg-cp-table::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.35); }

/* 6-column grid row */
.mg-cp-row {
    display: grid;
    grid-template-columns: 78px 1fr 110px 128px 108px 40px;
    align-items: center;
}

/* Header row */
.mg-cp-row--head {
    background: var(--mg-surface);
    border-bottom: 1px solid var(--mg-border);
    padding: 0.7rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1;
}
.mg-cp-row--head .mg-cp-col {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mg-cp-row--head .mg-cp-col--price,
.mg-cp-row--head .mg-cp-col--qty,
.mg-cp-row--head .mg-cp-col--total { text-align: center; }

/* Item rows */
.mg-cp-row--item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--mg-surface);
    transition: background var(--mg-transition-fast);
}
.mg-cp-row--item:last-child { border-bottom: none; }
.mg-cp-row--item:hover { background: var(--mg-surface); }

/* Column base */
.mg-cp-col { padding: 0 0.4rem; }
.mg-cp-col--img { padding: 0; }
.mg-cp-col--del { padding: 0; display: flex; align-items: center; justify-content: center; }
.mg-cp-col--price,
.mg-cp-col--qty,
.mg-cp-col--total { text-align: center; }

/* Thumbnail */
.mg-cp-img-link {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: var(--mg-radius-sm);
    overflow: hidden;
    background: var(--mg-surface);
    flex-shrink: 0;
}
.mg-cp-col--img img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--mg-radius-sm);
    background: var(--mg-surface);
}

/* Product name */
.mg-cp-col--product { min-width: 0; }
.mg-cp-product-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mg-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    transition: color var(--mg-transition-fast);
}
.mg-cp-product-name:hover { color: var(--mg-primary); }
.woocommerce-cart-item-data { font-size: 0.77rem; color: var(--mg-text-muted); margin-top: 0.2rem; }

/* Unit price */
.mg-cp-col--price { font-size: 0.87rem; color: var(--mg-text-muted); }
.mg-cp-col--price del,
.mg-cp-col--price del .woocommerce-Price-amount,
.mg-cp-col--price del bdi { font-size: 0.75rem; color: #bbb; text-decoration: line-through; display: block; }
.mg-cp-col--price ins { text-decoration: none; display: block; font-weight: 700; color: var(--mg-text); }
.mg-cp-col--price .mg-price-wrap {
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
.mg-cp-col--price .mg-price-col {
    align-items: center;
    gap: 0.1rem;
}
.mg-cp-col--price .mg-price-col .woocommerce-Price-amount,
.mg-cp-col--price .mg-price-col ins {
    font-size: 0.87rem;
    line-height: 1.35;
}
.mg-cp-col--price .mg-toman-icon {
    width: auto;
    max-width: none;
    height: 1.4rem;
    opacity: 0.25;
}

/* Quantity stepper */
.mg-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius-sm);
    overflow: hidden;
    background: var(--mg-bg);
    width: 108px;
    transition: border-color var(--mg-transition-fast);
    position: relative;
}
.mg-stepper:focus-within { border-color: var(--mg-primary); }
.mg-step-btn {
    flex-shrink: 0;
    width: 30px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-text-muted);
    transition: background var(--mg-transition-fast), color var(--mg-transition-fast);
}
.mg-step-btn:hover {
    background: var(--mg-surface);
    color: var(--mg-primary);
}
.mg-qty-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mg-text);
    font-family: inherit;
    background: none;
    padding: 0;
    -moz-appearance: textfield;
}
.mg-qty-input::-webkit-outer-spin-button,
.mg-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Row total */
.mg-cp-row-total {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--mg-primary);
}

/* Delete button */
.mg-cp-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--mg-radius-sm);
    color: var(--mg-border);
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--mg-transition-fast), color var(--mg-transition-fast);
}
.mg-cp-remove:hover {
    background: rgba(239,68,68,0.08);
    color: var(--mg-error);
}

/* ── Sidebar summary ── */
.mg-cp-side { position: sticky; top: 90px; }
.mg-cp-side--static { position: static; }
.mg-cp-summary {
    background: var(--mg-bg);
    border-radius: var(--mg-radius-lg);
    border: none;
    padding: 1.5rem;
    box-shadow: var(--mg-shadow-sm);
}
.mg-cp-summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-text);
    margin: 0 0 1.25rem;
    padding-bottom: 1rem;
    border-bottom: none;
}
.mg-cp-summary-rows { margin-bottom: 1.25rem; }
.mg-cp-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    font-size: 0.875rem;
    color: var(--mg-text-muted);
    border-bottom: none;
}
.mg-cp-summary-row:last-of-type { border-bottom: none; }
.mg-cp-summary-total {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mg-text);
    padding: 0.85rem 0 0;
    margin-top: 0.25rem;
    border-top: none !important;
    border-bottom: none !important;
}
.mg-summary-grand { color: var(--mg-primary); font-size: 1.1rem; }
.mg-cp-summary .woocommerce-Price-amount::after {
    content: ' تومان';
    margin-inline-start: 0.25rem;
    font-size: 0.85em;
    font-weight: inherit;
}
.mg-summary-discount { color: var(--mg-success); }
.mg-cp-summary-row .woocommerce-remove-coupon {
    font-size: 0.75rem;
    color: var(--mg-error);
    text-decoration: none;
    margin-inline-start: 0.4rem;
    opacity: 0.7;
    transition: opacity var(--mg-transition-fast);
}
.mg-cp-summary-row .woocommerce-remove-coupon:hover { opacity: 1; }

/* Checkout button */
.mg-cp-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    color: #fff !important;
}
.mg-cp-checkout-btn:hover,
.mg-cp-checkout-btn:focus,
.mg-cp-checkout-btn:active,
.mg-cp-checkout-btn:visited {
    color: #fff !important;
}

/* Continue shopping */
.mg-cp-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(100, 116, 139, 0.22);
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.04);
    font-size: 0.85rem;
    color: var(--mg-text-muted);
    text-decoration: none;
    transition: var(--mg-transition);
    margin: 0 auto 1.25rem;
}
.mg-cp-continue:hover {
    color: var(--mg-primary);
    border-color: rgba(16, 163, 127, 0.4);
    background: rgba(16, 163, 127, 0.08);
}

/* Trust badges */
.mg-cp-trust {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: none;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.mg-cp-trust span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--mg-text-muted);
}
.mg-cp-trust svg { color: var(--mg-success); flex-shrink: 0; }

/* ── Responsive: laptop narrow ── */
@media (max-width: 1024px) {
    .mg-cp-layout { grid-template-columns: 1fr 280px; }
}
@media (max-width: 860px) {
    .mg-cp-layout { grid-template-columns: 1fr; }
    .mg-cp-side { position: static; }
}

/* ── Responsive: tablet — hide price column ── */
@media (max-width: 720px) {
    .mg-cp-row { grid-template-columns: 66px 1fr 108px 90px 36px; }
    .mg-cp-col--price { display: none; }
    .mg-stepper { width: 96px; }
    .mg-step-btn { width: 28px; }
}

/* ── Responsive: mobile ── */
@media (max-width: 480px) {
    .mg-cart-page { padding: 0 0 3rem; }
    .mg-cp-banner { padding: 0.875rem 0; margin-bottom: 1.25rem; }
    .mg-cp-banner-title { font-size: 1.2rem; }
    .mg-cp-row--head { display: none; }

    .mg-cp-row--item {
        position: relative;
        display: grid;
        grid-template-columns: 62px 1fr;
        grid-template-rows: auto auto auto;
        column-gap: 0.75rem;
        row-gap: 0.4rem;
        padding: 0.875rem;
    }
    /* Image spans all 3 rows */
    .mg-cp-col--img {
        grid-column: 1;
        grid-row: 1 / 4;
        align-self: start;
        padding: 0;
        width: 62px;
    }
    .mg-cp-col--img img,
    .mg-cp-img-link { width: 62px !important; height: 62px !important; }
    /* Product name — row 1, leave physical-left space for delete button */
    .mg-cp-col--product {
        grid-column: 2;
        grid-row: 1;
        padding: 0 0 0 2.5rem;
        min-width: 0;
        align-self: start;
    }
    /* Hide unit price on mobile */
    .mg-cp-col--price { display: none; }
    /* Stepper — row 2 */
    .mg-cp-col--qty {
        grid-column: 2;
        grid-row: 2;
        padding: 0;
        text-align: start;
    }
    .mg-stepper { width: 96px; }
    .mg-step-btn { width: 28px; height: 34px; }
    /* Total — row 3 */
    .mg-cp-col--total {
        grid-column: 2;
        grid-row: 3;
        padding: 0;
        text-align: start;
        font-size: 0.85rem;
    }
    /* Delete — absolute top-left (physical = end side in RTL) */
    .mg-cp-col--del {
        position: absolute;
        top: 0.875rem;
        left: 0.875rem;
        padding: 0;
    }
    .mg-cp-summary { padding: 1.25rem; }
}

/* ── Empty Cart ── */
.mg-empty-cart {
    padding: 5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
}
.mg-ec-inner { text-align: center; max-width: 420px; width: 100%; }
.mg-ec-icon { margin-bottom: 1.75rem; }
.mg-ec-icon svg { width: 100px; height: 100px; }
.mg-ec-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 0.6rem;
}
.mg-ec-sub {
    font-size: 0.95rem;
    color: var(--mg-text-muted);
    line-height: 1.75;
    margin-bottom: 2rem;
}
.mg-empty-cart .mg-btn { padding: 0.85rem 2.25rem; font-size: 1rem; }
.mg-ec-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--mg-border);
    flex-wrap: wrap;
}
.mg-ec-badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--mg-text-muted);
}
.mg-ec-badges span svg { color: var(--mg-success); flex-shrink: 0; }

/* ── Cross-sells ── */
.mg-cross-sells { padding: 2.5rem 0; border-top: 1px solid var(--mg-border); }
.mg-cross-sells-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.mg-cross-sells-title svg { color: var(--mg-accent); }

/* ── Cart Loader ── */
#mg-cart-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
#mg-cart-loader.mg-cart-loader--visible { pointer-events: all; opacity: 1; }
.mg-cart-loader-inner {
    background: rgba(255,255,255,0.92);
    border-radius: var(--mg-radius);
    padding: 1rem 1.4rem;
    box-shadow: var(--mg-shadow-lg);
    backdrop-filter: blur(4px);
}
.mg-cart-spinner {
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--mg-border);
    border-top-color: var(--mg-primary);
    border-radius: 50%;
    animation: mg-spin 0.7s linear infinite;
}
@keyframes mg-spin { to { transform: rotate(360deg); } }

/* ── Cart Notice ── */
.mg-cart-notice {
    padding: 0.65rem 1rem;
    border-radius: var(--mg-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.mg-cart-notice--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.mg-cart-notice--error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.mg-cart-notice--info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Star Rating Fix ── */

.mg-empty-cart {
    padding: 5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
}

.mg-ec-inner {
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.mg-ec-icon {
    margin-bottom: 1.75rem;
}

.mg-ec-icon svg {
    width: 100px;
    height: 100px;
}

.mg-ec-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 0.6rem;
}

.mg-ec-sub {
    font-size: 0.95rem;
    color: var(--mg-text-muted);
    line-height: 1.75;
    margin-bottom: 2rem;
}

.mg-empty-cart .mg-btn {
    padding: 0.85rem 2.25rem;
    font-size: 1rem;
}
.mg-empty-cart .mg-btn-primary,
.mg-empty-cart .mg-btn-primary:hover,
.mg-empty-cart .mg-btn-primary:focus,
.mg-empty-cart .mg-btn-primary:active,
.mg-empty-cart .mg-btn-primary:visited {
    color: #fff !important;
}

.mg-ec-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--mg-border);
    flex-wrap: wrap;
}

.mg-ec-badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--mg-text-muted);
}

.mg-ec-badges span svg {
    color: #059669;
    flex-shrink: 0;
}

/* ============================================
   Cross-sells
   ============================================ */
.mg-cross-sells {
    padding: 2.5rem 0;
    border-top: 1px solid var(--mg-border);
}

.mg-cross-sells-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mg-text);
    margin-bottom: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.mg-cross-sells-title svg {
    color: var(--mg-accent);
}

/* ============================================
   Star Rating Fix
   ============================================ */
.star-rating {
    overflow: hidden;
    position: relative;
    height: 1.2em;
    line-height: 1.2;
    font-size: 1em;
    width: 5.4em;
    font-family: inherit;
}

.star-rating::before {
    content: "\2605\2605\2605\2605\2605";
    color: #ddd;
    float: right;
    top: 0;
    left: 0;
    position: absolute;
    letter-spacing: 0.1em;
}

.star-rating span {
    overflow: hidden;
    float: right;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.star-rating span::before {
    content: "\2605\2605\2605\2605\2605";
    top: 0;
    position: absolute;
    left: 0;
    color: #f59e0b;
    letter-spacing: 0.1em;
}



/* ============================================
   Checkout Block – Professional Design
   ============================================ */

/* Page wrapper */
.mg-checkout-page {
    background: #f8fafc;
    min-height: 80vh;
}

.mg-checkout-page--header {
    min-height: 0;
}

.mg-checkout-page--header .mg-cp-banner {
    margin-bottom: 0;
}

.mg-checkout-page--content {
    padding-top: 0;
}

/* Block content wrapper */
.mg-checkout-content {
    padding: 2rem 0 4rem;
}

/* Block checkout wrapper — centered with own max-width */
.wc-block-checkout.wp-block-woocommerce-checkout {
    direction: rtl;
    margin: 0 auto !important;
    padding: 0 clamp(1.5rem, 3vw, 3rem) !important;
    max-width: 1400px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Two-column layout — flex with high-specificity selector to beat WC block CSS */
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 2rem !important;
    align-items: start !important;
    width: 100% !important;
    direction: rtl !important;
}

/* Main form — grows to fill remaining space */
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-main,
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Sidebar — fixed width, never shrinks */
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar,
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar,
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar.is-large,
.wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar.is-large {
    flex: 0 0 420px !important;
    width: 420px !important;
    min-width: 420px !important;
    max-width: 420px !important;
}

@media (max-width: 1200px) {
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar.is-large,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar.is-large {
        flex-basis: 380px !important;
        width: 380px !important;
        min-width: 380px !important;
        max-width: 380px !important;
    }
}

@media (max-width: 960px) {
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout {
        flex-direction: column !important;
    }
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-main,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__main {
        width: 100% !important;
    }
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-components-sidebar.is-large,
    .wc-block-checkout.wp-block-woocommerce-checkout .wc-block-checkout__sidebar.is-large {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }
    /* در موبایل/تبلت لیست آیتم‌ها محدود نشه تا مجموع پایین دیده بشه */
    .wc-block-checkout .wc-block-components-order-summary__items,
    .wc-block-checkout ul.wc-block-components-order-summary__items,
    .wc-block-checkout .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item),
    .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-cart-items-block {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Main form column */
.wc-block-checkout .wc-block-components-main {
    background: var(--mg-bg) !important;
    border-radius: var(--mg-radius-lg) !important;
    border: 1px solid var(--mg-border) !important;
    overflow: hidden;
    padding: 0 !important;
    box-shadow: var(--mg-shadow-sm) !important;
}

/* Checkout steps / sections */
.wc-block-checkout .wc-block-components-checkout-step {
    padding: 1.5rem 1.75rem !important;
    border-bottom: 1px solid var(--mg-surface) !important;
    background: none !important;
}
.wc-block-checkout .wc-block-components-checkout-step:last-of-type {
    border-bottom: none !important;
}
.wc-block-checkout .wc-block-components-checkout-step::before {
    display: none !important;
}
.wc-block-checkout .wc-block-checkout__contact-fields .wc-block-components-checkout-step__heading-container,
.wc-block-checkout #contact-fields .wc-block-components-checkout-step__heading-container,
.wc-block-checkout .wc-block-checkout__contact-fields .wc-block-components-checkout-step__description,
.wc-block-checkout #contact-fields .wc-block-components-checkout-step__description {
    display: none !important;
}
body.logged-in.woocommerce-checkout .wc-block-checkout .wc-block-checkout__contact-fields,
body.logged-in.woocommerce-checkout .wc-block-checkout #contact-fields {
    display: none !important;
}

/* Step heading */
.wc-block-checkout .wc-block-components-checkout-step__heading-container {
    margin-bottom: 1.25rem;
}
.wc-block-checkout .wc-block-components-checkout-step__title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--mg-text) !important;
    font-family: inherit !important;
}

/* Text inputs */
.wc-block-checkout .wc-block-components-text-input {
    position: relative !important;
    margin-bottom: 1.1rem !important;
}
.wc-block-checkout .wc-block-components-text-input input[type="text"],
.wc-block-checkout .wc-block-components-text-input input[type="email"],
.wc-block-checkout .wc-block-components-text-input input[type="tel"],
.wc-block-checkout .wc-block-components-text-input input[type="password"] {
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    border: 1.5px solid var(--mg-border) !important;
    border-radius: var(--mg-radius-sm) !important;
    padding: 1.55rem 1.25rem 0.62rem !important;
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
    font-family: inherit !important;
    color: var(--mg-text) !important;
    background: var(--mg-bg) !important;
    transition: border-color var(--mg-transition-fast), box-shadow var(--mg-transition-fast) !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
.wc-block-checkout .wc-block-components-text-input input:focus {
    border-color: var(--mg-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mg-primary-rgb),0.08) !important;
}
.wc-block-checkout .wc-block-components-text-input label {
    position: absolute !important;
    top: 0.48rem !important;
    inset-inline-start: 1.25rem !important;
    z-index: 2 !important;
    font-size: 0.78rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    pointer-events: none !important;
}
.wc-block-checkout .wc-block-components-text-input.mg-fa-input-active input {
    color: transparent !important;
    caret-color: var(--mg-primary);
}
.wc-block-checkout .wc-block-components-text-input.mg-fa-input-active::after {
    content: attr(data-fa-value);
    position: absolute;
    inset-inline: 1.25rem;
    bottom: 0.72rem;
    z-index: 2;
    color: var(--mg-text);
    direction: rtl;
    text-align: start;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Country / state select */
.wc-block-checkout .wc-blocks-components-select__container {
    position: relative !important;
    margin-bottom: 1.1rem !important;
}
.wc-block-checkout .wc-blocks-components-select__select {
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    border: 1.5px solid var(--mg-border) !important;
    border-radius: var(--mg-radius-sm) !important;
    padding: 1.55rem 1.25rem 0.62rem 3rem !important;
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
    font-family: inherit !important;
    color: var(--mg-text) !important;
    background: var(--mg-bg) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}
.wc-block-checkout .wc-blocks-components-select__label {
    position: absolute !important;
    top: 0.48rem !important;
    inset-inline-start: 1.25rem !important;
    z-index: 2 !important;
    font-size: 0.78rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
    display: block !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    pointer-events: none !important;
}
.wc-block-checkout .wc-blocks-components-select__expand {
    position: absolute !important;
    left: 1.1rem !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--mg-text-muted) !important;
    pointer-events: none !important;
}

/* Address form grid */
.wc-block-checkout .wc-block-components-address-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 1rem !important;
}
.wc-block-checkout .wc-block-components-address-form__country,
.wc-block-checkout .wc-block-components-address-form__address_1,
.wc-block-checkout .wc-block-components-address-form__address_2-toggle {
    grid-column: 1 / -1 !important;
}
.wc-block-checkout .wc-block-components-address-form__address_2-toggle {
    font-size: 0.82rem !important;
    color: var(--mg-primary) !important;
    cursor: pointer !important;
    padding: 0.25rem 0 0.75rem !important;
    display: block !important;
}

/* Shipping / payment radio options */
.wc-block-checkout .wc-block-components-radio-control__option {
    border: none !important;
    border-radius: var(--mg-radius-sm) !important;
    padding: 0.85rem 2.5rem 0.85rem 1rem !important;
    margin-bottom: 0.6rem !important;
    cursor: pointer !important;
    transition: background var(--mg-transition-fast) !important;
    display: block !important;
    position: relative !important;
}

/* radio button در سمت راست (RTL) */
.wc-block-checkout .wc-block-components-radio-control__option > .wc-block-components-radio-control__input {
    position: absolute !important;
    right: 1rem !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/* label عرض کامل بگیره، padding-right برای جای radio */
.wc-block-checkout .wc-block-components-radio-control__option > .wc-block-components-radio-control__label {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: start !important;
}
.wc-block-checkout .wc-block-components-radio-control__option:hover {
    background: rgba(var(--mg-primary-rgb),0.04) !important;
}
.wc-block-checkout .wc-block-components-radio-control__option-checked,
.wc-block-checkout .wc-block-components-radio-control__option--checked-option-highlighted {
    background: rgba(var(--mg-primary-rgb),0.06) !important;
}
.wc-block-checkout .wc-block-components-radio-control__input {
    accent-color: var(--mg-primary) !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}
.wc-block-checkout .wc-block-components-radio-control__label {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: var(--mg-text) !important;
    font-family: inherit !important;
}
.wc-block-checkout .wc-block-components-radio-control__secondary-label {
    font-size: 0.82rem !important;
    color: var(--mg-success) !important;
    font-weight: 600 !important;
}
.wc-block-checkout .wc-block-components-radio-control-accordion-option {
    border: 0 !important;
    border-radius: var(--mg-radius-sm) !important;
    margin-bottom: 0.6rem !important;
    overflow: hidden !important;
    transition: border-color var(--mg-transition-fast) !important;
    box-shadow: none !important;
}
.wc-block-checkout .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
    border-color: transparent !important;
    box-shadow: none !important;
}
/* حذف box-shadow از گزینه انتخاب‌شده (override قانون پیش‌فرض WC با specificity بالا) */
.wc-block-checkout .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-checkout .wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted {
    box-shadow: none !important;
    outline: none !important;
}
.wc-block-checkout .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option,
.wc-block-checkout .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option:hover,
.wc-block-checkout .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option-checked,
.wc-block-checkout .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option--checked-option-highlighted {
    border: 0 !important;
    box-shadow: none !important;
}
.wc-block-checkout .wc-block-components-checkout-payment-methods-block .wc-block-components-radio-control__option,
.wc-block-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__option {
    border: 0 !important;
    box-shadow: none !important;
}
.wc-block-checkout .wc-block-components-radio-control-accordion-content {
    padding: 0 1rem 0.85rem !important;
    font-size: 0.83rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
    line-height: 1.65 !important;
    border: 0 !important;
}

/* Checkboxes */
.wc-block-checkout .wc-block-components-checkbox__input {
    accent-color: var(--mg-primary) !important;
    width: 16px !important;
    height: 16px !important;
}
.wc-block-checkout .wc-block-components-checkbox__label {
    font-size: 0.85rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
}

/* Order notes */
.wc-block-checkout__order-notes {
    padding: 1.25rem 1.75rem !important;
    border-bottom: 1px solid var(--mg-surface) !important;
}

/* Terms and conditions */
.wc-block-checkout__terms {
    padding: 1rem 1.75rem !important;
    font-size: 0.82rem !important;
    color: var(--mg-text-muted) !important;
    border-top: 1px solid var(--mg-surface) !important;
    font-family: inherit !important;
}

/* Place order button */
.wc-block-checkout__actions {
    padding: 1.25rem 1.75rem 1.75rem !important;
}
.wc-block-checkout__actions_row {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}
.wc-block-components-checkout-place-order-button {
    width: 100% !important;
    padding: 1rem !important;
    background: var(--mg-gradient-primary) !important;
    border-radius: var(--mg-radius) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    border: none !important;
    cursor: pointer !important;
    color: #fff !important;
    transition: opacity 0.15s, transform 0.15s !important;
    order: -1 !important;
}
.wc-block-components-checkout-place-order-button:hover,
.wc-block-components-checkout-place-order-button:focus,
.wc-block-components-checkout-place-order-button:active,
.wc-block-components-checkout-place-order-button:visited {
    color: #fff !important;
    opacity: 0.92 !important;
    transform: translateY(-1px) !important;
}
.wc-block-components-checkout-return-to-cart-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    font-size: 0.85rem !important;
    color: var(--mg-text-muted) !important;
    text-decoration: none !important;
    justify-content: center !important;
    font-family: inherit !important;
    transition: color var(--mg-transition-fast) !important;
}
.wc-block-components-checkout-return-to-cart-button:hover { color: var(--mg-primary) !important; }

/* Sidebar order summary */
.wc-block-checkout .wc-block-components-sidebar,
.wc-block-checkout .wc-block-checkout__sidebar {
    background: var(--mg-bg) !important;
    border-radius: var(--mg-radius-lg) !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    position: sticky !important;
    top: 88px !important;
    max-height: calc(100dvh - 140px) !important;
    overflow: hidden !important;
    scrollbar-width: none !important;
    scrollbar-color: transparent transparent !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
}

@media (min-width: 961px) {
    .wc-block-checkout .wc-block-components-sidebar,
    .wc-block-checkout .wc-block-checkout__sidebar {
        top: 88px !important;
        height: auto !important;
        /* ارتفاع طبیعی بر اساس محتوا؛ حداکثر برای جا شدن کامل در viewport هنگام ریلود */
        min-height: 0 !important;
        max-height: calc(100dvh - 140px) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary-block,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary-block,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-panel__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-panel__content {
        min-height: 0 !important;
    }

    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary-block,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary-block,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary {
        flex: 1 1 auto !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }

    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-panel__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-panel__content {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }

    .wc-block-checkout .wc-block-components-checkout-order-summary__title {
        flex: 0 0 auto !important;
    }

    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-wrapper,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-coupon,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-footer-item,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-footer-item {
        flex: 0 0 auto !important;
    }

    /* استایل تیکتی برای بخش کوپن/جمع کل: خط‌چین وسط دو نیم‌دایره کناره‌ها */
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-coupon {
        position: relative !important;
    }
    /* خط‌چین افقی در بالای کوپن — رنگ هماهنگ با پس‌زمینه صفحه */
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon::before,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-coupon::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 24px !important;
        right: 24px !important;
        height: 3px !important;
        background-image: repeating-linear-gradient(
            to right,
            #f1f5f9 0,
            #f1f5f9 14px,
            transparent 14px,
            transparent 30px
        ) !important;
        pointer-events: none !important;
        z-index: 2 !important;
    }
    /* دو نیم‌دایره روی لبه‌های چپ و راست دقیقاً روی خط‌چین — هم‌رنگ بک‌گراند صفحه */
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon::after,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-coupon::after {
        content: '' !important;
        position: absolute !important;
        top: -15px !important;
        left: 0 !important;
        right: 0 !important;
        height: 30px !important;
        pointer-events: none !important;
        z-index: 3 !important;
        background:
            radial-gradient(circle 15px at 0 50%, #f1f5f9 0 14px, transparent 15px),
            radial-gradient(circle 15px at 100% 50%, #f1f5f9 0 14px, transparent 15px) !important;
        background-repeat: no-repeat !important;
    }
}

.wc-block-checkout .wc-block-components-sidebar::-webkit-scrollbar,
.wc-block-checkout .wc-block-checkout__sidebar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}
.wc-block-checkout .wc-block-components-sidebar::-webkit-scrollbar-track,
.wc-block-checkout .wc-block-checkout__sidebar::-webkit-scrollbar-track { background: transparent; }
.wc-block-checkout .wc-block-components-sidebar::-webkit-scrollbar-thumb,
.wc-block-checkout .wc-block-checkout__sidebar::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: var(--mg-radius-full);
}
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content,
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary-block,
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-panel,
.wc-block-checkout .wc-block-components-sidebar .wc-block-components-panel__content,
.wc-block-checkout .wc-block-components-sidebar [class*="wc-block-components-totals"],
.wc-block-checkout .wc-block-components-sidebar [class*="wc-block-components-order-summary"],
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-totals-wrapper,
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary,
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content,
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary-block,
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-panel,
.wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-panel__content,
.wc-block-checkout .wc-block-checkout__sidebar [class*="wc-block-components-totals"],
.wc-block-checkout .wc-block-checkout__sidebar [class*="wc-block-components-order-summary"] {
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}
/* حذف کامل بوردر از خود کانتینر سایدبار و تمام descendant‌هاش */
.wc-block-checkout .wc-block-components-sidebar,
.wc-block-checkout .wc-block-checkout__sidebar,
.wc-block-checkout .wc-block-components-sidebar *,
.wc-block-checkout .wc-block-checkout__sidebar * {
    border: 0 !important;
    border-inline: 0 !important;
    border-block: 0 !important;
}
.wc-block-checkout .wc-block-components-checkout-order-summary__title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0.9rem 1.25rem !important;
    border-bottom: none !important;
    cursor: pointer !important;
}
.wc-block-checkout .wc-block-components-checkout-order-summary__title-text {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--mg-text) !important;
    font-family: inherit !important;
    margin: 0 !important;
}
.wc-block-checkout .wc-block-components-checkout-order-summary__title-price {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--mg-primary) !important;
    font-family: inherit !important;
}
.wc-block-checkout .wc-block-components-checkout-order-summary__title-icon {
    display: none !important;
}

/* Order items container — force vertical list, not thumbnail grid */
.wc-block-checkout .wc-block-components-order-summary__items,
.wc-block-checkout .wc-block-components-order-summary__content,
.wc-block-checkout .wc-block-components-panel__content {
    display: block !important;
}
@media (min-width: 961px) {
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-panel__content,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-panel__content {
        min-height: 0 !important;
    }
}
.wc-block-checkout .wc-block-components-order-summary__items {
    padding: 0 1.25rem !important;
}
.wc-block-checkout .wc-block-components-order-summary__items ul,
.wc-block-checkout ul.wc-block-components-order-summary__items {
    display: flex !important;
    flex-direction: column !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
}

@media (min-width: 961px) {
    /* wrapper بیرونی: فقط برش می‌کنه، اسکرول نداره؛ ارتفاعش از عنصر داخلی میاد */
    .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-cart-items-block.wc-block-components-totals-wrapper,
    .wc-block-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-cart-items-block,
    .wc-block-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-cart-items-block {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }

    /* اسکرول روی داخلی‌ترین ناحیه — حداکثر ~۱.۵ آیتم دیده بشه تا totals پایین همیشه نمایان باشه */
    .wc-block-checkout .wc-block-components-order-summary__items,
    .wc-block-checkout ul.wc-block-components-order-summary__items {
        max-height: 130px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(var(--mg-primary-rgb), 0.28) transparent !important;
    }

    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item),
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item) {
        max-height: 130px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(var(--mg-primary-rgb), 0.28) transparent !important;
    }

    .wc-block-checkout .wc-block-components-order-summary__items::-webkit-scrollbar,
    .wc-block-checkout ul.wc-block-components-order-summary__items::-webkit-scrollbar,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar {
        width: 5px !important;
    }

    .wc-block-checkout .wc-block-components-order-summary__items::-webkit-scrollbar-track,
    .wc-block-checkout ul.wc-block-components-order-summary__items::-webkit-scrollbar-track,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar-track,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar-track {
        background: transparent !important;
    }

    .wc-block-checkout .wc-block-components-order-summary__items::-webkit-scrollbar-thumb,
    .wc-block-checkout ul.wc-block-components-order-summary__items::-webkit-scrollbar-thumb,
    .wc-block-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar-thumb,
    .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary__content:has(> .wc-block-components-order-summary-item)::-webkit-scrollbar-thumb {
        background: rgba(var(--mg-primary-rgb), 0.24) !important;
        border-radius: var(--mg-radius-full) !important;
    }
}

/* Order items in sidebar */
.wc-block-checkout .wc-block-components-order-summary-item {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 0.9rem !important;
    row-gap: 0.2rem !important;
    align-items: start !important;
    padding: 0.7rem 0 !important;
    border-bottom: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__image {
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 56px !important;
    align-self: start !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__image img {
    border-radius: var(--mg-radius-sm) !important;
    object-fit: cover !important;
    width: 56px !important;
    height: 56px !important;
    background: var(--mg-surface) !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__quantity {
    background: var(--mg-primary) !important;
    color: #fff !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    border-radius: var(--mg-radius-full) !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    left: auto !important;
}
/* ناحیه اسم + قیمت واحد */
.wc-block-checkout .wc-block-components-order-summary-item__description {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
    padding: 0 !important;
}
.wc-block-checkout .wc-block-components-product-name {
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    color: var(--mg-text) !important;
    font-family: inherit !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    line-height: 1.55 !important;
}
.wc-block-checkout .wc-block-components-product-price__value,
.wc-block-checkout .wc-block-components-product-price {
    font-size: 0.75rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
    white-space: normal !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price,
.wc-block-checkout .wc-block-components-order-summary-item__individual-prices {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.08rem !important;
    margin-top: 0.05rem !important;
    line-height: 1.35 !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price::before,
.wc-block-checkout .wc-block-components-order-summary-item__individual-prices::before {
    content: 'قیمت واحد';
    color: var(--mg-text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.8;
}
.wc-block-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price__regular,
.wc-block-checkout .wc-block-components-order-summary-item__description del {
    display: block !important;
    color: var(--mg-text-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
    opacity: 0.72 !important;
    white-space: nowrap !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price__value,
.wc-block-checkout .wc-block-components-order-summary-item__description ins {
    display: block !important;
    color: var(--mg-primary) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}
.wc-block-checkout .wc-block-components-product-sale-badge,
.wc-block-checkout .wc-block-components-sale-badge,
.wc-block-checkout .wc-block-components-product-price__discount,
.wc-block-checkout .wc-block-components-product-price__sale-badge {
    display: none !important;
}
/* قیمت نهایی ردیف */
.wc-block-checkout .wc-block-components-order-summary-item__total-price {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    font-weight: 700 !important;
    color: var(--mg-primary) !important;
    font-family: inherit !important;
    font-size: 0.86rem !important;
    white-space: nowrap !important;
    text-align: start !important;
    justify-self: start !important;
    line-height: 1.35 !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__total-price::before {
    content: 'مجموع';
    color: var(--mg-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}
.wc-block-checkout .wc-block-components-product-metadata { display: none !important; }

/* Coupon panel */
.wc-block-checkout .wc-block-components-totals-coupon {
    border-top: none !important;
    border-bottom: none !important;
    padding: 0.75rem 1.25rem !important;
    margin-top: 0.15rem !important;
    position: relative !important;
    isolation: isolate !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button {
    font-size: 0.85rem !important;
    color: var(--mg-primary) !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0.5rem !important;
    background: rgba(var(--mg-primary-rgb), 0.05) !important;
    border: none !important;
    border-radius: var(--mg-radius-sm) !important;
    padding: 0.65rem 1rem !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
    margin-inline: 0 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button *,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button::before,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button::after {
    transform: none !important;
    translate: none !important;
    transition: none !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button svg {
    position: static !important;
    inset: auto !important;
    flex: 0 0 auto !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button:hover,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button:focus,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button:active {
    background: rgba(var(--mg-primary-rgb), 0.05) !important;
    color: var(--mg-primary) !important;
    box-shadow: none !important;
    transform: none !important;
    translate: none !important;
    margin-inline: 0 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon__form,
.wc-block-checkout .wc-block-components-totals-coupon form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 160px !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-text-input {
    margin: 0 !important;
    min-height: 64px !important;
    height: 64px !important;
}
.wc-block-checkout .wc-block-components-totals-coupon input[type="text"] {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 1.25rem !important;
    box-sizing: border-box !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-text-input label {
    top: 50% !important;
    transform: translateY(-50%) !important;
    will-change: top, transform, font-size, color !important;
    transition:
        top 0.28s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
        font-size 0.22s ease,
        color 0.22s ease !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-text-input:has(input:focus) label,
.wc-block-checkout .wc-block-components-totals-coupon form.mg-coupon-is-focused .wc-block-components-text-input label,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__form.mg-coupon-is-focused .wc-block-components-text-input label,
.wc-block-checkout .wc-block-components-totals-coupon form.mg-coupon-has-value .wc-block-components-text-input label,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__form.mg-coupon-has-value .wc-block-components-text-input label {
    top: 0.48rem !important;
    transform: none !important;
    font-size: 0.78rem !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-text-input:has(input:focus) input[type="text"],
.wc-block-checkout .wc-block-components-totals-coupon form.mg-coupon-is-focused input[type="text"],
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__form.mg-coupon-is-focused input[type="text"],
.wc-block-checkout .wc-block-components-totals-coupon form.mg-coupon-has-value input[type="text"],
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__form.mg-coupon-has-value input[type="text"] {
    padding: 1.55rem 1.25rem 0.62rem !important;
}
.wc-block-checkout .wc-block-components-totals-coupon button[type="submit"],
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-button,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__button {
    height: 64px !important;
    min-height: 64px !important;
    align-self: stretch !important;
    border: 1.5px solid var(--mg-border) !important;
    border-radius: var(--mg-radius-sm) !important;
    background: var(--mg-surface) !important;
    color: var(--mg-text-muted) !important;
    box-shadow: none !important;
    opacity: 0.65 !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    width: 100% !important;
    justify-content: center !important;
    transition: background var(--mg-transition-fast), color var(--mg-transition-fast), border-color var(--mg-transition-fast), opacity var(--mg-transition-fast) !important;
}
.wc-block-checkout .wc-block-components-totals-coupon button[type="submit"]:hover,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-button:hover,
.wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-totals-coupon__button:hover {
    border-color: var(--mg-border) !important;
    background: var(--mg-surface) !important;
    color: var(--mg-text-muted) !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value button[type="submit"],
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value .wc-block-components-button,
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value .wc-block-components-totals-coupon__button {
    border-color: var(--mg-primary) !important;
    background: var(--mg-primary) !important;
    color: #fff !important;
    opacity: 1 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value button[type="submit"]:hover,
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value .wc-block-components-button:hover,
.wc-block-checkout .wc-block-components-totals-coupon .mg-coupon-has-value .wc-block-components-totals-coupon__button:hover {
    border-color: var(--mg-primary) !important;
    background: var(--mg-primary-dark, var(--mg-primary)) !important;
    color: #fff !important;
}
@media (max-width: 480px) {
    .wc-block-checkout .wc-block-components-totals-coupon__form,
    .wc-block-checkout .wc-block-components-totals-coupon form {
        grid-template-columns: 1fr !important;
    }
}

/* Totals rows */
.wc-block-checkout .wc-block-components-totals-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.35rem 1.25rem !important;
    border-bottom: none !important;
}
.wc-block-checkout .wc-block-components-totals-item:last-child { border-bottom: none !important; }
.wc-block-checkout .wc-block-components-totals-item__label {
    font-size: 0.875rem !important;
    color: var(--mg-text-muted) !important;
    font-family: inherit !important;
}
.wc-block-checkout .wc-block-components-totals-item__value {
    font-size: 0.875rem !important;
    color: var(--mg-text) !important;
    font-weight: 600 !important;
    font-family: inherit !important;
}
/* Grand total */
.wc-block-checkout .wc-block-components-totals-footer-item {
    padding: 0.75rem 1.25rem 1.1rem !important;
    margin-top: 0 !important;
    border-top: none !important;
    border-bottom: none !important;
}
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--mg-text) !important;
}
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-checkout .wc-block-components-totals-footer-item-tax-value {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--mg-primary) !important;
    font-family: inherit !important;
}

/* Saved address card */
.wc-block-checkout .wc-block-components-address-card {
    border: 1.5px solid var(--mg-border) !important;
    border-radius: var(--mg-radius-sm) !important;
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.875rem !important;
    color: var(--mg-text) !important;
    font-family: inherit !important;
}
.wc-block-checkout .wc-block-components-address-card__edit {
    color: var(--mg-primary) !important;
    font-size: 0.82rem !important;
    cursor: pointer !important;
    font-family: inherit !important;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-block-checkout .wc-block-components-address-form {
        grid-template-columns: 1fr !important;
    }
    .wc-block-checkout .wc-block-components-address-form__country,
    .wc-block-checkout .wc-block-components-address-form__address_1 {
        grid-column: 1 !important;
    }
}
@media (max-width: 480px) {
    .mg-checkout-content { padding: 1.25rem 0 3rem; }
    .wc-block-checkout .wc-block-components-main { border-radius: var(--mg-radius) !important; }
    .wc-block-checkout .wc-block-components-sidebar,
    .wc-block-checkout .wc-block-checkout__sidebar {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }

    .wc-block-checkout__actions {
        padding: 1rem !important;
    }
    .wc-block-checkout__actions_row {
        gap: 0.5rem !important;
    }
    .wc-block-components-checkout-place-order-button {
        padding: 0.9rem 1rem !important;
        font-size: 0.95rem !important;
    }
    .wc-block-components-checkout-return-to-cart-button {
        font-size: 0.8rem !important;
    }
}


/* ───────────── Elementor Widget Compatibility ───────────── */
/* عرض کامل برای ویجت‌هایی که از edge to edge باید نمایش داده شن */
.elementor-widget-mehregan_hero,
.elementor-widget-mehregan_promo,
.elementor-widget-mehregan_brands,
.elementor-widget-mehregan_flashsale,
.elementor-widget-mehregan_banners,
.elementor-widget-mehregan_categories,
.elementor-widget-mehregan_featured,
.elementor-widget-mehregan_testimonials,
.elementor-widget-mehregan_blog,
.elementor-widget-mehregan_stats,
.elementor-widget-mehregan_features,
.elementor-widget-mehregan_app,
.elementor-widget-mehregan_newsletter,
.elementor-widget-mehregan_latest,
.elementor-widget-mehregan_top_bar,
.elementor-widget-mehregan_header,
.elementor-widget-mehregan_footer,
.elementor-widget-mehregan_mobile_nav {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-right: calc(-50vw + 50%) !important;
    margin-left: calc(-50vw + 50%) !important;
    padding: 0 !important;
}

/* حذف padding پیش‌فرض container برای تمام ویجت‌های مهرگان */
[class*="elementor-widget-mehregan_"] > .elementor-widget-container {
    padding: 0 !important;
    margin: 0 !important;
}

/* حذف فاصله بیرونی بین ویجت‌های مهرگان؛ فاصله‌های داخلی در استایل خود ویجت‌ها کنترل می‌شود */
[class*="elementor-widget-mehregan_"] {
    margin-bottom: 0 !important;
}

/* جلوگیری از دو برابر شدن فاصله وقتی چند ویجت محتوایی مهرگان دستی پشت سر هم قرار می‌گیرند */
[class*="elementor-widget-mehregan_"]:not(.elementor-widget-mehregan_top_bar):not(.elementor-widget-mehregan_header):not(.elementor-widget-mehregan_footer):not(.elementor-widget-mehregan_mobile_nav)
+ [class*="elementor-widget-mehregan_"]:not(.elementor-widget-mehregan_top_bar):not(.elementor-widget-mehregan_header):not(.elementor-widget-mehregan_footer):not(.elementor-widget-mehregan_mobile_nav) {
    margin-top: 0 !important;
}

/* override کردن display:flex پیش‌فرض المنتور روی ویجت‌های مهرگان */
[class*="elementor-widget-mehregan_"] {
    --display: block !important;
    display: block !important;
}

/* container پدر ویجت‌های مهرگان: پدینگ صفر، عرض کامل */
.e-con:has(> [class*="elementor-widget-mehregan_"]) {
    --padding-inline-start: 0 !important;
    --padding-inline-end: 0 !important;
    --padding-block-start: 0 !important;
    --padding-block-end: 0 !important;
    --padding-right: 0 !important;
    --padding-left: 0 !important;
    --padding-top: 0 !important;
    --padding-bottom: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* همچنین container والد بالاتر (در ساختار تو‌در‌توی Elementor) */
.e-con:has(.elementor-widget-mehregan_hero),
.e-con:has(.elementor-widget-mehregan_promo),
.e-con:has(.elementor-widget-mehregan_brands),
.e-con:has(.elementor-widget-mehregan_flashsale),
.e-con:has(.elementor-widget-mehregan_banners),
.e-con:has(.elementor-widget-mehregan_categories),
.e-con:has(.elementor-widget-mehregan_featured),
.e-con:has(.elementor-widget-mehregan_testimonials),
.e-con:has(.elementor-widget-mehregan_blog),
.e-con:has(.elementor-widget-mehregan_stats),
.e-con:has(.elementor-widget-mehregan_features),
.e-con:has(.elementor-widget-mehregan_app),
.e-con:has(.elementor-widget-mehregan_newsletter),
.e-con:has(.elementor-widget-mehregan_latest),
.e-con:has(.elementor-widget-mehregan_top_bar),
.e-con:has(.elementor-widget-mehregan_header),
.e-con:has(.elementor-widget-mehregan_footer),
.e-con:has(.elementor-widget-mehregan_mobile_nav) {
    --padding-inline-start: 0 !important;
    --padding-inline-end: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    max-width: 100% !important;
}
/* جلوگیری از اسکرول افقی هنگام استفاده از 100vw */
body { overflow-x: hidden; }

/* ─── اخطار/پیام empty state در ادیتور المنتور ─── */
.mg-elementor-notice {
    direction: rtl;
}
