/*
 * ====================================
 * 1. Global Resets and Variables 
 * ====================================
 */
:root {
    --primary-color: #007bff; /* Main brand color (Blue for tech) */
    --secondary-color: #6c757d; /* Grey for secondary elements */
    --text-dark: #212529;
    --text-light: #f8f9fa;
    --background-light: #ffffff;
    --background-grey: #f8f8f8; 
    --border-color: #dee2e6;
    --discount-color: #dc3545; /* Red for sale/discount badges */
    --success-color: #28a745; /* Green for 'Add to Cart' */
}

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

body {
    /* Use Arabic-friendly font stack */
    font-family: 'Droid Arabic Kufi', Tahoma, Arial, sans-serif; 
    color: var(--text-dark);
    background-color: var(--background-light);
    line-height: 1.6;
    text-align: right; /* Default text alignment for RTL */
}

/* Ensure links inherit brand color and have a smooth transition */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

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

h1, h2, h3 {
    font-weight: bold;
}

/* ====================================
   2. Buttons and Forms (Refining Bootstrap) 
   ==================================== */
.btn-add-cart {
    background-color: var(--success-color); 
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
    width: 100%;
    margin-top: 10px;
}

.btn-add-cart:hover {
    background-color: #1e7e34;
}

/* ====================================
   3. Header Navigation Overrides 
   ==================================== */

/* Customizing the logo/brand in the header */
.navbar-brand {
    font-size: 1.8em;
}

/* Refining the main navigation menu */
.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-start; /* Items flow from right to left in RTL */
}

.main-nav ul li a {
    font-weight: 600;
    display: block;
    padding: 5px 0;
    color: var(--text-dark);
}

.main-nav ul li a:hover {
    color: var(--primary-color);
}

/* ====================================
   4. Hero Banner (Homepage specific)
   ==================================== */
.hero-banner {
    background-color: var(--background-grey);
    padding: 60px 0;
    text-align: right;
}

.hero-banner h1 {
    font-size: 2.5em;
    color: var(--primary-color);
}

/* ====================================
   5. Product Grid & Cards (Used in index.php) 
   ==================================== */
.featured-products {
    padding: 40px 0;
}

/* Custom styling for product card images */
.product-card-img {
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
    padding: 15px;
}

.product-name a {
    /* Limit name height for grid consistency */
    display: block;
    height: 40px; 
    overflow: hidden;
    line-height: 1.2;
    font-weight: 600;
}

.price-section {
    margin: 10px 0;
}

.old-price {
    color: var(--secondary-color);
    text-decoration: line-through;
    font-size: 0.9em;
    margin-right: 10px; /* Space from the new price in RTL */
}

/* ====================================
   6. Shop Page Sidebar Layout (Refining Bootstrap)
   ==================================== */

/* Ensures sidebar is fixed width and pushes content */
.sidebar {
    /* Bootstrap handles the flex properties, this sets the max size */
    flex: 0 0 280px; 
}

/* Custom styling for filter list items */
.filter-group ul li a {
    color: var(--text-dark);
}
.filter-group ul li.active a,
.list-group-item.active a {
    color: white !important;
}


/* ====================================
   7. Value Propositions (Homepage specific)
   ==================================== */
.value-props {
    background-color: var(--background-grey);
    padding: 30px 0;
}

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

.prop-item h4 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 5px;
}


/* ====================================
   8. Footer Specific Styles
   ==================================== */

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

.footer-col h5 {
    font-size: 1.1em;
}

.social-icons a {
    color: white;
    font-size: 1.5em;
    margin-left: 10px; /* Space icons in RTL */
}

.newsletter-form input {
    text-align: right;
}

/* ====================================
   9. Cart Page Specific Styles
   ==================================== */
.cart-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
}