/* ==========================================================================
   کارت محصول — نسخهٔ مشترک صفحهٔ محصولات و صفحهٔ برند
   این فایل از همان قواعد درون‌خطی product_list.html استخراج شده تا کارت‌های
   صفحهٔ برند «دقیقاً» مثل صفحهٔ محصولات دیده شوند. مرجع اصلی: product_list.html
   ========================================================================== */
      /* ============================================================
           کارت محصول – یکپارچه با main.html
           ============================================================ */
      .product-card {
        border-radius: var(--radius);
        overflow: hidden;
        border: 1px solid var(--border);
        background: var(--bg-card);
        transition: all var(--dur) var(--ease);
        display: flex;
        flex-direction: column;
        position: relative;
        width: 100%;
        max-width: 280px;
      }
      .product-card:hover {
        border-color: var(--border-gold);
        transform: translateY(-6px);
        box-shadow: var(--shadow-card);
      }

      .card-media {
        position: relative;
        aspect-ratio: 16 / 12;
        background: var(--bg-2);
        overflow: hidden;
      }
      .card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s var(--ease);
      }
      .product-card:hover .card-media img {
        transform: scale(1.05);
      }

      .card-body {
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex: 1;
      }
      .card-brand {
        font-size: 11px;
        color: var(--t2);
      }
      .card-name {
        font-size: 14px;
        font-weight: 700;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.3;
      }
      .card-price {
        font-size: 16px;
        font-weight: 800;
        color: var(--gold-lt);
      }

      .card-actions {
        padding: 0 14px 14px 14px;
        margin-top: auto;
      }

      .stock-badge {
        font-size: 11px;
        font-weight: 600;
        display: inline-block;
        align-self: flex-start;
        padding: 3px 10px;
        border-radius: var(--radius);
        margin-top: 4px;
      }
      .stock-badge.in {
        color: var(--green);
        background: rgba(52, 211, 153, 0.12);
      }
      .stock-badge.out {
        color: var(--red);
        background: rgba(248, 113, 113, 0.12);
      }
      .stock-badge.low {
        color: var(--orange);
        background: rgba(251, 146, 60, 0.12);
      }
      .stock-badge.unlimited {
        color: var(--purple);
        background: rgba(167, 139, 250, 0.12);
      }

      /* دکمه‌های کارت – دقیقاً از main.html */
      .wishlist-btn-card {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 10;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(10, 11, 13, 0.7);
        backdrop-filter: blur(6px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--dur) var(--ease);
        cursor: pointer;
      }
      .wishlist-btn-card:hover {
        background: var(--gold-dim);
        border-color: var(--gold);
      }
      .wishlist-btn-card.active {
        color: var(--gold);
        border-color: var(--gold);
        background: var(--gold-dim);
      }
      .wishlist-btn-card svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
      }
      .wishlist-btn-card.active svg {
        fill: var(--gold);
        stroke: var(--gold);
      }

      .compare-btn-card {
        position: absolute;
        top: 56px;
        left: 12px;
        z-index: 10;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(10, 11, 13, 0.7);
        backdrop-filter: blur(6px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--dur) var(--ease);
        cursor: pointer;
        font-size: 14px;
      }
      .compare-btn-card:hover {
        background: var(--gold-dim);
        border-color: var(--gold);
        color: var(--gold);
      }
      .compare-btn-card.active {
        color: var(--gold);
        border-color: var(--gold);
        background: var(--gold-dim);
      }

      .qty-control-inline {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--bg-2);
        border-radius: var(--radius);
        border: 1px solid var(--border);
        overflow: hidden;
        width: 100%;
        justify-content: space-between;
      }
      .qty-control-inline .qty-btn {
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        color: var(--t2);
        font-size: 18px;
        font-weight: 300;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--dur) var(--ease);
        cursor: pointer;
      }
      .qty-control-inline .qty-btn:hover {
        color: var(--gold);
        background: var(--gold-dim);
      }
      .qty-control-inline .qty-num {
        font-size: 14px;
        font-weight: 700;
        color: var(--t1);
        min-width: 30px;
        text-align: center;
        background: transparent;
        border: none;
        outline: none;
        font-family: inherit;
      }
      .qty-control-inline .qty-num::-webkit-inner-spin-button,
      .qty-control-inline .qty-num::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }
      .qty-control-inline .qty-num[type="number"] {
        -moz-appearance: textfield;
      }

      .btn-add-cart {
        width: 100%;
        height: 36px;
        border-radius: var(--radius);
        background: var(--gold);
        color: var(--bg);
        border: none;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        transition: all var(--dur) var(--ease);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
      }
      .btn-add-cart:hover {
        opacity: 0.85;
        transform: translateY(-1px);
      }
      .btn-add-cart:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
      }

      .btn-notify {
        width: 100%;
        height: 36px;
        border-radius: var(--radius);
        background: transparent;
        color: var(--t1);
        border: 1px solid var(--border);
        font-weight: 600;
        font-size: 12px;
        cursor: pointer;
        transition: all var(--dur) var(--ease);
      }
      .btn-notify:hover {
        border-color: var(--gold);
        color: var(--gold-lt);
      }


      .tpl-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
        transition: opacity 0.3s;
      }
      .tpl-grid.loading {
        opacity: 0.4;
        pointer-events: none;
      }

      .card-media .out-overlay {
        position: absolute;
        inset: 0;
        background: rgba(7, 9, 13, 0.55);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 800;
        color: var(--t2);
        letter-spacing: 2px;
      }

      .card-badges {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        z-index: 2;
      }
      .card-badge {
        padding: 3px 10px;
        border-radius: 99px;
        font-size: 10px;
        font-weight: 700;
      }
      .badge-new {
        background: rgba(52, 211, 153, 0.15);
        color: var(--green);
        border: 1px solid rgba(52, 211, 153, 0.3);
      }
      .badge-best {
        background: rgba(251, 146, 60, 0.15);
        color: var(--orange);
        border: 1px solid rgba(251, 146, 60, 0.3);
      }
      .badge-sale {
        background: rgba(248, 113, 113, 0.15);
        color: var(--red);
        border: 1px solid rgba(248, 113, 113, 0.3);
      }
      .badge-out {
        background: rgba(127, 127, 127, 0.15);
        color: var(--t2);
        border: 1px solid rgba(127, 127, 127, 0.3);
      }
      .badge-low {
        background: rgba(251, 146, 60, 0.12);
        color: var(--orange);
        border: 1px solid rgba(251, 146, 60, 0.2);
      }

      .card-rating-row {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: var(--t2);
      }
      .card-stars {
        color: var(--gold);
        letter-spacing: -1px;
      }
      .card-rating-value {
        font-size: 11px;
      }

      .card-price-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        margin: 2px 0 6px;
      }
      .card-price {
        font-size: 16px;
        font-weight: 800;
        color: var(--gold-lt);
@media (max-width: 900px) {
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}
