@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables & Theme Setup */
:root {
    --primary-red: #d32f2f;
    --primary-red-hover: #b71c1c;
    --primary-red-glow: rgba(211, 47, 47, 0.4);
    --bg-dark: #0f0f12;
    --bg-card: #18181f;
    --bg-input: #21212a;
    --text-white: #f5f5f7;
    --text-gray: #a0a0ab;
    --border-color: #2e2e3a;
    --glass-bg: rgba(24, 24, 31, 0.75);
    --glass-border: rgba(255, 255, 255, 0.05);
    --success-green: #2e7d32;
    --success-bg: rgba(46, 125, 50, 0.1);
    --warning-orange: #ef6c00;
    --warning-bg: rgba(239, 108, 0, 0.1);
    --font-family: 'Cairo', sans-serif;
    --shadow-premium: 0 8px 30px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.light-mode {
    --bg-dark: #f4f4f7;
    --bg-card: #ffffff;
    --bg-input: #e8e8f0;
    --text-white: #121216;
    --text-gray: #646473;
    --border-color: #dadade;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.06);
    --shadow-premium: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) var(--bg-dark);
}

html, body {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    direction: rtl; /* Arabic default layout */
    text-align: right;
    line-height: 1.6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red-hover);
}

/* Helper Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Navigation Bar */
header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.nav-container {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-white);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-red), #ff5252);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px var(--primary-red-glow);
    font-weight: 800;
    font-size: 20px;
    color: var(--text-white);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-text span {
    font-size: 11px;
    color: var(--primary-red);
    font-weight: 600;
    letter-spacing: 1px;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav ul li a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-smooth);
    padding: 8px 12px;
    border-radius: 6px;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary-red);
    background-color: rgba(211, 47, 47, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon-badge {
    position: relative;
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    padding: 10px;
    border-radius: 50px;
    background-color: var(--bg-input);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-badge:hover {
    color: var(--primary-red);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.3);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    border: 2px solid var(--bg-dark);
}

.btn-admin {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-admin:hover {
    border-color: var(--primary-red);
    color: var(--text-white);
    background-color: rgba(211, 47, 47, 0.05);
}

.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding-top: 150px;
    padding-bottom: 80px;
    background: radial-gradient(circle at 10% 20%, rgba(211, 47, 47, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(211, 47, 47, 0.08) 0%, transparent 40%),
                var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h2 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-text h2 span {
    color: var(--primary-red);
    background: linear-gradient(to left, var(--primary-red), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-gray);
    font-size: 17px;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 35px;
}

.stat-item {
    border-right: 3px solid var(--primary-red);
    padding-right: 15px;
}

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.1;
}

.stat-lbl {
    font-size: 13px;
    color: var(--text-gray);
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), #e53935);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-red-glow);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--bg-input);
    border-color: var(--text-gray);
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.7));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

/* Brands Section */
.brands-section {
    padding: 40px 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-title-small {
    font-size: 14px;
    color: var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.brand-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: var(--text-white);
}

.brand-card img {
    height: 45px;
    width: auto;
    object-fit: contain;
    filter: grayscale(1) brightness(1.8);
    transition: var(--transition-smooth);
    margin-bottom: 10px;
}

.brand-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-gray);
    transition: var(--transition-smooth);
}

.brand-card:hover, .brand-card.active {
    border-color: var(--primary-red);
    background-color: rgba(211, 47, 47, 0.05);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.15);
    transform: translateY(-3px);
}

.brand-card:hover img, .brand-card.active img {
    filter: grayscale(0) brightness(1);
}

.brand-card:hover span, .brand-card.active span {
    color: var(--text-white);
}

/* Store Section: Search and Filter Control Center */
.store-section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-gray);
    font-size: 16px;
}

.filter-center {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-premium);
}

.filter-row-top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-search-box, .filter-vin-box {
    position: relative;
}

.filter-search-box input, .filter-vin-box input {
    width: 100%;
    height: 55px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 50px 0 20px;
    color: var(--text-white);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.filter-search-box input:focus, .filter-vin-box input:focus {
    border-color: var(--primary-red);
    outline: none;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.2);
}

.filter-search-box i, .filter-vin-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 18px;
    pointer-events: none;
}

.filter-vin-box input {
    border-color: rgba(211, 47, 47, 0.4);
    font-family: monospace;
    letter-spacing: 1px;
}

.filter-vin-box input::placeholder {
    font-family: var(--font-family);
    letter-spacing: 0;
}

