/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #45b1b8; /* VarageSale Teal */
    --primary-dark: #3a969c;
    --secondary-color: #f68b1e; /* Accent orange */
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #edf2f7;
    --bg-color: #f7fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 1rem;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

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

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

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

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

.location-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s;
}

.location-selector:hover {
    background: #e2e8f0;
}

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

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    background: var(--white);
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(69, 177, 184, 0.1);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
}

.nav-icon-link {
    color: var(--text-light);
    display: flex;
    align-items: center;
    transition: color 0.2s;
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--danger-color);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.nav-icon-link:hover {
    color: var(--primary-color);
}

.nav-user-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.btn-sell {
    padding: 0.625rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(69, 177, 184, 0.2);
}

/* Categories Menu */
.categories-menu {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.875rem;
    white-space: nowrap;
}

.category-item:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

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

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

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

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Hero Section */
.hero {
    background: var(--white);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    color: var(--text-light);
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search form {
    display: flex;
    gap: 0.75rem;
}

.hero-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
}

.hero-search-input:focus {
    background: var(--white);
    border-color: var(--primary-color);
    outline: none;
}

/* Categories Grid */
.categories-section {
    padding: 4rem 0;
}

.categories-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding-top: 2rem;
}

.category-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.category-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.category-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Ads Grid */
.latest-products-section {
    padding: 4rem 0;
    background: #ffffff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.5rem;
}

/* Ad Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f1f5f9;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0,0,0,0.6);
    color: var(--white);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.product-card-content {
    padding: 1rem;
}

.product-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.product-card-location,
.product-card-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    text-align: center;
    background: var(--bg-color);
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Auth Pages */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-card h1 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle,
.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.dropdown-toggle:hover,
.nav-user-btn:hover {
    background: #f1f5f9;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    z-index: 1000;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Error Pages */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
}

.error-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.pagination-link.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination-link:hover:not(.active) {
    background: var(--bg-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .nav {
        width: 100%;
        justify-content: space-between;
    }

    .hero h1 {
        font-size: 1.875rem;
    }

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

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Ad Detail Page */
.ad-detail {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.ad-gallery {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gallery-main {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.gallery-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.gallery-thumbnails img:hover,
.gallery-thumbnails img.active {
    border-color: var(--primary-color);
}

.gallery-no-image {
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    background: #f3f4f6;
}

.ad-main,
.ad-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-header {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.ad-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.ad-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.ad-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.ad-description {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.ad-description h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.ad-description p {
    white-space: pre-line;
    color: #4a5568;
    line-height: 1.7;
}

.ad-contact {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ad-contact h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    background: #edf2f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.seller-details h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
}

.seller-details p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.ad-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 992px) {
    .ad-detail {
        grid-template-columns: 1fr;
    }
}
