
/*
===============================================================================
 PAMELA SHOP — PRODUCT CARD / FINAL UX LAYER
 v3.4.12

 فقط ظاهر کارت محصول و Feedback افزودن به سبد خرید.
 Backend / URLs / Models / Cart logic / Wishlist logic دست‌نخورده‌اند.
===============================================================================
*/

/* ---------------------------------------------------------------------------
   A) PRICE — خواناتر، Premium و غیرهشداردهنده
--------------------------------------------------------------------------- */

.pamela-product-card .pamela-product-price {
    min-height: 58px !important;
}

.pamela-product-card .pamela-price-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 24px !important;
}

.pamela-product-card .pamela-price-row del {
    color: #9b9da3 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

.pamela-product-card .pamela-discount-percent {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: #fff1df !important;
    color: #b66a18 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
}

.pamela-product-card .pamela-product-price > strong {
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    margin: 2px 0 0 !important;
    color: #187a61 !important;
    font-size: 21px !important;
    font-weight: 950 !important;
    line-height: 1.35 !important;
    letter-spacing: -.25px !important;
    white-space: nowrap !important;
}

.pamela-product-card .pamela-product-price > strong small {
    color: #70757b !important;
    font-size: 10px !important;
    font-weight: 800 !important;
}

/* ---------------------------------------------------------------------------
   B) ADD TO CART — Premium، آرام و خوانا
--------------------------------------------------------------------------- */

.pamela-product-card .pamela-product-cart {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 11px !important;

    background: linear-gradient(135deg, #238b70 0%, #176c59 100%) !important;
    color: #fff !important;
    box-shadow: 0 7px 17px rgba(23,108,89,.17) !important;

    font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;

    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: hidden !important;
    text-overflow: clip !important;

    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

.pamela-product-card .pamela-product-cart i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 12px !important;
}

.pamela-product-card .pamela-product-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #2a987a 0%, #197461 100%) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(23,108,89,.23) !important;
}

.pamela-product-card .pamela-product-cart:active:not(:disabled) {
    transform: translateY(0) !important;
}

.pamela-product-card .pamela-product-cart.is-loading {
    opacity: .88 !important;
    cursor: wait !important;
}

/* Desktop/mobile label switching */
.pamela-cart-label-mobile {
    display: none !important;
}

.pamela-cart-label-desktop {
    display: inline !important;
    white-space: nowrap !important;
}

/* ---------------------------------------------------------------------------
   C) AJAX SUCCESS / ERROR MESSAGE
   قبلاً JS پیام را می‌ساخت اما CSS قابل‌نمایش آن ناقص بود.
--------------------------------------------------------------------------- */

.pamela-cart-toast {
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    z-index: 100000 !important;

    display: flex !important;
    align-items: center !important;
    gap: 9px !important;

    max-width: min(380px, calc(100vw - 44px)) !important;
    min-height: 48px !important;
    padding: 11px 16px !important;

    border: 1px solid rgba(25, 138, 104, .16) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.98) !important;
    color: #245548 !important;

    box-shadow: 0 15px 38px rgba(26,39,35,.16) !important;
    font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.7 !important;

    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) !important;
    pointer-events: none !important;

    transition: opacity .2s ease, transform .2s ease, visibility .2s ease !important;
}

.pamela-cart-toast.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.pamela-cart-toast.is-success::before {
    content: "✓" !important;
    flex: 0 0 auto !important;
    width: 25px !important;
    height: 25px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #e6f6f0 !important;
    color: #188265 !important;
    font-size: 14px !important;
    font-weight: 1000 !important;
}

.pamela-cart-toast.is-error {
    border-color: rgba(180,70,80,.16) !important;
    color: #8b4650 !important;
}

.pamela-cart-toast.is-error::before {
    content: "!" !important;
    flex: 0 0 auto !important;
    width: 25px !important;
    height: 25px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #fff0f1 !important;
    color: #a95460 !important;
    font-weight: 1000 !important;
}

/* ---------------------------------------------------------------------------
   D) LIGHT TRANSPARENT PRODUCT COVER
--------------------------------------------------------------------------- */

