:root {
    --navy: #1c1c5d;
    --purple: #511877;
    --brand: #ef5661;
    --teal: #0c88a2;
    --ink: #1b1f3b;
    --muted: #6b7280;
    --line: #e9ebf2;
    --soft: #f5f6fb;
    --radius: 20px;
    --shadow: 0 18px 40px -24px rgba(28, 28, 93, .28);
}

html, body { overflow-x: hidden; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--ink);
    background: var(--soft);
}

/* ================= اسلایدر اصلی: بدون کراپ ================= */
.main-slider { padding: 0; }
.main-slider .carousel-inner { border-radius: 0; box-shadow: none; overflow: visible; }
.main-slider img,
.hm-slide-img {
    width: 100%;
    height: auto;
    display: block;
}
.main-slider .carousel-control-prev,
.main-slider .carousel-control-next { width: 6%; }

/* ================= ساختار صفحه ================= */
.hm-page {
    padding-bottom: 64px;
    overflow-x: clip;
}
.hm-section { margin-top: 56px; min-width: 0; }

.hm-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
}
.hm-h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
    position: relative;
    padding-bottom: 10px;
}
.hm-h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 44px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand), var(--purple));
}
.hm-sub { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.hm-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 9px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--teal);
    background: rgba(12, 136, 162, .08);
    border: 1px solid rgba(12, 136, 162, .18);
    transition: background .25s, color .25s;
}
.hm-more:hover { background: var(--teal); color: #fff; }

.hm-eyebrow-dark {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: rgba(239, 86, 97, .1);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

/* ================= دسترسی سریع ================= */
.hm-quick {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.hm-qlink {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(28, 28, 93, .04);
    transition: color .25s, box-shadow .25s;
}
.hm-qlink i {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(28, 28, 93, .08), rgba(81, 24, 119, .12));
    color: var(--purple);
    font-size: 18px;
}
.hm-qlink:hover { color: var(--brand); box-shadow: 0 24px 40px -20px rgba(239, 86, 97, .35); }

/* ================= بنرها ================= */
.hm-banners-2,
.hm-banners {
    margin-top: 40px;
    display: grid;
    gap: 18px;
}
.hm-banners-2 { grid-template-columns: repeat(2, 1fr); }
.hm-banners { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hm-banner {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #fff;
}
.hm-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .5s ease;
}
.hm-banner:hover img { transform: scale(1.04); }

/* ================= مجموعه استثنایی ================= */
.hm-exclusive {
    margin-top: 56px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--purple) 100%);
    border-radius: 32px;
    padding: 44px 28px;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.hm-exclusive-head { margin-bottom: 28px; }
.hm-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #ffc6cb;
    margin-bottom: 10px;
}
.hm-exclusive-title h2 { font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
.hm-exclusive-title p { font-size: 13.5px; opacity: .78; margin: 0; }

.hm-exclusive-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.hm-ex-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 22px;
    padding: 16px;
    color: #fff;
    text-decoration: none;
    transition: background .25s, border-color .25s;
}
.hm-ex-card:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}
.hm-ex-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .3);
    color: #fff;
}
.hm-ex-badge i { color: #ffd166; font-size: 10px; }
.hm-ex-img {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}
.hm-ex-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hm-ex-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
    margin: 0 0 10px;
    min-height: 3.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-ex-price { margin-top: auto; font-size: 15px; font-weight: 800; color: #ffd6da; }

/* ================= دسته‌بندی‌ها ================= */
.hm-cats {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(6, 1fr);
}
.hm-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border-radius: 24px;
    padding: 22px 12px 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(28, 28, 93, .04);
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow .3s, border-color .3s;
}
.hm-cat:hover {
    box-shadow: 0 30px 50px -24px rgba(12, 136, 162, .35);
    border-color: rgba(12, 136, 162, .3);
    color: var(--ink);
}
.hm-cat-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #eef6fa);
    border: 2px solid rgba(12, 136, 162, .14);
    display: grid;
    place-items: center;
    padding: 16px;
    margin-bottom: 16px;
    overflow: hidden;
}
.hm-cat-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.hm-cat h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.hm-cat > span {
    font-size: 12px;
    font-weight: 600;
    color: var(--teal);
    background: rgba(12, 136, 162, .08);
    padding: 4px 12px;
    border-radius: 999px;
}

/* ================= ریل محصولات (افقی، بدون نوار اسکرول) ================= */
.hm-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 230px;
    gap: 20px;
    margin: 0;
    padding: 8px 4px 24px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x pan-y;
}
.hm-rail::-webkit-scrollbar { display: none; }
.hm-rail.is-dragging { cursor: grabbing; }
.hm-rail img,
.hm-rail a { -webkit-user-drag: none; user-select: none; }

