.rounded-1rem {
    border-radius: 1em;
}

.product-box {
    position: relative;
}

.product-box.unavailable .product-anchor {
    filter: grayscale(1);
    z-index: 10;
}

.product-box.unavailable::before {
    content: 'ناموجود';
    color: #fff;
    position: absolute;
    right: 0;
    padding: 4px 10px;
    margin-right: 10px;
    margin-top: 10px;
    background: #980c0c;
    font-size: 11px;
    font-weight: bold;
    border-radius: 15px;
    z-index: 11;
}

.cursor-pointer {
    cursor: pointer !important;
}

.filter-gray {
    filter: grayscale(1);
    z-index: 10;
}

tbody, td, tfoot, th, thead, tr {
    vertical-align: baseline;
}
.basket-table-container table {
    margin-bottom: 0;
}
.basket-table-container td, .basket-table-container th {
    white-space: nowrap;
    text-align: center;
}
.basket-table-container th {
    padding: 5px 8px;
}
table tbody {
    border-style: hidden;
}
.product-out-of-stock{
    color: #fff;
    background: #980c0c;
    font-weight: 700;
    border: 1px solid #980c0c;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
}
/* Price calculation loading overlay */
.price-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 236, 239, 0.95);
    border-radius: inherit;
    z-index: 5;
    pointer-events: all;
}
/* Discount popup legacy hooks neutralized — real chrome lives in storefront-theme (.bf-disc-*). */
.bg-gradient-primary-discount,
.discount-badge-discount,
.discount-percentage-discount,
.discount-text-discount,
.coupon-code-container-discount,
.coupon-code-discount,
.discount-features-discount {
    all: unset;
}
@media (min-width: 992px) {
    .banner-full-width .item-link {
        aspect-ratio: 2 / 1 !important;
    }
}
.discount-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    box-shadow: none;
    filter: none;
    position: relative;
    overflow: visible;
    font-size: inherit;
    transition: background .2s, color .2s;
  }

  .discount-btn::before {
    content: none;
    display: none;
  }

  .discount-btn:hover,
  .discount-btn:active {
    background: rgba(229, 2, 31, .08);
    box-shadow: none;
    transform: none;
    filter: none;
  }

  .discount-btn .ic {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
  }

  .discount-icon {
    font-size: 1.1em;
    filter: none;
  }

  .product-card-image {
    object-fit: contain !important;
    object-position: center;
    background: transparent !important;
  }

  @media (max-width: 600px) {
    .discount-btn {
      width: 40px;
      height: 40px;
      box-shadow: none;
    }

    .discount-btn:hover {
      box-shadow: none;
    }
  }
  .product-image-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    margin-bottom: 0.7em;
    border-radius: 1.2em;
    box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.07);
}

.product-image-wrapper .product-card-image {
    width: 100%;
    height: 210px;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.4s ease-in-out;
    margin-bottom: 0;
}

.product-image-wrapper .product-card-image.hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 1;
}

.product-box:hover .product-image-wrapper .hover-image {
    opacity: 1;
}

.product-content-container {
    align-self: stretch;
    width: 100%;
}

/* Product weight badge - روی تصویر، گوشه بالا راست */
.product-weight-badge-wrapper {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    pointer-events: none;
}

.product-weight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 0;
    padding: 0.3rem 0.65rem;
    background: rgba(245, 245, 245, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    font-size: 0.78rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    direction: rtl;
    box-sizing: border-box;
    white-space: nowrap;
}

.product-weight-badge-value-unit {
    color: #475569;
    font-weight: 600;
}

/* Header labeled actions (tenant switch): icon above, label below */
#main-header.bf-header--labeled-actions .header-content {
    display: grid;
    grid-template-columns: minmax(2.5rem, auto) minmax(0, 1fr) minmax(9rem, auto);
    align-items: center;
    column-gap: 0.65rem;
}

#main-header.bf-header--labeled-actions .logo {
    position: static !important;
    transform: none !important;
    inset: auto !important;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    max-width: 100%;
    min-width: 0;
}

#main-header.bf-header--labeled-actions .search-bar-container {
    display: contents;
}

#main-header.bf-header--labeled-actions .bf-header-menu-btn,
#main-header.bf-header--labeled-actions .search-modal-btn,
#main-header.bf-header--labeled-actions .search-bar {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

#main-header.bf-header--labeled-actions .bf-header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.bf-header-actions {
    display: inline-flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.55rem;
}

.bf-header-action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.18rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    width: 3.6rem;
    max-width: 3.6rem;
}

.bf-header-action:hover,
.bf-header-action:focus-visible {
    color: var(--bfrontshop-brand-primary, #0071e3);
    text-decoration: none;
}

.bf-header-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.bf-header-action__icon svg {
    width: 22px;
    height: 22px;
}

.bf-header-action__label {
    white-space: normal;
}

.bf-header-action__badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    color: #fff;
}

/* نرخ طلا - زیر جستجو و لاگین در هدر */
.header-gold-price-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    padding: 0.35rem 12px 0.5rem;
}

.fixed-gold-price-note {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    white-space: nowrap;
}

.fixed-gold-price-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 2.5em;
    font-size: 0.85rem;
    text-decoration: none;
    color: #1a365d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

.fixed-gold-price-box:hover {
    color: #1a365d;
    border-color: rgba(201, 162, 39, 0.35);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1), 0 2px 12px rgba(201, 162, 39, 0.12);
    transform: translateY(-2px);
}

.fixed-gold-price-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

.fixed-gold-price-label {
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.fixed-gold-price-value {
    color: #1a365d;
    font-weight: 700;
    font-size: 1.02em;
}

.fixed-gold-price-currency {
    color: #718096;
    font-size: 0.88em;
    font-weight: 500;
}

@media (max-width: 576px) {
    .header-gold-price-row {
        padding: 0.3rem 10px 0.4rem;
    }

    .fixed-gold-price-box {
        padding: 0.4rem 0.8rem 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .fixed-gold-price-icon {
        width: 24px;
        height: 24px;
    }

    .fixed-gold-price-label {
        max-width: 100px;
    }
}
