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

:root {
    /* Dark Mode Variables - Professional Electronics Theme */
    --bg-color: #790d8d; /* Deep dark blue */
    --text-color: #e2e8f0; /* Light slate */
    --card-bg: #3b0845; /* Dark blue-gray */
    --primary-color: #60a5fa; /* Lighter blue for dark mode */
    --secondary-color: #a78bfa; /* Lighter purple */
    --accent-color: #22d3ee; /* Bright cyan */
    --success-color: #34d399; /* Lighter green */
    --danger-color: #f87171; /* Lighter red */
    --nav-bg: rgba(26, 31, 53, 0.95);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbitron', 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    direction: rtl;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    box-shadow: var(--shadow);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo img {
    max-height: 45px;
    vertical-align: middle;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.5));
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease-out;
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

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

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-color);
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-color));
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(96, 165, 250, 0.5);
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 40px 0 20px;
    margin-top: 50px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(96, 165, 250, 0.15);
}

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

.footer-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

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

.footer-section ul li a:hover {
    padding-right: 8px;
    color: var(--accent-color);
}

.footer-section ul li i {
    color: var(--accent-color);
    margin-left: 8px;
}

.active-filter {
    color: var(--primary-color) !important;
    font-weight: 700;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-color);
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(96, 165, 250, 0.15);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* Hero Section */
.hero {
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
}

.hero-text {
    flex: 1;
    animation: slideInRight 1s ease-out;
}

.hero-text h1 {
    font-family: 'Poppins', 'Orbitron', 'Cairo', sans-serif;
    font-weight: 900;
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFD54F, #FFB300);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 12px rgba(255, 193, 7, 0.4);
    letter-spacing: 1.5px;
}

.hero-text p {
    font-size: 1.3rem;
    margin-bottom: 35px;
    opacity: 0.85;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    animation: slideInLeft 1s ease-out;
}

.hero-image img {
    max-width: 100%;
    filter: drop-shadow(0 0 25px rgba(96, 165, 250, 0.5));
    animation: float 3s ease-in-out infinite;
}

/* Features */
.features {
    padding: 60px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.feature-box {
    background: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.feature-box:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.4));
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 80px 0 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 15%;
    width: 70%;
    height: 5px;
    background: linear-gradient(to right, transparent, var(--primary-color), var(--accent-color), transparent);
    border-radius: 3px;
}

/* Product Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 30px 0;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(167, 139, 250, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-info {
    padding: 20px;
}

.product-brand {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 700;
}

.product-name {
    margin: 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.4));
}

.btn-add {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.btn-add:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.5);
}

/* Brands & Categories */
.category-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 50px 0;
}

.cat-card {
    position: relative;
    height: 250px;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.cat-card:hover img {
    transform: scale(1.2);
}

.cat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.95), transparent);
    padding: 20px;
    color: white;
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    border: 5px solid rgba(59, 130, 246, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scroll-to-Top Button */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 100;
    border: none;
    outline: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

#scrollTopBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* Brands Carousel */
.brands-carousel {
    padding: 20px 0;
}

.brands-carousel .swiper-slide {
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.brands-carousel .swiper-slide:hover {
    opacity: 1;
}

.brands-carousel img {
    max-height: 60px;
    width: auto;
    filter: grayscale(100%) brightness(1.5) invert(1);
    transition: filter 0.3s ease;
}

.brands-carousel .swiper-slide:hover img {
    filter: grayscale(0%) brightness(1.2);
}



/* Product Badges */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.badge-new {
    background-color: var(--success-color);
}

.badge-sale {
    background-color: var(--danger-color);
    left: auto;
    right: 10px;
}

.badge-outofstock {
    background-color: #6b7280;
}

/* Compare Button Styles */
.compare-btn {
    position: absolute;
    top: 15px;
    right: 55px;
    background: rgba(26, 31, 53, 0.9);
    color: #e2e8f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wishlist-btn-compare {
    right: 55px;
}

.compare-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.compare-btn .fa-regular {
    display: block;
}

.compare-btn .fa-solid {
    display: none;
    color: var(--primary-color);
}

.compare-btn.in-compare .fa-regular {
    display: none;
}

.compare-btn.in-compare .fa-solid {
    display: block;
    color: white;
}

/* Skeleton Loading Styles */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: #5c0a6b;
    }
    100% {
        background-color: #790d8d;
    }
}

.skeleton-text {
    width: 100%;
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-image {
    width: 100%;
    height: 150px;
    border-radius: 4px;
}

.skeleton-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.product-card-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.product-card-skeleton .skeleton-image {
    height: 220px;
    width: 100%;
    margin-bottom: 10px;
}

.product-card-skeleton .skeleton-line {
    height: 1em;
    width: 80%;
    margin: 0 10px 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
}

.product-card-skeleton .skeleton-price {
    height: 1.5em;
    width: 40%;
    margin: 0 10px 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
}

.product-card-skeleton .skeleton-btn {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    margin: 0 10px 10px;
}

.product-card-skeleton .product-info {
    padding: 0 20px 20px;
}


/* --- Responsive Adjustments --- */

/* Small devices (phones, 600px and down) */
@media (max-width: 600px) {
    .container {
        padding: 0 15px;
    }

    header .nav-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .logo {
        font-size: 1.5rem;
        flex-basis: 100%;
        text-align: center;
    }

    .search-box {
        order: 3;
        flex-basis: 100%;
    }

    .nav-icons {
        order: 2;
        justify-content: center;
        flex-basis: 100%;
    }

    .nav-links {
        display: none;
    }

    .icon-btn:nth-child(2) {
        display: none;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        height: auto;
        padding: 50px 15px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .hero-image {
        margin-top: 30px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 2rem;
        margin: 50px 0 30px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-shortcuts {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cat-overlay {
        font-size: 1.5rem;
    }

    .cart-layout, .profile-layout {
        flex-direction: column;
        gap: 20px;
    }

    .cart-items, .cart-summary, .user-info, .orders-history {
        min-width: unset;
        flex: auto;
    }

    .glass {
        grid-template-columns: 1fr !important;
    }

    .product-details .product-image {
        height: 300px;
    }
}

/* Medium devices (tablets, 601px to 992px) */
@media (min-width: 601px) and (max-width: 992px) {
    .container {
        padding: 0 20px;
    }

    header .nav-container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .logo {
        flex-basis: auto;
    }

    .search-box {
        order: 3;
        flex-basis: 100%;
        margin-top: 10px;
    }

    .nav-links {
        display: flex;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-text p {
        font-size: 1.1rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .cart-layout, .profile-layout {
        flex-direction: column;
    }

    .user-info, .orders-history {
        min-width: unset;
        flex: auto;
    }
}