:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-text .highlight {
    color: var(--primary-color);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-bar form {
    display: flex;
    background: #F3F4F6;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border var(--transition-fast);
}

.search-bar form:focus-within {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
}

.search-bar button {
    padding: 0 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.search-bar button:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    position: relative;
    font-weight: 500;
}

.action-btn i {
    font-size: 20px;
    margin-bottom: 4px;
}

.action-btn:hover {
    color: var(--primary-color);
}

.cart-btn .badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background: #EF4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Categories Nav */
.categories-nav {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.cat-list {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    overflow-x: auto;
    white-space: nowrap;
}

.cat-list::-webkit-scrollbar {
    display: none;
}

.cat-list a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.cat-list a:hover {
    color: var(--text-main);
    border-bottom-color: var(--text-main);
}

.cat-list a.highlight-link {
    color: var(--primary-color);
    font-weight: 600;
}

/* Main Content */
.main-content {
    min-height: 70vh;
    padding: 40px 0;
}

/* Footer */
.app-footer {
    background: #1F2937;
    color: #F9FAFB;
    padding: 60px 0 20px;
}

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

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col ul li {
    margin-bottom: 12px;
    color: #D1D5DB;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
    color: #9CA3AF;
    font-size: 14px;
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: inherit;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    .search-bar {
        order: 3;
        margin: 15px 0 0;
        max-width: 100%;
    }

    /* Banner/Hero */
    .hero-container {
        padding: 30px 20px !important;
    }
    .hero-content h1 {
        font-size: 32px !important;
    }
    .hero-content p {
        font-size: 16px !important;
    }

    /* Cabinet Layout */
    .cabinet-layout {
        flex-direction: column !important;
    }
    .cabinet-sidebar {
        width: 100% !important;
    }

    /* Category Layout */
    .category-layout {
        flex-direction: column !important;
    }
    .category-sidebar {
        width: 100% !important;
        position: static !important;
        margin-bottom: 20px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px !important;
    }
}

/* --- Modern UI Components --- */

/* FAB Cart */
.fab-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
}
.fab-cart:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
    color: white;
}
.fab-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #EF4444;
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 2px solid white;
    transform: translate(20%, -20%);
}

/* Modern Sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modern-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2001;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.modern-sidebar.active {
    left: 0;
}
.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.close-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
}
.sidebar-menu li a:hover {
    background: #F3F4F6;
    color: var(--primary-color);
}
.sidebar-menu li a i {
    width: 24px;
    margin-right: 15px;
    color: var(--text-muted);
    font-size: 18px;
    text-align: center;
}
.sidebar-menu li.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}
.sidebar-menu li.menu-title {
    padding: 10px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    padding-top: 100px;
}
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}
.search-overlay-content {
    width: 100%;
    max-width: 800px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.search-overlay.active .search-overlay-content {
    transform: translateY(0);
}
.modern-search-form {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}
.search-icon-input {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 15px;
}
.modern-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 24px;
    outline: none;
    color: var(--text-main);
}
.close-search {
    position: absolute;
    top: -60px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.close-search:hover {
    color: #EF4444;
}

/* Mobile FAB adjustment */
@media (max-width: 768px) {
    .fab-cart {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}
