/* ========================================
   assets/css/style.css - النسخة الكاملة
   الموقع الرئيسي (باشا ستور)
   ======================================== */

/* ----- المتغيرات العامة ----- */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ----- إعدادات أساسية ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--dark-color);
    line-height: 1.6;
}
/* دعم اللغتين */
html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

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

/* ----- الهيدر والتنقل ----- */
header {
    background: var(--white-color);
    box-shadow: var(--shadow);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

header h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: var(--dark-color);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: 500;
}

nav a:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

/* ----- الرئيسية - شبكة المنتجات ----- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.product-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

/* في القسم الخاص بالمنتجات */
.product-card img {
    width: 100%;
    height: 200px;
    /* ارتفاع ثابت */
    object-fit: contain;
    /* تغيير من cover إلى contain */
    background: #f5f5f5;
    /* لون خلفية للصور الصغيرة */
    border-radius: 8px 8px 0 0;
}

.product-card h3 {
    padding: 15px 15px 5px;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.product-card .price {
    padding: 0 15px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.3rem;
    margin: 10px 0;
}

.product-card .btn {
    margin: 15px;
    display: block;
    text-align: center;
}

/* ----- صفحة تفاصيل المنتج ----- */
.product-page {
    background: var(--white-color);
    border-radius: 15px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: var(--shadow);
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

/* معرض الصور */
.gallery {
    width: 100%;
}

.main-image-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.main-image {
    width: 100%;
    max-width: 450px;
    height: 350px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.thumbnails img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnails img:hover {
    border-color: var(--primary-color);
    opacity: 0.9;
}

/* فيديو */
.video-container {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.video-container h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.video-container video {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

/* معلومات المنتج */
.product-info {
    padding: 20px 0;
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.price-large {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.description {
    line-height: 1.8;
    margin-bottom: 30px;
    color: #555;
}

/* ----- صفحة إتمام الطلب ----- */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.order-summary {
    background: var(--white-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.order-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.order-form {
    background: var(--white-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* ----- النماذج ----- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ----- الأزرار ----- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
    width: 100%;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background: var(--gray-color);
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* ----- بطاقات ----- */
.card {
    background: var(--white-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ----- التنبيهات ----- */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ----- الفوتر ----- */
footer {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: var(--white-color);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    opacity: 1;
    padding-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
}

/* ----- التجاوب مع الشاشات الصغيرة ----- */
@media (max-width: 992px) {
    .product-container,
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .main-image {
        height: 250px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .thumbnails img {
        height: 60px;
    }
    
    .product-info h1 {
        font-size: 1.5rem;
    }
    
    .price-large {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-large {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ----- أدوات مساعدة ----- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-2 {
    margin-top: 10px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-4 {
    margin-bottom: 20px;
}

.p-3 {
    padding: 15px;
}

.p-4 {
    padding: 20px;
}
/* =========================
   RTL / LTR SMART SYSTEM
========================= */

/* اتجاه الصفحة */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="ltr"] {
    direction: ltr;
}

/* النصوص */
body {
    text-align: start; /* بدل left/right */
}

/* الهيدر */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* يعكس تلقائي حسب اللغة */
html[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

html[dir="ltr"] .header-content {
    flex-direction: row;
}

/* القائمة */
nav {
    display: flex;
    gap: 20px;
}

/* الكاتيجوري */
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* عكس تلقائي */
html[dir="rtl"] .category-link {
    flex-direction: row-reverse;
}

html[dir="ltr"] .category-link {
    flex-direction: row;
}

/* المسافات الذكية بدل left/right */
.category-list {
    padding-inline-start: 0;
}

.subcategory-list {
    padding-inline-start: 20px;
}

/* الهامش الذكي */
.section-header h2 {
    padding-inline-start: 15px;
}

/* الخط الجانبي */
.section-header h2::before {
    inset-inline-start: 0;
}

/* footer hover fix */
html[dir="rtl"] .footer-section ul li a:hover {
    padding-inline-start: 5px;
}

html[dir="ltr"] .footer-section ul li a:hover {
    padding-inline-start: 5px;
}