* {
    font-family: 'Tajawal', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --pearl-white: #FFFFFF;
    --warm-sand: #F5F5F0;
    --deep-charcoal: #2C2C2C;
    --metallic-gold: #D4AF37;
    --gold-hover: #C19B2B;
}

body {
    background-color: var(--pearl-white);
    color: var(--deep-charcoal);
}

html {
    scroll-behavior: smooth;
}

.glass-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

.mega-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.parallax-bg {
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.15s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 32px rgba(212, 175, 55, 0.5);
        transform: scale(1.05);
    }
}

.floating-button {
    animation: pulse-gold 2.5s ease-in-out infinite;
}

.floating-button:hover {
    animation: none;
    transform: scale(1.15);
}

.product-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.color-swatch {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px #D4AF37, 0 0 0 8px #FFFFFF, 0 20px 40px rgba(212, 175, 55, 0.4);
    position: relative;
    z-index: 10;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 80px;
    right: -320px;
    width: 320px;
    max-width: 85vw;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
    overflow-y: auto;
}

.mobile-menu.open {
    right: 0;
}

.branch-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.branch-card.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: #D4AF37;
}

.blog-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* تأثيرات Variants */
.variant-color-btn.selected {
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    transform: scale(1.1);
}

.variant-size-btn.selected {
    border-color: #D4AF37 !important;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(193, 155, 43, 0.1)) !important;
    color: #2C2C2C;
    font-weight: bold;
}

/* تأثيرات المنتج */
.product-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* تأثيرات الأزرار */
button:active {
    transform: scale(0.98);
}

/* تجميل عداد الكمية */
.bg-\[\#F5F5F0\] {
    transition: all 0.3s ease;
}

.bg-\[\#F5F5F0\]:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* تحسين بطاقات المنتجات */
.product-card-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title-section {
    margin-bottom: 12px;
    min-height: 72px;
}

.product-variants-section {
    flex: 1;
    margin-bottom: 16px;
}

.product-actions-section {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* تحسين تنسيق الـ variants */
.compact-variants {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 8px;
}

.compact-variants::-webkit-scrollbar {
    width: 4px;
}

.compact-variants::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.compact-variants::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 10px;
}

/* تحسين تنسيق أزرار variants */
.variant-colors-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.variant-color-btn-compact {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    padding: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-color-btn-compact.selected {
    border-color: #d4af37;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d4af37;
}

.color-dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-sizes-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.variant-size-btn-compact {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
    cursor: pointer;
}

.variant-size-btn-compact.selected {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    color: #2c2c2c;
    font-weight: 600;
}

/* تحسين حجم العداد */
.compact-quantity-control {
    height: 36px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 2px;
}

/* تحسين حجم الأزرار */
.compact-button {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
}

/* تحسين تنسيق المنتجات بدون variants */
.no-variants-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-description-compact {
    flex: 1;
    margin-bottom: 16px;
}

/* تحسينات لقسم استوديو الألوان للشاشات الصغيرة */
.color-lab-mobile-view {
    display: none;
}

.color-lab-desktop-view {
    display: block;
}

@media (max-width: 768px) {
    .color-lab-mobile-view {
        display: block;
    }

    .color-lab-desktop-view {
        display: none;
    }

    .color-swatches-mobile {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .color-swatch-mobile {
        aspect-ratio: 1;
        border-radius: 12px;
        border: 2px solid transparent;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .color-swatch-mobile.selected {
        border-color: #D4AF37;
        transform: scale(1.05);
        box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px #D4AF37;
    }

    .room-preview-mobile {
        height: 300px;
        border-radius: 16px;
        overflow: hidden;
        margin-bottom: 20px;
        background: #f8f9fa;
    }

    .room-preview-mobile svg {
        width: 100%;
        height: 100%;
    }
}

/* تحسين Responsive للبطاقات */
@media (max-width: 768px) {
    .product-image-container {
        height: 180px;
    }

    .product-content {
        padding: 16px;
    }

    .product-title-section {
        min-height: 64px;
    }

    .compact-button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .variant-size-btn-compact {
        padding: 5px 10px;
        font-size: 11px;
        min-width: 45px;
    }
}

@media (max-width: 640px) {
    #productsGrid {
        grid-template-columns: 1fr;
    }

    .mobile-menu {
        width: 280px;
        right: -280px;
    }

    .glass-header.scrolled {
        background: rgba(255, 255, 255, 0.98);
    }

    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #productsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    #productsGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    section {
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .text-4xl {
        font-size: 2rem;
    }

    .text-5xl {
        font-size: 2.5rem;
    }

    .floating-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        left: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .mega-menu {
        padding: 1rem;
    }

    .mega-menu .grid {
        gap: 1rem;
    }
}

/* تحسين عرض الفروع في الشاشات الصغيرة */
@media (max-width: 768px) {
    #branches .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .branch-card {
        padding: 1rem;
    }

    #branchDetails {
        padding: 1rem;
    }
}

/* تحسين نموذج الاتصال */
@media (max-width: 640px) {
    #contactForm {
        padding: 1rem;
    }

    #contactForm input,
    #contactForm select,
    #contactForm textarea {
        padding: 0.75rem;
        font-size: 16px; /* لمنع التكبير في iOS */
    }
}

