/**
 * هیمونا — اجزای صفحه اصلی و کارت‌ها
 */

/* ===== بنرهای بالای صفحه ===== */
.hm-hero {
        display: grid;
        grid-template-columns: 2.4fr 1fr;
        gap: 12px;
        margin: 16px 0 28px;
}

.hm-hero__slide {
        position: relative;
        height: 320px;
        border-radius: var(--hm-radius-lg);
        background-color: #0d3450;
        background-image:
                linear-gradient(105deg, #0d3450 0%, #144566 42%, rgba(20, 69, 102, 0.35) 78%, rgba(20, 69, 102, 0.05) 100%),
                url('../img/hero.jpg');
        background-size: cover;
        background-position: left center;
        color: #fff;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 8px;
        padding: 36px;
        overflow: hidden;
}

.hm-hero__slide::after {
        content: '';
        position: absolute;
        inset-inline-end: -80px;
        top: -80px;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
}

.hm-hero__slide::before {
        content: '';
        position: absolute;
        inset-inline-end: 40px;
        bottom: -120px;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
}

.hm-hero__tag {
        position: relative;
        z-index: 1;
        background: rgba(255, 255, 255, 0.2);
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 11.5px;
        font-weight: 500;
}

.hm-hero__title {
        position: relative;
        z-index: 1;
        font-size: 30px;
        font-weight: 800;
        line-height: 1.5;
}

.hm-hero__subtitle {
        position: relative;
        z-index: 1;
        font-size: 14px;
        opacity: 0.9;
}

.hm-hero__cta {
        position: relative;
        z-index: 1;
        margin-top: 10px;
        background: #fff;
        color: var(--hm-primary);
        font-size: 13px;
        font-weight: 700;
        padding: 10px 26px;
        border-radius: var(--hm-radius-sm);
}

.hm-hero__side {
        display: grid;
        grid-template-rows: 1fr 1fr;
        gap: 12px;
}

.hm-hero__banner {
        border-radius: var(--hm-radius);
        border: 1px solid var(--hm-border);
        background: var(--hm-surface);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 4px;
        padding: 20px;
        overflow: hidden;
        position: relative;
}

.hm-hero__banner::after {
        content: '';
        position: absolute;
        inset-inline-end: -30px;
        bottom: -30px;
        width: 110px;
        height: 110px;
        border-radius: 50%;
        background: var(--hm-primary-soft);
        transition: transform 0.25s ease;
}

.hm-hero__banner strong {
        position: relative;
        z-index: 1;
        font-size: 15px;
        font-weight: 700;
}

.hm-hero__banner span {
        position: relative;
        z-index: 1;
        font-size: 12px;
        color: var(--hm-text-2);
}

/* ===== بخش‌ها ===== */
.hm-section {
        margin-bottom: 28px;
}

.hm-section__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
}

.hm-section__title {
        font-size: 17px;
        font-weight: 800;
        margin: 0;
        position: relative;
        padding-inline-start: 14px;
}

.hm-section__title::before {
        content: '';
        position: absolute;
        inset-inline-start: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 5px;
        height: 22px;
        border-radius: 4px;
        background: var(--hm-primary);
}

.hm-section__more {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--hm-secondary);
}

.hm-section__more .hm-icon {
        transform: scaleX(-1);
}

.hm-section__more:hover {
        color: var(--hm-primary);
}

/* ===== پیشنهاد شگفت‌انگیز ===== */
.hm-amazing__inner {
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        padding: 14px 16px 18px;
}

.hm-amazing__head {
        display: flex;
        align-items: center;
        gap: 18px;
        flex-wrap: wrap;
        margin-bottom: 14px;
}

.hm-amazing__title {
        display: inline-flex;
        align-items: center;
        gap: 10px;
}

.hm-amazing__title strong {
        font-size: 17px;
        font-weight: 800;
        color: var(--hm-deal);
}

.hm-amazing__icon {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--hm-deal-soft);
        color: var(--hm-deal);
}

.hm-amazing__timer {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-inline-start: auto;
}

.hm-amazing__timer-label {
        font-size: 11.5px;
        color: var(--hm-text-3);
}

.hm-amazing__timer-clock {
        direction: ltr;
        font-size: 15px;
        font-weight: 700;
        background: var(--hm-text);
        color: #fff;
        padding: 4px 10px;
        border-radius: var(--hm-radius-sm);
        letter-spacing: 1px;
}

