/* Next-Gen Auto Parts Platform - Compiled Styles */

/* CSS Variables for Dark Mode */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --bg-primary: #1a1f36;
    --bg-secondary: #0f1419;
    --text-primary: #f8f9fa;
    --text-secondary: #dee2e6;
    --text-muted: #adb5bd;
    --border-color: #495057;
    --card-bg: #0f1419;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Global Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top Bar */
.top-bar {
    background-color: #0f1419;
    color: #f8f9fa;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-link {
    color: #dee2e6;
    text-decoration: none;
    transition: color 0.15s;
}

.top-bar-link:hover {
    color: #ff3b30;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

.dark-mode-toggle .light-icon {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle .dark-icon {
    display: none;
}

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

/* Main Header */
.main-header {
    background-color: var(--bg-primary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    color: #ff3b30;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.text-accent {
    color: #ff3b30;
}

.logo-sub {
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Header Search */
.header-search {
    flex-grow: 1;
    max-width: 600px;
}

.ymm-search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.search-input-group:focus-within {
    border-color: #ff3b30;
}

.ymm-dropdown {
    position: relative;
    flex-shrink: 0;
}

.ymm-select {
    appearance: none;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    padding: 0.75rem 2rem 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.ymm-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

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

.voice-search-btn,
.search-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.voice-search-btn:hover {
    color: #ff3b30;
}

.search-btn {
    background: #ff3b30;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    background: #e03228;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}

.header-link:hover {
    color: #ff3b30;
}

.header-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.15s;
}

.header-icon-btn:hover {
    color: #ff3b30;
}

.header-icon-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff3b30;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-total {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Navigation */
.main-nav {
    background: linear-gradient(135deg, #ff3b30 0%, #ff9500 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: white;
    text-decoration: none;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.15s;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

.badge-hot {
    background: #ffd60a;
    color: #000;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    margin-right: 0.25rem;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: var(--bg-primary);
    transform: translateX(-100%);
    transition: transform 0.3s;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 100px;
    right: 2rem;
    background: #ff3b30;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    z-index: 1000;
    transition: all 0.3s;
}

@media (max-width: 991px) {
    .scroll-to-top {
        bottom: 150px;
        right: 1.5rem;
    }
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(255, 59, 48, 0.5);
}

.scroll-to-top.visible {
    display: flex;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ff3b30;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 991px) {

    .header-search,
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* Utility Classes */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

@media (min-width: 768px) {
    .d-md-inline {
        display: inline !important;
    }

    .d-md-block {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }
}

@media (min-width: 1200px) {
    .d-xl-flex {
        display: flex !important;
    }

    .d-xl-inline {
        display: inline !important;
    }

    .d-xl-block {
        display: block !important;
    }
}