/* General Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
}

.main-header, .main-footer {
    background: #fff;
    box-shadow: 0 2px 8px rgba(44,62,80,0.05);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* تحسين المسافات بين الأزرار */
.info-section .whatsapp-btn {
    margin-top: 1.2rem;
}



.nav-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.2rem;
    height: 64px;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2c3e50;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
}
.logo-text {
    font-size: 2rem;
    color: #2c3e50;
    font-weight: bold;
    letter-spacing: 1px;
    margin-right: 12px;
    text-decoration: none !important;
}
.contact-icon {
    color: #2c3e50;
    font-size: 1.5rem;
    background: transparent;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    border: 2px solid #2c3e50;
    padding: 2px;
    margin-left: 12px;
}
.contact-icon:hover {
    background: #2c3e50;
    color: #fff;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.9), rgba(44, 62, 80, 0.9));
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Products Section */
.products-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #2c3e50;
    border-radius: 25px;
    background: transparent;
    color: #2c3e50;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: #2c3e50;
    color: #fff;
}

.filter-btn.active {
    background: #2c3e50;
    color: #fff;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    padding-top: 18px;
    padding-bottom: 18px;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #f5f5f5;
    display: block;
    margin: 0 auto;
    border: 2px solid rgba(44, 62, 80, 0.1);
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
    border-color: rgba(44, 62, 80, 0.2);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.1);
}

.product-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.product-info {
    padding: 1.2rem 1.5rem 1.5rem 1.5rem;
    background: #fff;
    text-align: right;
}

/* صف الاسم والسعر */
.name-price-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    gap: 1rem;
}
.product-name {
    flex: 1;
    text-align: right;
    margin-bottom: 0;
}
.product-price {
    flex-shrink: 0;
    text-align: left;
    margin-bottom: 0;
}

.product-brand {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 0.3rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    text-align: right;
}

.product-description {
    display: none !important;
}

.product-card a, .product-card a:visited, .product-card a:active {
    text-decoration: none !important;
    border: none !important;
    color: inherit;
}

/* إزالة الخطوط تحت الروابط داخل البطاقات */
.product-card * {
    text-decoration: none !important;
    border: none !important;
}

.no-products {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
    grid-column: 1 / -1;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    grid-column: 1 / -1;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #34495e;
}

/* Footer */
.main-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
}

.social-links a.twitter-link:hover {
    background-color: #1da1f2;
    color: #fff;
}
.social-links a.tiktok-link:hover {
    background: #000;
    color: #fff;
}
.social-links a.instagram-link:hover {
    background: linear-gradient(45deg, #fd1d1d, #fcb045, #833ab4, #405de6);
    color: #fff;
}
.social-links a.telegram-link:hover {
    background: #229ed9;
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem 0;
    }

    .product-image-container {
        height: 200px;
    }

    .filters {
        /* flex-wrap: wrap; Removed to ensure nowrap is dominant */
    }

    .filter-btn {
        padding: 0.4rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }

    .product-image-container {
        height: 180px;
    }
}

@media (max-width: 600px) {
    .main-header {
        height: 52px;
        min-height: 52px;
    }
    .nav-flex {
        padding: 0 0.3rem;
        height: 52px;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .logo-area {
        gap: 0.2rem;
    }
    .contact-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        margin-left: 7px;
        padding: 1px;
    }
}

/* صورة شعار الريال بجانب السعر */
.sar-currency-img {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 2px;
    margin-left: 0;
    display: inline-block;
}

/* زر واتساب كحلي بحدود فقط، ويتحول للأخضر عند التحويم */
.whatsapp-btn {
    display: block;
    margin: 1.2rem auto 0 auto;
    padding: 0.5rem 1.2rem;
    background: transparent;
    color: #2c3e50 !important;
    font-weight: 700;
    border-radius: 25px;
    font-size: 1rem;
    text-align: center;
    text-decoration: none !important;
    border: 2px solid #2c3e50 !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.05);
    width: fit-content;
    position: relative;
    z-index: 1;
}
.whatsapp-btn i {
    margin-left: 0.5rem;
    font-size: 1.2em;
    vertical-align: middle;
    color: #2c3e50 !important;
    transition: color 0.2s ease;
}
.whatsapp-btn:hover, .whatsapp-btn:focus {
    background: #25d366;
    color: #fff !important;
    border-color: #25d366 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}
.whatsapp-btn:hover i {
    color: #fff !important;
}

.product-card .whatsapp-btn {
    border: 2px solid #2c3e50 !important;
}