/* =========================================================
   Business Offers
   Desktop and Tablet only
   Bootstrap 4 compatible
========================================================= */

.business-offers {
    width: 100%;
    padding: 8px 0 30px;
    direction: ltr;
}

.business-offers *,
.business-offers *::before,
.business-offers *::after {
    box-sizing: border-box;
}

/* =========================================================
   Header and Filters
========================================================= */

.business-offers__header {
    margin-bottom: 17px;
}

.business-offers__title {
    margin: 0 0 13px;
    color: #1b1b1b;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.business-offers__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.business-offers__filter {
    color: #2c2c2c;
    background-color: #f1f1f1;
      border: none;
      padding: 7px 18px;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 600;
      white-space: nowrap;
      cursor: pointer;
      transition: background-color 0.2s ease, color 0.2s ease;
}

.business-offers__filter:hover,
.business-offers__filter:focus {
    color: #ffffff;
    background-color: #303030;
    outline: 0;
}

.business-offers__filter.is-active {
    color: #ffffff;
    background-color: #171717;
}

/* =========================================================
   Offers Grid
========================================================= */

.business-offers__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

/* =========================================================
   Offer Card
========================================================= */

.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 338px;
    overflow: hidden;
    border: 1px solid #e9e9e9;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.offer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 23px rgba(0, 0, 0, 0.16);
}

.offer-card__media {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: 148px;
    overflow: hidden;
    background: #ececec;
}

.offer-card__image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
}

.offer-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.offer-card:hover .offer-card__image {
    transform: scale(1.05);
}

.offer-card__discount {
    position: absolute;
    z-index: 2;
    top: 11px;
    left: 11px;
    max-width: calc(100% - 75px);
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 5px;
    color: #ffffff;
    background: #e1272f;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-card__info-icon {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.35);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.offer-card__info-icon:hover,
.offer-card__info-icon:focus {
    background: rgba(0, 0, 0, 0.78);
    outline: 0;
}

.offer-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 14px 14px 15px;
}

.offer-card__title {
    min-height: 22px;
    margin: 0;
    overflow: hidden;
    color: #252525;
    font-size: 17px;
    font-weight: 800;
    line-height: 22px;
    text-overflow: ellipsis;
    
}

.offer-card__short-description {
    min-height: 17px;
    margin: 3px 0 9px;
    overflow: hidden;
    color: #7c7c7c;
    font-size: 14px;
    font-weight: 400;
    line-height: 17px;
    text-overflow: ellipsis;
    
}

.offer-card__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.offer-card__price-wrap {
    min-width: 0;
}

.offer-card__price-line {
    display: flex;
    align-items: baseline;
    min-height: 29px;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
}

.offer-card__price {
    color: #1e1e1e;
    font-size: 22px;
    font-weight: 800;
    line-height: 29px;
}

.offer-card__currency {
    color: #1e1e1e;
    font-size: 15px;
    font-weight: 800;
}

.offer-card__old-price {
    margin-left: 4px;
    overflow: hidden;
    color: #8b8b8b;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
}

