@font-face {
    font-family: "TarhinoIRANSansDirect";
    src: url("https://tarhinu.ir/wp-content/uploads/2026/09/IRANSansXVF.ttf?v=2") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    font-feature-settings: "kern";
}

/* بارگذاری و اجبار مستقیم فونت IRANSans روی تمام اجزای افزونه */
.tarhino-products,
.tarhino-products *,
.tarhino-products button,
.tarhino-products input,
.tarhino-products textarea,
.tarhino-products select {
    font-family: "TarhinoIRANSansDirect", sans-serif !important;
    font-synthesis: none !important;
}

.tarhino-products,
.tarhino-products * {
    box-sizing: border-box;
}

.tarhino-products {
    --tp-blue-1: #2182f2;
    --tp-blue-2: #0757c9;
    --tp-green-1: #27b978;
    --tp-green-2: #078553;
    --tp-soft: #f1f8ff;
    --tp-text: #123d78;
    --tp-muted: #7387a3;
    width: 100%;
    font-family: "TarhinoIRANSansDirect", sans-serif !important;
    font-weight: 450;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.tarhino-products-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.tarhino-product-card {
    min-width: 0;
    overflow: hidden;
    background: #fff !important;
    border: 1px solid rgba(221, 234, 249, .95);
    border-radius: 40px;
    box-shadow:
        0 22px 50px rgba(31, 77, 126, .12),
        0 6px 16px rgba(31, 77, 126, .06);
    transition: transform .25s ease, box-shadow .25s ease;
}

.tarhino-product-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 27px 58px rgba(31, 77, 126, .16),
        0 8px 20px rgba(31, 77, 126, .07);
}

.tarhino-product-image-link {
    display: block;
    padding: 10px;
    text-decoration: none !important;
}

.tarhino-product-image {
    width: 100%;
    aspect-ratio: 1 / .82;
    overflow: hidden;
    border-radius: 31px;
    background: var(--tp-soft);
}

.tarhino-product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.tarhino-product-card:hover .tarhino-product-image img {
    transform: scale(1.035);
}

.tarhino-product-content {
    padding: 8px 22px 24px;
}

.tarhino-product-title {
    margin: 0 0 6px !important;
    color: var(--tp-text) !important;
    font-size: clamp(20px, 2.15vw, 26px) !important;
    line-height: 1.5 !important;
    font-weight: 800 !important;
}

.tarhino-product-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.tarhino-product-description {
    min-height: 44px;
    margin: 0 0 12px !important;
    color: var(--tp-muted) !important;
    font-size: 15.5px !important;
    line-height: 1.95 !important;
    font-weight: 500 !important;
}

.tarhino-product-bottom {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.tarhino-price {
    display: flex !important;
    align-items: baseline;
    justify-content: flex-start;
    gap: 5px;
    direction: rtl;
    color: var(--tp-blue-2) !important;
    font-size: 23px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.tarhino-price-prefix {
    font-weight: 950 !important;
    font-size: 1em !important;
    line-height: 1 !important;
    transform: translateY(-2px);
}

.tarhino-price-number {
    font-weight: 850 !important;
    font-size: 1em !important;
    line-height: 1 !important;
}

.tarhino-price-currency {
    font-size: 1em !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    transform: translateY(-2px);
}

/* جلوگیری از استایل ووکامرس/المنتور/قالب روی دکمه */
.tarhino-products button.tarhino-add-to-cart,
.tarhino-products a.tarhino-add-to-cart {
    width: 100% !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 9px 14px !important;
    border: 0 !important;
    outline: none !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, var(--tp-blue-1) 0%, var(--tp-blue-2) 100%) !important;
    background-color: var(--tp-blue-2) !important;
    color: #fff !important;
    font-family: "TarhinoIRANSansDirect", IRANSans, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    box-shadow: 0 9px 20px rgba(7, 87, 201, .22) !important;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, background .2s ease !important;
}

.tarhino-products button.tarhino-add-to-cart:hover,
.tarhino-products a.tarhino-add-to-cart:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #2b8bfa 0%, #0750b9 100%) !important;
    box-shadow: 0 13px 26px rgba(7, 87, 201, .28) !important;
}

.tarhino-products button.tarhino-add-to-cart:focus,
.tarhino-products button.tarhino-add-to-cart:active {
    outline: none !important;
    border: 0 !important;
    box-shadow: 0 9px 20px rgba(7, 87, 201, .22) !important;
}

/* حالت «در حال افزودن...» */
.tarhino-products button.tarhino-add-to-cart.is-loading {
    pointer-events: none !important;
    opacity: 1 !important;
    background: linear-gradient(135deg, var(--tp-green-1) 0%, var(--tp-green-2) 100%) !important;
    box-shadow: 0 9px 20px rgba(7, 133, 83, .22) !important;
}

/* حالت موفق */
.tarhino-products button.tarhino-add-to-cart.is-added {
    background: linear-gradient(135deg, #31c987 0%, #078553 100%) !important;
    box-shadow: 0 10px 22px rgba(7, 133, 83, .25) !important;
}

/* تبلت: ۳ ستون */
@media (min-width: 768px) and (max-width: 1024px) {
    .tarhino-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    .tarhino-product-content {
        padding-inline: 18px;
    }
}

/* موبایل: ۲ ستون */
@media (max-width: 767px) {
    .tarhino-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .tarhino-product-card {
        border-radius: 28px;
        box-shadow:
            0 15px 34px rgba(31, 77, 126, .11),
            0 4px 11px rgba(31, 77, 126, .055);
    }

    .tarhino-product-image-link {
        padding: 7px;
    }

    .tarhino-product-image {
        border-radius: 22px;
        aspect-ratio: 1 / .84;
    }

    .tarhino-product-content {
        padding: 6px 13px 16px;
    }

    .tarhino-product-title {
        margin-bottom: 4px !important;
        font-size: 16.5px !important;
        font-weight: 800 !important;
    }

    .tarhino-product-description {
        min-height: 38px;
        margin-bottom: 7px !important;
        font-size: 12.5px !important;
        line-height: 1.8 !important;
        font-weight: 500 !important;
    }

    .tarhino-product-bottom {
        gap: 16px;
    }

    .tarhino-price {
        font-size: 18px !important;
        gap: 5px;
        line-height: 1.3 !important;
    }

    .tarhino-price-prefix {
        font-size: 1em !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        transform: translateY(-2px);
    }

    .tarhino-price-number {
        font-size: 1em !important;
        font-weight: 850 !important;
        line-height: 1 !important;
    }

    .tarhino-price-currency {
        font-size: 1em !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        opacity: 1 !important;
        transform: translateY(-2px);
    }

    .tarhino-products button.tarhino-add-to-cart,
    .tarhino-products a.tarhino-add-to-cart {
        min-height: 43px !important;
        padding: 7px 7px !important;
        border-radius: 15px !important;
        font-size: 11px !important;
        font-weight: 500 !important;
    }
}

@media (max-width: 390px) {
    .tarhino-products-grid {
        gap: 10px;
    }

    .tarhino-product-content {
        padding-inline: 11px;
    }

    .tarhino-product-title {
        font-size: 14.5px !important;
        font-weight: 800 !important;
    }

    .tarhino-product-description {
        font-size: 11px !important;
    }

    .tarhino-price {
        font-size: 14.5px !important;
        gap: 5px;
    }

    .tarhino-products button.tarhino-add-to-cart,
    .tarhino-products a.tarhino-add-to-cart {
        font-size: 10.5px !important;
    }
}

.tarhino-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    background: var(--tp-soft);
    border-radius: 40px;
    color: var(--tp-muted);
    font-weight: 600;
}
