/* Modern E-Commerce Design - Inspired by Amazon & Noon */
:root {
    --primary-color: #016B61;
    --primary-hover: #015550;
    --secondary-color: #8C8C8C;
    --accent-color: #4A4A4A;
    --light-bg: #F5F5F5;
    --white: #FFFFFF;
    --border-color: #E5E5E5;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

/* Global Styles */
body {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-color);
    background-color: var(--light-bg);
}

[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #016B61 0%, #015550 100%);
    padding: 60px 0;
    margin-bottom: 0;
}

.hero-content {
    color: var(--white);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-hero-primary i {
    color: var(--primary-color);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
}

.btn-hero-secondary {
    background-color: transparent;
    color: var(--white);
    padding: 12px 30px;
    border: 2px solid var(--white);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-hero-secondary i {
    color: var(--white) !important;
}

.btn-hero-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.btn-hero-secondary:hover i {
    color: var(--primary-color) !important;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Features Bar */
.features-bar {
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.feature-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
}

@media (max-width: 991px) {
    .hero-banner {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-banner {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .feature-item i {
        font-size: 1.5rem;
    }
    
    .feature-item span {
        font-size: 0.75rem;
    }
}

/* Top Header Bar */
.top-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-header a {
    color: var(--white);
    text-decoration: none;
}

.top-header a:hover {
    text-decoration: underline;
}

/* Navbar Override for Bootstrap */
.main-navbar .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.navbar-content {
    flex: 1;
    min-width: 0;
}

/* Main Navbar */
.main-navbar {
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 10px 0;
}

.main-navbar .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-menu-btn {
    border: none !important;
    padding: 5px !important;
    background: transparent !important;
}

.navbar-menu-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-brand {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 45px;
    display: block;
}

.navbar-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 38px;
    }
    
    .main-navbar .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .navbar-left {
        gap: 8px;
    }
}

.search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-bar .input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-bar input {
    border: 2px solid var(--primary-color);
    border-right: none;
}

.search-bar .btn {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: var(--white);
}

.search-bar .btn:hover {
    background-color: var(--primary-hover);
}

/* Navbar Icons */
.navbar-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-icon {
    position: relative;
    color: var(--accent-color);
    font-size: 1.3rem;
    transition: color 0.3s;
}

.navbar-icon:hover {
    color: var(--primary-color);
}

.navbar-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    font-size: 0.7rem;
    padding: 2px 5px;
}

/* Categories Navbar */
.categories-navbar {
    background-color: var(--primary-color);
    padding: 0;
}

.categories-navbar .nav-link {
    color: var(--white);
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: background-color 0.3s;
}

.categories-navbar .nav-link:hover {
    background-color: var(--primary-hover);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
}

.mobile-bottom-nav .nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
}

.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--accent-color);
    font-size: 0.75rem;
    padding: 5px;
    transition: color 0.3s;
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.3rem;
    margin-bottom: 3px;
}

.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link.active {
    color: var(--primary-color);
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
}

[dir="rtl"] .mobile-sidebar {
    left: auto;
    right: -300px;
    transition: right 0.3s ease;
}

.mobile-sidebar.active {
    left: 0;
}

[dir="rtl"] .mobile-sidebar.active {
    right: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--accent-color);
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover {
    background-color: var(--light-bg);
}

.sidebar-menu i {
    margin-right: 10px;
    color: var(--primary-color);
    width: 20px;
}

[dir="rtl"] .sidebar-menu i {
    margin-right: 0;
    margin-left: 10px;
}

/* Sidebar Dropdown */
.sidebar-dropdown > a {
    position: relative;
}

.dropdown-arrow {
    position: absolute;
    right: 20px;
    transition: transform 0.3s;
    width: auto !important;
    margin: 0 !important;
}

[dir="rtl"] .dropdown-arrow {
    right: auto;
    left: 20px;
}

.sidebar-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f8f9fa;
}

.sidebar-submenu.active {
    max-height: 500px;
}

.sidebar-submenu li {
    border-bottom: none;
}

.sidebar-submenu a {
    padding: 12px 20px 12px 50px;
    font-size: 0.9rem;
}

[dir="rtl"] .sidebar-submenu a {
    padding: 12px 50px 12px 20px;
}

/* Sidebar Bottom Actions */
.sidebar-bottom-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background-color: var(--white);
    border-top: 2px solid var(--border-color);
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--white);
}

.sidebar-action-btn i {
    margin-right: 8px;
    color: inherit !important;
    width: auto !important;
}

[dir="rtl"] .sidebar-action-btn i {
    margin-right: 0;
    margin-left: 8px;
}

.login-btn {
    background-color: var(--primary-color);
}

.login-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.logout-btn {
    background-color: #dc3545;
}

.logout-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.language-btn {
    background-color: var(--secondary-color);
}

.language-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.mobile-sidebar {
    padding-bottom: 150px;
}

/* Category Circles */
.category-circles {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scrollbar-width: none;
}

