/* تأثيرات حركية للمنتجات المضافة حديثاً */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

.recently-added-section {
    position: relative;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.recently-added-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
}

.recently-added-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: #333;
    animation: slideInRight 0.8s ease-out;
}

.recently-added-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: #ff7e5f;
    animation: slideInLeft 1s ease-out;
}

.recently-added-product {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.recently-added-product:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.recently-added-product:nth-child(1) { animation-delay: 0.1s; }
.recently-added-product:nth-child(2) { animation-delay: 0.2s; }
.recently-added-product:nth-child(3) { animation-delay: 0.3s; }
.recently-added-product:nth-child(4) { animation-delay: 0.4s; }
.recently-added-product:nth-child(5) { animation-delay: 0.5s; }
.recently-added-product:nth-child(6) { animation-delay: 0.6s; }

.recently-added-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 2;
    animation: pulse 2s infinite;
}

.recently-added-image {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: transform 0.3s ease;
}

.recently-added-product:hover .recently-added-image {
    transform: scale(1.05);
}

.recently-added-details {
    padding: 15px;
}

.recently-added-name {
    font-weight: 600;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recently-added-price {
    font-weight: bold;
    color: #ff7e5f;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.recently-added-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.recently-added-button {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.recently-added-button:hover {
    background: linear-gradient(45deg, #feb47b, #ff7e5f);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.view-all-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 10px 25px;
    background-color: transparent;
    color: #ff7e5f;
    border: 2px solid #ff7e5f;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.view-all-button:hover {
    background-color: #ff7e5f;
    color: white;
    transform: translateY(-5px);
}

/* تأثيرات الخلفية المتحركة */
.animated-bg {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 3rem;
    z-index: 1;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
    transition: all 0.5s ease;
}

/* تأثير خلفية العروض */
.animated-bg-offers {
    background-color: #f8f9fa;
}

.animated-bg-offers::before {
    background: radial-gradient(circle, rgba(255,126,95,0.3) 0%, rgba(254,180,123,0.1) 100%);
    animation: pulse-bg 8s infinite alternate;
}

/* تأثير خلفية المنتجات المميزة */
.animated-bg-featured {
    background-color: #f0f7ff;
}

.animated-bg-featured::before {
    background: linear-gradient(135deg, rgba(0,123,255,0.2) 0%, rgba(0,123,255,0) 100%);
    animation: slide-bg-right 15s infinite linear;
}

/* تأثير خلفية الأقسام */
.animated-bg-categories {
    background-color: #f5f5f5;
}

.animated-bg-categories::before {
    background: radial-gradient(circle at center, rgba(108,117,125,0.1) 0%, rgba(108,117,125,0) 70%);
    animation: expand-bg 10s infinite alternate;
}

/* تأثير خلفية المنتجات الموصى بها */
.animated-bg-recommended {
    background-color: #fff8f0;
}

.animated-bg-recommended::before {
    background: linear-gradient(45deg, rgba(253,126,20,0.1) 0%, rgba(253,126,20,0) 100%);
    animation: slide-bg-left 15s infinite linear;
}

/* تأثير خلفية المنتجات الجديدة */
.animated-bg-new {
    background-color: #f0fff4;
}

.animated-bg-new::before {
    background: linear-gradient(to bottom, rgba(40,167,69,0.1) 0%, rgba(40,167,69,0) 100%);
    animation: wave-bg 12s infinite linear;
}

/* تأثيرات ظهور العناصر */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

/* تعريف التحريكات */
@keyframes pulse-bg {
    0% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.2); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.1; }
}

@keyframes slide-bg-right {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes slide-bg-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes expand-bg {
    0% { transform: scale(0.8); opacity: 0.1; }
    100% { transform: scale(1.2); opacity: 0.2; }
}

@keyframes wave-bg {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(10px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* تحسينات للعرض على الأجهزة المحمولة */
@media (max-width: 768px) {
    .recently-added-section {
        padding: 1.5rem 0;
    }
    
    .recently-added-product {
        margin-bottom: 1rem;
    }
}

/* تنسيقات زر العودة للأعلى */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px; /* تعديل الموضع ليكون على اليسار بسبب اتجاه RTL */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color, #007bff);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

#back-to-top-btn:hover {
    background-color: var(--primary-color-dark, #0056b3);
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* تأثيرات حركية للزر */
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes bounceOut {
    0% { transform: scale(1); }
    25% { transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(0.3); }
}

#back-to-top-btn.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

#back-to-top-btn.bounce-out {
    animation: bounceOut 0.3s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

/* تأثير النبض عند التمرير */
#back-to-top-btn:hover {
    animation: pulse 1s infinite;
}

/* تأثير الظل عند التمرير */
@keyframes shadow-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

#back-to-top-btn:hover {
    animation: shadow-pulse 1.5s infinite;
}
