/**
 * ArabFlex Inline Products - Slider Styles
 * تصميم متوافق مع WoodMart وألوان Arab Flex
 */

/* === الكونتينر الرئيسي === */
.afip-container {
    direction: rtl;
    margin: 35px 0;
    padding: 25px 20px;
    background: linear-gradient(135deg, #f8fffe 0%, #f0faf6 100%);
    border: 2px solid #00C896;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 200, 150, 0.08);
}

/* خط زخرفي فوق */
.afip-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #00C896, #FF7A3D, #C8A96E, #00C896);
    background-size: 200% 100%;
    animation: afip-gradient 3s ease infinite;
}

@keyframes afip-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === الهيدر === */
.afip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.afip-title {
    font-size: 20px;
    font-weight: 700;
    color: #1B2B3A;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* === أزرار التنقل === */
.afip-nav {
    display: flex;
    gap: 8px;
}

.afip-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #00C896;
    background: #fff;
    color: #00C896;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.afip-nav-btn:hover,
.afip-nav-btn:focus {
    background: #00C896;
    color: #fff;
    transform: scale(1.1);
    outline: none;
}

/* Accessibility: focus visible ring */
.afip-nav-btn:focus-visible,
.afip-btn:focus-visible,
.afip-dot:focus-visible {
    outline: 3px solid #FF7A3D;
    outline-offset: 2px;
}

/* === تراك السلايدر === */
.afip-slider-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 5px 2px 15px;
}

.afip-slider-track::-webkit-scrollbar {
    display: none;
}

/* === كارد المنتج === */
.afip-card {
    flex: 0 0 calc(25% - 12px);
    min-width: 200px;
    max-width: 260px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.afip-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0, 200, 150, 0.18);
}

/* === بادج العرض === */
.afip-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FF7A3D, #ff5722);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 122, 61, 0.3);
}

/* === رابط الكارد === */
.afip-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.afip-card-link:hover {
    text-decoration: none !important;
}

/* === صورة المنتج === */
.afip-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9f9f9;
}

.afip-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* === محتوى الكارد === */
.afip-card-body {
    padding: 14px 16px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.afip-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1B2B3A;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === التقييم === */
.afip-rating {
    color: #C8A96E;
    font-size: 13px;
    margin-bottom: 6px;
}

.afip-rating-count {
    color: #999;
    font-size: 11px;
}

/* === السعر === */
.afip-price {
    font-size: 16px;
    font-weight: 700;
    color: #00C896;
    margin-top: auto;
    padding-top: 4px;
}

/* WooCommerce price overrides */
.afip-price del {
    color: #bbb;
    font-size: 13px;
    font-weight: 400;
    margin-left: 6px;
}

.afip-price ins {
    text-decoration: none;
    color: #FF7A3D;
    font-weight: 700;
}

/* === زرار الشراء === */
.afip-btn {
    display: block;
    text-align: center;
    padding: 12px 16px;
    margin: 8px 14px 14px;
    background: linear-gradient(135deg, #00C896, #00b386);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(0, 200, 150, 0.25);
}

.afip-btn:hover {
    background: linear-gradient(135deg, #FF7A3D, #ff5722);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255, 122, 61, 0.3);
    color: #fff !important;
    text-decoration: none !important;
}

/* === النقط (Dots) === */
.afip-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.afip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.afip-dot.active {
    background: #00C896;
    width: 24px;
    border-radius: 4px;
}

/* ================================ */
/* === ريسبونسيف === */
/* ================================ */

/* تابلت */
@media (max-width: 1024px) {
    .afip-card {
        flex: 0 0 calc(33.33% - 11px);
    }
}

/* موبايل كبير */
@media (max-width: 768px) {
    .afip-container {
        margin: 25px -10px;
        padding: 20px 15px;
        border-radius: 12px;
    }

    .afip-card {
        flex: 0 0 calc(50% - 8px);
        min-width: 160px;
    }

    .afip-title {
        font-size: 17px;
    }
}

/* موبايل صغير */
@media (max-width: 480px) {
    .afip-container {
        padding: 15px 12px;
    }

    .afip-card {
        flex: 0 0 calc(50% - 6px);
        min-width: 145px;
    }

    .afip-product-name {
        font-size: 13px;
    }

    .afip-price {
        font-size: 14px;
    }

    .afip-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .afip-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* === أنيميشن ظهور === */
.afip-card {
    opacity: 0;
    animation: afip-fadeIn 0.5s ease forwards;
}

.afip-card:nth-child(1) { animation-delay: 0.05s; }
.afip-card:nth-child(2) { animation-delay: 0.15s; }
.afip-card:nth-child(3) { animation-delay: 0.25s; }
.afip-card:nth-child(4) { animation-delay: 0.35s; }

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

/* === Dark mode support === */
@media (prefers-color-scheme: dark) {
    .afip-container {
        background: linear-gradient(135deg, #1a2332 0%, #1B2B3A 100%);
        border-color: #00C896;
    }
    .afip-card {
        background: #243447;
    }
    .afip-title,
    .afip-product-name {
        color: #e8f0f8;
    }
}

/* === Reduced motion - احترام إعدادات المستخدم === */
@media (prefers-reduced-motion: reduce) {
    .afip-card {
        animation: none;
        opacity: 1;
    }
    .afip-container::before {
        animation: none;
    }
    .afip-slider-track {
        scroll-behavior: auto;
    }
    .afip-card:hover {
        transform: none;
    }
    .afip-card:hover .afip-img-wrap img {
        transform: none;
    }
}
