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

:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f9;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e5e5e5;
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --radius-main: 16px;
    --radius-icon: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #121212;
        --bg-secondary: #1e1e1e;
        --bg-tertiary: #2d2d2d;
        --bg-card: #252525;
        --bg-card-hover: #2d2d2d;
        --text-primary: #f5f5f5;
        --text-secondary: #a0a0a0;
        --text-muted: #707070;
        --border-color: #333;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
}

[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f9;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e5e5e5;
    --shadow-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --bg-card: #252525;
    --bg-card-hover: #2d2d2d;
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

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

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ff4444, var(--accent-color), #ff6b6b);
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px rgba(220, 38, 38, 0.5);
}

.main-header {
    background-color: var(--bg-secondary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo .light-logo { display: block; }
.logo .dark-logo { display: none; }

@media (prefers-color-scheme: dark) {
    .logo .light-logo { display: none; }
    .logo .dark-logo { display: block; }
}

[data-theme="light"] .logo .light-logo { display: block; }
[data-theme="light"] .logo .dark-logo { display: none; }
[data-theme="dark"] .logo .light-logo { display: none; }
[data-theme="dark"] .logo .dark-logo { display: block; }

.header-categories {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-category-item {
    position: relative;
}

.header-category-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 8px;
}

.header-category-link:hover,
.header-category-item:hover .header-category-link {
    color: var(--text-primary);
    background: var(--bg-card);
}

.header-category-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-hover);
    flex-shrink: 0;
}

.header-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcategories-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    z-index: 1000;
}

.header-category-item:hover .subcategories-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.subcategory-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s;
}

.subcategory-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.subcategory-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    flex-shrink: 0;
}

.subcategory-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.view-all-link:hover {
    background: var(--bg-card-hover);
}

.search-bar {
    flex-grow: 1;
    margin: 0 30px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 45px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-card-hover);
}

.search-bar .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    opacity: 0.8;
    transition: all 0.3s;
}

.search-bar:focus-within .search-icon {
    color: var(--accent-color);
    opacity: 1;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 14px;
    color: var(--text-secondary);
}

.tool-item {
    cursor: pointer;
    transition: color 0.3s;
    white-space: nowrap;
}

.tool-item:hover {
    color: var(--accent-color);
}

.tool-item.login {
    background: var(--accent-color);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
}

.tool-item.login:hover {
    background: var(--accent-hover);
    color: #fff;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-color);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .theme-toggle .icon-sun { display: block; }
}
@media (prefers-color-scheme: light) {
    .theme-toggle .icon-moon { display: block; }
}

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.hero-banner {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

.slider-container {
    position: relative;
    width: 100%;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
}

.slide .desktop-img {
    display: block;
}

.slide .mobile-img {
    display: none;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background-color: var(--accent-color);
    width: 30px;
    border-radius: 10px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    z-index: 10;
    transition: all 0.3s;
}

.slider-arrow:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev {
    right: 20px;
}

.slider-arrow.next {
    left: 20px;
}

.categories-section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.category-card,
.store-card {
    background: var(--bg-card);
    padding: 20px 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    overflow: hidden;
    min-width: 0;
}

.store-card {
    padding: 24px;
    align-items: stretch;
    text-align: right;
    overflow: hidden;
    min-width: 0;
}

.category-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-icon .placeholder {
    font-size: 28px;
    color: var(--text-muted);
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

.store-section {
    padding: 40px 20px;
    background-color: var(--bg-secondary);
}

.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.view-more {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.view-more:hover {
    color: var(--text-primary);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    overflow: hidden;
}

.store-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    overflow: hidden;
    min-width: 0;
}

.store-item:hover {
    transform: translateY(-3px);
}

.item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.item-icon {
    width: 54px;
    height: 54px;
    background-color: var(--bg-card-hover);
    border-radius: var(--radius-icon);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
    flex-shrink: 0;
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .main-header .container {
        padding: 0 10px;
    }

    .header-right {
        gap: 15px;
    }

    .header-categories {
        display: none;
    }

    .search-bar {
        display: none;
    }

    .header-tools {
        gap: 15px;
    }

    .header-tools .tool-item:not(.login) {
        display: none;
    }

    .logo img {
        height: 32px;
    }

    .slide .desktop-img {
        display: none;
    }

    .slide .mobile-img {
        display: block;
    }

    .slider-arrow {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .slider-arrow.prev {
        right: 10px;
    }

    .slider-arrow.next {
        left: 10px;
    }

    .slider-dots {
        bottom: 15px;
    }

    .slider-dot {
        width: 8px;
        height: 8px;
    }

    .slider-dot.active {
        width: 20px;
    }

    .categories-section {
        padding: 25px 0;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 12px 8px;
        border-radius: 10px;
    }

    .category-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .category-name {
        font-size: 11px;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .category-card {
        padding: 10px 5px;
    }

    .category-icon {
        width: 40px;
        height: 40px;
    }

    .category-name {
        font-size: 10px;
    }

    .store-section {
        padding: 25px 10px;
    }

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

    .store-card {
        padding: 15px;
    }

    .card-title {
        font-size: 1rem;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .store-item {
        padding: 10px;
    }

    .item-icon {
        width: 50px;
        height: 50px;
    }

    .item-name {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-grid {
        gap: 15px;
    }

    .store-card {
        padding: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .view-more {
        font-size: 12px;
    }
}



