/* =============================================
   تصميم متجاوب + تحسين أداء صور المنتجات
   ============================================= */

/* ==================== تصحيحات عامة ==================== */
.s-product-card-image,
.bg-gray-100,
.store-footer,
.s-comments-product,
.store-footer__inner,
.main-nav-container.fixed-header .inner,
.topnav-is-dark .top-navbar {
    background: #fff !important;
}

/* ==================== تحسين أداء صور المنتجات (الجزء الجديد) ==================== */
.s-product-card-image {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;           /* لون خلفية أثناء التحميل */
    aspect-ratio: 1 / 1;           /* نسبة ثابتة لمنع Layout Shift (CLS) */
}

.s-product-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;           /* يحافظ على نسبة الصورة بدون تشويه */
    transition: transform 0.4s ease;
    will-change: transform;
}

/* تأثير hover أنيق مع أداء جيد */
.s-product-card-image:hover img {
    transform: scale(1.05);
}

/* تحسين للصور الكبيرة */
.s-product-card-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy Loading تحسين (بالتعاون مع HTML) */
img[loading="lazy"] {
    min-height: 200px;
}

/* ==================== Grid المنتجات - متجاوب ==================== */
@media (min-width: 1280px) {
    .md\:grid-cols-3,
    .grid-cols-3 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .md\:grid-cols-3,
    .grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    .md\:grid-cols-3,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .sm\:gap-8, .gap-8 {
        gap: 1rem !important;
    }

    .s-product-card-image {
        aspect-ratio: 1 / 1;
    }
    
    .s-product-card-image img {
        height: 210px !important;
    }
}

@media (max-width: 480px) {
    .s-product-card-image img {
        height: 185px !important;
    }
}

/* ==================== روابط وعناوين ==================== */
.s-product-card-content-title a {
    color: #8401B8;
}

/* ==================== زر المفضلة ==================== */
.s-product-card-vertical .s-product-card-wishlist-btn {
    top: 5.5rem;
}

.s-product-card-vertical .s-product-card-wishlist-btn button {
    background-color: var(--color-primary) !important;
}

/* ==================== زر الواتساب العائم ==================== */
.whatsapp-floating {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #46a51e;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.whatsapp-floating:hover,
.whatsapp-floating:focus {
    width: 260px;
    height: 58px;
    border-radius: 30px;
    font-size: 17px;
    padding: 0 18px;
    justify-content: flex-start;
}

.whatsapp-floating .wa-label {
    display: none;
    margin-right: 12px;
    font-family: "dinnextltarabic-regular", system-ui, sans-serif;
    font-weight: 500;
    white-space: nowrap;
}

.whatsapp-floating:hover .wa-label,
.whatsapp-floating:focus .wa-label {
    display: inline;
}

/* ==================== تحسينات عامة ==================== */
@media (max-width: 1024px) {
    .container, .max-w-7xl, .mx-auto {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 15px;
    }

    .s-add-to-cart-btn {
        padding: 12px 16px !important;
        font-size: 15px !important;
    }
}