
@font-face {
    font-family: 'Vazir';
    src: url('./fonts/Vazirmatn-Regular.woff2') format('woff2'),
        url('./fonts/Vazirmatn-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('./fonts/Vazirmatn-Medium.woff2') format('woff2'),
        url('./fonts/Vazirmatn-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('./fonts/Vazirmatn-Bold.woff2') format('woff2'),
        url('./fonts/Vazirmatn-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
:root {
--primary: #6C3483;
--primary-light: #9B59B6;
--primary-dark: #4A235A;
--secondary: #F39C12;
--secondary-light: #F7DC6F;
--surface: #FFFFFF;
--surface-alt: #F8F4FC;
--bg: #F2EEF8;
--text: #2C1A3E;
--text-muted: #7D6B8A;
--border: #E8DEF0;
--success: #27AE60;
--danger: #E74C3C;
--shadow-sm: 0 2px 8px rgba(108,52,131,0.08);
--shadow-md: 0 4px 20px rgba(108,52,131,0.14);
--shadow-lg: 0 8px 40px rgba(108,52,131,0.18);
--radius-sm: 10px;
--radius-md: 16px;
--radius-lg: 24px;
--nav-h: 70px;
--header-h: 60px;
--search-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
height: 100%;
font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
background: var(--bg);
color: var(--text);
overflow: hidden;
}

/* ===== HEADER ===== */
.app-header {
position: fixed;
top: 0; left: 0; right: 0;
height: var(--header-h);
background: linear-gradient(135deg, var(--primary-dark), var(--primary));
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
z-index: 100;
box-shadow: var(--shadow-md);
}
.header-logo {
display: flex;
align-items: center;
gap: 10px;
}
.header-logo-icon {
width: 36px; height: 36px;
background: rgba(255,255,255,0.15);
border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-size: 18px;
}
.header-logo-text { color: #fff; }
.header-logo-text h1 { font-size: 1rem; font-weight: 700; }
.header-logo-text p { font-size: 0.68rem; opacity: 0.8; margin-top: 1px; }
.header-user {
display: flex; align-items: center; gap: 8px;
background: rgba(255,255,255,0.12);
padding: 6px 12px;
border-radius: 20px;
cursor: pointer;
}
.header-user-avatar {
width: 28px; height: 28px;
background: var(--secondary);
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 14px;
}
.header-user-name { color: #fff; font-size: 0.78rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== SEARCH BAR ===== */
.search-wrap {
position: fixed;
bottom: var(--nav-h);
left: 0; right: 0;
height: var(--search-h);
background: var(--surface);
padding: 8px 16px;
border-bottom: 1px solid var(--border);
z-index: 99;
display: none;
box-shadow: var(--shadow-sm);
}
.search-wrap.visible { display: block; }
.search-inner {
position: relative;
height: 100%;
}
.search-icon {
position: absolute;
right: 12px; top: 50%;
transform: translateY(-50%);
font-size: 15px;
color: var(--text-muted);
}
.search-input {
width: 100%; height: 100%;
border: 1.5px solid var(--border);
border-radius: 22px;
padding: 0 40px 0 14px;
font-size: 0.9rem;
color: var(--text);
background: var(--surface-alt);
outline: none;
font-family: inherit;
transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary-light); background: #fff; }
.search-clear {
position: absolute;
left: 12px; top: 50%;
transform: translateY(-50%);
font-size: 13px;
color: var(--text-muted);
cursor: pointer;
display: none;
width: 20px; height: 20px;
background: var(--border);
border-radius: 50%;
align-items: center; justify-content: center;
}
.search-clear.show { display: flex; }

/* ===== SCREENS ===== */
.screen {
position: fixed;
top: var(--header-h); left: 0; right: 0;
bottom: var(--nav-h);
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
opacity: 0;
pointer-events: none;
transform: translateY(8px);
transition: opacity 0.25s, transform 0.25s;
background: var(--bg);
}
.screen.active {
opacity: 1;
pointer-events: all;
transform: translateY(0);
}
.screen-home { top: var(--header-h); bottom: calc(var(--nav-h) + var(--search-h)); }
.screen-inner { padding: 12px 12px calc(16px); min-height: 100%; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
position: fixed;
bottom: 0; left: 0; right: 0;
height: var(--nav-h);
background: var(--surface);
display: flex;
border-top: 1px solid var(--border);
z-index: 100;
box-shadow: 0 -4px 20px rgba(108,52,131,0.1);
}
.nav-item {
flex: 1;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
gap: 3px;
cursor: pointer;
transition: background 0.2s;
position: relative;
border-radius: 0;
padding: 6px 0;
}
.nav-item:active { background: var(--surface-alt); }
.nav-icon { font-size: 22px; transition: transform 0.2s; }
.nav-label { font-size: 0.65rem; color: var(--text-muted); transition: color 0.2s; font-weight: 500; }
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-item.active .nav-label { color: var(--primary); font-weight: 700; }
.nav-item.active::after {
content: '';
position: absolute;
top: 0; left: 50%; transform: translateX(-50%);
width: 32px; height: 3px;
background: var(--primary);
border-radius: 0 0 4px 4px;
}
.nav-badge {
position: absolute;
top: 5px; right: calc(50% - 22px);
min-width: 18px; height: 18px;
background: var(--danger);
color: #fff;
border-radius: 9px;
font-size: 0.65rem;
font-weight: 700;
display: none;
align-items: center; justify-content: center;
padding: 0 4px;
border: 2px solid var(--surface);
}
.nav-badge.show { display: flex; }

/* ===== PRODUCT GRID ===== */
.product-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.product-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--shadow-sm);
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
position: relative;
}
.product-card:active { transform: scale(0.97); box-shadow: var(--shadow-lg); }
.product-img-wrap {
position: relative;
background: var(--surface-alt);
padding-top: 100%;
overflow: hidden;
}
.product-img {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
object-fit: cover;
transition: transform 0.3s;
}
.product-card:active .product-img { transform: scale(1.05); }
.product-discount-badge {
position: absolute;
top: 8px; left: 8px;
background: var(--danger);
color: #fff;
font-size: 0.65rem;
font-weight: 700;
padding: 3px 7px;
border-radius: 20px;
}
.product-fav-btn {
position: absolute;
top: 8px; right: 8px;
width: 30px; height: 30px;
background: rgba(255,255,255,0.9);
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 16px;
cursor: pointer;
transition: transform 0.2s;
border: none;
}
.product-fav-btn:active { transform: scale(1.3); }
.product-info { padding: 10px; }
.product-name { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.product-prices { display: flex; flex-direction: column; gap: 2px; }
.product-old-price { font-size: 0.7rem; color: var(--text-muted); text-decoration: line-through; }
.product-price { font-size: 0.88rem; font-weight: 700; color: var(--primary); }
.product-add-btn {
display: block;
width: calc(100% - 16px);
margin: 0 8px 8px;
padding: 7px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: #fff;
border: none;
border-radius: var(--radius-sm);
font-size: 0.78rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: opacity 0.2s;
}
.product-add-btn:active { opacity: 0.85; }

/* ===== SECTION TITLE ===== */
.section-title {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 0 10px;
}
.section-title h2 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.section-title span { font-size: 0.78rem; color: var(--primary); cursor: pointer; }

/* ===== EMPTY STATE ===== */
.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-muted);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.7; }
.empty-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-desc { font-size: 0.82rem; line-height: 1.6; }

/* ===== LOADING ===== */
.loading-wrap {
display: flex; flex-direction: column;
align-items: center; justify-content: center;
padding: 60px 20px;
gap: 14px;
}
.spinner {
width: 36px; height: 36px;
border: 3px solid var(--border);
border-top-color: var(--primary);
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PRODUCT SHEET ===== */
.overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
z-index: 200;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s;
backdrop-filter: blur(2px);
}
.overlay.active { opacity: 1; pointer-events: all; }

.bottom-sheet {
position: fixed;
bottom: 0; left: 0; right: 0;
background: var(--surface);
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
z-index: 201;
transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
max-height: 90vh;
display: flex; flex-direction: column;
}
.bottom-sheet.active { transform: translateY(0); }
.sheet-handle-area {
padding: 12px 0 4px;
text-align: center;
cursor: pointer;
flex-shrink: 0;
}
.sheet-handle {
width: 36px; height: 4px;
background: var(--border);
border-radius: 2px;
display: inline-block;
}
.sheet-scroll { overflow-y: auto; flex: 1; }
.sheet-slider {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
gap: 0;
}
.sheet-slider::-webkit-scrollbar { display: none; }
.sheet-slide {
min-width: 100%;
scroll-snap-align: start;
aspect-ratio: 1;
background: var(--surface-alt);
overflow: hidden;
}
.sheet-slide img {
width: 100%; height: 100%;
object-fit: cover;
}
.slider-dots {
display: flex; justify-content: center; gap: 6px;
padding: 10px 0 0;
}
.dot {
width: 6px; height: 6px;
border-radius: 50%;
background: var(--border);
transition: background 0.2s, width 0.2s;
}
.dot.active { background: var(--primary); width: 18px; border-radius: 3px; }
.sheet-body { padding: 14px 16px; }
.sheet-product-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.sheet-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.sheet-old-price { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }
.sheet-discount-chip {
background: #FDECEA;
color: var(--danger);
font-size: 0.72rem;
font-weight: 700;
padding: 3px 8px;
border-radius: 20px;
}
.sheet-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.8; text-align: justify; margin-bottom: 16px; }
.sheet-footer {
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
border-top: 1px solid var(--border);
flex-shrink: 0;
background: var(--surface);
}
.sheet-footer-row {
display: flex; align-items: center; gap: 12px;
}
.qty-control {
display: flex; align-items: center; gap: 0;
background: var(--surface-alt);
border: 1.5px solid var(--border);
border-radius: 22px;
overflow: hidden;
flex-shrink: 0;
}
.qty-btn {
width: 36px; height: 36px;
border: none;
background: transparent;
color: var(--primary);
font-size: 1.1rem;
font-weight: 700;
cursor: pointer;
display: flex; align-items: center; justify-content: center;
font-family: inherit;
transition: background 0.15s;
}
.qty-btn:active { background: var(--border); }
.qty-val {
min-width: 28px;
text-align: center;
font-size: 0.95rem;
font-weight: 700;
color: var(--text);
}
.btn-add-cart {
flex: 1;
padding: 10px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: #fff;
border: none;
border-radius: 22px;
font-size: 0.88rem;
font-weight: 700;
cursor: pointer;
font-family: inherit;
transition: opacity 0.2s;
}
.btn-add-cart:active { opacity: 0.85; }

/* ===== CART ===== */
.cart-item {
background: var(--surface);
border-radius: var(--radius-md);
padding: 12px;
margin-bottom: 10px;
display: flex; align-items: center; gap: 12px;
box-shadow: var(--shadow-sm);
}
.cart-item-img {
width: 64px; height: 64px;
object-fit: cover;
border-radius: var(--radius-sm);
flex-shrink: 0;
background: var(--surface-alt);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.82rem; color: var(--primary); font-weight: 700; }
.cart-item-unit { font-size: 0.72rem; color: var(--text-muted); }
.cart-item-qty { flex-shrink: 0; }

.cart-summary {
background: var(--surface);
border-radius: var(--radius-md);
padding: 16px;
margin-top: 12px;
box-shadow: var(--shadow-sm);
}
.summary-row {
display: flex; justify-content: space-between; align-items: center;
padding: 8px 0;
font-size: 0.88rem;
color: var(--text-muted);
}
.summary-row + .summary-row { border-top: 1px dashed var(--border); }
.summary-row.total {
border-top: 2px solid var(--border) !important;
padding-top: 12px;
margin-top: 4px;
}
.summary-row.total span:first-child { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.summary-row.total span:last-child { font-size: 1rem; font-weight: 700; color: var(--primary); }

.form-group { margin-bottom: 12px; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }
.form-input {
width: 100%;
padding: 10px 14px;
border: 1.5px solid var(--border);
border-radius: var(--radius-sm);
font-size: 0.9rem;
color: var(--text);
background: var(--surface-alt);
outline: none;
font-family: inherit;
transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary-light); background: #fff; }
.form-input.ltr { direction: ltr; text-align: left; }
textarea.form-input { resize: none; height: 80px; line-height: 1.6; }

.btn-primary {
width: 100%;
padding: 13px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: #fff;
border: none;
border-radius: var(--radius-sm);
font-size: 0.95rem;
font-weight: 700;
cursor: pointer;
font-family: inherit;
margin-top: 12px;
transition: opacity 0.2s, transform 0.1s;
display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
width: 100%;
padding: 12px;
background: transparent;
color: var(--primary);
border: 1.5px solid var(--primary);
border-radius: var(--radius-sm);
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
margin-top: 8px;
transition: background 0.2s;
}
.btn-secondary:active { background: var(--surface-alt); }

/* ===== PROFILE ===== */
.profile-card {
background: linear-gradient(135deg, var(--primary-dark), var(--primary));
border-radius: var(--radius-md);
padding: 20px;
margin-bottom: 16px;
display: flex; align-items: center; gap: 14px;
color: #fff;
box-shadow: var(--shadow-md);
}
.profile-avatar {
width: 56px; height: 56px;
background: rgba(255,255,255,0.15);
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 26px;
flex-shrink: 0;
border: 2px solid rgba(255,255,255,0.3);
}
.profile-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.profile-info p { font-size: 0.8rem; opacity: 0.8; }

.order-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: 14px 16px;
margin-bottom: 10px;
box-shadow: var(--shadow-sm);
}
.order-card-header {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 10px;
}
.order-code { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.order-date { font-size: 0.75rem; color: var(--text-muted); }
.order-status {
display: inline-block;
font-size: 0.72rem; font-weight: 700;
padding: 4px 10px;
border-radius: 20px;
margin-bottom: 8px;
}
.status-pending { background: #FEF9E7; color: #D4AC0D; }
.status-paid { background: #EAF7F0; color: var(--success); }
.status-shipped { background: #EAF2F8; color: #2980B9; }
.status-delivered { background: #EAF7F0; color: var(--success); }
.status-cancelled { background: #FDEDEC; color: var(--danger); }
.order-total { font-size: 0.9rem; font-weight: 700; color: var(--primary); }

/* ===== PAYMENT RESULT ===== */
.payment-result-screen {
display: flex; flex-direction: column;
align-items: center; justify-content: center;
text-align: center;
padding: 40px 24px;
min-height: 70vh;
}
.result-icon {
width: 80px; height: 80px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 36px;
margin-bottom: 20px;
}
.result-icon.success { background: #EAF7F0; }
.result-icon.fail { background: #FDEDEC; }
.result-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.result-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.result-code {
background: var(--surface-alt);
border: 1.5px dashed var(--border);
border-radius: var(--radius-sm);
padding: 12px 24px;
font-size: 1.2rem;
font-weight: 700;
letter-spacing: 2px;
color: var(--primary);
margin-bottom: 24px;
}

/* ===== TOAST ===== */
.toast {
position: fixed;
bottom: calc(var(--nav-h) + 12px);
left: 50%; transform: translateX(-50%) translateY(20px);
background: rgba(44,26,62,0.92);
color: #fff;
padding: 10px 20px;
border-radius: 22px;
font-size: 0.85rem;
font-weight: 500;
white-space: nowrap;
z-index: 300;
opacity: 0;
transition: opacity 0.25s, transform 0.25s;
backdrop-filter: blur(4px);
max-width: calc(100vw - 32px);
overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== BANNER / PROMO ===== */
.promo-banner {
background: linear-gradient(135deg, var(--primary-dark), var(--primary));
border-radius: var(--radius-md);
padding: 16px 18px;
margin-bottom: 12px;
color: #fff;
display: flex; align-items: center; justify-content: space-between;
box-shadow: var(--shadow-md);
}
.promo-text h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.promo-text p { font-size: 0.78rem; opacity: 0.85; }
.promo-icon { font-size: 40px; opacity: 0.8; }

/* ===== FILTER CHIPS ===== */
.filter-chips {
display: flex; gap: 8px;
overflow-x: auto; scrollbar-width: none;
padding: 0 0 10px;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
flex-shrink: 0;
padding: 6px 14px;
border-radius: 20px;
font-size: 0.78rem;
font-weight: 600;
cursor: pointer;
border: 1.5px solid var(--border);
background: var(--surface);
color: var(--text-muted);
transition: all 0.2s;
font-family: inherit;
}
.chip.active {
background: var(--primary);
color: #fff;
border-color: var(--primary);
}

/* ===== BACK BUTTON in header ===== */
.header-back {
display: none;
background: rgba(255,255,255,0.15);
border: none;
color: #fff;
width: 34px; height: 34px;
border-radius: 10px;
font-size: 18px;
cursor: pointer;
align-items: center; justify-content: center;
}
.header-back.show { display: flex; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ===== SKELETON ===== */
.skeleton {
background: linear-gradient(90deg, var(--border) 25%, var(--surface-alt) 50%, var(--border) 75%);
background-size: 200% 100%;
animation: shimmer 1.2s infinite;
border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--shadow-sm);
}
.skeleton-img { height: 160px; }
.skeleton-line { height: 12px; margin: 8px; }
.skeleton-line.short { width: 60%; }

/* ===== SCROLLBAR ===== */
.screen::-webkit-scrollbar { width: 3px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.order-card {
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:active {
transform: scale(0.98);
}

.order-items-count {
font-size: 0.85rem;
color: #666;
margin-top: 8px;
}

.back-btn {
background: none;
border: none;
font-size: 1rem;
color: var(--primary);
cursor: pointer;
padding: 8px 0;
margin-bottom: 16px;
}

.order-detail-header {
text-align: center;
margin-bottom: 24px;
}

.order-code-large {
font-size: 1.1rem;
font-weight: bold;
margin: 12px 0;
}

.order-detail-section {
background: white;
border-radius: 12px;
padding: 16px;
margin-bottom: 16px;
}

.order-detail-section h3 {
margin: 0 0 12px 0;
font-size: 1rem;
}

.order-detail-info .info-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
}

.order-detail-info .info-row:last-child {
border-bottom: none;
}

.info-label {
font-weight: 500;
color: #666;
}

.order-detail-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
}

.order-detail-item:last-child {
border-bottom: none;
}

.order-detail-item-name {
font-weight: 500;
margin-bottom: 4px;
}

.order-detail-item-qty {
font-size: 0.85rem;
color: #666;
}

.order-detail-item-price {
font-weight: bold;
color: var(--primary);
}

.order-summary .summary-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
}

.order-summary .summary-row.total {
border-top: 2px solid #e0e0e0;
margin-top: 8px;
padding-top: 12px;
font-weight: bold;
font-size: 1.1rem;
color: var(--primary);
}