.offer-card__category {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #626262;
    font-size: 13px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-card__order-button {
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #df2028;
    border-radius: 5px;
    color: #ffffff;
    background: #df2028;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.offer-card__order-button:hover,
.offer-card__order-button:focus {
    border-color: #b6171e;
    color: #ffffff;
    background: #b6171e;
    outline: 0;
}

.offer-card__order-button--disabled,
.offer-card__order-button:disabled {
    border-color: #d0d0d0;
    color: #8a8a8a;
    background: #e6e6e6;
    cursor: not-allowed;
}

.offer-card__stock {
    display: inline-block;
    width: fit-content;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
}

.offer-card__stock--low {
    color: #815600;
    background: #fff0cd;
}

.offer-card__stock--sold-out {
    color: #a21319;
    background: #ffe1e1;
}

/* =========================================================
   More Offers Button
========================================================= */

.business-offers__more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 23px;
}

.business-offers__more {
    min-width: 310px;
    min-height: 47px;
    padding: 10px 22px;
    border: 2px solid #efa5a8;
    border-radius: 9px;
    color: #d7272e;
    background: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 21px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.business-offers__more:hover,
.business-offers__more:focus {
    border-color: #df2028;
    color: #ffffff;
    background: #df2028;
    outline: 0;
}

/* =========================================================
   Modal Base Fixes - Bootstrap 4
   Modal ها باید خارج از business-offers__grid باشند.
========================================================= */

.business-offers__modals {
    display: block;
}

.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

.modal-dialog {
    width: auto;
    margin: 30px auto;
}

.modal-dialog.modal-lg {
    max-width: 900px;
}

.modal-content {
    border: 0;
}

/* =========================================================
   Image Modal
   روی خود .modal کلاس offer-image-modal قرار دهید.
========================================================= */

.offer-image-modal .modal-content {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.28);
}

.offer-image-modal .modal-body {
    padding: 0;
    background: #f3f3f3;
}

.offer-image-modal .img-fluid {
    display: block;
    width: 100%;
    max-height: 75vh;
    margin: 0 auto;
    object-fit: contain;
}

.offer-modal-close {
    position: absolute;
    z-index: 5;
    top: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.62);
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
    opacity: 1;
    text-align: center;
    text-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.offer-modal-close:hover,
.offer-modal-close:focus {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.86);
    outline: 0;
}

/* =========================================================
   Order Modal
   کلاس offer-order-modal روی .modal-content قرار می‌گیرد.
========================================================= */

.offer-order-modal {
    max-height: calc(100vh - 40px);
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.28);
}

.offer-order-modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.offer-order-modal .modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
    padding: 15px 20px;
    border-bottom: 1px solid #e9e9e9;
    background: #fafafa;
}

.offer-order-modal .modal-title {
    margin: 0;
    color: #242424;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
}

.offer-order-modal .close {
    padding: 0;
    color: #292929;
    font-size: 29px;
    font-weight: 400;
    line-height: 1;
    opacity: 0.75;
    text-shadow: none;
}

.offer-order-modal .close:hover,
.offer-order-modal .close:focus {
    opacity: 1;
    outline: 0;
}

.offer-order-modal .modal-body {
    max-height: calc(100vh - 215px);
    padding: 22px;
    overflow-x: hidden;
    overflow-y: auto;
}

.offer-order-modal .modal-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 20px;
    border-top: 1px solid #e9e9e9;
    background: #ffffff;
}

.offer-order-modal .row {
    margin-right: -10px;
    margin-left: -10px;
}

.offer-order-modal .row > [class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
}

.offer-order-modal label {
    float: none !important;
    max-width: 100%;
    margin-bottom: 0;
}

/* =========================================================
   Order Modal Content
========================================================= */

.offer-order-modal__title {
    margin: 0 0 9px;
    color: #242424;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
}

.offer-order-modal__description {
    margin: 0 0 13px;
    color: #606060;
    font-size: 15px;
    line-height: 1.65;
}

.offer-order-modal__base-price {
    margin-bottom: 15px;
    color: #353535;
    font-size: 15px;
    line-height: 1.5;
}

.offer-order-modal__base-price strong {
    margin-left: 5px;
    color: #df2028;
    font-size: 18px;
    font-weight: 800;
}

/*.offer-order-modal__image {*/
/*    display: block;*/
/*    width: 100%;*/
/*    height: 185px;*/
/*    border-radius: 8px;*/
/*    object-fit: cover;*/
/*}*/

.offer-order-modal__brand-total {
    margin: 10px 0 0;
    color: #646464;
    font-size: 12px;
    line-height: 1.55;
}

.offer-order-modal__brand-total strong {
    color: #252525;
    font-weight: 800;
}

.offer-policy-content {
    color: #454545;
    font-size: 14px;
    line-height: 1.8;
    text-align: justify;
}

/* =========================================================
   Delivery and Quantity
========================================================= */

.offer-delivery-option {
    margin: 14px 0;
    padding: 11px 13px;
    border: 1px solid #dcebef;
    border-radius: 7px;
    background: #f8fcfd;
}

.offer-delivery-option .custom-control {
    min-height: 22px;
}

