:root {
    --m-blue: #1f6db1;
    --m-blue-dark: #14528c;
    --m-mint: #99d4c0;
    --m-ink: #17212f;
    --m-muted: #6d7888;
    --m-line: #e7edf3;
    --m-soft: #f5f8fb;
}

body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    background: #eef2f6;
}

.home-page,
.home-page * {
    box-sizing: border-box;
}

.home-page {
    direction: rtl;
    padding: 14px 14px 0;
    color: var(--m-ink);
    background:
        radial-gradient(circle at 100% 4%, rgba(153, 212, 192, .13), transparent 220px),
        #f9fbfd;
    font-family: "YekanBakhHibrand", IRANSans, sans-serif;
}

.home-section {
    margin: 0 0 18px;
}

.home-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--m-blue);
    font-size: 10px;
    font-weight: 500;
}

.home-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.home-section__head h2 {
    margin: 0;
    color: var(--m-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}

.home-section__head p {
    margin: 2px 0 0;
    color: var(--m-muted);
    font-size: 10px;
}

.home-section__head > a {
    flex: 0 0 auto;
    color: var(--m-blue);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
}

.home-section__head > a::after {
    content: " ←";
}

/* Active request */
.request-card {
    padding: 14px;
    border: 1px solid rgba(31, 109, 177, .13);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(31, 65, 99, .06);
}

.request-card__top,
.request-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.request-card__top h1 {
    max-width: 245px;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-card__live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 20px;
    color: #34735f;
    background: #eff9f5;
    font-size: 9px;
    white-space: nowrap;
}

.request-card__live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4bb38d;
    box-shadow: 0 0 0 4px rgba(75, 179, 141, .12);
    animation: request-pulse 1.6s ease-out infinite;
}

@keyframes request-pulse {
    0% { box-shadow: 0 0 0 0 rgba(75, 179, 141, .42); }
    65% { box-shadow: 0 0 0 7px rgba(75, 179, 141, 0); }
    100% { box-shadow: 0 0 0 0 rgba(75, 179, 141, 0); }
}

.request-progress {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin: 17px 10px 12px;
}

.request-progress::before,
.request-progress::after {
    position: absolute;
    top: 11px;
    right: 12px;
    left: 12px;
    height: 2px;
    border-radius: 2px;
    content: "";
}

.request-progress::before {
    background: #e5ebf1;
}

.request-progress::after {
    left: auto;
    width: calc((100% - 24px) * var(--request-progress) / 100);
    background: linear-gradient(90deg, var(--m-mint), var(--m-blue));
}

.request-progress__step {
    position: relative;
    z-index: 1;
    display: flex;
    width: 24%;
    flex-direction: column;
    align-items: center;
    color: #909aa7;
}

.request-progress__step:first-child { align-items: flex-start; }
.request-progress__step:last-child { align-items: flex-end; }

.request-progress__step span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid #e5ebf1;
    border-radius: 50%;
    background: #fff;
    font-size: 9px;
    font-weight: 700;
}

.request-progress__step span svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.request-progress__step small {
    margin-top: 5px;
    font-size: 10px;
    white-space: nowrap;
}

.request-progress__step.is-done {
    color: var(--m-blue);
}

.request-progress__step.is-done span {
    border-color: var(--m-blue);
    color: #fff;
    background: var(--m-blue);
}

.request-card__bottom {
    padding-top: 10px;
    border-top: 1px solid #eef2f5;
}

.request-card__bottom p {
    margin: 0;
    color: var(--m-muted);
    font-size: 9px;
}

.request-card__bottom a {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(31, 109, 177, .22);
    border-radius: 9px;
    color: var(--m-blue);
    background: #f7fbff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* Assistant */
.assistant-card {
    position: relative;
    min-height: 226px;
    overflow: hidden;
    padding: 23px 20px 18px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 22%, rgba(153, 212, 192, .45), transparent 95px),
        radial-gradient(circle at 88% 100%, rgba(113, 70, 218, .45), transparent 170px),
        linear-gradient(135deg, #135b9a 0%, #1f6db1 52%, #2938a7 100%);
    box-shadow: 0 16px 36px rgba(31, 109, 177, .25);
}

.assistant-card::before {
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 19px 19px;
    content: "";
    mask-image: linear-gradient(90deg, #000, transparent 70%);
}

.assistant-card__copy {
    position: relative;
    z-index: 2;
    width: 64%;
}

.assistant-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    background: rgba(255,255,255,.1);
    font-size: 9px;
}

.assistant-card__badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--m-mint);
    box-shadow: 0 0 0 4px rgba(153, 212, 192, .15);
}