.hm-amazing__head .hm-section__more {
        margin-inline-start: 0;
}

/* ===== ریل اسکرولی ===== */
.hm-rail {
        position: relative;
}

.hm-rail__track {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
}

.hm-rail__track::-webkit-scrollbar {
        display: none;
}

.hm-rail__track > * {
        scroll-snap-align: start;
}

/* درگ با ماوس در دسکتاپ (به‌جای فلش‌ها) */
@media (hover: hover) and (pointer: fine) {
        .hm-rail__track {
                cursor: grab;
        }

        .hm-rail__track.is-dragging {
                cursor: grabbing;
                scroll-snap-type: none;
                user-select: none;
                -webkit-user-select: none;
        }

        .hm-rail__track.is-dragging-snap {
                scroll-snap-type: none;
        }
}

/* تصاویر داخل ریل نباید با ماوس کشیده شوند */
.hm-rail__track img {
        -webkit-user-drag: none;
        pointer-events: none;
}

/* ===== کارت محصول ===== */
.hm-card {
        position: relative;
        flex: 0 0 186px;
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        padding: 10px;
        transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.hm-card:hover {
        box-shadow: var(--hm-shadow-lg);
        border-color: transparent;
        transform: translateY(-2px);
}

.hm-card__link {
        display: flex;
        flex-direction: column;
        height: 100%;
}

.hm-card__badge {
        position: absolute;
        top: 10px;
        inset-inline-end: 10px;
        z-index: 2;
        background: var(--hm-deal);
        color: #fff;
        font-size: 9.5px;
        font-weight: 700;
        padding: 3px 8px;
        border-radius: 20px;
}

.hm-card__img {
        position: relative;
        border-radius: var(--hm-radius-sm);
        overflow: hidden;
        background: #fafbfc;
        margin-bottom: 10px;
}

.hm-card__img::before {
        content: '';
        display: block;
        padding-top: 100%;
}

.hm-card__img img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 6px;
        transition: transform 0.25s ease;
}

.hm-card:hover .hm-card__img img {
        transform: scale(1.05);
}

.hm-card__title {
        font-size: 12.5px;
        font-weight: 500;
        line-height: 1.7;
        height: 42.5px;
        margin: 0 0 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--hm-text);
}

.hm-card__link:hover .hm-card__title {
        color: var(--hm-primary);
}

.hm-card__rating {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: var(--hm-text-3);
        margin-bottom: auto;
}

.hm-card__rating .hm-icon {
        color: var(--hm-warning);
        fill: var(--hm-warning);
}

.hm-card__price {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 6px;
        margin-top: 10px;
        min-height: 38px;
}

.hm-card__discount {
        background: var(--hm-deal);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        padding: 2px 7px;
        border-radius: 20px;
        line-height: 1.6;
}

.hm-card__price-col {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 1px;
}

.hm-card__regular {
        font-size: 11px;
        color: var(--hm-text-3);
}

.hm-card__final {
        font-size: 14px;
        font-weight: 700;
        color: var(--hm-text);
        white-space: nowrap;
}

.hm-card__final--na {
        color: var(--hm-text-3);
        font-weight: 500;
        font-size: 12.5px;
}

/* حالت کارت در ریل شگفت‌انگیز */
.hm-amazing__rail .hm-card {
        flex-basis: 172px;
        border-color: var(--hm-border);
}

/* شبکه محصولات (جستجو و ...) */
.hm-products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
        gap: 10px;
}

.hm-products-grid .hm-card {
        flex: initial;
}

/* ===== دسته‌بندی‌های گرد ===== */
.hm-cat-tiles {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 14px;
}

.hm-cat-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 16px 8px;
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hm-cat-tile:hover {
        border-color: var(--hm-primary);
        box-shadow: var(--hm-shadow);
        transform: translateY(-3px);
}

.hm-cat-tile__icon {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: var(--hm-bg);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--hm-text-2);
        transition: background 0.2s ease, color 0.2s ease;
}

.hm-cat-tile:hover .hm-cat-tile__icon {
        background: var(--hm-primary-soft);
        color: var(--hm-primary);
}

.hm-cat-tile__label {
        font-size: 12.5px;
        font-weight: 500;
        text-align: center;
}

/* ===== کارت مقاله ===== */
.hm-mag {
        background: var(--hm-surface);
        border-top: 1px solid var(--hm-border);
        border-bottom: 1px solid var(--hm-border);
        padding-block: 28px;
        margin-top: 8px;
}