.offer-delivery-option .custom-control-label {
    padding-top: 1px;
    color: #343434;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.offer-delivery-option .custom-control-label strong {
    margin-left: 4px;
    color: #0d738b;
    font-weight: 800;
}

.offer-delivery-option__free {
    margin: 8px 0 0;
    color: #bd2525;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.offer-delivery-option__note {
    margin: 7px 0 0;
    color: #696969;
    font-size: 12px;
    line-height: 1.5;
}

.offer-quantity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.offer-quantity__label {
    margin-right: 4px;
    color: #353535;
    font-size: 14px;
    font-weight: 800;
}

.offer-quantity__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    padding: 0;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    color: #333333;
    background: #f7f7f7;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.offer-quantity__button:hover,
.offer-quantity__button:focus {
    border-color: #df2028;
    color: #ffffff;
    background: #df2028;
    outline: 0;
}

.offer-quantity__input {
    width: 50px;
    height: 33px;
    padding: 4px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    color: #292929;
    background: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 23px;
    text-align: center;
}

.offer-quantity__max {
    color: #777777;
    font-size: 12px;
    line-height: 18px;
}

.offer-order-modal__total {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 20px;
    padding: 13px 15px;
    border-radius: 7px;
    color: #353535;
    background: #f2f7f8;
    font-size: 15px;
    font-weight: 700;
}

.offer-order-modal__total strong {
    color: #df2028;
    font-size: 21px;
    font-weight: 800;
}

/* =========================================================
   Modal Buttons
========================================================= */

.offer-order-modal .modal-footer .btn {
    min-width: 170px;
    min-height: 39px;
    font-size: 14px;
    font-weight: 700;
}

.offer-order-modal__buy-button {
    border-color: #56464e;
    color: #ffffff;
    background: #56464e;
}

.offer-order-modal__buy-button:hover,
.offer-order-modal__buy-button:focus {
    border-color: #3d3036;
    color: #ffffff;
    background: #3d3036;
    outline: 0;
}

/* =========================================================
   Responsive: Large desktop
========================================================= */

@media (min-width: 1200px) {
    .offer-card__media {
        height: 160px;
    }
}

/* =========================================================
   Responsive: Small desktop
========================================================= */

@media (min-width: 992px) and (max-width: 1199.98px) {
    .business-offers__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .offer-card__media {
        height: 155px;
    }
}

/* =========================================================
   Responsive: Tablet
========================================================= */

@media (min-width: 768px) and (max-width: 991.98px) {
    .business-offers__title {
        font-size: 22px;
    }

    .business-offers__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .offer-card {
        min-height: 340px;
    }

    .offer-card__media {
        height: 178px;
    }

    .offer-card__title {
        font-size: 17px;
    }

    .offer-card__price {
        font-size: 23px;
    }

    .modal-dialog.modal-lg {
        max-width: 720px;
    }

    .offer-order-modal__image {
        height: 150px;
    }

    .offer-order-modal .modal-footer .btn {
        min-width: 145px;
    }
}


/* =========================================================
   Business Offers - Mobile Optimization (زیر 768 پیکسل)
   ========================================================= */
