/* ==========================================================================
   Mali 123 - Official Design System & Stylesheet
   ========================================================================== */

/* 1. @font-face Definitions */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* 2. Global Resets & Typography */
*, *::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: 'Vazirmatn', Tahoma, sans-serif;
  letter-spacing: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  font-size: 16px;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tabular Numbers for financial values */
.tabular-nums, .price-val, .amount-val, .financial-figure, .stat-value {
  font-variant-numeric: tabular-nums;
}

/* LTR Elements: domain, email, latin id, brand 123 */
.brand-num, [dir="ltr"], .ltr-text, .latin-id, .email-link, .domain-text {
  direction: ltr !important;
  display: inline-block;
  unicode-bidi: embed;
}

/* 3. Responsive Typography Rules */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-navy);
  line-height: 1.4;
  margin-bottom: var(--space-12);
}

/* Mobile defaults (< 768px) */
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }

p, .body-text, input, select, textarea {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-main);
  line-height: 1.8;
}

label, .field-label, th, .col-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.5;
}

td, .table-row-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-main);
}

.help-text, .date-text, .currency-unit, .text-helper, small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.balance-amount, .total-price-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-navy);
  font-variant-numeric: tabular-nums;
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  h1 { font-size: 34px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
  h4 { font-size: 18px; }
  h5 { font-size: 16px; }
  h6 { font-size: 14px; }
  .balance-amount, .total-price-val { font-size: 28px; }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
  h4 { font-size: 20px; }
  h5 { font-size: 18px; }
  h6 { font-size: 16px; }
  td, .table-row-text { font-size: 15px; }
  .help-text, .date-text, .currency-unit, .text-helper, small { font-size: 14px; }
  .balance-amount, .total-price-val { font-size: 32px; }
}

/* 4. Links & Focus */
a {
  color: var(--brand-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-hover);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-primary) !important;
  outline-offset: 2px !important;
}

/* 5. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #FFFFFF !important;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #FFFFFF !important;
}

.btn-primary:active {
  background-color: var(--brand-active);
  border-color: var(--brand-active);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary);
}

.btn-secondary:hover {
  background-color: var(--brand-bg-light);
  color: var(--brand-primary) !important;
}

.btn-secondary:active {
  background-color: #D5E1E2;
}

.btn-lg {
  min-height: 52px;
  font-size: 16px;
  padding: 0 24px;
}

.btn-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn:disabled, .btn.disabled {
  background-color: var(--btn-disabled-bg) !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
  cursor: not-allowed !important;
  pointer-events: none;
  opacity: 0.7;
}

/* 6. Form Inputs & Controls */
.form-group {
  margin-bottom: var(--space-16);
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--border-input);
  background-color: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  padding: 12px;
  min-height: 120px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-primary);
  outline: none;
}

/* 7. Cards & Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: var(--space-16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 1024px) {
  .card {
    padding: var(--space-24);
  }
}

/* 8. Status Pills & Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-cleared {
  color: var(--status-success-text);
  background-color: var(--status-success-bg);
}

.status-pending {
  color: var(--status-pending-text);
  background-color: var(--status-pending-bg);
}

.status-overdue, .status-error {
  color: var(--status-danger-text);
  background-color: var(--status-danger-bg);
}

/* 9. Financial Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  background: #FFFFFF;
  margin-bottom: var(--space-24);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  min-width: 640px;
}

.financial-table th {
  background-color: var(--bg-page);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.financial-table td {
  padding: 12px 16px;
  min-height: 44px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
  vertical-align: middle;
}

.financial-table tr:last-child td {
  border-bottom: none;
}

.financial-table tr:hover td {
  background-color: var(--brand-bg-light);
}

.financial-table .col-amount {
  text-align: left;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* 10. Site Header */
.site-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(11, 38, 48, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--space-16);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  text-decoration: none;
}

.site-logo-img {
  height: 46px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

@media (max-width: 767px) {
  .site-logo-img {
    height: 38px;
    max-width: 170px;
  }
}

.logo-text-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-navy);
}

.logo-icon-svg {
  width: 36px;
  height: 36px;
}

.brand-badge {
  background-color: var(--brand-light);
  color: var(--text-navy);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
}

.main-navigation {
  display: none;
}

@media (min-width: 1024px) {
  .main-navigation {
    display: flex;
    align-items: center;
    gap: var(--space-24);
  }

  .main-navigation a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
  }

  .main-navigation a:hover,
  .main-navigation .current-menu-item > a {
    color: var(--brand-primary);
    background-color: var(--brand-bg-light);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  cursor: pointer;
}

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

