/*
Theme Name: بازار سبز
Theme URI: https://bazarsabz.ir
Author: BazarSabz Team
Description: قالب حرفه‌ای بازار سبز — سیستم بازیافت، فروشگاه سبز، کیف پول هوشمند
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL v2
Text Domain: ecocycle
Tags: rtl-language, woocommerce, green, sustainability, recycling
*/

/* ===================================================
   Design System — بازار سبز
   =================================================== */
:root {
    /* Brand */
    --bs-primary:           #005511;
    --bs-primary-dark:      #003d0d;
    --bs-primary-light:     #007d1e;
    --bs-primary-bg:        rgba(0, 112, 26, 0.10);
    --bs-secondary:         #556158;
    --bs-secondary-container: #d9e6da;
    --bs-error:             #ba1a1a;
    --bs-error-container:   #ffdad6;
    --bs-warning:           #b38600;
    --bs-warning-bg:        #fff3cd;

    /* Surfaces */
    --bs-bg:                #f4f7f4;
    --bs-surface:           #ffffff;
    --bs-surface-container: #eceeef;
    --bs-surface-high:      #e6e8e9;
    --bs-outline:           #c8d5c8;
    --bs-outline-variant:   #e0eae0;

    /* Text */
    --bs-text:              #1a2e1a;
    --bs-text-muted:        #5a6b5a;
    --bs-text-placeholder:  #8fa08f;

    /* Typography */
    --bs-font:              'Vazirmatn', 'Tahoma', sans-serif;

    /* Spacing */
    --bs-container-margin:  20px;
    --bs-card-padding:      16px;
    --bs-nav-height:        68px;

    /* Radii */
    --bs-radius-sm:    6px;
    --bs-radius:       10px;
    --bs-radius-md:    14px;
    --bs-radius-lg:    18px;
    --bs-radius-xl:    24px;
    --bs-radius-full:  9999px;

    /* Shadows */
    --bs-shadow-sm:  0 2px 8px rgba(0,0,0,.06);
    --bs-shadow:     0 4px 16px rgba(0,0,0,.08);
    --bs-shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --bs-shadow-nav: 0 -2px 16px rgba(0,0,0,.08);

    /* App */
    --bs-app-max-width: 480px;
}

/* ── Reset ─────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--bs-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--bs-text);
    background: var(--bs-bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bs-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--bs-primary-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ── App Container ─────────────────────────────────── */
.ec-app-wrapper  { display: flex; justify-content: center; min-height: 100svh; background: var(--bs-bg); }
.ec-app-container {
    width: 100%; max-width: var(--bs-app-max-width); min-height: 100svh;
    background: var(--bs-bg); position: relative; display: flex; flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,.12); overflow-x: hidden;
}
.bs-page-content {
    flex: 1; padding: var(--bs-container-margin);
    padding-bottom: calc(var(--bs-nav-height) + 24px); overflow-y: auto;
}