/* تحسين الشعار في الشاشات الصغيرة */
@media (max-width: 480px) {
    #navbar .flex-col span:first-child {
        font-size: 14px;
    }

    #navbar .w-10 {
        width: 36px;
        height: 36px;
    }
}

/* تحسينات لقسم الفروع */
.branch-details-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* تحسين الصور */
.branch-image-container {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.branch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.branch-image:hover {
    transform: scale(1.05);
}

/* تحسين الـ iframe لخرائط جوجل */
.map-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.map-responsive-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* نسبة 16:9 */
    height: 0;
    overflow: hidden;
}

.map-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* تحسين بطاقة تفاصيل الفرع */
.branch-info-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* تحسين تخطيط زر الاتصال */
.contact-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* تحسين قائمة المدن */
.city-list-item {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.city-list-item:hover {
    border-color: #D4AF37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(193, 155, 43, 0.05));
    transform: translateX(-4px);
}

.city-list-item.active {
    border-color: #D4AF37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(193, 155, 43, 0.1));
    transform: translateX(-8px);
}

/* تأثيرات إضافية */
.info-item {
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateX(8px);
}

/* تحسين عنوان الفرع */
.branch-title {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.branch-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #D4AF37, #C19B2B);
    border-radius: 2px;
}

/* تحسين شارة الفرع الرئيسي */
.main-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #D4AF37, #C19B2B);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* تحسينات للتفاصيل الصغيرة */
.detail-label {
    color: #2C2C2C;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-value {
    color: #2C2C2C;
    line-height: 1.5;
}

/* تحسينات للروابط */
.contact-link {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contact-link:hover {
    color: #C19B2B;
    transform: translateX(-4px);
}

/* تحسين تأثيرات الـ hover للشاشات التي تدعمها */
@media (hover: hover) and (pointer: fine) {
    .city-list-item:hover .fa-chevron-left {
        transform: translateX(-4px);
        transition: transform 0.3s ease;
    }

    .contact-link:hover .fa-external-link-alt {
        transform: translateY(-1px);
        transition: transform 0.3s ease;
    }
}

/* تحسين أداء الصور */
.branch-image {
    background-color: #f5f5f0;
    background-image: linear-gradient(45deg, #f5f5f0 25%, transparent 25%),
    linear-gradient(-45deg, #f5f5f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f5f5f0 75%),
    linear-gradient(-45deg, transparent 75%, #f5f5f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* تحسين أداء الـ iframe */
.map-responsive-wrapper iframe {
    pointer-events: auto;
}

/* تحسينات للأجهزة الصغيرة جداً */
@media (max-width: 375px) {
    .branch-image-container {
        height: 180px;
    }

    .branch-title h3 {
        font-size: 1.5rem;
    }

    .contact-buttons-grid {
        gap: 8px;
    }

    .city-list-item {
        padding: 12px;
    }
}

/* تحسينات للشاشات الكبيرة جداً */
@media (min-width: 1920px) {
    .branch-image-container {
        height: 320px;
    }

    .map-responsive-wrapper {
        padding-bottom: 45%;
    }

    .branch-info-card {
        padding: 32px;
    }
}

/* تحسينات للطباعة */
@media print {
    .map-container,
    .contact-buttons-grid,
    .city-list-item {
        break-inside: avoid;
    }

    .branch-image-container {
        height: 200px;
    }

    .map-responsive-wrapper {
        padding-bottom: 40%;
    }
}
/* Additional CSS for Enhanced Brands & Hero */

/* Brand Carousel Styles */
.brands-carousel-container {
    position: relative;
    overflow: visible;
}

#brandsCarousel {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-card {
    flex: 0 0 100%;
}

@media (min-width: 1024px) {
    #brandsCarousel {
        display: grid;
        transform: none !important;
    }
}

/* Brand Card Hover Effects */
.brand-card .group:hover .brand-image {
    transform: scale(1.05);
}

.brand-card .group:hover .brand-stats {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section Enhancements */
.hero-stats-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(45deg, #D4AF37, #C19B2B, #B38F2A);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

/* Enhanced Button Effects */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .brand-card {
        margin: 0 8px;
    }

    #brandsCarousel {
        padding: 0 16px;
    }
}

/* Brand Indicators Active State */
.brand-indicator.active {
    background-color: #D4AF37;
    transform: scale(1.2);
}

/* Loading Animation for Images */
.brand-image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* إضافة هذه الأنماط إلى ملف CSS الحالي */

/* تحسين عرض الأسعار للمنتجات مع variants */
.product-price-with-variants {
    position: relative;
}

.product-price-with-variants .starting-from {
    font-size: 0.75rem;
    color: #6b7280;
    margin-right: 0.5rem;
}

/* تحسين تنسيق أزرار variants */
.variant-size-btn-compact.with-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    min-width: 70px;
}

.variant-size-btn-compact.with-price .size-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.variant-size-btn-compact.with-price .price-label {
    font-size: 0.75rem;
    color: #d4af37;
    margin-top: 0.25rem;
}

/* تحسين عرض السلة */
.cart-sidebar .cart-item-variant-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 0.5rem;
    border-right: 3px solid #d4af37;
}

/* تحسين responsiveness */
@media (max-width: 768px) {
    .variant-size-btn-compact.with-price {
        min-width: 60px;
        padding: 0.375rem 0.5rem;
    }

    .variant-size-btn-compact.with-price .size-label {
        font-size: 0.75rem;
    }

    .variant-size-btn-compact.with-price .price-label {
        font-size: 0.65rem;
    }
}

/* تحسين تنسيق فلاتر المنتجات */
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background: #e5e7eb;
}

.filter-tag button {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.filter-tag button:hover {
    color: #ef4444;
}

/* تحسين تنسيق مؤشر التحميل */
#loadingSpinner {
    display: none;
}

#loadingSpinner.active {
    display: block;
}

