/* ═══════════════════════════════════════════════════════════════════
   PRODUCTS GRID - شبكة المنتجات
   ═══════════════════════════════════════════════════════════════════ */

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    contain: content;
}

@media (min-width: 481px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   PRODUCT CARD - بطاقة المنتج
   ═══════════════════════════════════════════════════════════════════ */

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: row;
    transition:
        transform var(--transition-normal) var(--easing-smooth),
        box-shadow var(--transition-normal) var(--easing-smooth);
    border: 1px solid rgba(0, 0, 0, 0.03);
    opacity: 0;
    transform: translateY(20px);
    min-height: 110px;
    touch-action: manipulation;
}

.product-card.visible {
    animation: revealCard 0.5s var(--easing-out) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes revealCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-soft);
    }

    @media (min-width: 601px) {
        .product-card:hover {
            transform: translateY(-4px);
        }
    }
}

/* تأثير active للمس على الموبايل */
.product-card:active {
    box-shadow: var(--shadow-sm);
}

/* صورة المنتج */
.product-img-wrapper {
    position: relative;
    width: 110px;
    min-width: 110px;
    height: 110px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-soft) 0%, #e7e5e4 100%);
    flex-shrink: 0;
}

.product-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.15) 0%,
            transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

@media (hover: hover) {
    .product-card:hover .product-img-wrapper::after {
        opacity: 1;
    }

    .product-card:hover .product-img {
        transform: scale(1.08);
    }
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) var(--easing-smooth);
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* تحسين زوايا الصورة للتصميم الأفقي */
.product-img-wrapper {
    border-radius: var(--radius) 0 0 var(--radius);
}

/* زر القلب (المفضلة) على صورة المنتج */
.favorite-heart-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    z-index: 2;
    transition: all var(--transition-normal) var(--easing-smooth);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.favorite-heart-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.15);
    color: var(--danger);
}

.favorite-heart-btn:active {
    transform: scale(0.9);
}

.favorite-heart-btn.active {
    color: var(--danger);
    background: rgba(255, 255, 255, 0.9);
}

/* Heart bounce - when adding to favorites */
.favorite-heart-btn.heart-bounce {
    animation: heartBounce 0.6s var(--easing-bounce);
}

@keyframes heartBounce {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(0.75);
    }

    40% {
        transform: scale(1.35);
    }

    60% {
        transform: scale(0.95);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Heart shrink - when removing from favorites */
.favorite-heart-btn.heart-shrink {
    animation: heartShrink 0.4s var(--easing-smooth);
}

@keyframes heartShrink {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(0.7);
    }

    100% {
        transform: scale(1);
    }
}

/* Magical glow - radiant sparkle emanating from the heart */
.favorite-heart-btn.heart-glow {
    animation: heartGlow 0.8s var(--easing-smooth);
}

@keyframes heartGlow {
    0% {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    30% {
        box-shadow: 0 0 8px 4px rgba(239, 68, 68, 0.4), 0 0 20px 8px rgba(239, 68, 68, 0.15);
    }

    60% {
        box-shadow: 0 0 4px 2px rgba(239, 68, 68, 0.25), 0 0 12px 4px rgba(239, 68, 68, 0.08);
    }

    100% {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 480px) {
    .favorite-heart-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        top: 4px;
        left: 4px;
    }
}

/* Placeholder للصور */
.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #fde68a 100%);
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 800;
    pointer-events: none;
}

/* معلومات المنتج */
.product-info {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    flex-grow: 0;
    cursor: pointer;
}

/* Description Modal */
.desc-modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 420px;
    width: 90%;
    background: var(--modal-bg, var(--bg-card));
    box-shadow: var(--shadow-lg);
    animation: descModalIn 0.25s var(--easing-smooth);
    direction: rtl;
    margin: auto;
}

.desc-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes descModalIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.desc-modal-content {
    padding: 0;
}

.desc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.desc-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.desc-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.desc-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.desc-modal-body {
    padding: 16px 20px 24px;
}

.desc-modal-body p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    border-top: none;
    margin-top: auto;
}

.product-price {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary);
}

.product-price small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* زر الإضافة - مدمج */
.add-btn {
    background: var(--gradient);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-normal) var(--easing-smooth);
    box-shadow:
        0 3px 12px rgba(217, 119, 6, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    will-change: transform;
    flex-shrink: 0;
}

.add-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 70%);
    transform: scale(0);
    transition: transform var(--transition-fast);
}

.add-btn:active::before {
    transform: scale(2);
}