.hm-mag__grid,
.hm-posts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
}

.hm-posts-grid {
        grid-template-columns: repeat(2, 1fr);
}

.hm-post-card {
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        overflow: hidden;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hm-post-card:hover {
        box-shadow: var(--hm-shadow-lg);
        transform: translateY(-2px);
}

.hm-post-card__img {
        display: block;
        position: relative;
        aspect-ratio: 16 / 9;
        background: var(--hm-bg);
}

.hm-post-card__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
}

.hm-post-card__placeholder {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--hm-text-3);
        background: linear-gradient(135deg, #f6f7f8, #eef0f2);
}

.hm-post-card__body {
        padding: 14px 16px 16px;
}

.hm-post-card__title {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 8px;
        line-height: 1.7;
}

.hm-post-card__title a:hover {
        color: var(--hm-primary);
}

.hm-post-card__excerpt {
        font-size: 12.5px;
        color: var(--hm-text-2);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 10px;
}

.hm-post-card__meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11px;
        color: var(--hm-text-3);
}

.hm-post-card__more {
        color: var(--hm-secondary);
        font-weight: 500;
}

.hm-post-card__more:hover {
        color: var(--hm-primary);
}

/* ===== وبلاگ و برگه‌ها ===== */
.hm-blog-layout {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 28px;
        padding-block: 24px;
        align-items: start;
}

body.hm-no-blog-sidebar .hm-blog-layout {
        grid-template-columns: 1fr;
}

.hm-page-head {
        margin-bottom: 20px;
}

.hm-page-title {
        font-size: 21px;
        font-weight: 800;
}

.hm-page-title span {
        color: var(--hm-primary);
}

.hm-sidebar .hm-widget {
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        padding: 16px;
        margin-bottom: 16px;
}

.hm-widget__title {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--hm-border);
}

.hm-sidebar ul li {
        padding: 6px 0;
        font-size: 13px;
        color: var(--hm-text-2);
}

.hm-sidebar ul a:hover {
        color: var(--hm-primary);
}

/* نوشته تکی */
.hm-page-area {
        padding-block: 24px;
}

.hm-single-post {
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        padding: 28px;
        margin-bottom: 20px;
}

.hm-single-post__title {
        font-size: 22px;
        font-weight: 800;
}

.hm-single-post__meta {
        display: flex;
        gap: 16px;
        font-size: 12px;
        color: var(--hm-text-3);
        margin-bottom: 18px;
}

.hm-single-post__thumb {
        border-radius: var(--hm-radius);
        overflow: hidden;
        margin-bottom: 20px;
}

.hm-single-post__content {
        font-size: 14.5px;
        line-height: 2.2;
        color: var(--hm-text);
}

.hm-single-post__content h2 {
        font-size: 19px;
        margin-top: 1.8em;
}

.hm-single-post__content h3 {
        font-size: 16.5px;
        margin-top: 1.6em;
}

.hm-single-post__content a {
        color: var(--hm-primary);
        text-decoration: underline;
        text-underline-offset: 4px;
}

.hm-single-post__content img {
        border-radius: var(--hm-radius-sm);
        margin-block: 14px;
}

.hm-single-post__content blockquote {
        border-inline-start: 4px solid var(--hm-primary);
        background: var(--hm-bg);
        padding: 14px 18px;
        border-radius: var(--hm-radius-sm);
        margin: 1.4em 0;
        color: var(--hm-text-2);
}

.hm-post-nav {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        font-size: 12.5px;
}

.hm-post-nav a {
        color: var(--hm-secondary);
        font-weight: 500;
}

/* نظرات */
.hm-content-area .comment-list .comment {
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius);
        padding: 16px;
        margin-bottom: 14px;
}

.hm-content-area .comment-list .children {
        margin-inline-start: 20px;
        margin-top: 14px;
}

.hm-content-area .comment-meta {
        font-size: 11.5px;
        color: var(--hm-text-3);
        margin-bottom: 8px;
}

.hm-content-area .comment-reply-title,
.hm-content-area .comments-title {
        font-size: 16px;
        font-weight: 700;
}

.hm-content-area .comment-form input[type='text'],
.hm-content-area .comment-form input[type='email'],
.hm-content-area .comment-form input[type='url'],
.hm-content-area .comment-form textarea {
        width: 100%;
        border: 1px solid var(--hm-border-2);
        border-radius: var(--hm-radius-sm);
        padding: 10px 14px;
        font-size: 13px;
        background: var(--hm-bg);
}

