/* Base layout + design tokens — light, calm palette built around the real
   brand mark's exact teal (#00AB9F), RTL, Vazirmatn. Self-hosted fonts
   only, no Google Fonts CDN (see AGENTS.md "Lightweight/performance
   conventions").

   This replaces an earlier dark navy + amber palette that was designed
   before the real logo existed. The brand's own product promise is
   "peace for the household" — a dark, high-contrast tech palette fought
   that message, and it was never based on the actual logo color anyway.
   --accent carries the exact brand hex unmodified (logo, buttons, large
   fills); --accent-text is a deeper shade used wherever the color sits as
   *text* or a thin icon stroke on the light background, since the exact
   brand teal alone doesn't reach readable contrast there (~2.7:1) — see
   the accent-on-button vs accent-as-text distinction used throughout. */

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

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

:root {
    --bg: oklch(0.985 0.006 195);
    --surface: oklch(0.998 0.002 195);
    --surface-2: oklch(0.955 0.02 190);
    --surface-3: oklch(0.925 0.028 188);
    --border: oklch(0.87 0.03 190);
    --text: oklch(0.22 0.02 220);
    --text-dim: oklch(0.47 0.02 210);
    --accent: #00ab9f;
    --accent-text: oklch(0.42 0.10 195);
    --accent-ink: oklch(0.14 0.02 210);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding-bottom: 58px; /* clears the fixed .contact-bar so it never overlaps footer content */
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    direction: rtl;
}

a {
    color: var(--accent-text);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    min-height: 44px;
    padding: 13px 26px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    border-radius: 2px;
    box-sizing: border-box;
}

.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.flash-success { background: oklch(0.55 0.14 150 / 20%); }
.flash-error, .flash-danger { background: oklch(0.55 0.18 25 / 20%); }
.flash-warning { background: oklch(0.75 0.15 70 / 20%); }
.flash-info { background: oklch(0.55 0.1 230 / 20%); }

.mono {
    /* No second typeface — self-hosting a mono face just for a few
       numbers isn't worth the extra font weight, and falling back to
       whatever monospace the OS has looked inconsistent next to
       Vazirmatn. Vazirmatn's own numerals + tabular-nums is enough. */
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.2px;
}

h1, h2, h3 { text-wrap: balance; }
p { max-width: 68ch; }

/* ---- Header / nav ---- */
.site-header {
    border-bottom: 1px solid var(--border);
}