/* تحسين تنسيق حالة عدم وجود نتائج */
#noResults {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 1rem;
    padding: 3rem 1rem;
}

#noResults i {
    font-size: 4rem;
    opacity: 0.3;
}

/* تحسين تنسيق زر تحميل المزيد */
#loadMoreBtn {
    position: relative;
    overflow: hidden;
}

#loadMoreBtn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

#loadMoreBtn:hover:before {
    left: 100%;
}

/* تحسين تنسيق شريط البحث */
#searchInput {
    transition: all 0.3s ease;
}

#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* تحسين تنسيق الفلاتر على الشاشات الصغيرة */
@media (max-width: 640px) {
    .filter-select {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #activeFilters {
        padding: 0.75rem;
    }

    .filter-tag {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* تحسين تنسيق بطاقات المنتجات */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-image-container {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image-container img {
    transition: transform 0.6s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* تحسين تنسيق أزرار variants */
.variant-color-btn-compact {
    position: relative;
    transition: all 0.3s ease;
}

.variant-color-btn-compact.selected:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
    }
}

/* تحسين تنسيق عداد الكمية */
.compact-quantity-control {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.compact-quantity-control button {
    transition: all 0.3s ease;
}

.compact-quantity-control button:hover {
    background: #d4af37;
    color: white;
    transform: scale(1.1);
}

/* تحسين تنسيق أزرار الإجراءات */
.compact-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compact-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.compact-button:hover:before {
    left: 100%;
}

.compact-button:hover {
    transform: translateY(-2px);
}

/* ========================================
   ENHANCED PRODUCT CARD STYLES - COMPACT VERSION
   Modern E-commerce Design
   ======================================== */

/* Product Card Container */
.product-card-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #e0e0e0;
}

/* ========================================
   IMAGE SECTION - COMPACT
   ======================================== */

.product-image-wrapper {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 85%; /* Slightly shorter aspect ratio */
    overflow: hidden;
}

.product-main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-main-image {
    transform: scale(1.06);
}

.product-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image-placeholder i {
    font-size: 2.5rem;
    color: rgba(212, 175, 55, 0.3);
}

/* Image Overlay */
.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image-overlay {
    opacity: 1;
    visibility: visible;
}

.quick-view-btn {
    background: white;
    color: #2C2C2C;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card:hover .quick-view-btn {
    transform: translateY(0);
}

.quick-view-btn:hover {
    background: #D4AF37;
    color: white;
    transform: scale(1.05);
}

/* Badges - Smaller */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
    pointer-events: none;
}

.badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
}

.badge-featured {
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2B 100%);
    color: white;
}

.badge-category {
    background: rgba(59, 130, 246, 0.95);
    color: white;
}

/* Quick Actions */
.quick-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.product-card:hover .quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.quick-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    color: #2C2C2C;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quick-action-btn:hover {
    background: #D4AF37;
    color: white;
    transform: scale(1.1);
}

/* ========================================
   CONTENT SECTION - COMPACT
   ======================================== */