.pamela-product-card .pamela-product-image {
    isolation: isolate !important;
}

@media (hover: hover) and (pointer: fine) {

    .pamela-product-card .pamela-product-image::before {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 2 !important;
        pointer-events: none !important;

        /* شفاف؛ فقط یک لایه خیلی نرم برای یکدست شدن تصاویر */
        background:
            linear-gradient(
                135deg,
                rgba(255,255,255,.18),
                rgba(255,255,255,.035) 48%,
                rgba(255,255,255,.10)
            ) !important;

        opacity: .72 !important;
        transition: opacity .32s ease !important;
    }

    .pamela-product-card .pamela-product-image::after {
        content: "PAMELA SHOP" !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 3 !important;
        pointer-events: none !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;

        color: rgba(80,70,76,.035) !important;
        font-family: Arial, Tahoma, sans-serif !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        letter-spacing: 2.6px !important;

        opacity: .8 !important;
        transition: opacity .32s ease !important;
    }

    .pamela-product-card:hover .pamela-product-image::before,
    .pamela-product-card:hover .pamela-product-image::after {
        opacity: 0 !important;
    }
}

/* Touch/mobile: تصویر واقعی بدون Overlay */
@media (hover: none), (pointer: coarse) {
    .pamela-product-card .pamela-product-image::before,
    .pamela-product-card .pamela-product-image::after {
        display: none !important;
        content: none !important;
    }
}

/* ---------------------------------------------------------------------------
   E) MOBILE
--------------------------------------------------------------------------- */

@media (max-width: 560px) {

    .pamela-product-card .pamela-product-price {
        min-height: 52px !important;
    }

    .pamela-product-card .pamela-price-row {
        gap: 6px !important;
    }

    .pamela-product-card .pamela-price-row del {
        font-size: 10px !important;
    }

    .pamela-product-card .pamela-discount-percent {
        min-width: 35px !important;
        padding: 3px 7px !important;
        font-size: 10px !important;
    }

    .pamela-product-card .pamela-product-price > strong {
        font-size: 17px !important;
    }

    .pamela-product-card .pamela-product-price > strong small {
        font-size: 9px !important;
    }

    .pamela-product-card .pamela-cart-row {
        grid-template-columns: 62px minmax(0,1fr) !important;
        gap: 6px !important;
    }

    .pamela-product-card .pamela-quantity-control {
        width: 62px !important;
        min-width: 62px !important;
        height: 38px !important;
    }

    .pamela-product-card .pamela-product-cart {
        min-height: 38px !important;
        padding: 6px 5px !important;
        font-size: 10px !important;
        gap: 4px !important;
    }

    .pamela-cart-label-desktop {
        display: none !important;
    }

    .pamela-cart-label-mobile {
        display: inline !important;
        white-space: nowrap !important;
    }

    .pamela-cart-toast {
        right: 10px !important;
        left: 10px !important;
        bottom: 12px !important;
        max-width: none !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 11px !important;
    }
}

@media (max-width: 380px) {
    .pamela-product-card .pamela-cart-row {
        grid-template-columns: 58px minmax(0,1fr) !important;
        gap: 5px !important;
    }

    .pamela-product-card .pamela-quantity-control {
        width: 58px !important;
        min-width: 58px !important;
    }

    .pamela-product-card .pamela-product-cart {
        font-size: 9px !important;
    }
}

/* ---------------------------------------------------------------------------
   F) SHOP SEARCH ICON — inline SVG
--------------------------------------------------------------------------- */

.pamela-search-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.pamela-search-button .pamela-search-svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}


/* ---------------------------------------------------------------------------
   FINAL COVER TONE — کمی محسوس‌تر، اما همچنان شفاف و ظریف
--------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
    .pamela-product-card .pamela-product-image::before {
        background:
            linear-gradient(
                135deg,
                rgba(78,68,76,.055),
                rgba(255,255,255,.025) 52%,
                rgba(78,68,76,.035)
            ) !important;
        opacity: .82 !important;
    }

    .pamela-product-card .pamela-product-image::after {
        color: rgba(80,70,76,.045) !important;
        opacity: .82 !important;
    }
}