/* ── Toast Container ───────────────────────────────── */
.ec-toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; min-width: 260px; max-width: calc(var(--bs-app-max-width) - 32px);
    pointer-events: none; display: flex; flex-direction: column; gap: 8px;
}
.ec-toast {
    padding: 12px 16px; border-radius: var(--bs-radius-md);
    font-size: 14px; font-weight: 500; box-shadow: var(--bs-shadow-lg);
    pointer-events: all; animation: bs-toast-in .3s ease;
}
@keyframes bs-toast-in { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.ec-toast--success { background: var(--bs-primary-light); color: #fff; }
.ec-toast--error   { background: var(--bs-error);         color: #fff; }
.ec-toast--info    { background: #1d2327;                  color: #fff; }

/* ── Overlay & Drawer ──────────────────────────────── */
.ec-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.ec-overlay.active { opacity: 1; pointer-events: all; }

.bs-drawer {
    position: fixed; bottom: 0; left: 50%; z-index: 201;
    transform: translateX(-50%) translateY(100%);
    width: 100%; max-width: var(--bs-app-max-width);
    background: var(--bs-surface); border-radius: var(--bs-radius-xl) var(--bs-radius-xl) 0 0;
    padding: 16px var(--bs-container-margin) calc(20px + env(safe-area-inset-bottom));
    transition: transform .3s ease; box-shadow: var(--bs-shadow-lg);
}
.bs-drawer.active { transform: translateX(-50%) translateY(0); }
.bs-drawer-handle {
    width: 40px; height: 4px; background: var(--bs-outline); border-radius: var(--bs-radius-full);
    margin: 0 auto 20px;
}

/* ── Bottom Navigation ─────────────────────────────── */
.ec-bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--bs-app-max-width);
    height: var(--bs-nav-height); background: var(--bs-surface);
    box-shadow: var(--bs-shadow-nav); display: flex; align-items: center; justify-content: space-around;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 100;
    transition: transform .3s ease;
}
.ec-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 14px; border-radius: var(--bs-radius-md); flex: 1;
    color: var(--bs-text-muted); text-decoration: none; transition: color .15s;
}
.ec-nav-item:hover, .ec-nav-item.active { color: var(--bs-primary); }
.ec-nav-item .material-symbols-outlined { font-size: 24px; }
.ec-nav-item.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
.ec-nav-label { font-size: 10px; font-weight: 500; }
.ec-nav-cart-count {
    position: absolute; top: -2px; left: 6px; min-width: 18px; height: 18px;
    background: var(--bs-error); color: #fff; border-radius: var(--bs-radius-full);
    font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Page Header ───────────────────────────────────── */
.bs-page-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px var(--bs-container-margin) 12px;
    background: var(--bs-surface); position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 0 var(--bs-outline-variant);
}
.bs-back-btn {
    width: 38px; height: 38px; border-radius: var(--bs-radius); display: flex;
    align-items: center; justify-content: center; background: var(--bs-bg);
    color: var(--bs-text); text-decoration: none; flex-shrink: 0;
}
.bs-back-btn .material-symbols-outlined { font-size: 18px; }
.bs-page-title { font-size: 16px; font-weight: 700; flex: 1; }
.bs-header-action {
    width: 38px; height: 38px; border-radius: var(--bs-radius); display: flex;
    align-items: center; justify-content: center; color: var(--bs-primary); text-decoration: none;
}
.bs-header-action .material-symbols-outlined { font-size: 24px; }

/* ── Buttons ───────────────────────────────────────── */
.bs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: var(--bs-font); font-size: 15px; font-weight: 600;
    border-radius: var(--bs-radius-md); min-height: 48px; padding: 12px 20px;
    text-decoration: none; transition: all .15s; border: none; cursor: pointer;
}
.bs-btn:active { transform: scale(0.97); }
.bs-btn-primary { background: var(--bs-primary-light); color: #fff; box-shadow: 0 4px 12px rgba(0,112,26,.25); }
.bs-btn-primary:hover { background: var(--bs-primary-dark); color: #fff; }
.bs-btn-secondary { background: var(--bs-secondary-container); color: var(--bs-primary-dark); }
.bs-btn-outline { background: transparent; color: var(--bs-primary); border: 1.5px solid var(--bs-primary); }
.bs-btn-outline:hover { background: var(--bs-primary-bg); }
.bs-btn-ghost { background: transparent; color: var(--bs-text-muted); }
.bs-btn-ghost:hover { background: var(--bs-surface-container); }
.bs-btn-sm { min-height: 38px; padding: 8px 16px; font-size: 13px; border-radius: var(--bs-radius); }
.bs-btn-full { width: 100%; }

/* ── Cards ─────────────────────────────────────────── */
.bs-card {
    background: var(--bs-surface); border-radius: var(--bs-radius-lg);
    padding: var(--bs-card-padding); box-shadow: var(--bs-shadow-sm);
}

/* ── Forms ─────────────────────────────────────────── */
.bs-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.bs-label { font-size: 13px; font-weight: 500; color: var(--bs-text-muted); }
.bs-hint  { font-size: 11px; color: var(--bs-text-muted); margin-top: 3px; }
.bs-input {
    width: 100%; background: var(--bs-bg); border: 1.5px solid transparent;
    border-radius: var(--bs-radius); padding: 12px 14px;
    font-size: 14px; color: var(--bs-text); outline: none; transition: all .15s;
}
.bs-input:focus { border-color: var(--bs-primary-light); background: #fff; box-shadow: 0 0 0 3px rgba(0,112,26,.1); }
.bs-input::placeholder { color: var(--bs-text-placeholder); }
.bs-input--error { border-color: var(--bs-error) !important; }
.bs-textarea { resize: vertical; min-height: 88px; }
.bs-input-wrap { position: relative; }
.bs-input-wrap .bs-input { padding-right: 42px; }
.bs-input-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--bs-text-muted); pointer-events: none; }
.bs-input-icon .material-symbols-outlined { font-size: 20px; }
.bs-eye-btn { pointer-events: all !important; background: none; border: none; cursor: pointer; padding: 0; display: flex; }

/* ── Auth pages ────────────────────────────────────── */
.bs-auth-page {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: var(--bs-container-margin); padding-bottom: calc(var(--bs-nav-height) + 24px);
    min-height: calc(100svh - var(--bs-nav-height));
}
.bs-auth-brand { text-align: center; margin-bottom: 28px; padding-top: 20px; }
.bs-brand-logo {
    width: 72px; height: 72px; border-radius: var(--bs-radius-full);
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-light));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; font-size: 36px;
}
.bs-brand-name    { font-size: 26px; font-weight: 800; color: var(--bs-primary); }
.bs-brand-tagline { font-size: 14px; color: var(--bs-text-muted); margin-top: 4px; }
.bs-auth-card { background: var(--bs-surface); border-radius: var(--bs-radius-xl); padding: 24px 20px; box-shadow: var(--bs-shadow-lg); }
.bs-auth-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.bs-auth-desc  { font-size: 13px; color: var(--bs-text-muted); margin-bottom: 16px; }
.bs-auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--bs-text-muted); }
.bs-form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bs-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.bs-auth-back-row { margin-bottom: 16px; }
.bs-back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--bs-text-muted); }
.bs-back-link .material-symbols-outlined { font-size: 14px; }