/* ================= کارت محصول ================= */
.hm-pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-radius: 24px;
    padding: 14px;
    border: 1px solid rgba(28, 28, 93, .05);
    box-shadow: 0 12px 28px -20px rgba(28, 28, 93, .35);
    overflow: hidden;
    transition: box-shadow .3s ease, border-color .3s ease;
}
.hm-pcard:hover {
    box-shadow: 0 22px 40px -22px rgba(28, 28, 93, .4);
    border-color: rgba(239, 86, 97, .25);
}
.hm-rail.is-dragging .hm-pcard,
.hm-rail.is-dragging .hm-pcard * { transition: none !important; }

.hm-pcard-img {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #f1f5fb 75%);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
    overflow: hidden;
}
.hm-pcard-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .4s ease;
}
.hm-pcard:hover .hm-pcard-img img { transform: scale(1.05); }

.hm-pcard-body { display: flex; flex-direction: column; flex: 1; }
.hm-pcard-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.8;
    color: var(--ink);
    text-decoration: none;
    min-height: 3.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-pcard-title:hover { color: var(--brand); }

/* ستاره‌ها: همیشه ۵ ستاره طلایی */
.hm-stars { display: flex; gap: 3px; margin: 8px 0 4px; direction: ltr; }
.hm-stars i { font-size: 13px; color: #f5b301; }

.hm-pcard-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hm-pcard-price { font-size: 14px; font-weight: 800; color: var(--brand); }
.hm-pcard-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(12, 136, 162, .1);
    color: var(--teal);
}
.hm-pcard-tag.hot { background: rgba(239, 86, 97, .1); color: var(--brand); }
.hm-pcard-tag.hot i { font-size: 10px; margin-inline-end: 3px; }

