/*
Custom Css
*/
.dir-rtl {
    direction: rtl;
}

.dir-ltr {
    direction: ltr;
}

body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #f0fef9 0%, #ffffff 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ================= Category Cards ================= */
.category-card {
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.category-image-wrapper {
    width: 160px;
    height: 160px;
    overflow: hidden;
    border-radius: 50%;
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

.category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================= Product Cards ================= */
.product-card {
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* جایگزین height ثابت برای یکدست شدن کارت‌ها */
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.product-card:hover .product-img {
    transform: scale(1.08);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .overlay {
    opacity: 1;
}

/* ================= Side Banners ================= */
.side-banner {
    min-height: 300px;
    transition: transform .3s ease, box-shadow .3s ease;
}

.side-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

/* ///////////////// فاکتور /////////////////// */
.invoice-wrapper {
    padding: 60px 15px;
}

.invoice-box {
    max-width: 900px;
    margin: auto;
    padding: 30px;
    border: 2px solid #000;
    font-size: 14px;
    background: #fff;
}

.invoice-header {
    text-align: center;
    margin-bottom: 20px;
}

.invoice-header h2 {
    font-weight: bold;
}

.invoice-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 20px;
}

.info-right,
.info-left {
    width: 48%;
}

.address-box {
    margin-top: 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.8;
}

.table-invoice {
    width: 100%;
    border-collapse: collapse;
}

.table-invoice th,
.table-invoice td {
    border: 1px solid #000;
    padding: 8px;
    text-align: center;
}

.table-invoice th {
    background-color: #f2f2f2;
}

.total-row {
    font-weight: bold;
    font-size: 15px;
}

.payment-status {
    margin-top: 20px;
}

/* ================= Floating Contact ================= */
.contact-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

.contact-toggle {
    width: 60px;
    height: 60px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .3);
    transition: 0.3s;
}

.contact-toggle:hover {
    transform: scale(1.1);
}

.contact-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.contact-menu.active {
    display: flex;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

.contact-item i {
    font-size: 18px;
}

/* رنگ‌ها */
.phone {
    background: #007bff;
}

.whatsapp {
    background: #25D366;
}

.telegram {
    background: #0088cc;
}

.contact-item.instagram {
    background: linear-gradient(45deg,
            #f09433,
            #e6683c,
            #dc2743,
            #cc2366,
            #bc1888);
    color: #fff;
}

/* ================= End Floating Contact ================= */


/* ===================================================== */
/* =================== Responsive ======================= */
/* ===================================================== */

@media (max-width: 992px) {
    .product-card .card-title {
        font-size: 0.9rem;
    }
}

/* Tablet + Mobile */
@media (max-width: 768px) {

    /* ---------- Home Hero Carousel (override inline style) ---------- */
    #template-mo-zay-hero-carousel .carousel-item>.position-relative {
        height: 40vh !important;
        min-height: 280px !important;
    }

    #template-mo-zay-hero-carousel h2.display-3 {
        font-size: 1.4rem !important;
        line-height: 1.6;
        margin-bottom: .5rem !important;
    }

    #template-mo-zay-hero-carousel h3.display-5 {
        font-size: 1.05rem !important;
        margin-bottom: .5rem !important;
    }

    #template-mo-zay-hero-carousel p.lead {
        font-size: 0.9rem !important;
        margin-bottom: .5rem !important;
    }

    #template-mo-zay-hero-carousel .btn.btn-lg {
        padding: .4rem .9rem !important;
        font-size: .85rem !important;
    }

    #template-mo-zay-hero-carousel .pe-5 {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    /* ---------- Category ---------- */
    .category-image-wrapper {
        width: 110px;
        height: 110px;
    }

    .category-card {
        padding: 14px !important;
    }

    /* ---------- Product cards ---------- */
    .product-card {
        border-radius: 10px;
    }

    .product-card .card-body {
        padding: 8px !important;
    }

    .product-card .card-title {
        font-size: 0.82rem !important;
        line-height: 1.5;
        min-height: 2.4em;
    }

    .product-card .small {
        font-size: 0.75rem !important;
    }

    /* ---------- Side banner ---------- */
    .side-banner {
        min-height: 180px;
        padding: 1rem !important;
    }

    .side-banner h4 {
        font-size: 1rem;
        margin-bottom: .35rem !important;
    }

    .side-banner p {
        font-size: .78rem;
        margin-bottom: .5rem !important;
    }

    /* ---------- Invoice ---------- */
    .invoice-box {
        padding: 15px;
        font-size: 13px;
    }

    .invoice-info {
        flex-direction: column;
        gap: 15px;
    }

    .info-right,
    .info-left {
        width: 100%;
    }

    .invoice-header h2 {
        font-size: 18px;
    }

    .invoice-header h3 {
        font-size: 16px;
    }

    .table-invoice {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table-invoice th,
    .table-invoice td {
        font-size: 12px;
        padding: 6px;
    }

    .total-row {
        font-size: 14px;
    }

    .btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 576px) {

    .contact-float {
        bottom: 12px;
        right: 12px;
    }

    .contact-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .contact-item {
        font-size: 12px;
        padding: 8px 12px;
    }

    .contact-item i {
        font-size: 15px;
    }

    .product-card .card-title {
        font-size: 0.78rem !important;
    }

    .product-card .small {
        font-size: 0.70rem !important;
    }
}

