/* ===== متغيرات CSS ===== */
:root {
    --primary-color: #ff7900;
    --secondary-color: #3498db;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --grey-color: #888;
    --body-font: 'Cairo', sans-serif;
}

/* ===== إعدادات عامة ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    background-color: #f8f9fa;
    color: var(--dark-color);
    direction: rtl;
}

a {
    text-decoration: none;
    color: var(--dark-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== الهيدر ===== */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.search-container {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.search-form {
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border-radius: 5px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background-color: #f1f1f1;
    font-family: var(--body-font);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    display: block;
}

.logo img {
    height: 35px;
    max-width: 100%;
}

.cart-container {
    display: flex;
    align-items: center;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.cart-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.cart-icon i {
    font-size: 20px;
    color: #333;
}

.cart-total {
    font-size: 14px;
    color: var(--dark-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
}

/* ===== القائمة الجانبية ===== */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease;
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.close-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.side-menu-content {
    padding: 20px 0;
}

.side-menu-links li {
    margin-bottom: 10px;
}

.side-menu-links a {
    display: block;
    padding: 10px 20px;
    transition: background-color 0.3s;
}

.side-menu-links a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* ===== سلايدر الرئيسية ===== */
.main-slider {
    margin-top: 23px;
    margin-bottom: 30px;
}

.slider-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== التصنيفات ===== */
.section-title {
    margin-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
    position: relative;
    padding-right: 15px;
}

.section-title h2::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 5px;
    height: 20px;
    background-color: var(--primary-color);
    transform: translateY(-50%);
}

.section-title a {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.categories-slider {
    margin-bottom: 30px;
}

.category-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    margin: 10px;
    width: 120px;
    height: 140px;
    display: block;
    text-decoration: none;
    color: var(--dark-color);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-icon {
    margin-bottom: 10px;
}

.category-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.category-name {
    font-size: 0.8rem;
    color: var(--dark-color);
    font-weight: bold;
}

/* ===== الإعلانات ===== */
.ads-slider {
    margin-top: 40px; /* المسافة العلوية من قسم العروض */
    margin-bottom: 40px; /* المسافة السفلية من قسم سامسونج */
    position: relative;
}

.ads-slider .owl-dots {
    text-align: center;
    margin-top: 15px;
}

.ads-slider .owl-dots .owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.ads-slider .owl-dots .owl-dot span {
    display: block;
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ads-slider .owl-dots .owl-dot.active span {
    background-color: #ff7900; /* لون برتقالي للمؤشر النشط */
    width: 30px; /* لجعل المؤشر النشط أطول للتمييز */
    border-radius: 5px; /* لجعله مستطيل بزوايا منحنية */
}

/* ===== البانر الدعائي ===== */
.promo-banner {
    margin-top: 40px; /* المسافة من أعلى البانر */
    margin-bottom: 40px; /* المسافة بين البانر وقسم آراء العملاء */
}

.banner-wrapper {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.banner-wrapper:last-child {
    margin-bottom: 0;
}

.banner-wrapper img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

/* ===== المنتجات ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 320px; /* Altura fija para todas las tarjetas */
    width: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
    height: 160px !important; /* ارتفاع ثابت لجميع صور المنتجات */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-height: 160px !important;
}

.product-image-link {
    display: block;
    height: 100%;
    width: 100%;
    text-decoration: none;
}

.product-image .wishlist {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-image .discount {
    position: absolute;
    top: 10px;
    right: 0;
    background: #dc0000;
    color: white;
    padding: 2px 6px;
    border-radius: 4px 0 0 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 1;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info {
    padding: 10px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name, .offers-page .product-name, .category-page .product-name {
    font-size: 0.8rem;
    margin-bottom: 5px;
    height: 52px; /* ارتفاع ثابت لاسم المنتج، تقريبًا 3 أسطر */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    font-weight: bold;
    color: #333;
}

.product-name a, .offers-page .product-name a, .category-page .product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover, .offers-page .product-name a:hover, .category-page .product-name a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 10px;
    direction: ltr;
    margin-top: 5px;
    height: 24px; /* Altura fija para la sección de precios */
}

.current-price {
    font-weight: bold;
    color: #000000;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.old-price {
    text-decoration: line-through;
    color: var(--grey-color);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.price-spacer {
    flex: 1;
}

.empty-price {
    visibility: hidden;
    height: 1px;
    width: 50px;
    display: inline-block;
}

.product-actions {
    display: flex;
    gap: 5px;
    margin-top: auto; /* Empuja el botón hacia abajo */
}

.product-actions .btn-add-cart {
    background-color: white !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
}

.btn-add-cart, .btn-add-wishlist {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--body-font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
}

.btn-add-cart {
    background-color: white !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
    transition: all 0.3s ease;
}

.btn-add-wishlist {
    background-color: #f1f1f1;
    color: var(--dark-color);
}

/* ===== سلايدر الإعلانات ===== */
.ads-slider {
    margin-bottom: 30px;
}

.ads-slide {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.ads-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ===== أراء العملاء ===== */
.testimonials {
    margin-bottom: 40px;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.testimonial-item {
    text-align: center;
    margin: 0 15px;
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid var(--primary-color);
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-quote {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    padding: 0 30px;
}

.testimonial-quote::before, .testimonial-quote::after {
    content: '"';
    font-size: 50px;
    color: #eee;
    position: absolute;
    top: -10px;
}

.testimonial-quote::before {
    left: 0;
}

.testimonial-quote::after {
    right: 0;
    transform: rotate(180deg);
}

/* ===== آراء العملاء ===== */
.testimonials {
    margin-top: 40px;
    margin-bottom: 40px;
}

.testimonials .section-title {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.testimonials .section-title h2 {
    color: var(--dark-color);
    position: relative;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0;
    padding-right: 15px;
}

.testimonials .section-title h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    background-color: var(--primary-color);
}

.testimonial-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin: 10px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    border: 3px solid #f8f9fa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-quote {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--dark-color);
    position: relative;
    padding: 0 20px;
}

.testimonial-quote::before {
    content: '\201C';
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 0;
}

.testimonial-quote::after {
    content: '\201D';
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    bottom: -30px;
    right: 0;
}

.testimonial-author {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.testimonial-rating {
    color: #ffc107;
    margin-top: 10px;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* ===== الفوتر ===== */
.site-footer {
    background-color: #ffffff;
    color: #333;
    padding: 40px 0 20px;
    text-align: right;
    direction: rtl;
}

.footer-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section {
    margin-bottom: 10px;
}

.footer-logo {
    display: block;
    width: 160px;
    max-width: 160px;
    height: auto;
    margin-bottom: 15px;
}

.footer-title {
    color: #ff7900;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    padding-right: 12px;
}

.footer-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: #ff7900;
}

.footer-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff7900;
}

.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    margin-bottom: 10px;
}

.contact-info a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: #ff7900;
}

.contact-info i {
    color: #ff7900;
    width: 20px;
    text-align: center;
}

.social-media-row {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.social-icon:hover {
    background-color: #ff7900;
    color: #fff;
}

.copyright {
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.payment-methods {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.payment-icon {
    height: 25px;
    filter: grayscale(0.2);
}

.site-certificate {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.certificate-logo {
    max-height: 60px;
}

/* ===== تحسينات للشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .product-image {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .header-main {
        padding: 10px 0;
    }
    
    .logo img {
        max-height: 40px;
    }
    
    .section-title h2 {
        font-size: 1.2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