.category-circles::-webkit-scrollbar {
    display: none;
}

.category-circle {
    flex-shrink: 0;
    text-align: center;
    text-decoration: none;
    color: var(--accent-color);
    transition: transform 0.3s;
}

.category-circle:hover {
    transform: translateY(-5px);
}

.category-circle-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: 8px;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-circle-img i {
    font-size: 2rem;
    color: var(--primary-color);
}

.category-circle-title {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 80px;
    word-wrap: break-word;
}

/* Product Cards */
.product-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.product-card-img {
    position: relative;
    height: 220px;
    overflow: hidden;
    background-color: var(--light-bg);
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card-img img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

.product-badge.bg-success {
    background-color: var(--success-color);
}

.product-badge.bg-danger {
    background-color: var(--danger-color);
}

[dir="rtl"] .product-badge {
    left: auto;
    right: 10px;
}

.product-card-body {
    padding: 10px;
}

.product-category {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 5px;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.product-description {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 6px;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.product-rating .stars {
    color: var(--warning-color);
}

.product-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-add-cart {
    flex: 1;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    font-weight: 500;
}

.btn-add-cart:hover {
    background-color: var(--primary-hover);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-details {
    flex: 1;
    background-color: var(--light-bg);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    font-weight: 500;
}

.btn-details:hover {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.btn-add-cart i {
    font-size: 1rem;
    flex-shrink: 0;
    color: var(--white);
}

.btn-details i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.btn-details:hover i {
    color: var(--white);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

.section-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background-color: rgba(1, 107, 97, 0.1);
    border: 2px solid transparent;
}

.section-link:hover {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 107, 97, 0.3);
}

.section-link i {
    font-size: 0.85rem;
    transition: transform 0.3s;
}

.section-link:hover i {
    transform: translateX(3px);
}

[dir="rtl"] .section-link:hover i {
    transform: translateX(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .section-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

@media (max-width: 576px) {
    .section-link {
        font-size: 0.8rem;
        padding: 5px 10px;
        gap: 4px;
    }
    
    .section-link i {
        font-size: 0.75rem;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .search-bar {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .categories-navbar {
        display: none;
    }
    
    .mobile-bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 768px) {
    .category-circle-img {
        width: 70px;
        height: 70px;
    }
    
    .category-circle-img i {
        font-size: 1.8rem;
    }
    
    .category-circle-title {
        font-size: 0.8rem;
        max-width: 70px;
    }
    
    .product-card-img {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .category-circle-img {
        width: 60px;
        height: 60px;
    }
    
    .category-circle-img i {
        font-size: 1.5rem;
    }
    
    .category-circle-title {
        font-size: 0.75rem;
        max-width: 60px;
    }
    
    .product-card-body {
        padding: 8px;
    }
    
    .product-category {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }
    
    .product-description {
        font-size: 0.75rem;
        height: 30px;
        margin-bottom: 5px;
    }
    
    .product-title {
        font-size: 0.85rem;
        height: 34px;
        margin-bottom: 4px;
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .product-actions {
        gap: 4px;
    }
    
    .btn-add-cart,
    .btn-details {
        font-size: 0.75rem;
        padding: 6px 6px;
        gap: 3px;
    }
    
    .btn-add-cart i {
        font-size: 0.9rem;
    }
    
    .btn-details i {
        font-size: 0.85rem;
    }
}


/* Additional Improvements */

/* Hero Section Improvements */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, var(--white) 100%);
    padding: 40px 0;
}

/* Services Section */
.services-section {
    background-color: var(--white);
}

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-3px);
}

.services-text {
    color: var(--accent-color);
    line-height: 1.8;
}

/* Quick Links Cards */
.quick-links-section .card {
    transition: all 0.3s ease;
}

.quick-links-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important;
}

/* Improved Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 107, 97, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Stock Badge */
.stock-status .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Dropdown Menu Improvements */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
}

.dropdown-item {
    padding: 10px 20px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

.dropdown-item i {
    color: var(--primary-color);
    width: 20px;
    margin-right: 8px;
}

[dir="rtl"] .dropdown-item i {
    margin-right: 0;
    margin-left: 8px;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Smooth Transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

a, button {
    transition: all 0.3s ease;
}

/* Focus States */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 991px) {
    .hero-section {
        padding: 30px 0;
    }
    
    .section-header {
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 20px 0;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .product-card-body {
        padding: 10px;
    }
    
    .product-title {
        font-size: 0.85rem;
        height: 34px;
        margin-bottom: 6px;
    }
    
    .product-description {
        font-size: 0.75rem;
        height: 30px;
        margin-bottom: 6px;
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .product-actions {
        gap: 4px;
    }
}

/* Print Styles */
@media print {
    .mobile-bottom-nav,
    .mobile-sidebar,
    .sidebar-overlay,
    .scroll-to-top {
        display: none !important;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .product-card,
    .category-circle {
        border: 2px solid var(--accent-color);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
