/* =============================================
   main.css - استایل عمومی مزرعه آنلاین
   شامل: ریست، انیمیشن‌ها، هدر، اسکرول و ...
   ============================================= */

/* === ریست و پایه === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    background: #1a2e12;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #fef7ec;
    color: #2c2a24;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* === هماهنگی با نوار مرورگر موبایل === */
body::before {
    content: '';
    display: block;
    height: constant(safe-area-inset-top);
    height: env(safe-area-inset-top);
    background: #1a2e12;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

/* === اسکرول بار === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9aa6f; border-radius: 10px; }

/* === انیمیشن‌های عمومی === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}
@keyframes borderGlow {
    0%, 100% { border-color: #c59a5f; box-shadow: 0 0 5px rgba(197,154,95,0.2); }
    50%      { border-color: #8bc34a; box-shadow: 0 0 18px rgba(139,195,74,0.2); }
}
@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    30%      { transform: scale(1.35); }
    60%      { transform: scale(0.9); }
}
@keyframes progressLine {
    from { width: 0%; }
}
@keyframes checkBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}
@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes emptyFloat {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-10px); }
}
@keyframes shimmerBorder {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* کلاس‌های انیمیشن آماده */
.fade-in-up    { animation: fadeInUp 0.5s ease forwards; }
.fade-in-down  { animation: fadeInDown 0.4s ease forwards; }
.fade-in-right { animation: fadeInRight 0.5s ease forwards; }
.fade-in-left  { animation: fadeInLeft 0.5s ease forwards; }
.scale-in      { animation: scaleIn 0.4s cubic-bezier(0.2,0.9,0.4,1.1) forwards; }
.slide-up      { animation: slideUp 0.5s cubic-bezier(0.2,0.9,0.4,1.1) forwards; }

/* =============================================
   هدر اصلی فروشگاه (طراحی نوین)
   ============================================= */
.main-header {
    background: rgba(26, 40, 20, 0.96);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.persian-border {
    background: linear-gradient(90deg, 
        #c48a3c 0%, 
        #8b5a2b 20%, 
        #c48a3c 40%, 
        #e8c48a 60%, 
        #c48a3c 80%, 
        #8b5a2b 100%
    );
    height: 3px;
    width: 100%;
    background-size: 200% auto;
    animation: shimmerBorder 3s linear infinite;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1300px;
    margin: 0 auto;
    gap: 15px;
}

/* لوگو */
.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: 0.2s;
}

.logo-area:active { transform: scale(0.95); }

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #c48a3c, #8b5a2b);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(196, 138, 60, 0.3);
}

.logo-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-icon i {
    display: none;
}

.logo-text h2 {
    font-size: 1.1rem;
    background: linear-gradient(135deg, #f9e2b7, #e8c48a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
    font-weight: 800;
}

.logo-text span {
    font-size: 0.6rem;
    color: #c48a3c;
    font-weight: 500;
}

/* نویگیشن */
.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: #e4d5b4;
    font-size: 0.9rem;
    transition: 0.3s;
    position: relative;
    padding: 6px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 50%;
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #c48a3c, #ffda9e);
    transition: 0.3s;
    border-radius: 2px;
    transform: translateX(50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
    right: 0;
    transform: translateX(0);
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffda9e;
}

/* آیکون‌های هدر */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #e4d5b4;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: 0.2s;
    position: relative;
    text-decoration: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(196, 138, 60, 0.2);
    color: #ffda9e;
    transform: translateY(-2px);
}

.icon-btn:active { transform: scale(0.9); }

.cart-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    padding: 0 4px;
    animation: cartBounce 0.4s ease;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(196, 138, 60, 0.3);
    padding: 6px 16px;
    border-radius: 40px;
    color: #e4d5b4;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
}

.user-btn:hover {
    background: rgba(196, 138, 60, 0.15);
    border-color: #c48a3c;
    transform: translateY(-2px);
}

.user-btn:active { transform: scale(0.95); }

.user-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c48a3c, #8b5a2b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* همبرگر (موبایل) */
.hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #e4d5b4;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: 0.2s;
}

.hamburger:active {
    background: rgba(196, 138, 60, 0.2);
    transform: scale(0.9);
}

/* =============================================
   فوتر عمومی
   ============================================= */