/* رتبه‌بندی پرفروش‌ها */
.hm-rank {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--navy), var(--purple));
}
.hm-pcard:nth-child(1) .hm-rank { background: linear-gradient(135deg, #f6c343, #e8a317); }
.hm-pcard:nth-child(2) .hm-rank { background: linear-gradient(135deg, #c9d1dc, #98a2b3); }
.hm-pcard:nth-child(3) .hm-rank { background: linear-gradient(135deg, #e0a070, #b8703e); }

/* دکمه مشاهده سریع */
.hm-quick-btn {
    position: absolute;
    top: 22px;
    inset-inline-end: 22px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: var(--navy);
    display: grid;
    place-items: center;
    font-size: 14px;
    box-shadow: 0 8px 18px -10px rgba(28, 28, 93, .5);
    opacity: 0;
    transition: opacity .25s ease, background .25s ease, color .25s ease;
}
.hm-pcard:hover .hm-quick-btn { opacity: 1; }
.hm-quick-btn:hover { background: var(--brand); color: #fff; }
@media (hover: none) { .hm-quick-btn { opacity: 1; } }

/* ================= پیشنهاد ویژه ================= */
.hm-picks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}
.hm-pick {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #fff;
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(28, 28, 93, .04);
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow .3s;
}
.hm-pick:hover { box-shadow: 0 26px 40px -22px rgba(239, 86, 97, .35); color: var(--ink); }
.hm-pick img {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    object-fit: contain;
    background: var(--soft);
    border-radius: 16px;
    padding: 8px;
}
.hm-pick h3 { font-size: 14px; font-weight: 600; line-height: 1.8; margin: 0 0 6px; }
.hm-pick-price { font-size: 14px; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.hm-pick-btn { font-size: 12px; font-weight: 700; color: var(--teal); }

/* ================= برندها: داخل جعبه ================= */
.hm-brands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.hm-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    padding: 18px;
    overflow: hidden;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 10px 24px -18px rgba(28, 28, 93, .35);
    border: 1px solid rgba(28, 28, 93, .04);
    transition: box-shadow .3s;
}
.hm-brand:hover { box-shadow: var(--shadow); }
.hm-brand img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: grayscale(1);
    opacity: .75;
    transition: filter .3s, opacity .3s;
}
.hm-brand:hover img { filter: none; opacity: 1; }

/* ================= مقالات ================= */
.hm-blogs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}
.hm-blog {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(28, 28, 93, .04);
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow .3s;
}
.hm-blog:hover { box-shadow: 0 30px 50px -24px rgba(12, 136, 162, .35); color: var(--ink); }
.hm-blog-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); }
.hm-blog-img img { width: 100%; height: 100%; object-fit: cover; }
.hm-blog-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hm-blog-body h3 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-blog-more { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--teal); }

/* ================= مودال مشاهده سریع ================= */
.hm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 18, 40, .6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hm-modal.is-open { display: flex; }
.hm-modal-box {
    position: relative;
    width: 100%;
    max-width: 820px;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5);
}
.hm-modal-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--soft);
    color: var(--navy);
    display: grid;
    place-items: center;
}
.hm-modal-close:hover { background: var(--brand); color: #fff; }
.hm-modal-grid { display: grid; grid-template-columns: 1fr 1.1fr; }
.hm-modal-img {
    background: radial-gradient(circle at 50% 40%, #ffffff, #eef6fa);
    display: grid;
    place-items: center;
    padding: 40px;
}
.hm-modal-img img { max-width: 100%; max-height: 320px; object-fit: contain; }
.hm-modal-info { padding: 36px 32px; display: flex; flex-direction: column; }
.hm-modal-cat {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    color: var(--teal);
    background: rgba(12, 136, 162, .08);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.hm-modal-title { font-size: 19px; font-weight: 800; line-height: 1.7; color: var(--navy); margin: 0 0 12px; }
.hm-modal-price { font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 20px; }
.hm-modal-dl { margin: 0 0 24px; border-top: 1px solid var(--line); }
.hm-modal-dl > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}
.hm-modal-dl dt { font-weight: 400; color: var(--muted); margin: 0; }
.hm-modal-dl dd { margin: 0; font-weight: 600; }
.hm-btn-main {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--brand), #ff7a85);
    box-shadow: 0 14px 24px -14px var(--brand);
}
.hm-btn-main:hover { color: #fff; }

/* ================= ریسپانسیو ================= */
@media (max-width: 1199px) {
    .hm-cats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
    .hm-quick { grid-template-columns: repeat(3, 1fr); }
    .hm-exclusive { padding: 32px 18px; border-radius: 24px; }
    .hm-modal-grid { grid-template-columns: 1fr; }
    .hm-modal-img { padding: 24px; }
    .hm-modal-info { padding: 24px; }
}
@media (max-width: 767px) {
    .hm-section { margin-top: 40px; }
    .hm-h2 { font-size: 1.25rem; }
    .hm-head { align-items: center; }
    .hm-more { padding: 7px 14px; font-size: 12px; }
    .hm-quick { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hm-qlink { padding: 14px 8px; font-size: 12px; }
    .hm-qlink i { width: 42px; height: 42px; font-size: 16px; }
    .hm-banners-2 { grid-template-columns: 1fr; }
    .hm-cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hm-cat { padding: 16px 8px; border-radius: 20px; }
    .hm-cat-img { width: 84px; height: 84px; }
    .hm-exclusive-title h2 { font-size: 1.35rem; }
    .hm-rail { grid-auto-columns: 200px; gap: 14px; }
    .hm-quick-btn { opacity: 1; }
    .hm-pick { flex-direction: row; }
    .hm-pick img { width: 80px; height: 80px; flex-basis: 80px; }
    .hm-brand { height: 96px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .hm-page *,
    .hm-page *::before,
    .hm-page *::after,
    .hm-modal * {
        transition: none !important;
        animation: none !important;
    }
}

/* ================= فلش‌های ریل (دسکتاپ) ================= */
.hm-rail-wrap { position: relative; }

.hm-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: var(--navy);
    display: grid;
    place-items: center;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 12px 24px -12px rgba(28, 28, 93, .45);
    transition: background .25s ease, color .25s ease, opacity .25s ease, transform .25s ease;
}
.hm-arrow-left { left: -8px; }
.hm-arrow-right { right: -8px; }

.hm-arrow:hover:not(:disabled) {
    background: var(--brand);
    color: #fff;
    transform: translateY(-50%) scale(1.06);
}
.hm-arrow:disabled {
    opacity: .3;
    cursor: default;
}

/* روی لمس، اسکرول با انگشت کافی است */
@media (hover: none) {
    .hm-arrow { display: none; }
}
@media (max-width: 767px) {
    .hm-arrow { display: none; }
}

/* ================= دکمه‌ی مشاهده سریع: قرمز با آیکون سفید ================= */
.hm-quick-btn {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 20px -10px rgba(239, 86, 97, .7);
}
.hm-quick-btn i { color: #fff; }
.hm-quick-btn:hover {
    background: #d9454f;
    color: #fff;
}
.hm-quick-btn:hover i { color: #fff; }