.site-header__row {
    height: 88px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.brand__mark {
    /* The real logo is itself a solid colored mark, not an icon that
       needs a colored box behind it — no background here, unlike the
       placeholder droplet icon this replaced. */
    width: 30px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand__mark--sm { width: 22px; height: 19px; }

/* The full printed lockup (mark + Persian name + flag colors) used in
   the header — served as a real cacheable .svg file (not inlined; it's
   34KB and would otherwise be re-sent with every page's HTML) via
   <img>, height-constrained with width following its own aspect ratio
   (viewBox ~4.34:1) so it never distorts. */
.brand--lockup img {
    display: block;
    height: 40px;
    width: auto;
}

.brand__name {
    font-size: 19px;
    font-weight: 800;
}

.site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    font-size: 14px;
}

.site-nav a {
    color: var(--text-dim);
    font-weight: 600;
}

.site-nav a:hover { color: var(--accent-text); }

.header-phone {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: var(--accent-text);
    flex-shrink: 0;
}

.header-phone:hover { opacity: 0.8; }

.header-phone__text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.header-phone__num {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.header-phone__note {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
}

/* Transparent on desktop so .header-phone and .nav-toggle act as direct
   flex children of .site-header__row (keeps the existing logo/nav/phone
   space-between layout exactly as it was) -- becomes a real flex box on
   mobile instead, see the 640px breakpoint below. */
.header-actions {
    display: contents;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle__bar {
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar--top { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar--mid { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar--bot { transform: translateY(-5px) rotate(-45deg); }

/* A real ring-ring cadence -- a quick wiggle burst, then a long pause --
   rather than a constant jiggle, so it reads as "ringing" instead of
   just nervous motion. */
@keyframes phone-ring {
    0%, 70%, 100% { transform: rotate(0deg); }
    72%, 80%, 88% { transform: rotate(-15deg); }
    76%, 84%, 92% { transform: rotate(15deg); }
}
.phone-ring {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: phone-ring 3.6s ease-in-out infinite;
}

/* ---- Hero ---- */
.hero {
    position: relative;
    overflow: hidden;
}

.hero__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 56px;
    padding: 64px 0 48px;
    position: relative;
}

.hero__copy {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    min-width: 0;
}

.badge {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--accent-text);
    font-weight: 600;
    padding: 5px 12px;
    border: 1px solid var(--accent-text);
    border-radius: 999px;
}

.hero__title {
    font-size: 44px;
    font-weight: 900;
    line-height: 1.24;
    margin: 0;
}

.hero__title .accent { color: var(--accent-text); }

.hero__lede {
    font-size: 16px;
    color: var(--text-dim);
    line-height: 1.9;
    max-width: 46ch;
}

.hero__ctas {
    display: flex;
    flex-direction: row;
    gap: 14px;
    margin-top: 6px;
}

.btn-outline {
    display: inline-block;
    min-height: 44px;
    padding: 13px 26px;
    border: 1.5px solid var(--border);
    color: var(--text);
    font-weight: 700;
    border-radius: 2px;
    box-sizing: border-box;
}

.hero__art {
    flex: 0 0 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Trust strip ---- */
.trust-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    margin: 0 0 64px;
}

.trust-item {
    background: var(--surface-2);
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trust-item__icon {
    color: var(--accent-text);
    margin-bottom: 2px;
}
.trust-item__icon svg { width: 30px; height: 24px; display: block; }

.trust-item__stat {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-text);
}

.trust-item__label {
    font-size: 14px;
    font-weight: 700;
}

.trust-item__desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ---- Section ---- */
.section {
    padding: 0 0 64px;
}

.section__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.section__title {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
}

.section__lede {
    font-size: 14.5px;
    color: var(--text-dim);
}

/* ---- Feature grid ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
}

.feature-card {
    background: var(--surface-2);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-card__icon { color: var(--accent-text); }
.feature-card__icon svg { width: 34px; height: 34px; display: block; }
.feature-card__title { font-size: 14px; font-weight: 700; }
.feature-card__desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }

/* ---- Signature feature icons (see includes/partials/feature-icon.php) ----
   Each animation narrates its feature rather than decorating it: silent
   operation's sound waves ripple out and fade to nothing, self-priming's
   dashes march upward, the motor turns slowly, etc. All pure CSS,
   transform/opacity only (no layout thrash), and fully disabled under
   prefers-reduced-motion below. */

@keyframes icon-pulse-ring {
    0% { transform: scale(0.55); opacity: 0.9; }
    70% { opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}
.icon-pulse-ring {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: icon-pulse-ring 2.4s ease-out infinite;
}
.icon-pulse-ring--delay { animation-delay: 1.2s; }

@keyframes icon-check-blink {
    0%, 100% { opacity: 0; stroke-dashoffset: 10; }
    15% { opacity: 1; }
    45%, 75% { stroke-dashoffset: 0; opacity: 1; }
    90% { opacity: 0; }
}
.icon-check-blink { animation: icon-check-blink 3.2s ease-in-out infinite; }

@keyframes icon-shield-glow {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
.icon-shield-glow { animation: icon-shield-glow 2.6s ease-in-out infinite; }

@keyframes icon-wave-fade {
    0% { opacity: 0.9; }
    70%, 100% { opacity: 0; }
}
.icon-wave { animation: icon-wave-fade 1.8s ease-out infinite; }
.icon-wave-1 { animation-delay: 0s; }
.icon-wave-2 { animation-delay: 0.25s; }
.icon-wave-3 { animation-delay: 0.5s; }

@keyframes icon-flow-dash {
    to { stroke-dashoffset: -12; }
}
.icon-flow-dash { animation: icon-flow-dash 1.1s linear infinite; }

@keyframes icon-motor-spin {
    to { transform: rotate(360deg); }
}
.icon-motor-spin {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: icon-motor-spin 7s linear infinite;
}

/* ---- Flag icon: waving with a proud, unhurried rhythm ---- */
@keyframes flag-wave {
    0%, 100% { transform: skewY(0deg); }
    25% { transform: skewY(-3deg); }
    50% { transform: skewY(0deg); }
    75% { transform: skewY(3deg); }
}
.flag-wave {
    transform-box: fill-box;
    transform-origin: 0% 50%;
    animation: flag-wave 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .icon-pulse-ring, .icon-check-blink, .icon-shield-glow,
    .icon-wave, .icon-flow-dash, .icon-motor-spin, .flag-wave, .phone-ring {
        animation: none;
    }
    .icon-pulse-ring, .icon-wave { opacity: 0.9; }
    .icon-check-blink, .icon-flow-dash { stroke-dashoffset: 0; opacity: 1; }
}

/* ---- Product cards ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-card__model {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent-text);
}

.product-card__name {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.product-card__tagline {
    font-size: 13.5px;
    color: var(--text-dim);
}

.product-card__specs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0;
}

.spec-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.spec-row:last-child { border-bottom: none; }
.spec-row__label { color: var(--text-dim); }
.spec-row__value { font-weight: 600; }

.wide-voltage-note {
    font-size: 12.5px;
    color: var(--accent-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Warranty CTA ---- */
.warranty-cta {
    background: var(--surface-3);
    padding: 48px 0;
    margin-bottom: 64px;
}

.warranty-cta__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.warranty-cta__copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 52ch;
}

.warranty-cta__title { font-size: 24px; font-weight: 800; margin: 0; }
.warranty-cta__desc { font-size: 14px; color: var(--text-dim); }
.warranty-cta__actions { display: flex; flex-direction: row; gap: 14px; margin-top: 4px; }

/* ---- Footer ---- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 44px 0;
}

.site-footer__grid {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-dim);
    min-width: 160px;
}

.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--accent-text); }

.footer-col a.footer-phone {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: var(--accent-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.footer-col__title {
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.footer-legal, .footer-address { max-width: 30ch; line-height: 1.8; }

.footer-col--badge { align-items: flex-end; }

.enamad-placeholder {
    width: 74px;
    height: 88px;
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    color: var(--text-dim);
    text-align: center;
    padding: 6px;
}

/* ---- Product detail page ---- */
.product-hero {
    padding: 48px 0 32px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
}

.product-hero__art {
    flex: 0 0 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-hero__body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 32px;
}

.spec-table th, .spec-table td {
    text-align: right;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

.table-scroll { overflow-x: auto; }

.breadcrumb {
    font-size: 13px;
    color: var(--text-dim);
    padding-top: 24px;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent-text); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .site-nav { gap: 18px; font-size: 13px; }
    .brand--lockup img { height: 30px; }
    .header-phone__note { display: none; }
    .hero__row { flex-direction: column; padding-top: 40px; }
    .hero__art { order: -1; flex-basis: auto; }
    .hero__title { font-size: 32px; }
    .trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .warranty-cta__row { flex-direction: column; align-items: flex-start; }
    .product-hero { flex-direction: column; }
    .product-hero__art { order: -1; flex-basis: auto; }
    .site-footer__grid { flex-direction: column; }
}

/* True mobile: logo/nav/phone no longer fit in one row (this is the
   fix for the header overflowing on phones -- previously .site-nav had
   no collapse behavior at all, so adding the phone CTA pushed it past
   the viewport width). Nav becomes a toggled dropdown; phone becomes
   an icon-only tap target instead of icon+number+note. */
@media (max-width: 640px) {
    .site-header__row { position: relative; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 12px 20px 16px;
        box-shadow: 0 8px 16px oklch(0.2 0.02 220 / 8%);
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 8px 0; width: 100%; }

    .header-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 2px;
    }
    .header-phone { padding: 10px; }
    .header-phone__text { display: none; }
    .nav-toggle { display: flex; }
}

/* ---- Persistent bottom contact bar (call / WhatsApp / Bale) ---- */
.contact-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: row;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 16px oklch(0.2 0.02 220 / 10%);
}

.contact-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px 10px;
    min-height: 56px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
}

.contact-bar__item:not(:first-child) {
    border-inline-start: 1px solid var(--border);
}

.contact-bar__item:hover { background: var(--surface-2); }
.contact-bar__item svg { display: block; }

.contact-bar__item--call { color: var(--accent-text); }
.contact-bar__item--whatsapp { color: #25d366; }
.contact-bar__item--bale { color: var(--accent-text); }
