/* Scoped Styles for All Products Slider */

/* Section Background */
.all-products-section {
    background-color: #121212;
    overflow: hidden;
}

/* Section Header */
.section-title {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0px;
    font-size: 32px;
    color: #d4af37;
}

.section-subtitle {
    color: #aaaaaa;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    max-width: 800px;
    margin-left: auto;
}

/* Card Base - Matching Screenshot 1 */
.home-best-sellers .product-card-login-style,
.home-collections .product-card-login-style {
    background: #1a1a1a; /* Dark content area Footer */
    border: none !important;
    border-radius: 12px; /* Smoother radius */
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    /* تأكيد تمدد الكارت ليملأ السلايد بالكامل */
    height: 100% !important; 
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.home-best-sellers .product-card-login-style:hover,
.home-collections .product-card-login-style:hover {
    transform: translateY(-8px);
    border: 2px solid #d4af37 !important; /* Gold Border Hover - Restored */
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3); /* Enhanced Gold Glow */
}

/* --------------------------------------------------------------------------
   Category Card Scope (.home-sections)
   -------------------------------------------------------------------------- */
/* Section Grid Layout */
.home-sections .sections-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .home-sections .sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .home-sections .sections-grid {
        grid-template-columns: 1fr;
    }
}

.home-sections .section-card {
    height: 100%;
    width: 100%;
}

.home-sections .product-card-login-style {
    background: #1a1a1a;
    border: none !important;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    height: 480px !important; /* Standardize with other cards */
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.home-sections .product-card-login-style:hover {
    transform: translateY(-8px);
    border: 2px solid #d4af37 !important;
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
}

.home-sections .product-img-wrapper {
    height: 65% !important; /* Increased to 65% to give image even more space */
    width: 100% !important;
    background: #1a1a1a !important;
    padding: 0 !important; /* Zero padding */
    display: block;
    position: relative;
    border-bottom: 2px solid #1a1a1a;
}

.home-sections .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Cover to fill area professionally without stretching */
    margin: 0 !important;
    display: block !important;
}

/* --------------------------------------------------------------------------
   Product Cards Scope (.home-best-sellers, .home-collections)
   -------------------------------------------------------------------------- */

/* Image Wrapper - Transparent Full-Bleed (User Refinement) */
.home-best-sellers .product-img-wrapper,
.home-collections .product-img-wrapper,
.S4_home .product-img-wrapper {
    flex: 0 0 auto !important;
    height: clamp(160px, 22vw, 260px) !important; 
    background: #000 !important; /* Static black background */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important; 
    margin: 0 !important;
    border-bottom: 2px solid #1a1a1a;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.home-best-sellers .product-img,
.home-collections .product-img,
.S4_home .product-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Static container with contained image to preserve aspect ratio */
    background: transparent !important; 
    transition: transform 0.5s ease;
}

.home-best-sellers .product-card-login-style:hover .product-img,
.home-collections .product-card-login-style:hover .product-img,
.S4_home .product-card-login-style:hover .product-img {
    transform: scale(1.08); /* Slight zoom on hover */
}