.product-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Header - Brand & Title */
.product-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 52px;
}

.product-brand {
    color: #D4AF37;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    margin: 0;
    line-height: 1.3;
}

.product-title a {
    color: #2C2C2C;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #D4AF37;
}

/* Price Section - Compact */
.product-price-section {
    padding: 6px 0;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.from-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #D4AF37;
    line-height: 1;
}

.currency {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 600;
}

/* ========================================
   VARIANTS SECTION - ULTRA COMPACT
   ======================================== */

.product-variants-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variants-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variants-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #4b5563;
    min-width: 40px;
    flex-shrink: 0;
}

/* Color Variants - Inline */
.variant-colors-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.variant-color-btn-compact {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    padding: 2px;
    background: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.color-swatch {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-check {
    position: absolute;
    color: white;
    font-size: 0.6rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.variant-color-btn-compact.selected {
    border-color: #D4AF37;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.variant-color-btn-compact:hover:not(.selected) {
    border-color: #D4AF37;
    transform: scale(1.05);
}

/* Size Variants - Inline */
.variant-sizes-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
}

.variant-size-btn-compact {
    min-width: 42px;
    padding: 5px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.75rem;
    color: #4b5563;
    flex-shrink: 0;
}

.variant-size-btn-compact.selected {
    border-color: #D4AF37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(193, 155, 43, 0.1));
    color: #2C2C2C;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.15);
}

.variant-size-btn-compact:hover:not(.selected) {
    border-color: #D4AF37;
    background: rgba(212, 175, 55, 0.05);
}

/* ========================================
   ACTIONS SECTION - COMPACT INLINE
   ======================================== */

.product-actions {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.quantity-and-cart {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quantity Control - Inline Compact */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 3px 6px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.quantity-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: white;
    color: #2C2C2C;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    border: 1px solid #e5e7eb;
}

.quantity-btn:hover {
    background: #D4AF37;
    color: white;
    border-color: #D4AF37;
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #2C2C2C;
}

/* Add to Cart Button - Compact */
.add-to-cart-btn-main {
    flex: 1;
    padding: 10px 14px;
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2B 100%);
    color: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.25);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.add-to-cart-btn-main:hover::before {
    left: 100%;
}

.add-to-cart-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35);
}

.add-to-cart-btn-main:active {
    transform: translateY(0);
}

.add-to-cart-btn-main i {
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .product-image-container {
        padding-top: 90%;
    }

    .product-content {
        padding: 12px;
        gap: 8px;
    }

    .product-header {
        min-height: 48px;
    }

    .product-title a {
        font-size: 0.85rem;
    }

    .current-price {
        font-size: 1.15rem;
    }

    .variant-color-btn-compact {
        width: 26px;
        height: 26px;
    }

    .variant-size-btn-compact {
        min-width: 38px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .add-to-cart-btn-main {
        padding: 9px 12px;
        font-size: 0.8rem;
    }

    .quantity-btn {
        width: 24px;
        height: 24px;
    }

    /* Show quick actions always on mobile */
    .quick-actions {
        opacity: 1;
        transform: translateX(0);
    }

    /* Hide overlay on mobile for performance */
    .product-image-overlay {
        display: none;
    }
}

@media (max-width: 640px) {
    .product-image-container {
        padding-top: 95%;
    }

    .quantity-control {
        gap: 5px;
        padding: 2px 5px;
    }

    .variants-label {
        font-size: 0.65rem;
        min-width: 35px;
    }
}

/* ========================================
   GRID LAYOUT
   ======================================== */

#productsGrid {
    display: grid;
    gap: 20px;
}

@media (max-width: 640px) {
    #productsGrid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #productsGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1025px) {
    #productsGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1440px) {
    #productsGrid {
        grid-template-columns: repeat(4, 1fr);
        gap: 22px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-container {
    animation: slideInUp 0.4s ease-out;
}

/* Stagger animation for grid items */
.product-card-container:nth-child(1) { animation-delay: 0.05s; }
.product-card-container:nth-child(2) { animation-delay: 0.1s; }
.product-card-container:nth-child(3) { animation-delay: 0.15s; }
.product-card-container:nth-child(4) { animation-delay: 0.2s; }
.product-card-container:nth-child(5) { animation-delay: 0.25s; }
.product-card-container:nth-child(6) { animation-delay: 0.3s; }

/* Loading State */
.product-card.loading {
    pointer-events: none;
}

.product-card.loading .product-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   COMPACT VARIANTS OVERRIDE
   ======================================== */

.compact-variants {
    max-height: none;
    overflow: visible;
    padding: 0;
}

/* Remove scrollbar styles for inline layout */
.compact-variants::-webkit-scrollbar {
    display: none;
}