/* ── Alerts ────────────────────────────────────────── */
.bs-alert { padding: 12px 14px; border-radius: var(--bs-radius-md); font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.bs-alert-error   { background: var(--bs-error-container); color: var(--bs-error); }
.bs-alert-success { background: rgba(0,112,26,.12); color: var(--bs-primary-dark); }
.bs-alert-warn    { background: var(--bs-warning-bg); color: var(--bs-warning); }

/* ── Chips & Badges ────────────────────────────────── */
.bs-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: var(--bs-radius-full); font-size: 12px; font-weight: 500; white-space: nowrap; }
.bs-chip-sm { font-size: 11px; padding: 2px 8px; }
.bs-chip-ok  { background: rgba(0,112,26,.1); color: var(--bs-primary); }
.bs-chip-err { background: var(--bs-error-container); color: var(--bs-error); }
.bs-chip-warn{ background: var(--bs-warning-bg); color: var(--bs-warning); }
.bs-chip-info{ background: var(--bs-surface-container); color: var(--bs-text-muted); }
.bs-badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 10px; border-radius: var(--bs-radius-full); font-size: 11px; font-weight: 700; }
.bs-badge-ok  { background: rgba(0,112,26,.1); color: var(--bs-primary); }
.bs-badge-err { background: var(--bs-error-container); color: var(--bs-error); }
.bs-badge-warn{ background: var(--bs-warning-bg); color: var(--bs-warning); }
.bs-badge-info{ background: var(--bs-surface-container); color: var(--bs-text-muted); }

/* ── Progress Bar ──────────────────────────────────── */
.bs-progress-bar { width: 100%; height: 7px; background: var(--bs-bg); border-radius: var(--bs-radius-full); overflow: hidden; }
.bs-progress-fill { height: 100%; background: linear-gradient(90deg,var(--bs-primary),var(--bs-primary-light)); border-radius: var(--bs-radius-full); transition: width .6s ease; }

/* ── Section headers ───────────────────────────────── */
.bs-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bs-section-title  { font-size: 16px; font-weight: 700; }
.bs-headline { font-size: 20px; font-weight: 700; }
.bs-title-sm { font-size: 15px; font-weight: 600; }
.bs-body-md  { font-size: 14px; }
.bs-label-sm { font-size: 12px; }
.bs-text-muted { color: var(--bs-text-muted); }
.bs-link  { color: var(--bs-primary); font-weight: 600; }
.bs-link-sm { font-size: 12px; color: var(--bs-primary); font-weight: 500; }

/* ── Empty state ───────────────────────────────────── */
.bs-empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; }
.bs-empty-icon  { font-size: 64px; color: var(--bs-outline); margin-bottom: 12px; }
.bs-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.bs-empty-desc  { font-size: 13px; color: var(--bs-text-muted); max-width: 240px; }

/* ── Req icon ──────────────────────────────────────── */
.bs-req-icon { width: 42px; height: 42px; border-radius: var(--bs-radius); background: var(--bs-primary-bg); color: var(--bs-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bs-req-icon .material-symbols-outlined { font-size: 22px; }

/* ── Utility ───────────────────────────────────────── */
.bs-flex { display: flex; }
.bs-flex-col { flex-direction: column; }
.bs-items-center { align-items: center; }
.bs-justify-between { justify-content: space-between; }
.bs-gap-2 { gap: 8px; }
.bs-gap-3 { gap: 12px; }
.bs-gap-4 { gap: 16px; }
.bs-text-center { text-align: center; }
.bs-mt-3 { margin-top: 12px; }
.bs-mt-4 { margin-top: 16px; }
.bs-mt-5 { margin-top: 20px; }
.bs-mb-3 { margin-bottom: 12px; }
.bs-mb-4 { margin-bottom: 16px; }
.bs-mb-5 { margin-bottom: 20px; }
.bs-w-full { width: 100%; }

/* ── Responsive ────────────────────────────────────── */
@media (min-width: 520px) {
    .ec-app-wrapper { padding: 20px 0; background: #e8ede8; }
    .ec-app-container { border-radius: var(--bs-radius-xl); min-height: auto; max-height: calc(100svh - 40px); }
    .ec-bottom-nav { border-radius: 0 0 var(--bs-radius-xl) var(--bs-radius-xl); }
}

/* ── Password Strength ─────────────────────────────── */
.bs-pass-strength { display: flex; flex-direction: column; gap: 3px; }

/* ── WC price colors ───────────────────────────────── */
.woocommerce-Price-amount { color: var(--bs-primary) !important; font-weight: 700 !important; }
del .woocommerce-Price-amount { color: var(--bs-text-muted) !important; font-weight: 400 !important; }
ins { text-decoration: none !important; }
