/* ===========================
   Global Styles & Variables
   =========================== */
:root {
    --primary-color: #dc2626;
    --secondary-color: #991b1b;
    --accent-color: #ef4444;
    --success-color: #10b981;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --gray-color: #6b7280;
    --white: #ffffff;
    --background: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --light-gray: #f9fafb;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
body.dark-mode {
    --dark-color: #f9fafb;
    --light-color: #1f2937;
    --gray-color: #9ca3af;
    --white: #111827;
    --background: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f9fafb;
    --border-color: #374151;
    --light-gray: #1e293b;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===========================
   Header & Navigation
   =========================== */
.main-header,
header {
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.logo:hover {
    transform: scale(1.05);
}

.logo:hover .racing-car {
    animation: race 0.6s ease-in-out;
}

.logo i {
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
    color: var(--primary-color);
}

.logo .fa-flag-checkered {
    color: var(--gray-color);
    animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

.racing-car {
    font-size: 4rem !important;
    color: #dc2626 !important;
    filter: drop-shadow(0 5px 15px rgba(220, 38, 38, 0.8)) drop-shadow(0 0 25px rgba(220, 38, 38, 0.5)) !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    transform: skewX(-20deg) scaleY(0.8) translateX(-30px) !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 4rem !important;
    height: 4rem !important;
    line-height: 4rem !important;
}

.logo .racing-car {
    font-size: 4rem !important;
    color: #dc2626 !important;
    filter: drop-shadow(0 5px 15px rgba(220, 38, 38, 0.8)) drop-shadow(0 0 25px rgba(220, 38, 38, 0.5)) !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    transform: skewX(-20deg) scaleY(0.8) translateX(-30px) !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 4rem !important;
    height: 4rem !important;
    line-height: 4rem !important;
}

.logo .racing-car::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 65%;
    width: 30px;
    height: 3px;
    background: linear-gradient(270deg, transparent, var(--primary-color));
    animation: speedLinesRight 0.8s linear infinite;
}

.logo .racing-car::after {
    content: '';
    position: absolute;
    right: -35px;
    top: 75%;
    width: 25px;
    height: 2px;
    background: linear-gradient(270deg, transparent, var(--accent-color));
    animation: speedLinesRight 0.8s linear infinite 0.2s;
}

@keyframes speedLines {
    0% {
        transform: translateX(-10px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(10px);
        opacity: 0;
    }
}

@keyframes speedLinesRight {
    0% {
        transform: translateX(10px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(-10px);
        opacity: 0;
    }
}

@keyframes race {
    0% {
        transform: skewX(-20deg) scaleY(0.8) translateX(0);
        filter: drop-shadow(0 3px 8px rgba(220, 38, 38, 0.6));
    }
    30% {
        transform: skewX(-35deg) scaleY(0.7) translateX(30px) scale(1.2);
        filter: drop-shadow(0 5px 15px rgba(220, 38, 38, 0.9)) drop-shadow(0 0 25px rgba(220, 38, 38, 0.5));
    }
    50% {
        transform: skewX(-40deg) scaleY(0.65) translateX(40px) scale(1.3);
        filter: drop-shadow(0 5px 20px rgba(220, 38, 38, 1)) drop-shadow(0 0 30px rgba(220, 38, 38, 0.7));
    }
    70% {
        transform: skewX(-35deg) scaleY(0.7) translateX(30px) scale(1.2);
        filter: drop-shadow(0 5px 15px rgba(220, 38, 38, 0.9)) drop-shadow(0 0 25px rgba(220, 38, 38, 0.5));
    }
    100% {
        transform: skewX(-20deg) scaleY(0.8) translateX(0);
        filter: drop-shadow(0 3px 8px rgba(220, 38, 38, 0.6));
    }
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--dark-color), var(--gray-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.main-nav a:hover,
.main-nav a.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.cart-icon,
.profile-icon {
    position: relative;
    font-size: 1.5rem;
    color: var(--dark-color);
    transition: color 0.3s ease, transform 0.2s ease;
}

.cart-icon:hover,
.profile-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.trunk-icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
    color: var(--dark-color);
}

.cart-icon:hover .trunk-icon {
    color: var(--primary-color);
}

.profile-icon i {
    font-size: 1.8rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--white);
}

.profile-dropdown-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--light-gray), var(--white));
}

.profile-dropdown-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--danger-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.profile-dropdown-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark-color);
}