.vin-badge-helper {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.vin-badge-helper:hover {
    background-color: var(--primary-red-hover);
}

/* Demo VINs block */
.demo-vins {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.demo-vins span.demo-title {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 600;
}

.demo-vin-btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-gray);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.demo-vin-btn:hover {
    border-color: var(--primary-red);
    color: var(--text-white);
}

.filter-row-bottom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.filter-select {
    position: relative;
}

.filter-select select {
    width: 100%;
    height: 48px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 15px 0 30px;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-select select:focus {
    border-color: var(--primary-red);
    outline: none;
}

.filter-select::after {
    content: '\f107'; /* fontawesome angle down */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
}

.btn-reset-filters {
    height: 48px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset-filters:hover {
    border-color: var(--primary-red);
    color: var(--text-white);
    background-color: rgba(211, 47, 47, 0.05);
}

/* Active Filtering Alert */
.active-filter-alert {
    background-color: rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.3);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.4s ease-in;
}

.active-filter-text {
    font-size: 14px;
    color: #81c784;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-clear-active-filter {
    background: none;
    border: none;
    color: #ef5350;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

/* Products Section */
.products-grid-container {
    min-height: 400px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-gray);
    text-align: center;
}

.no-results i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 15px;
}

.no-results h4 {
    font-size: 20px;
    color: var(--text-white);
    margin-bottom: 8px;
}

/* Product Card Design */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(211, 47, 47, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.badge-warranty {
    background-color: var(--success-green);
    color: white;
}

.badge-no-warranty {
    background-color: var(--warning-orange);
    color: white;
}

.badge-condition {
    background-color: var(--bg-input);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.product-brand-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
}

.product-img-wrapper {
    width: 100%;
    height: 200px;
    background-color: var(--bg-input);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.product-card:hover .product-img {
    transform: scale(1.06);
}

.product-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-cat {
    font-size: 12px;
    color: var(--primary-red);
    font-weight: 700;
    margin-bottom: 6px;
}

.product-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 10px;
    line-height: 1.3;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-compat {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-compat i {
    font-size: 13px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.product-price {
    display: flex;
    flex-direction: column;
}

.price-iqd {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
}

.price-usd {
    font-size: 12px;
    color: var(--text-gray);
}

.btn-add-cart-small {
    background-color: var(--primary-red);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-add-cart-small:hover {
    background-color: var(--primary-red-hover);
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
    transform: scale(1.05);
}

.btn-out-of-stock {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: none;
}

/* Modals General Style */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-premium);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px; /* Left-side close for RTL */
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    border-radius: 50px;
    background-color: var(--bg-input);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary-red);
    background-color: rgba(211, 47, 47, 0.1);
}

/* Product Detail Modal Specific */
.detail-modal-body {
    padding: 30px;
}

.detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.detail-img-container {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.detail-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-brand-cat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.detail-brand {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--primary-red);
    font-weight: 700;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 6px;
}

.detail-cat {
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 600;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 15px;
    line-height: 1.3;
}

.detail-pricing {
    margin-top: auto;
    background-color: var(--bg-input);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.detail-pricing .iqd {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-white);
}

.detail-pricing .usd {
    font-size: 14px;
    color: var(--text-gray);
}

.detail-specs-box {
    margin-bottom: 25px;
}

.spec-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    color: var(--text-white);
}

.spec-list {
    list-style: none;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
}

.spec-list li:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-gray);
}

.spec-value {
    font-weight: 600;
    color: var(--text-white);
}

.policy-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.policy-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

.policy-title.secured {
    color: #81c784;
}

.policy-title.unsecured {
    color: #ffb74d;
}

.policy-desc {
    font-size: 13px;
    color: var(--text-gray);
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.detail-actions .btn-primary {
    flex-grow: 1;
    justify-content: center;
    height: 50px;
}

/* Cart Drawer (Sidebar) */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-drawer-overlay.active {
    display: block;
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px; /* Slide out right */
    width: 100%;
    max-width: 420px;
    height: 100%;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 1600;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer-overlay.active + .cart-drawer, .cart-drawer.active {
    right: 0;
}

.cart-drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer-header h3 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-drawer-header h3 i {
    color: var(--primary-red);
}

.btn-close-cart {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50px;
    background-color: var(--bg-input);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.btn-close-cart:hover {
    color: var(--primary-red);
    background-color: rgba(211, 47, 47, 0.1);
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.cart-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-desc {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 6px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-red);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-qty-buttons {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-input);
}

.btn-qty {
    background: none;
    border: none;
    color: var(--text-white);
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 700;
}

.btn-qty:hover {
    background-color: var(--border-color);
    color: var(--primary-red);
}

.qty-val {
    width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition-smooth);
}

.btn-remove-item:hover {
    color: var(--primary-red);
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-gray);
    text-align: center;
    padding: 40px;
}

.cart-empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--border-color);
}

.cart-empty-state p {
    font-size: 15px;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-input);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-gray);
}

.cart-summary-row.total {
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
}

.cart-summary-row.total .total-price-iqd {
    color: var(--primary-red);
}

.cart-footer .btn-primary {
    width: 100%;
    justify-content: center;
    height: 50px;
}