@media (max-width: 767.98px) {

    /* بخش کلی آفرها */
    .business-offers {
        display: block !important;
        padding: 10px 4px 25px;
    }

    .business-offers__header {
        margin-bottom: 14px;
    }

    .business-offers__title {
        font-size: 19px;
        margin-bottom: 10px;
    }

    /* فیلترها: اسکرول افقی روان لمسی */
    .business-offers__filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .business-offers__filters::-webkit-scrollbar {
        display: none;
    }

    .business-offers__filter {
        flex: 0 0 auto;
        min-width: auto;
        min-height: 34px;
        padding: 6px 14px;
        font-size: 13px;
        border-radius: 6px;
        white-space: nowrap;
    }

    /* گرید کارت‌ها: نمایش ۲ ستونه فشرده */
    .business-offers__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    /* بدنه کارت آفر */
    .offer-card {
        min-height: 275px;
        border-radius: 8px;
    }

    .offer-card__media {
        height: 125px;
    }

    .offer-card__discount {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 11px;
        line-height: 14px;
        border-radius: 4px;
    }

    .offer-card__info-icon {
        top: 6px;
        right: 6px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .offer-card__body {
        padding: 8px 9px 10px;
    }

    .offer-card__title {
        font-size: 15px;
        line-height: 18px;
        min-height: 18px;
    }

    .offer-card__short-description {
        font-size: 14px;
        line-height: 15px;
        margin: 2px 0 6px;
        min-height: 15px;
    }

    .offer-card__bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-top: auto;
    }

    .offer-card__price-line {
        justify-content: flex-start;
        min-height: auto;
    }

    .offer-card__price {
        font-size: 16px;
        line-height: 20px;
    }

    .offer-card__currency {
        font-size: 13px;
    }

    .offer-card__old-price {
        font-size: 10px;
    }

    .offer-card__category {
        display: none;
    }

    .offer-card__order-button {
        width: 100%;
        min-height: 32px;
        padding: 5px 8px;
        font-size: 12px;
        border-radius: 4px;
    }

    .offer-card__stock {
        margin-top: 5px;
        padding: 2px 6px;
        font-size: 10px;
    }

    /* دکمه مشاهده بیشتر */
    .business-offers__more-wrap {
        margin-top: 18px;
    }

    .business-offers__more {


  color: #059669;
  background-color: #ffffff;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  
    }

    /* بهینه‌سازی مودال سفارش (Order Modal) */
    .modal-dialog {
        margin: 10px !important;
    }

    .offer-order-modal {
        max-height: 92vh !important;
    }

    .offer-order-modal .modal-header {
        padding: 12px 15px;
        min-height: 50px;
    }

    .offer-order-modal .modal-title {
        font-size: 16px;
    }

    .offer-order-modal .modal-body {
        padding: 14px 15px !important;
        max-height: calc(92vh - 130px) !important;
    }

    .offer-order-modal__title {
        font-size: 16px;
    }

    .offer-order-modal__description {
        font-size: 13px;
        line-height: 1.5;
    }

    .offer-order-modal__image-column {
        margin-top: 12px;
    }

    .offer-order-modal__image-wrap {
        height: 140px;
    }

    .offer-order-modal__image {
        max-height: 140px !important;
    }

    .offer-quantity {
        margin-top: 14px;
        gap: 6px;
    }

    .offer-order-modaltotal {
        margin-top: 14px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .offer-order-modaltotal strong {
        font-size: 18px;
    }

    .offer-order-modal .modal-footer {
        flex-direction: column;
        padding: 10px 15px;
        gap: 8px;
    }

    .offer-order-modal .modal-footer .btn {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        font-size: 13px;
    }
}

/* برای موبایل‌های با صفحه بسیار باریک (زیر 380 پیکسل) */
@media (max-width: 380px) {
    .business-offers__grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .offer-card {
        min-height: auto;
    }

    .offer-card__media {
        height: 150px;
    }

    .offer-card__bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .offer-card__order-button {
        width: auto;
        min-width: 80px;
    }
}


/* =========================================================
   Order modal image - prevent overflow and preserve image
========================================================= */

/* جلوگیری از خروج محتوا از محدوده مودال */
.offer-order-modal {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* بدنه مودال نباید باعث خروج افقی محتوا شود */
.offer-order-modal .modal-body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* اصلاح رفتار ستون Bootstrap که عکس داخل آن است */
.offer-order-modal .col-md-4 {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* کانتینر تصویر */
.offer-order-modal__image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 185px;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f2f2;
}

/* تصویر محصول */
.offer-order-modal__image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 185px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px;
    object-fit: contain !important;
    object-position: center center;
}

/* جلوگیری از اعمال styleهای عمومی سایت روی عکس مودال */
.offer-order-modal img.offer-order-modal__image {
    min-width: 0 !important;
    min-height: 0 !important;
    float: none !important;
    position: static !important;
    transform: none !important;
}

/* در تبلت، قاب تصویر کمی کوتاه‌تر باشد */
@media (min-width: 768px) and (max-width: 991.98px) {
    .offer-order-modal__image-wrap {
        height: 150px;
    }

    .offer-order-modal__image {
        max-height: 150px !important;
    }
}