.profile-dropdown-info p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--gray-color);
}

.profile-dropdown-menu {
    padding: 0.5rem 0;
}

.profile-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.profile-dropdown-menu a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.profile-dropdown-menu a i {
    width: 20px;
    text-align: center;
    color: var(--gray-color);
}

.profile-dropdown-menu a:hover i {
    color: var(--primary-color);
}

.profile-dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.btn-login,
.btn-register {
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

.btn-login {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-register {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-register:hover {
    background-color: var(--secondary-color);
}

/* ===========================
   Hero Search Section
   =========================== */
.hero-search {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-search h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-search p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-box {
    display: flex;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
}

.btn-search {
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.btn-search:hover {
    background-color: #d97706;
}

.advanced-filters {
    display: flex;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.advanced-filters select,
.advanced-filters input {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    min-width: 150px;
}

/* ===========================
   Categories Section
   =========================== */
.categories {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.categories h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    background-color: var(--primary-color);
    color: var(--white);
}

.category-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===========================
   Listings Grid
   =========================== */
.featured-listings {
    padding: 4rem 0;
    background-color: var(--light-color);
}

.featured-listings h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.listing-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.watchlist-btn-card {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.watchlist-btn-card:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.watchlist-btn-card i {
    font-size: 1.2rem;
    color: var(--gray-color);
    transition: color 0.3s ease;
}

.watchlist-btn-card:hover i {
    color: var(--primary-color);
}

.watchlist-btn-card.active i {
    color: #dc2626;
}

.watchlist-btn-card.active:hover i {
    color: #991b1b;
}

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.listing-content {
    padding: 1rem;
}

.listing-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.listing-details {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.condition-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--success-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.condition-badge.used {
    background-color: var(--accent-color);
}

.condition-badge.parts {
    background-color: var(--gray-color);
}

.listing-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.listing-price {
    display: flex;
    flex-direction: column;
}

.seller-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.retail-price-small {
    font-size: 0.85rem;
    color: var(--gray-color);
    text-decoration: line-through;
}

.savings-badge {
    background-color: var(--danger-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
}

.dealer-link-small {
    font-size: 0.8rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.dealer-link-small:hover {
    text-decoration: underline;
}

/* ===========================
   How It Works Section
   =========================== */
.how-it-works {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.how-it-works h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
}

.step-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.step h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--gray-color);
}

/* ===========================
   Browse Page Styles
   =========================== */
.browse-section {
    padding: 2rem 0;
    min-height: 100vh;
}

.browse-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 2rem;
    transition: grid-template-columns 0.3s ease;
}

.browse-layout.filters-collapsed {
    grid-template-columns: 60px 1fr 300px;
}

.filters-sidebar {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    height: fit-content;
    position: sticky;
    top: 100px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.filters-sidebar.collapsed {
    width: 60px;
    padding: 1rem 0.5rem;
}

.filters-sidebar.collapsed .filters-header h3,
.filters-sidebar.collapsed .filter-group,
.filters-sidebar.collapsed .btn-apply-filters,
.filters-sidebar.collapsed .btn-clear-filters {
    display: none;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.filters-sidebar h3 {
    margin: 0;
    font-size: 1.5rem;
}

.btn-toggle-filters {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-toggle-filters:hover {
    color: var(--secondary-color);
}

.filters-sidebar.collapsed .btn-toggle-filters .fa-chevron-left {
    display: none;
}

.filters-sidebar.collapsed .btn-toggle-filters .fa-filter {
    display: inline-block !important;
}

.filters-sidebar.collapsed .filters-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    justify-content: center;
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-group h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--dark-color);
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.filter-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.btn-apply-filters,
.btn-clear-filters {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.btn-apply-filters {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-apply-filters:hover {
    background-color: var(--secondary-color);
}

.btn-clear-filters {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn-clear-filters:hover {
    background-color: var(--gray-color);
    color: var(--white);
}

.browse-content {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

/* Ads Sidebar */
.ads-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-slot {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}

.ad-slot:nth-child(2) {
    top: 120px;
}

.ad-slot:nth-child(3) {
    top: 140px;
}

.ad-label {
    background-color: var(--gray-color);
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    text-align: center;
}

.ad-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.ad-content img {
    width: 100%;
    height: auto;
    display: block;
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.results-info {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

.listings-grid-browse {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    transition: grid-template-columns 0.3s ease;
}

.browse-layout.filters-collapsed .listings-grid-browse {
    grid-template-columns: repeat(2, 1fr);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-page {
    padding: 0.75rem 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--dark-color);
}

.btn-page:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.page-number.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ===========================
   Sell Page Styles
   =========================== */
.sell-section {
    padding: 2rem 0;
    background-color: var(--light-color);
}

.sell-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.sell-intro h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.sell-form {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--light-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #f3f4f6;
    cursor: move;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.image-preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border-color: var(--primary-color);
}

.image-preview-item.drag-over {
    border-color: var(--accent-color);
    background-color: #fef3c7;
}

.drag-handle {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--gray-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    z-index: 3;
    cursor: grab;
    transition: all 0.3s ease;
    opacity: 0;
}

.image-preview-item:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-item:hover .image-controls {
    opacity: 1;
}

.rotate-image {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rotate-image:hover {
    background-color: var(--white);
    transform: scale(1.1);
}

.remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--danger-color);
    color: var(--white);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.remove-image:hover {
    background-color: var(--danger-hover);
    transform: scale(1.1);
}

/* Fullscreen Image Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fullscreen-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.fullscreen-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10001;
}

.fullscreen-content img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.fullscreen-close {
    position: absolute;
    top: -50px;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 10002;
}

.fullscreen-close:hover {
    background-color: #fff;
    transform: scale(1.1) rotate(90deg);
}

.fullscreen-info {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-submit,
.btn-draft,
.btn-cancel {
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-submit:hover {
    background-color: #059669;
}

.btn-draft {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-draft:hover {
    background-color: #d97706;
}

.btn-cancel {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn-cancel:hover {
    background-color: var(--gray-color);
    color: var(--white);
}

/* ===========================
   Product Details Page
   =========================== */
.product-section {
    padding: 2rem 0;
    background-color: var(--light-color);
}

.breadcrumb {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-images {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.thumbnail-images img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail-images img:hover,
.thumbnail-images img.active {
    border-color: var(--primary-color);
}

.product-info {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.price-section {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.seller-price h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.retail-comparison {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-color);
}

.retail-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.retail-price {
    color: var(--gray-color);
    text-decoration: line-through;
    font-size: 1.2rem;
}

.savings {
    color: var(--success-color);
    font-weight: 700;
}

.dealer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.dealer-link:hover {
    text-decoration: underline;
}

.vehicle-fit,
.product-description,
.shipping-info {
    margin-bottom: 1.5rem;
}

.vehicle-fit h3,
.product-description h3,
.shipping-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1.2rem;
}

.quantity-selector button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.btn-add-cart,
.btn-buy-now,
.btn-watchlist {
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-cart {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-add-cart:hover {
    background-color: #d97706;
}

.btn-buy-now {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-buy-now:hover {
    background-color: var(--secondary-color);
}

.btn-watchlist {
    background-color: var(--card-bg);
    color: var(--dark-color);
    border: 2px solid var(--light-color);
}

.btn-watchlist:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-watchlist.in-watchlist {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-watchlist.in-watchlist:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.seller-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.seller-card {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.seller-avatar i {
    font-size: 4rem;
    color: var(--gray-color);
}

.seller-rating {
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.btn-contact-seller {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
}

.price-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-item {
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
}

.comparison-item.best-deal {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: var(--white);
}

.deal-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.deal-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.deal-link {
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.deal-link:hover {
    text-decoration: underline;
}

.savings-summary {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
}

.total-savings {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.protection-list {
    list-style: none;
}

.protection-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protection-list i {
    color: var(--success-color);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-buttons button {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1.2rem;
}

.share-buttons button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.product-tabs {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid var(--light-color);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background-color: transparent;
    font-weight: 600;
    color: var(--gray-color);
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid var(--border-color);
}

.specs-table td {
    padding: 1rem;
}

.specs-table td:first-child {
    font-weight: 600;
    width: 30%;
}

/* ===========================
   Footer
   =========================== */
.main-footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===========================
   Cart Page Styles
   =========================== */
.cart-section {
    padding: 2rem 0;
    min-height: 80vh;
}

.cart-section h2 {
    margin-bottom: 2rem;
}

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: 120px 1fr auto auto auto;
    gap: 1.5rem;
    align-items: center;
    position: relative;
}

.cart-item-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-item-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cart-item-seller {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cart-item-comparison {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.retail-price-text {
    font-size: 0.85rem;
    color: var(--gray-color);
    text-decoration: line-through;
}

.cart-item-quantity {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
}

.quantity-controls button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.quantity-controls input {
    width: 50px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.cart-item-price {
    text-align: right;
}

.item-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.item-total {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.item-savings {
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 0.25rem;
}

.cart-item-remove {
    background-color: transparent;
    color: var(--danger-color);
    font-size: 1.2rem;
    padding: 0.5rem;
}

.cart-item-remove:hover {
    color: var(--white);
    background-color: var(--danger-color);
    border-radius: var(--border-radius);
}

.cart-summary {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.summary-row.total {
    font-size: 1.3rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.cart-summary hr {
    border: none;
    border-top: 2px solid var(--light-color);
    margin: 1rem 0;
}

.retail-savings-summary {
    background-color: var(--success-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.retail-savings-summary i {
    font-size: 2rem;
}

.savings-amount {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.btn-checkout,
.btn-continue-shopping {
    width: 100%;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-checkout {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-checkout:hover {
    background-color: var(--secondary-color);
}

.btn-continue-shopping {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn-continue-shopping:hover {
    background-color: var(--gray-color);
    color: var(--white);
}

.payment-methods {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.payment-methods p {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 2rem;
    color: var(--gray-color);
}

/* ===========================
   Auth Pages Styles
   =========================== */
.auth-section {
    padding: 3rem 0;
    min-height: 80vh;
    background-color: var(--light-color);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.auth-card {
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.auth-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--gray-color);
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-link {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-auth:hover {
    background-color: var(--secondary-color);
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--light-color);
}

.auth-divider span {
    background-color: var(--card-bg);
    padding: 0 1rem;
    position: relative;
    color: var(--gray-color);
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px solid var(--light-color);
}

.btn-social.google {
    background-color: var(--card-bg);
    color: var(--dark-color);
}

.btn-social.google:hover {
    background-color: var(--light-color);
}

.btn-social.facebook {
    background-color: #1877f2;
    color: var(--white);
    border-color: #1877f2;
}

.btn-social.facebook:hover {
    background-color: #0c63d4;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--gray-color);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-benefits {
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.auth-benefits h3 {
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.auth-benefits ul {
    list-style: none;
}

.auth-benefits li {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-benefits i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 0.25rem;
}

.auth-benefits strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1200px) {
    .browse-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .ads-sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr 1fr;
    }
    
    .price-sidebar {
        grid-column: 1 / -1;
    }
    
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .main-nav {
        width: 100%;
        order: 3;
    }
    
    .main-nav ul {
        justify-content: space-around;
    }
    
    .browse-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .product-layout {
        grid-template-columns: 1fr;
    }
    
    .hero-search h2 {
        font-size: 1.8rem;
    }
    
    .advanced-filters {
        flex-direction: column;
    }
    
    .advanced-filters select,
    .advanced-filters input {
        width: 100%;
    }
    
    .cart-item {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
    }
    
    .cart-item-quantity,
    .cart-item-price {
        grid-column: 1 / -1;
    }
    
    .cart-item-remove {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .listings-grid,
    .listings-grid-browse {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
    }
    
    .cart-item-image img {
        width: 100%;
        height: 200px;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-benefits {
        padding: 2rem 1.5rem;
    }
}

/* ===========================
   Profile Pages
   =========================== */
.profile-section {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--light-gray), var(--white));
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--danger-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 5rem;
    flex-shrink: 0;
}

.profile-header-info h1 {
    margin: 0;
    color: var(--dark-color);
}

.profile-header-info p {
    margin: 0.5rem 0 0;
    color: var(--gray-color);
}

.profile-joined {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-top: 0.5rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.profile-nav {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.profile-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--dark-color);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.profile-nav a:hover {
    background-color: var(--light-gray);
    border-left-color: var(--primary-color);
}

.profile-nav a.active {
    background-color: var(--light-gray);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.profile-nav i {
    width: 20px;
    text-align: center;
}

.profile-main {
    min-height: 400px;
}

.profile-main h1 {
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.profile-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.profile-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    margin: 0.5rem 0;
    font-size: 2rem;
    color: var(--dark-color);
}

.stat-card p {
    margin: 0;
    color: var(--gray-color);
}

/* Orders */
.orders-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Drafts */
.drafts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.draft-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.draft-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.draft-thumbnail {
    width: 200px;
    height: 150px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.draft-thumbnail i {
    font-size: 3rem;
    color: var(--gray-color);
}

.draft-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.draft-image-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.draft-image-count i {
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

.draft-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.draft-info h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.25rem;
}

.draft-details {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.draft-details span {
    color: var(--gray-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draft-details i {
    color: var(--primary-color);
}

.draft-description {
    color: var(--gray-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.draft-meta {
    color: var(--gray-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draft-meta i {
    color: var(--primary-color);
}

.draft-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.draft-actions .btn {
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .draft-card {
        flex-direction: column;
    }
    
    .draft-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .draft-actions {
        flex-direction: row;
    }
}

.order-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.order-header {
    padding: 1.5rem;
    background: var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.order-date {
    margin: 0.25rem 0 0;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.order-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.shipped {
    background: #e0e7ff;
    color: #4338ca;
}

.order-status.delivered {
    background: #d1fae5;
    color: #065f46;
}

.order-items {
    padding: 1.5rem;
}

.order-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.order-item-details h4 {
    margin: 0 0 0.5rem;
    color: var(--dark-color);
}

.order-item-details p {
    margin: 0.25rem 0;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.order-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.order-footer {
    padding: 1.5rem;
    background: var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-size: 1.1rem;
}

/* Listings */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.listings-header h1 {
    margin: 0;
}

.listing-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.listing-status.active {
    background: #d1fae5;
    color: #065f46;
}

.listing-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.listing-views {
    color: var(--gray-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Settings */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.settings-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--border-color);
    border-radius: 34px;
    transition: background-color 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.settings-toggle input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.settings-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    color: var(--dark-color);
    font-size: 1rem;
}

.danger-zone {
    border: 2px solid var(--danger-color);
}

.danger-zone h2 {
    color: var(--danger-color);
}

.danger-zone p {
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--border-color);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--gray-color);
    margin-bottom: 2rem;
}

/* Responsive - Profile Pages */
@media (max-width: 768px) {
    .profile-content {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .listings-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ===========================
   Dark Mode Footer
   =========================== */
body.dark-mode footer {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
}

body.dark-mode .main-nav a {
    color: var(--text-color);
}

body.dark-mode .main-nav a:hover {
    color: var(--primary-color);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: var(--background);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .listing-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: var(--text-color);
}

/* ===========================
   Garage Door Opening Effect
   =========================== */
.garage-door-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.garage-door {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(80, 80, 80, 0.45) 0%,
        rgba(90, 90, 90, 0.35) 5%,
        rgba(80, 80, 80, 0.45) 10%,
        rgba(90, 90, 90, 0.35) 15%,
        rgba(80, 80, 80, 0.45) 20%,
        rgba(90, 90, 90, 0.35) 25%,
        rgba(80, 80, 80, 0.45) 30%,
        rgba(90, 90, 90, 0.35) 35%,
        rgba(80, 80, 80, 0.45) 40%,
        rgba(90, 90, 90, 0.35) 45%,
        rgba(80, 80, 80, 0.45) 50%,
        rgba(90, 90, 90, 0.35) 55%,
        rgba(80, 80, 80, 0.45) 60%,
        rgba(90, 90, 90, 0.35) 65%,
        rgba(80, 80, 80, 0.45) 70%,
        rgba(90, 90, 90, 0.35) 75%,
        rgba(80, 80, 80, 0.45) 80%,
        rgba(90, 90, 90, 0.35) 85%,
        rgba(80, 80, 80, 0.45) 90%,
        rgba(90, 90, 90, 0.35) 95%,
        rgba(80, 80, 80, 0.45) 100%
    );
    box-shadow: 
        inset 0 3px 2px rgba(255, 255, 255, 0.2),
        inset 0 -3px 2px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s ease-out;
}

.garage-door::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        rgba(60, 60, 60, 0.7) 0px,
        rgba(60, 60, 60, 0.7) 10px,
        rgba(40, 40, 40, 0.5) 10px,
        rgba(40, 40, 40, 0.5) 20px
    );
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.garage-door::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(0, 0, 0, 0.15) 45px,
        rgba(0, 0, 0, 0.25) 50px,
        rgba(0, 0, 0, 0.15) 55px,
        transparent 100px
    );
}

.garage-door-single {
    top: 0;
    border-bottom: 5px solid rgba(40, 40, 40, 0.6);
    transform: translateY(0);
}

.garage-door-single::before {
    bottom: -2px;
}

/* Scrolled state - door opens upward */
body.garage-opened .garage-door-single {
    transform: translateY(-100%);
}

/* Dark mode adjustments */
body.dark-mode .garage-door {
    background: linear-gradient(
        to bottom,
        rgba(40, 40, 40, 0.5) 0%,
        rgba(50, 50, 50, 0.4) 5%,
        rgba(40, 40, 40, 0.5) 10%,
        rgba(50, 50, 50, 0.4) 15%,
        rgba(40, 40, 40, 0.5) 20%,
        rgba(50, 50, 50, 0.4) 25%,
        rgba(40, 40, 40, 0.5) 30%,
        rgba(50, 50, 50, 0.4) 35%,
        rgba(40, 40, 40, 0.5) 40%,
        rgba(50, 50, 50, 0.4) 45%,
        rgba(40, 40, 40, 0.5) 50%,
        rgba(50, 50, 50, 0.4) 55%,
        rgba(40, 40, 40, 0.5) 60%,
        rgba(50, 50, 50, 0.4) 65%,
        rgba(40, 40, 40, 0.5) 70%,
        rgba(50, 50, 50, 0.4) 75%,
        rgba(40, 40, 40, 0.5) 80%,
        rgba(50, 50, 50, 0.4) 85%,
        rgba(40, 40, 40, 0.5) 90%,
        rgba(50, 50, 50, 0.4) 95%,
        rgba(40, 40, 40, 0.5) 100%
    );
}

/* ===========================
   Checkout Garage Door Animation
   =========================== */
.checkout-garage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.checkout-garage-door {
    position: absolute;
    top: -100vh;
    left: 0;
    width: 100%;
    height: 300vh;
    background: linear-gradient(
        to bottom,
        rgba(80, 80, 80, 0.45) 0%,
        rgba(90, 90, 90, 0.35) 2.5%,
        rgba(80, 80, 80, 0.45) 5%,
        rgba(90, 90, 90, 0.35) 7.5%,
        rgba(80, 80, 80, 0.45) 10%,
        rgba(90, 90, 90, 0.35) 12.5%,
        rgba(80, 80, 80, 0.45) 15%,
        rgba(90, 90, 90, 0.35) 17.5%,
        rgba(80, 80, 80, 0.45) 20%,
        rgba(90, 90, 90, 0.35) 22.5%,
        rgba(80, 80, 80, 0.45) 25%,
        rgba(90, 90, 90, 0.35) 27.5%,
        rgba(80, 80, 80, 0.45) 30%,
        rgba(90, 90, 90, 0.35) 32.5%,
        rgba(80, 80, 80, 0.45) 35%,
        rgba(90, 90, 90, 0.35) 37.5%,
        rgba(80, 80, 80, 0.45) 40%,
        rgba(90, 90, 90, 0.35) 42.5%,
        rgba(80, 80, 80, 0.45) 45%,
        rgba(90, 90, 90, 0.35) 47.5%,
        rgba(80, 80, 80, 0.45) 50%
    );
    box-shadow: 
        inset 0 3px 2px rgba(255, 255, 255, 0.2),
        inset 0 -3px 2px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: none;
}

.checkout-garage-door::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(0, 0, 0, 0.15) 45px,
        rgba(0, 0, 0, 0.25) 50px,
        rgba(0, 0, 0, 0.15) 55px,
        transparent 100px
    );
}

.checkout-garage-door::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        rgba(60, 60, 60, 0.7) 0px,
        rgba(60, 60, 60, 0.7) 10px,
        rgba(40, 40, 40, 0.5) 10px,
        rgba(40, 40, 40, 0.5) 20px
    );
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

body.checkout-garage-closing .checkout-garage-door {
    animation: garageDoorClosing 2s ease-in forwards;
}

@keyframes garageDoorClosing {
    0% {
        top: -100vh;
    }
    100% {
        top: 100vh;
    }
}

body.dark-mode .checkout-garage-door {
    background: linear-gradient(
        to bottom,
        rgba(40, 40, 40, 0.5) 0%,
        rgba(50, 50, 50, 0.4) 2.5%,
        rgba(40, 40, 40, 0.5) 5%,
        rgba(50, 50, 50, 0.4) 7.5%,
        rgba(40, 40, 40, 0.5) 10%,
        rgba(50, 50, 50, 0.4) 12.5%,
        rgba(40, 40, 40, 0.5) 15%,
        rgba(50, 50, 50, 0.4) 17.5%,
        rgba(40, 40, 40, 0.5) 20%,
        rgba(50, 50, 50, 0.4) 22.5%,
        rgba(40, 40, 40, 0.5) 25%,
        rgba(50, 50, 50, 0.4) 27.5%,
        rgba(40, 40, 40, 0.5) 30%,
        rgba(50, 50, 50, 0.4) 32.5%,
        rgba(40, 40, 40, 0.5) 35%,
        rgba(50, 50, 50, 0.4) 37.5%,
        rgba(40, 40, 40, 0.5) 40%,
        rgba(50, 50, 50, 0.4) 42.5%,
        rgba(40, 40, 40, 0.5) 45%,
        rgba(50, 50, 50, 0.4) 47.5%,
        rgba(40, 40, 40, 0.5) 50%
    );
}

/* ===========================
   Legal Pages (Privacy Policy, Terms)
   =========================== */
.legal-section {
    padding: 3rem 0;
    min-height: 70vh;
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.legal-content h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.last-updated {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.legal-text h2 {
    color: var(--text-color);
    font-size: 1.75rem;
    margin: 2rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.legal-text h2:first-child {
    border-top: none;
    padding-top: 0;
}

.legal-text h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
}

.legal-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-text ul {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
}

.legal-text li {
    margin-bottom: 0.5rem;
}

.legal-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-text a:hover {
    text-decoration: underline;
}

.legal-text strong {
    color: var(--text-color);
    font-weight: 600;
}

.contact-info {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 1rem 0;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.warning-box {
    background-color: #fef2f2;
    border: 2px solid var(--danger-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

body.dark-mode .warning-box {
    background-color: rgba(220, 38, 38, 0.1);
}

.warning-box h3 {
    color: var(--danger-color);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.warning-box p, .warning-box ul {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.warning-box ul {
    margin-left: 2rem;
}

.warning-box i {
    margin-right: 0.5rem;
}

/* ===========================
   Checkout Modal
   =========================== */
.checkout-modal {
    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: 10000;
    padding: 2rem;
    overflow-y: auto;
}

.checkout-modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.checkout-modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-modal-header h2 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-color);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    color: var(--primary-color);
}

.checkout-modal-body {
    padding: 2rem;
}

.checkout-section {
    margin-bottom: 2rem;
}

.checkout-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.checkout-summary {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--text-color);
}

.summary-total {
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.checkout-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--light-gray);
}

.checkout-modal-footer button {
    padding: 0.75rem 2rem;
}

.payment-security-notice {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid #6ee7b7;
}

.payment-security-notice i {
    color: #065f46;
    font-size: 1.5rem;
}

.payment-security-notice span {
    color: #065f46;
    font-size: 0.9rem;
    font-weight: 500;
}

.cvv-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--gray-color);
}

body.dark-mode .payment-security-notice {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .payment-security-notice i,
body.dark-mode .payment-security-notice span {
    color: #6ee7b7;
}

@media (max-width: 768px) {
    .checkout-modal {
        padding: 1rem;
    }
    
    .checkout-modal-content {
        max-height: 95vh;
    }
    
    .checkout-modal-header,
    .checkout-modal-body,
    .checkout-modal-footer {
        padding: 1.5rem;
    }
    
    .checkout-modal-footer {
        flex-direction: column;
    }
    
    .checkout-modal-footer button {
        width: 100%;
    }
}

/* Messages Page Styles */
.messages-section {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.messages-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 250px);
    min-height: 600px;
}

.conversations-sidebar {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
}

.conversations-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.conversation-item:hover {
    background: var(--light-color);
}

.conversation-item.active {
    background: #fef2f2;
    border-left: 3px solid var(--primary-color);
}

.conversation-item.unread {
    background: #fef2f2;
    font-weight: 600;
}

.conversation-avatar {
    font-size: 2.5rem;
    color: var(--gray-color);
}

.conversation-details {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.conversation-preview {
    font-size: 0.875rem;
    color: var(--gray-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.messages-main {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
}

.conversation-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
}

.conversation-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-color);
}

.messages-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f9fafb;
}

.message {
    display: flex;
    margin-bottom: 0.5rem;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.message.sent .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.received .message-bubble {
    background: white;
    color: var(--dark-color);
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-bubble p {
    margin: 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.message-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.info-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.info-notice i {
    color: #f59e0b;
}

.message-form {
    display: flex;
    gap: 0.75rem;
}

.message-form textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.message-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-send:hover {
    background: var(--secondary-color);
}

.btn-send i {
    margin-right: 0.5rem;
}

.empty-state-small {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-color);
}

.empty-state-small i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.empty-state-small p {
    margin-bottom: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.loading-state, .error-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-color);
}

.loading-state i, .error-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .messages-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .conversations-sidebar {
        max-height: 300px;
    }
    
    .messages-main {
        min-height: 500px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* ===========================
   AI Chatbot Styles
   =========================== */

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.6);
}

.chatbot-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chatbot-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    max-width: 75%;
}

.user-message .message-content {
    background: #dc2626;
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
    background: white;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    white-space: pre-line;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-replies button {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-replies button:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.typing-indicator .message-content {
    padding: 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-input {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input input:focus {
    border-color: #dc2626;
}

.chatbot-input button {
    width: 44px;
    height: 44px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
}

.chatbot-input button:hover {
    background: #991b1b;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

/* Avatar Selector & Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #16a34a;
}

.notification-success i {
    color: #16a34a;
    font-size: 1.5rem;
}

.notification-error {
    border-left: 4px solid #dc2626;
}

.notification-error i {
    color: #dc2626;
    font-size: 1.5rem;
}

.notification-info {
    border-left: 4px solid #2563eb;
}

.notification-info i {
    color: #2563eb;
    font-size: 1.5rem;
}

.car-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* My Garage Styles */
.garage-header {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), #991b1b);
    color: white;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.garage-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.garage-car-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

.garage-car-icon {
    font-size: 3rem;
}

.garage-filters {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #e5e7eb;
}

.garage-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
}

.garage-empty i {
    font-size: 4rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.garage-empty h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.garage-empty p {
    color: var(--gray-color);
    margin-bottom: 2rem;
}