.assistant-card h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 450;
    line-height: 1.55;
}

.assistant-card h1 strong {
    color: #bfe9db;
    font-weight: 780;
}

.assistant-card__copy p {
    margin: 7px 0 0;
    overflow: hidden;
    color: rgba(255,255,255,.76);
    font-size: 9px;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assistant-card__mascot {
    position: absolute;
    z-index: 1;
    bottom: 12px;
    left: -3px;
    width: 145px;
    max-height: 198px;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,.22));
}

.assistant-entry {
    position: absolute;
    z-index: 3;
    right: 16px;
    bottom: 14px;
    left: 16px;
    display: flex;
    height: 52px;
    align-items: center;
    gap: 9px;
    padding: 6px 7px 6px 13px;
    border: 1px solid rgba(255,255,255,.56);
    border-radius: 17px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 25px rgba(17, 42, 83, .22);
}

.assistant-entry input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--m-ink);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
}

.assistant-entry input::placeholder { color: #98a3b1; }

.assistant-entry button {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: var(--m-blue);
    cursor: pointer;
}

.assistant-entry button svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transform: rotate(180deg);
}

/* My car */
.my-car-card {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #d7e6f2;
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 50%, rgba(153, 212, 192, .16), transparent 95px),
        #f3f8fc;
    box-shadow: 0 7px 22px rgba(31, 65, 99, .05);
}

.my-car-card__icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 15px;
    color: var(--m-blue);
    background: linear-gradient(145deg, #e8f3fc, #edf9f5);
}