/* Checkout Modal Styling */
.checkout-modal-body {
    padding: 30px;
}

.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    position: relative;
}

.checkout-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-node {
    width: 32px;
    height: 32px;
    border-radius: 50px;
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-gray);
    transition: var(--transition-smooth);
}

.step-node.active {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    box-shadow: 0 0 10px var(--primary-red-glow);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    padding: 12px 15px;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary-red);
    outline: none;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    accent-color: var(--primary-red);
}

@media (max-width: 576px) {
    .cart-btn-text {
        display: none;
    }
    .logo-text span {
        display: none;
    }
}

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

.checkout-totals-summary {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.checkout-totals-summary h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* About Us & Info Page */
.about-section {
    padding: 80px 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.feat-item {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition-smooth);
}

.feat-item:hover {
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.feat-item i {
    font-size: 24px;
    color: var(--primary-red);
    margin-bottom: 12px;
}

.feat-item h5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feat-item p {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
}

.location-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.map-placeholder {
    width: 100%;
    height: 200px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.map-placeholder iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: invert(90%) hue-rotate(180deg); /* Dark maps styling */
}

/* Admin Dashboard Section */
.admin-section {
    padding-top: 120px;
    padding-bottom: 80px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.admin-tabs {
    display: flex;
    gap: 15px;
    list-style: none;
}

.admin-tab-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.admin-tab-btn.active, .admin-tab-btn:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.admin-view {
    display: none;
}

.admin-view.active {
    display: block;
}

/* Admin Login Section */
.admin-login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    margin: 80px auto;
    box-shadow: var(--shadow-premium);
}

.admin-login-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.admin-login-card p {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 25px;
    text-align: center;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 25px;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 14px;
}

.table-custom th {
    background-color: var(--bg-input);
    color: var(--text-white);
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-gray);
    vertical-align: middle;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tr:hover td {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.01);
}

.btn-action-table {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.btn-action-table.edit:hover {
    color: #4fc3f7;
    background-color: rgba(79, 195, 247, 0.1);
}

.btn-action-table.delete:hover {
    color: #ef5350;
    background-color: rgba(239, 83, 80, 0.1);
}

/* Form layouts in Admin Panel */
.admin-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.admin-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-header h4 {
    font-size: 18px;
    font-weight: 700;
}

/* Footer Section */
footer {
    background-color: #0b0b0d;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-white);
}

.footer-col p {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
}

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

.footer-links li a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.footer-links li a:hover {
    color: var(--primary-red);
    padding-right: 5px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.social-btn:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    box-shadow: 0 4px 10px var(--primary-red-glow);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-gray);
}

/* Animations helper */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .hero-text p {
        margin: 0 auto 30px auto;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    header {
        height: 70px;
    }
    
    .nav-container {
        height: 70px;
    }
    
    nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 70%;
        height: calc(100vh - 70px);
        background-color: var(--bg-card);
        border-left: 1px solid var(--border-color);
        transition: var(--transition-smooth);
        padding: 40px 20px;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        gap: 20px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .filter-row-top {
        grid-template-columns: 1fr;
    }
    
    .filter-row-bottom {
        grid-template-columns: 1fr 1fr;
    }
    
    .detail-header {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    /* تحسين شبكة المنتجات لتكون من عمودين لتسهيل التصفح السريع */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .product-card {
        border-radius: 10px !important;
    }
    
    .product-details {
        padding: 12px !important;
    }
    
    .product-name {
        font-size: 14px !important;
        height: 38px !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
    }
    
    .product-compat {
        font-size: 10px !important;
        margin-bottom: 10px !important;
        gap: 4px !important;
    }
    
    .price-iqd {
        font-size: 14px !important;
        font-weight: 800 !important;
    }
    
    .price-usd {
        font-size: 10px !important;
    }
    
    .btn-add-cart-small {
        width: 34px !important;
        height: 34px !important;
        border-radius: 6px !important;
    }
    
    .btn-out-of-stock {
        font-size: 10px !important;
        padding: 6px 8px !important;
        border-radius: 6px !important;
    }
    
    .product-badges {
        top: 8px !important;
        right: 8px !important;
        gap: 4px !important;
    }
    
    .badge-item {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    /* تحسين أبعاد وتصميم النوافذ المنبثقة على الهواتف */
    .modal-content {
        border-radius: 12px !important;
        max-height: 95vh !important;
    }
    
    .detail-modal-body, .checkout-modal-body {
        padding: 15px !important;
    }
    
    .detail-header {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .detail-img-container {
        height: 180px !important;
    }

    /* تحسين لوحة تصفية المتجر */
    .filter-row-top {
        gap: 12px !important;
    }
    
    .filter-box input, .filter-box select {
        height: 42px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row-bottom {
        grid-template-columns: 1fr;
    }
    
    .about-features {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
