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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e53935;
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #e53935;
}

/* Marketplace Switcher */
.marketplace-switcher {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.marketplace-switcher select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
}

.marketplace-switcher select:hover {
    border-color: #e53935;
}

.marketplace-switcher select:focus {
    outline: none;
    border-color: #e53935;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.1);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-switcher a {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #666;
    transition: all 0.2s;
}

.lang-switcher a:hover {
    border-color: #e53935;
    color: #e53935;
}

.lang-switcher a.lang-active {
    background-color: #e53935;
    border-color: #e53935;
    color: white;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

.hero-small {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.hero-small h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.category-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

.search-button {
    padding: 0.75rem 2rem;
    background-color: #e53935;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #c62828;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    object-position: center;
    margin-top: 13px;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
    min-height: 3rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #e53935;
    margin-bottom: 0.5rem;
}

.product-condition {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.product-actions {
    margin-top: auto;
    padding-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-align: center;
}

.btn-primary {
    background-color: #e53935;
    color: white;
}

.btn-primary:hover {
    background-color: #c62828;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
}

/* Homepage Sections */
.homepage-section {
    margin: 3rem 0;
}

.homepage-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 3px solid #e53935;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.text-center {
    text-align: center;
    margin-top: 2rem;
}

.results-count {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.results-count p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

/* Categories Section */
.categories-section {
    margin: 2rem 0;
}

.categories-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.category-card h3 {
    margin-bottom: 0.5rem;
}

.category-card p {
    margin: 0;
    color: #e53935;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-card:hover h3 {
    color: white;
}

.category-card:hover p {
    opacity: 1;
    color: white;
}

/* Product Detail Page */
.product-detail {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.main-image {
    width: 100%;
    border-radius: 8px;
}

.product-info-detail h1 {
    margin-bottom: 1rem;
}

.price-section,
.condition-section,
.location-section,
.shipping-section {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.price-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e53935;
}

.description-section {
    margin: 2rem 0;
}

.action-buttons {
    margin: 2rem 0;
}

.checkout-widget-container {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f0f0f0;
    border-radius: 8px;
    display: none;
}

/* Checkout Page */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.cart-summary,
.checkout-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

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

.cart-item-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-table tfoot td {
    font-size: 1.125rem;
    padding-top: 1.5rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
}

/* Footer */
.site-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.site-footer p {
    margin: 0.5rem 0;
}

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

    .search-form {
        flex-direction: column;
    }

    .category-select {
        min-width: auto;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.product-description {
    line-height: 1.6;
    color: #333;
}

.product-description p {
    margin-bottom: 1rem;
}

.product-description ul,
.product-description ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.product-description img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.product-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.product-description table td,
.product-description table th {
    border: 1px solid #ddd;
    padding: 0.5rem;
}

.product-description table th {
    background-color: #f5f5f5;
    font-weight: bold;
}