/* Print */
@media print {
    body * {
        visibility: hidden;
    }

    .invoice-box,
    .invoice-box * {
        visibility: visible;
    }

    .invoice-box {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

/* ===== Mobile Tight Layout Fix (Aggressive) ===== */
@media (max-width: 768px) {

    /* فاصله‌های کلی سکشن‌ها */
    .py-5 {
        padding-top: 1.2rem !important;
        padding-bottom: 1.2rem !important;
    }

    .my-5 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .mb-5 {
        margin-bottom: 1rem !important;
    }

    .mt-5 {
        margin-top: 1rem !important;
    }

    /* بنر اصلی صفحه */
    #template-mo-zay-hero-carousel .carousel-item>.position-relative {
        height: 32vh !important;
        min-height: 210px !important;
    }

    #template-mo-zay-hero-carousel h2.display-3 {
        font-size: 1.05rem !important;
        line-height: 1.5 !important;
        margin-bottom: .35rem !important;
    }

    #template-mo-zay-hero-carousel h3.display-5 {
        font-size: .88rem !important;
        margin-bottom: .3rem !important;
    }

    #template-mo-zay-hero-carousel p.lead {
        font-size: .76rem !important;
        margin-bottom: .35rem !important;
    }

    #template-mo-zay-hero-carousel .btn.btn-lg {
        font-size: .72rem !important;
        padding: .30rem .65rem !important;
        border-radius: .4rem !important;
    }

    /* دایره دسته‌بندی‌ها */
    .category-image-wrapper {
        width: 88px !important;
        height: 88px !important;
        margin-bottom: .55rem !important;
    }

    .category-card {
        padding: .65rem !important;
        border-radius: .65rem !important;
    }

    .category-card h5 {
        font-size: .78rem !important;
        margin-bottom: .35rem !important;
    }

    /* کارت محصول */
    .product-card {
        border-radius: .7rem !important;
    }

    .product-card .card-body {
        padding: .45rem !important;
    }

    .product-card .card-title {
        font-size: .74rem !important;
        line-height: 1.4 !important;
        min-height: 2.1em !important;
        margin-bottom: .25rem !important;
    }

    .product-card .small,
    .product-card .text-muted,
    .product-card .text-success {
        font-size: .68rem !important;
    }

    .product-card .btn,
    .product-card .badge {
        font-size: .64rem !important;
        padding: .2rem .4rem !important;
    }

    /* بنرهای کناری */
    .side-banner {
        min-height: 130px !important;
        padding: .7rem !important;
        border-radius: .7rem !important;
    }

    .side-banner h4 {
        font-size: .82rem !important;
        margin-bottom: .2rem !important;
    }

    .side-banner p {
        font-size: .68rem !important;
        margin-bottom: .25rem !important;
    }

    .side-banner .btn {
        font-size: .64rem !important;
        padding: .25rem .5rem !important;
    }

    /* ناوبری/منو */
    .navbar-brand {
        font-size: .95rem !important;
    }

    .nav-link {
        font-size: .82rem !important;
        padding: .35rem .45rem !important;
    }

    /* فوتر */
    footer h2,
    footer h3,
    footer h4,
    footer h5 {
        font-size: .9rem !important;
    }

    footer p,
    footer li,
    footer a {
        font-size: .72rem !important;
    }

    /* دکمه تماس شناور */
    .contact-float {
        right: 10px !important;
        bottom: 10px !important;
    }

    .contact-toggle {
        width: 44px !important;
        height: 44px !important;
        font-size: 17px !important;
    }

    .contact-item {
        font-size: 11px !important;
        padding: 7px 10px !important;
        border-radius: 18px !important;
    }
}