.my-car-card__icon svg {
    width: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.my-car-card__content {
    min-width: 0;
    flex: 1;
}

.my-car-card__content strong,
.my-car-card__content small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-car-card__content strong { font-size: 14px; }
.my-car-card__content small { margin-top: 2px; color: var(--m-muted); font-size: 9px; }

.my-car-card > a {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 10px;
    color: #fff;
    background: #3475ad;
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

/* Products */
.product-row {
    display: grid;
    grid-auto-columns: 136px;
    grid-auto-flow: column;
    gap: 9px;
    margin: 0 -14px;
    padding: 0 14px 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.product-row::-webkit-scrollbar { display: none; }

.home-product {
    position: relative;
    display: flex;
    min-height: 215px;
    flex-direction: column;
    padding: 9px;
    border: 1px solid var(--m-line);
    border-radius: 16px;
    color: inherit;
    background: #fff;
    box-shadow: 0 5px 17px rgba(31, 65, 99, .045);
    scroll-snap-align: start;
    text-decoration: none;
}

.home-product__image {
    position: relative;
    display: grid;
    height: 112px;
    margin-bottom: 8px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
}

.home-product__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.home-product__image i {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 5px;
    border-radius: 6px;
    color: #fff;
    background: #df5b5b;
    font-size: 8px;
    font-style: normal;
}

.home-product > strong {
    display: -webkit-box;
    min-height: 38px;
    overflow: hidden;
    color: #293445;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-product__price {
    display: flex;
    min-height: 27px;
    align-items: flex-end;
    gap: 3px;
    margin-top: auto;
    color: var(--m-blue);
}

.home-product__price b { font-size: 11px; font-weight: 750; }
.home-product__price small { padding-bottom: 1px; color: var(--m-muted); font-size: 8px; }

.home-product__action {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 9px;
    color: var(--m-blue);
    background: #edf5fc;
}

.home-product__action svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* Banners */
.promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.promo-card {
    position: relative;
    min-height: 120px;
    overflow: hidden;
    padding: 13px;
    border: 1px solid #e5ebf1;
    border-radius: 18px;
    color: var(--m-ink);
    text-decoration: none;
}

.promo-card--service { background: #ecf0fa; }
.promo-card--market { background: #efe9fb; }

.promo-card div {
    position: relative;
    z-index: 2;
    width: 74%;
}

.promo-card span,
.promo-card strong,
.promo-card small { display: block; }
.promo-card span { color: var(--m-blue); font-size: 9px; font-weight: 700; }
.promo-card strong { margin-top: 3px; font-size: 12px; line-height: 1.6; }
.promo-card small { margin-top: 13px; color: var(--m-muted); font-size: 8px; }

.promo-card small::after {
    display: inline-grid;
    width: 15px;
    height: 15px;
    margin-right: 4px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--m-blue);
    content: "←";
}

.promo-card__visual {
    position: absolute;
    bottom: 5px;
    left: 4px;
    display: grid !important;
    width: 88px;
    height: 68px;
    place-items: center;
    color: #7f9fba !important;
    opacity: .9;
}

.promo-card__visual img {
    width: 80px;
    height: 80px;
}

.promo-card--service .promo-card__visual { color: #ecf0fa !important; }

.promo-card__visual .promo-accent {
    color: var(--m-blue);
    stroke: currentColor;
}

/* Categories */
.category-section {
    padding: 15px 13px;
    border: 1px solid var(--m-line);
    border-radius: 19px;
    background: #fff;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.category-item {
    min-width: 0;
    color: var(--m-ink);
    text-align: center;
    text-decoration: none;
}

.category-item span {
    display: grid;
    width: 100%;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--category-accent);
}

.category-item img {
    width: 72%;
    height: 72%;
    object-fit: contain;
}

.category-item strong {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Magazine */
.magazine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.magazine-card,
.magazine-skeleton {
    overflow: hidden;
    border: 1px solid var(--m-line);
    border-radius: 15px;
    background: #fff;
}

.magazine-card {
    color: inherit;
    text-decoration: none;
}

.magazine-card__image,
.magazine-skeleton i {
    display: block;
    width: 100%;
    height: 102px;
    object-fit: cover;
    background: #edf1f5;
}

.magazine-card__body {
    min-height: 82px;
    padding: 9px 10px;
}

.magazine-card__body strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.magazine-card__body small {
    display: block;
    margin-top: 5px;
    color: var(--m-muted);
    font-size: 8px;
}

.magazine-skeleton i,
.magazine-skeleton span,
.magazine-skeleton small {
    background: linear-gradient(90deg, #edf1f5, #f7f9fb, #edf1f5);
    background-size: 200% 100%;
    animation: home-shimmer 1.4s infinite;
}

.magazine-skeleton span,
.magazine-skeleton small {
    display: block;
    height: 9px;
    margin: 11px 10px 0;
    border-radius: 5px;
}

.magazine-skeleton small {
    width: 55%;
    margin-bottom: 13px;
}

.magazine-error {
    grid-column: 1 / -1;
    margin: 0;
    padding: 28px 18px;
    border: 1px dashed #d8e0e8;
    border-radius: 15px;
    color: var(--m-muted);
    background: #fff;
    font-size: 10px;
    text-align: center;
}

@keyframes home-shimmer {
    to { background-position: -200% 0; }
}

/* Home-only footer */
.home-footer {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 22px;
    margin: 30px -14px 0;
    padding: 25px 20px calc(22px + env(safe-area-inset-bottom));
    color: rgba(255,255,255,.78);
    background:
        radial-gradient(circle at 15% 0, rgba(31, 109, 177, .42), transparent 190px),
        #111d2c;
}

.home-footer__brand img {
    width: 114px;
    filter: brightness(0) invert(1);
}

.home-footer__brand p {
    margin: 12px 0;
    font-size: 11px;
    line-height: 2;
}

.home-footer__social {
    display: flex;
    gap: 7px;
}

.home-footer__social a {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 9px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 9px;
    text-decoration: none;
}

.home-footer__links {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.home-footer__links strong {
    margin-bottom: 3px;
    color: #fff;
    font-size: 11px;
}

.home-footer__links a {
    color: rgba(255,255,255,.75);
    font-size: 11px;
    text-decoration: none;
}

.home-footer__bottom {
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 8px;
}

.home-footer__bottom a { color: inherit; text-decoration: none; }

.home-footer__badges {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.home-footer__badges a {
    display: grid;
    min-width: 82px;
    height: 42px;
    place-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    background: rgba(255,255,255,.96);
}

.home-footer__badges img {
    width: auto;
    max-width: 72px;
    max-height: 32px;
    object-fit: contain;
}

.home-footer__badges a:last-child {
    min-width: 48px;
}

.home-footer__badges a:last-child img {
    max-width: 38px;
    max-height: 36px;
}

@media (max-width: 360px) {
    .assistant-card h1 { font-size: 19px; }
    .assistant-card__mascot { width: 128px; }
    .category-grid { gap: 4px; }
    .category-item strong { font-size: 7px; }
    .promo-card { padding: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .magazine-skeleton i,
    .magazine-skeleton span,
    .magazine-skeleton small,
    .request-card__live i { animation: none; }
}