/* Badge - Rounded Pill (Screenshot 1) */
.badge-overlay {
    position: absolute;
    top: 15px;
    right: 15px; /* RTL - Top Right preferably or Top Left per screenshot */
    background: #333333 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 25px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Title */
.product-title {
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem; 
    font-weight: 700;
    line-height: 1.2;
    max-height: 2.4em; /* Allow up to 2 lines but don't force it */
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.product-title a {
    transition: color 0.3s;
}

.product-card-login-style:hover .product-title a {
    color: #d4af37 !important;
}

/* تعليق عربي: ضمان إن الصور تظهر كاملة وتملأ الكارت بشكل افتراضي (Cover) */
.home-best-sellers .product-img-wrapper,
.home-collections .product-img-wrapper { width: 100% !important; background: #000 !important; padding: 0 !important; margin: 0 !important; }

.home-best-sellers .product-img,
.home-collections .product-img,
.S4_home .product-img { width: 100% !important; height: 100% !important; object-fit: contain !important; display: block !important; margin: 0 !important; padding: 0 !important; }

/* We've completely removed the .is-contain logic to ensure 
   all images are perfectly full-width (cover) per user request */

/* Subtitle - Small and Muted */
.product-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    font-family: 'Cairo', sans-serif;
    min-height: 1.2em;
    width: 100%;
    max-width: 100%;
}

/* Price - Golden White text */
.price-tag {
    color: #D4AF37;
    font-weight: 700;
    font-size: 1.05rem;
    font-family: 'Cairo', sans-serif;
    direction: ltr;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    width: 100%;
}

.price-tag .price-amount {
    color: #D4AF37;
    font-weight: 900;
    font-size: 1.15rem;
}

.price-tag .currency {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(212, 175, 55, 0.7);
}

/* Old Price — Strikethrough */
.price-tag .old-price {
    text-decoration: line-through;
    color: rgba(212, 175, 55, 0.4); /* Muted Gold for old price */
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 8px;
    display: inline-block;
}

/* Button - Solid Gold (Screenshot 1) */
.btn-login-style {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px; /* Increased height for premium feel and better usability */
    border-radius: 8px; /* Slightly smoother radius */
    font-size: 13px; 
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    background-color: #d4af37 !important; 
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-login-style:hover {
    background-color: #b4932a; /* var(--primary-hover) */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Navigation Arrows */
.arrow-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d4af37;
    border-radius: 50%;
    background: transparent;
    color: #d4af37;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-btn:hover {
    background: #d4af37;
    color: #000;
}

.arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}

/* Swiper Container Override */
.swiper.all-products-swiper {
    padding: 20px 5px;
}
/* إجبار سطر السلايدر على مساواة أطول كارت منعاً للـ Trapping */
.swiper.all-products-swiper .swiper-wrapper {
    align-items: stretch !important;
}
.swiper.all-products-swiper .swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    min-width: 0;
    max-width: 100%;
}
/* Quick Actions Overlay (Bottom Left on Image) */
.quick-actions {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-direction: row; /* Horizontal layout as requested */
    gap: 12px; /* Slightly more space for horizontal tap targets */
    z-index: 10;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card-login-style:hover .quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.quick-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.quick-action-btn:hover {
    background: #d4af37;
    color: #000;
    border-color: #d4af37;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.quick-action-btn.active {
    color: #ff4757;
    background: rgba(255, 255, 255, 0.2);
}

.quick-action-btn i {
    font-size: 16px;
}

/* Base Card Refinement */
.product-card-login-style {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.product-card-login-style:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.2) !important;
}

/* Optimized Image Mask */
.product-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card-login-style:hover .product-img-wrapper::after {
    opacity: 1;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS (Tablet & Mobile)
   ========================================= */
@media (max-width: 991px) {
    /* Tablet */
    .home-best-sellers .product-card-login-style,
    .home-collections .product-card-login-style,
    .home-sections .product-card-login-style {
        height: 100% !important;
        min-height: 0 !important;
    }
}

@media (max-width: 575px) {
    /* Mobile - Exactly 2 Cards layout identical to Desktop Replica */
    .home-best-sellers .product-card-login-style,
    .home-collections .product-card-login-style,
    .home-sections .product-card-login-style {
        height: 100% !important;
        min-height: 0 !important;
        border-radius: 12px;
    }
    
    /* جعل صندوق المحتوى يتمدد ليدفع زر السلة للأسفل تماماً */
    /* جعل صندوق المحتوى يتمدد ليدفع زر السلة للأسفل تماماً */
    .product-content {
        padding: 8px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* Changed from space-between to flex-start + gap */
        gap: 8px !important;
    }

    /* ضمان اصطفاف السعر والبيانات في سطر واحد دون تكسير */
    .price-tag {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
        gap: 6px !important;
    }

    .price-tag span {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-width: 0 !important;
    }

    .btn-login-style {
        margin-top: auto !important; /* Push button to the very bottom */
        height: clamp(32px, 8vw, 40px);
        font-size: clamp(10px, 2.5vw, 13px);
        border-radius: 8px;
    }

    .quick-action-btn {
        width: clamp(30px, 8vw, 38px);
        height: clamp(30px, 8vw, 38px);
    }
}