/* گوشی‌های خیلی کوچک */
@media (max-width: 420px) {
    #template-mo-zay-hero-carousel .carousel-item>.position-relative {
        height: 29vh !important;
        min-height: 185px !important;
    }

    .category-image-wrapper {
        width: 78px !important;
        height: 78px !important;
    }

    .product-card .card-title {
        font-size: .69rem !important;
    }

    .product-card .small,
    .product-card .text-muted,
    .product-card .text-success {
        font-size: .64rem !important;
    }

    .contact-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 15px !important;
    }
}

/* اصلاح نمایش دسته‌بندی در موبایل (دو ستونه) */
@media (max-width: 768px) {
    .category-grid-mobile {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .category-item-mobile {
        flex: 0 0 46% !important;
        /* هر کارت ۴۶٪ عرض صفحه */
        max-width: 46% !important;
    }

    /* کوچک‌تر کردن آیکون/عکس در حالت دو ستونه */
    .category-image-wrapper {
        width: 70px !important;
        height: 70px !important;
    }
}

/* اصلاح سایز عکس برای موبایل */
@media (max-width: 576px) {
    .category-image-wrapper {
        width: 65px !important;
        height: 65px !important;
    }
}

/* ایجاد فضای تنفس بین سکشن‌ها */
@media (min-width: 992px) {
    .my-5 {
        margin-top: 4rem !important;
        margin-bottom: 4rem !important;
    }
}

@media (max-width: 768px) {
    .my-5 {
        margin-top: 2rem !important;
        /* فاصله کمتر در موبایل */
        margin-bottom: 2rem !important;
    }

    .section-title h3 {
        font-size: 1.2rem;
        /* کمی کوچک‌تر برای موبایل */
    }
}





/* ----------SHOP----------------- */
/* ===== Shop Responsive Fix (Safe) ===== */
.shop-filter-box {
    background: #f1f3f5;
}

/* کارت محصول */
.shop-product-card {
    border-radius: 12px;
    overflow: hidden;
}

/* قاب تصویر با نسبت ثابت برای جلوگیری از کشیدگی */
.shop-product-image-wrap {
    aspect-ratio: 1 / 1;
    /* مربع استاندارد */
    background: #fff;
}

/* خود تصویر */
.shop-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* عنوان محصول: دو خط، بیشتر شد ... */
.shop-product-title {
    font-size: .95rem;
    font-weight: 500;
    color: #222;
    line-height: 1.6;
    min-height: calc(1.6em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Overlay ملایم */
.product-overlay {
    background: rgba(0, 0, 0, .18);
    opacity: 0;
    transition: .25s ease;
}

.shop-product-image-wrap:hover .product-overlay {
    opacity: 1;
}

/* موبایل */
@media (max-width: 767.98px) {
    .shop-product-title {
        font-size: .85rem;
        min-height: calc(1.5em * 2);
        line-height: 1.5;
    }

    .shop-product-card .card-body {
        padding: .6rem .5rem;
    }

    .shop-product-card p {
        font-size: .82rem;
    }

    .accordion-button {
        font-size: .95rem;
    }
}

/* دسکتاپ بزرگ: کارت کمی نفس‌دارتر */
@media (min-width: 1200px) {
    .shop-product-card .card-body {
        padding: .9rem .8rem;
    }
}