/* 11. Hero Section */
.hero-section {
  padding: var(--space-48) 0;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-page) 100%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-32);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-48);
  }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  background-color: var(--brand-bg-light);
  border: 1px solid var(--brand-light);
  color: var(--brand-hover);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-16);
}

.hero-title {
  margin-bottom: var(--space-16);
  letter-spacing: -0.5px;
}

.hero-title span.highlight {
  color: var(--brand-primary);
  position: relative;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: var(--space-32);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.hero-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  border-top: 1px solid var(--border-card);
  padding-top: var(--space-24);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-item svg {
  color: var(--brand-primary);
  width: 18px;
  height: 18px;
}

/* 12. Mockup Card / Live Dashboard Preview */
.mockup-window {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 40px rgba(11, 38, 48, 0.08);
  overflow: hidden;
}

.mockup-header {
  background: var(--bg-page);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-dots {
  display: flex;
  gap: 6px;
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-input);
}

.mockup-dot:nth-child(1) { background: #FF5F56; }
.mockup-dot:nth-child(2) { background: #FFBD2E; }
.mockup-dot:nth-child(3) { background: #27C93F; }

.mockup-body {
  padding: var(--space-24);
}

.mockup-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.stat-box {
  background: var(--bg-page);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-navy);
}

/* 13. Features Grid */
.features-section {
  padding: var(--space-48) 0;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-48);
}

.section-tag {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: var(--space-8);
  display: block;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-24);
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-4px);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-bg-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-16);
}

.feature-icon-box svg {
  width: 26px;
  height: 26px;
}

/* 14. Pricing Cards */
.pricing-section {
  padding: var(--space-48) 0;
  background: var(--bg-page);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-24);
  align-items: stretch;
}

@media (min-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pricing-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: var(--space-32);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card.popular {
  border-color: var(--brand-primary);
  box-shadow: 0 12px 30px rgba(0, 118, 111, 0.12);
}

.popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--brand-primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
}

.pricing-price-wrap {
  margin: var(--space-24) 0;
  padding-bottom: var(--space-24);
  border-bottom: 1px solid var(--border-card);
}

.pricing-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-navy);
  font-variant-numeric: tabular-nums;
}

.pricing-unit {
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 6px;
}

.pricing-features-list {
  list-style: none;
  margin-bottom: var(--space-32);
  flex-grow: 1;
}

.pricing-features-list li {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: var(--space-12);
}

.pricing-features-list li svg {
  color: var(--brand-primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 15. FAQ Section */
.faq-section {
  padding: var(--space-48) 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  margin-bottom: var(--space-16);
  overflow: hidden;
}

.faq-question {
  padding: var(--space-24);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-icon {
  transition: transform 0.2s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 var(--space-24) var(--space-24);
  display: none;
  color: var(--text-main);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  display: block;
}

/* 16. Site Footer */
.site-footer {
  background-color: var(--text-navy);
  color: #D5E1E2;
  margin-top: auto;
  padding-top: var(--space-48);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-32);
  padding-bottom: var(--space-48);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-col h5 {
  color: #FFFFFF;
  margin-bottom: var(--space-16);
}

.footer-col p {
  color: #A3B8BE;
  font-size: 15px;
  line-height: 1.8;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-8);
}

.footer-links a {
  color: #D5E1E2;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--brand-light);
}

.footer-bottom {
  border-top: 1px solid #1E3A45;
  padding: var(--space-24) 0;
  text-align: center;
  font-size: 14px;
  color: #75898E;
}

/* 17. Mobile Menu Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #FFFFFF;
  z-index: 2000;
  padding: var(--space-24);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 38, 48, 0.5);
  z-index: 1999;
  display: none;
}

.drawer-backdrop.active {
  display: block;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-24);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-card);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-navy);
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.mobile-nav-links a {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-navy);
  text-decoration: none;
}

/* 18. WooCommerce Global Overrides */
.woocommerce-page .content-area {
  padding: var(--space-32) 0;
}

.woocommerce-cart-form, .woocommerce-checkout {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: var(--space-24);
}

.woocommerce table.shop_table {
  border-collapse: collapse;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  width: 100%;
}

.woocommerce table.shop_table th {
  background: var(--bg-page);
  color: var(--text-muted);
}

.woocommerce .button {
  background-color: var(--brand-primary) !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-sm) !important;
  min-height: 44px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
}

.woocommerce .button:hover {
  background-color: var(--brand-hover) !important;
}