.dashboard-footer {
    text-align: center;
    padding: 20px;
    color: #8b7355;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* =============================================
   استایل عکس در فوتر
   ============================================= */
.footer-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 10px;
    background: linear-gradient(145deg, #c48a3c, #8b5a2b);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer-col h4 i.fa-leaf-maple,
.footer-col h4 i.fad.fa-leaf-maple {
    display: none;
}

/* =============================================
   نویگیشن پایین موبایل
   ============================================= */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(196, 138, 60, 0.2);
    z-index: 90;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #b0a18a;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    min-width: 60px;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.3rem;
    transition: 0.2s;
}

.mobile-bottom-nav .nav-item.active {
    color: #c48a3c;
    background: rgba(196, 138, 60, 0.1);
}

.mobile-bottom-nav .nav-item.active i {
    color: #c48a3c;
    transform: translateY(-2px);
}

.mobile-bottom-nav .nav-item:active {
    transform: scale(0.92);
    background: rgba(196, 138, 60, 0.15);
}

/* =============================================
   نوتیفیکیشن (Toast)
   ============================================= */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #3b5522;
    color: #fff;
    padding: 13px 26px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 999;
    transition: transform 0.35s cubic-bezier(0.2,0.9,0.4,1.1);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #4b6e2e; }
.toast.error   { background: #c0392b; }

/* =============================================
   دکمه‌های عمومی
   ============================================= */
.btn-primary {
    background: linear-gradient(135deg, #4b6e2e, #3a5622);
    border: none;
    padding: 13px 28px;
    border-radius: 35px;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-primary:active { transform: scale(0.95); }

.btn-gold {
    background: linear-gradient(135deg, #c48a3c, #8b5a2b);
    border: none;
    padding: 13px 28px;
    border-radius: 35px;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-gold:active { transform: scale(0.95); }

.btn-outline {
    background: transparent;
    border: 2px solid #e8d9c2;
    padding: 12px 22px;
    border-radius: 35px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    color: #5a4a35;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-outline:hover { border-color: #c48a3c; color: #c48a3c; background: #fffdf7; }
.btn-outline:active { transform: scale(0.95); }

/* =============================================
   کارت عمومی
   ============================================= */
.card {
    background: #fff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 6px 22px -8px rgba(0,0,0,0.04);
    border: 1px solid #efe8db;
}

/* =============================================
   مودال عمومی
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 700px;
    max-height: 88vh;
    border-radius: 28px 28px 0 0;
    padding: 8px 18px 24px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2,0.9,0.4,1.1);
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
}
.modal-overlay.active .modal-sheet { transform: translateY(0); }
.modal-handle {
    width: 36px; height: 5px;
    background: #d5c8b0;
    border-radius: 10px;
    margin: 10px auto 18px;
    flex-shrink: 0;
}
.modal-close {
    position: absolute;
    top: 12px; left: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #8b7355;
    cursor: pointer;
    z-index: 5;
}
.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #3b5522;
    text-align: center;
    margin-bottom: 18px;
}

/* =============================================
   استیت خالی عمومی
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 28px;
    display: none;
}
.empty-state.show { display: block; }
.empty-state i {
    font-size: 4rem;
    color: #e0d4c0;
    margin-bottom: 16px;
}
.empty-state h3 { color: #3b5522; margin-bottom: 6px; font-size: 1.1rem; }
.empty-state p  { color: #b0a18a; font-size: 0.85rem; margin-bottom: 20px; }

/* =============================================
   رسپانسیو عمومی
   ============================================= */
@media (max-width: 768px) {
    .nav-links  { display: none; }
    .hamburger  { display: block; }
    .mobile-bottom-nav { display: block; }
    .user-btn span { display: none; }
    .user-btn { padding: 6px 12px; }
    .header-container { padding: 10px 16px; }
    .logo-icon { width: 40px; height: 40px; }
    .logo-text h2 { font-size: 0.95rem; }
    .logo-text span { font-size: 0.5rem; }
    .icon-btn { width: 34px; height: 34px; font-size: 1rem; }
}

@media (max-width: 480px) {
    .header-container { gap: 8px; }
    .logo-area { gap: 6px; }
    .logo-icon { width: 36px; height: 36px; }
    .logo-text h2 { font-size: 0.85rem; }
    .user-btn { padding: 5px 10px; }
    .header-actions { gap: 6px; }
    .icon-btn { width: 32px; height: 32px; font-size: 0.95rem; }
}

@media (min-width: 700px) {
    .modal-overlay { align-items: center; }
    .modal-sheet {
        border-radius: 28px;
        max-height: 82vh;
        margin: 20px;
    }
}

/* =============================================
   استایل‌های Font Awesome Pro 7
   ============================================= */

/* Duotone - رنگ‌های پیش‌فرض */
.fad {
    --fa-primary-color: #3b5522;
    --fa-secondary-color: #c48a3c;
    --fa-secondary-opacity: 0.35;
}

/* آیکون‌های Duotone در بنرها */
.promo-banner .fad,
.hero-slider .fad {
    --fa-primary-color: #fff;
    --fa-secondary-color: #ffda9e;
    --fa-secondary-opacity: 0.5;
}

/* آیکون‌های سایدبار - بدون محدودیت فونت */
.sidebar-nav li a i {
    vertical-align: middle;
}

/* وزن Light برای آیکون‌های ظریف */
.stat-icon-circle i,
.feature-item i {
    font-weight: 300;
}

/* انیمیشن برای Duotone */
.fad:hover {
    --fa-secondary-opacity: 0.7;
    transition: all 0.3s ease;
}

/* =============================================
   انیمیشن‌های Font Awesome Pro
   ============================================= */

/* چرخش آروم */
.fa-spin-slow {
    animation: fa-spin 3s linear infinite;
}

/* ضربان قلب برای علاقه‌مندی */
.fa-heart-pulse {
    animation: heartBeat 1.5s ease infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.15); }
}

/* چشمک زدن */
.fa-blink {
    animation: blink 1.5s ease infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* پرواز به بالا */
.fa-float {
    animation: floatUp 3s ease-in-out infinite;
}

/* لرزش */
.fa-shake {
    animation: shake 0.5s ease;
}
@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}