.add-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow:
        0 6px 24px rgba(217, 119, 6, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.add-btn:active {
    transform: scale(0.95);
}

.add-btn.success {
    background: var(--success);
    transform: scale(1.1) rotate(0deg);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.add-btn.success i {
    animation: checkPop 0.4s var(--easing-bounce);
}

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}


/* ═══════════════════════════════════════════════════════════════
   Discount & Offers - عروض وخصومات المنيو الذكي
   ═══════════════════════════════════════════════════════════════ */

/* شارة الخصم على صورة المنتج */
.product-discount-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 0.85rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.product-discount-overlay span {
    font-size: 0.9rem;
    font-weight: 800;
}

.product-discount-overlay small {
    font-size: 0.6rem;
    font-weight: 600;
}

.product-discount-overlay.small {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.product-discount-overlay.medium {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.product-discount-overlay.big {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: discountPulse 2s ease-in-out infinite;
}

@keyframes discountPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* تأثير hover على شارة الخصم */
.product-card:hover .product-discount-overlay {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.product-card:hover .product-discount-overlay.big {
    animation: discountPulse 1s ease-in-out infinite;
}

/* أسعار المنتج مع خصم */
.product-price.has-discount {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-price .original-price {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    color: #6b7280;
    font-size: 0.9em;
    font-weight: 500;
}

.product-price .discounted-price {
    font-weight: 800;
    color: #dc2626;
    font-size: 1.25em;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

/* بطاقة منتج عليها خصم */
.product-card.has-active-discount {
    border: 3px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15), var(--shadow-card);
    background: linear-gradient(to bottom, #fff 0%, #fef2f2 100%);
}

.product-card.has-active-discount:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25), var(--shadow-lg);
}

/* شارة الخصم في السلة */
.cart-discount-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 4px;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

/* السعر الأصلي في السلة */
.cart-original-price {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    color: #6b7280;
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 4px;
}

/* عرض إجمالي التوفير */
.cart-savings-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-radius: 12px;
    margin: 12px 0;
    border: 2px dashed #22c55e;
}

.cart-savings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #15803d;
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-savings-label i {
    font-size: 1.2rem;
}

.cart-savings-amount {
    color: #15803d;
    font-weight: 800;
    font-size: 1.1rem;
}

/* إجمالي الخصم في تفاصيل الطلب */
.cart-discount-summary {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #ef4444;
    font-weight: 500;
    font-size: 0.9rem;
    border-top: 1px dashed #fee2e2;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   🔥 قسم عروض اليوم - Offers Section
   ═══════════════════════════════════════════════════════════════ */

.offers-section {
    padding: 18px 0 10px;
    background: transparent;
}

.offers-section-header {
    margin-bottom: 14px;
}

.offers-section-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.offers-section-header h2 i {
    color: var(--primary-light);
    font-size: 1.2rem;
}

/* شريط التمرير الأفقي */
.offers-scroll-container {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 16px;
    scrollbar-width: none;
}

.offers-scroll-container::-webkit-scrollbar {
    display: none;
}

/* بطاقة العرض */
.offer-scroll-card {
    min-width: 210px;
    max-width: 230px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1.5px solid var(--primary-soft);
    transition: transform 0.3s var(--easing-smooth), box-shadow 0.3s var(--easing-smooth);
    cursor: pointer;
    position: relative;
}

.offer-scroll-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow), var(--shadow);
}

/* صورة العرض */
.offer-scroll-img {
    position: relative;
    width: 100%;
    height: 135px;
    overflow: hidden;
}

.offer-scroll-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--easing-smooth);
}

.offer-scroll-card:hover .offer-scroll-img img {
    transform: scale(1.06);
}

/* شارة الخصم */
.offer-scroll-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.offer-scroll-badge span {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.offer-scroll-badge small {
    font-size: 0.6rem;
    font-weight: 600;
    opacity: 0.9;
}

.offer-scroll-badge.small {
    background: linear-gradient(135deg, rgba(34,197,94,0.9), rgba(22,163,74,0.95));
}

.offer-scroll-badge.medium {
    background: linear-gradient(135deg, rgba(249,115,22,0.9), rgba(234,88,12,0.95));
}

.offer-scroll-badge.big {
    background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(220,38,38,0.95));
    animation: discountPulse 2s ease-in-out infinite;
}

/* معلومات العرض */
.offer-scroll-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offer-scroll-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* أسعار العرض */
.offer-scroll-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    direction: rtl;
}

.offer-scroll-prices .original-price {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--primary-light);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.offer-scroll-prices .discounted-price {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.2rem;
}

/* زر إضافة العرض */
.offer-add-btn {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 12px;
    background: var(--gradient);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.2s, transform 0.2s;
    font-family: inherit;
}

.offer-add-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.offer-add-btn:active {
    transform: scale(0.97);
}

/* Responsive - شاشات صغيرة */
@media (max-width: 480px) {
    .offer-scroll-card {
        min-width: 175px;
        max-width: 195px;
    }

    .offer-scroll-img {
        height: 115px;
    }

    .offers-section-header h2 {
        font-size: 1.15rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Product Rating Display (Stars on Product Cards)
   ═══════════════════════════════════════════════════════════════ */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.product-rating .stars {
    display: flex;
    gap: 2px;
}

.product-rating .stars i {
    color: var(--primary);
    font-size: 0.9rem;
}

.product-rating .rating-value {
    font-weight: 600;
    color: var(--text-primary);
}

.product-rating .review-count {
    color: #6b7280;
    font-size: 0.8rem;
}

.product-rating .no-rating {
    color: #9ca3af;
    font-size: 0.8rem;
    font-style: italic;
}

.product-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.rate-btn {
    background: none;
    border: 1px solid var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast) var(--easing-smooth);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Tajawal', sans-serif;
}

.rate-btn i {
    font-size: 0.7rem;
    color: var(--primary-light);
}

.rate-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.rate-btn:active {
    transform: scale(0.95);
}

