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

:root {
    --primary: #18a8ff;
    --primary-dark: #0788dc;
    --primary-light: #eaf7ff;

    --bg: #f5f9fc;
    --card: #ffffff;
    --text: #17212b;
    --muted: #71808d;
    --border: #e7eef4;

    --success: #16a66a;
    --danger: #ef5350;

    --radius: 20px;
}

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

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    font-family: Vazir, Tahoma, Arial, sans-serif;
    font-size: 14px;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.app {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 25px;
    font-weight: 900;
    background: linear-gradient(
        145deg,
        #48c3ff,
        #0799eb
    );
    box-shadow: 0 9px 22px rgba(24, 168, 255, .22);
}

.brand-title {
    font-size: 16px;
    font-weight: 900;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.wallet-card {
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    padding: 22px;
    color: white;
    background: linear-gradient(
        135deg,
        #22b4ff,
        #087fd0
    );
    box-shadow: 0 15px 35px rgba(12, 143, 215, .22);
    margin-bottom: 18px;
}

.wallet-card::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    left: -65px;
    top: -70px;
    background: rgba(255,255,255,.09);
}

.wallet-label {
    font-size: 12px;
    opacity: .9;
}

.wallet-balance {
    font-size: 25px;
    font-weight: 900;
    margin-top: 6px;
}

.wallet-unit {
    font-size: 12px;
    opacity: .85;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 2px 11px;
}

.section-title h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
}

.section-title span {
    color: var(--muted);
    font-size: 11px;
}

.categories {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 2px 1px 8px;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: white;
    border-radius: 15px;
    padding: 10px 15px;
    color: #44515c;
    font-size: 12px;
    transition: .2s ease;
}

.category.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 7px 18px rgba(24,168,255,.2);
}

.services {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
}

.service {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 5px 18px rgba(25, 65, 90, .04);
}

.service-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.service-name {
    font-size: 14px;
    font-weight: 900;
}

.service-description {
    color: var(--muted);
    line-height: 1.8;
    font-size: 11px;
    margin-top: 7px;
}

.price {
    flex: 0 0 auto;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: 11px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.order-button {
    width: 100%;
    border: 0;
    border-radius: 13px;
    margin-top: 13px;
    padding: 11px;
    color: white;
    background: var(--primary);
    font-weight: 800;
    font-size: 12px;
}

.order-button:active {
    transform: scale(.98);
}

.loading,
.empty,
.error {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    color: var(--muted);
}

.error {
    color: var(--danger);
}

.hidden {
    display: none !important;
}

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

@media (prefers-color-scheme: dark) {

    :root {
        --bg: #10171d;
        --card: #172127;
        --text: #f2f6f8;
        --muted: #9baab4;
        --border: #25343e;
        --primary-light: #123b52;
    }

    .category {
        background: var(--card);
        color: #d6e0e5;
    }

    .loading,
    .empty,
    .error {
        background: var(--card);
        border-color: var(--border);
    }
}

/* =========================
   ORDER MODAL
   ========================= */

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 25, 38, .48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card);
    border-radius: 27px 27px 0 0;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -15px 45px rgba(0, 0, 0, .18);
    animation: modalUp .22s ease-out;
}

@keyframes modalUp {
    from {
        transform: translateY(25px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 17px;
    font-weight: 900;
    color: var(--text);
}

.modal-description {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
    margin-top: 5px;
}

.modal-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 25px;
    line-height: 1;
}

.order-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    width: 100%;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}

.required {
    color: var(--danger);
    margin-right: 3px;
}

.form-control {
    display: block;
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    padding: 11px 13px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    transition: .18s ease;
}

textarea.form-control {
    resize: vertical;
    min-height: 95px;
    line-height: 1.8;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 168, 255, .10);
}

.order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    padding: 14px;
    border-radius: 15px;
    background: var(--primary-light);
    color: var(--text);
    font-size: 12px;
}

.order-summary strong {
    color: var(--primary-dark);
    font-size: 14px;
}

.form-error {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 13px;
    background: rgba(239, 83, 80, .09);
    border: 1px solid rgba(239, 83, 80, .18);
    color: var(--danger);
    font-size: 11px;
    line-height: 1.8;
}

.submit-order {
    width: 100%;
    border: 0;
    border-radius: 14px;
    margin-top: 13px;
    padding: 13px;
    color: white;
    background: linear-gradient(
        135deg,
        #27b5ff,
        #078ddc
    );
    box-shadow: 0 9px 22px rgba(24, 168, 255, .20);
    font-size: 13px;
    font-weight: 900;
}

.submit-order:disabled {
    opacity: .65;
    cursor: not-allowed;
}

@media (min-width: 600px) {
    .modal {
        align-items: center;
        padding: 20px;
    }

    .modal-card {
        border-radius: 27px;
        max-height: 85vh;
    }
}