.hm-content-area .comment-form input:focus,
.hm-content-area .comment-form textarea:focus {
        outline: none;
        border-color: var(--hm-primary);
        background: var(--hm-surface);
}

/* صفحه‌بندی */
.hm-pagination,
.navigation.pagination {
        margin-top: 26px;
}

.nav-links {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
}

.page-numbers {
        min-width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-inline: 10px;
        background: var(--hm-surface);
        border: 1px solid var(--hm-border);
        border-radius: var(--hm-radius-sm);
        font-size: 13px;
        color: var(--hm-text-2);
}

.page-numbers.current {
        background: var(--hm-primary);
        border-color: var(--hm-primary);
        color: #fff;
}

.page-numbers:hover:not(.current) {
        border-color: var(--hm-primary);
        color: var(--hm-primary);
}

/* ===== ۴۰۴ و حالت خالی ===== */
.hm-404 {
        text-align: center;
        padding: 70px 20px 90px;
        max-width: 560px;
        margin-inline: auto;
}

.hm-404__code {
        font-size: 88px;
        font-weight: 800;
        color: var(--hm-primary);
        line-height: 1;
        display: block;
        margin-bottom: 14px;
}

.hm-404__title {
        font-size: 20px;
        font-weight: 800;
}

.hm-404__text {
        color: var(--hm-text-2);
        font-size: 13.5px;
        margin-bottom: 24px;
}

.hm-404__actions {
        display: flex;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
}

.hm-empty-note {
        background: var(--hm-surface);
        border: 1px dashed var(--hm-border-2);
        border-radius: var(--hm-radius);
        padding: 28px 20px;
        text-align: center;
        color: var(--hm-text-3);
        font-size: 13px;
        grid-column: 1 / -1;
}

.hm-search-page-form {
        max-width: 480px;
        margin: 20px auto 0;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 1100px) {
        .hm-cat-tiles {
                grid-template-columns: repeat(5, 1fr);
        }
}

@media (max-width: 1024px) {
        .hm-hero {
                grid-template-columns: 1fr;
        }

        .hm-hero__side {
                grid-template-columns: 1fr 1fr;
                grid-template-rows: 1fr;
        }

        .hm-menu {
                gap: 16px;
                overflow-x: auto;
                scrollbar-width: none;
        }

        .hm-menu::-webkit-scrollbar {
                display: none;
        }
}

@media (max-width: 820px) {
        .hm-header__top {
                flex-wrap: wrap;
                height: auto;
                padding-block: 10px;
                row-gap: 10px;
        }

        .hm-header__search {
                order: 3;
                flex-basis: 100%;
                max-width: none;
        }

        .hm-header__actions .hm-btn--account span {
                display: none;
        }

        .hm-cats__sub {
                right: 0;
                transform: none;
                width: min(560px, 90vw);
        }

        .hm-footer__main {
                grid-template-columns: 1fr 1fr;
        }

        .hm-blog-layout {
                grid-template-columns: 1fr;
        }

        .hm-posts-grid,
        .hm-mag__grid {
                grid-template-columns: 1fr;
        }
}

@media (max-width: 640px) {
        .hm-hero__slide {
                height: 230px;
                padding: 22px;
        }

        .hm-hero__title {
                font-size: 20px;
        }

        .hm-hero__slide {
                background-position: center;
                background-image:
                        linear-gradient(0deg, rgba(13, 52, 80, 0.82) 0%, rgba(13, 52, 80, 0.45) 60%, rgba(13, 52, 80, 0.2) 100%),
                        url('../img/hero.jpg');
        }

        .hm-hero__side {
                grid-template-columns: 1fr;
        }

        .hm-cat-tiles {
                grid-template-columns: repeat(3, 1fr);
                gap: 10px;
        }

        .hm-footer__services {
                grid-template-columns: repeat(2, 1fr);
        }

        .hm-footer__main {
                grid-template-columns: 1fr;
                gap: 24px;
        }

        .hm-card {
                flex-basis: 158px;
        }

        .hm-amazing__rail .hm-card {
                flex-basis: 150px;
        }

        .hm-products-grid {
                grid-template-columns: repeat(2, 1fr);
        }

        .hm-section__title {
                font-size: 15px;
        }

        .hm-amazing__timer-label {
                display: none;
        }

        .hm-single-post {
                padding: 18px;
        }

        .hm-backtop {
                bottom: 16px;
                left: 16px;
        }
}
