:root {
    --primary-color: #e74c3c;
    --text-main: #333;
    --text-muted: #888;
    --bg-light: #f8f9fa;
    --border-color: #eee;
    --container-width: 1000px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-light);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #000;
    text-decoration: none;
}

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

.search-bar {
    flex: 0 1 400px;
    display: flex;
    background: #f1f3f5;
    border-radius: 20px;
    padding: 5px 15px;
    margin: 0 20px;
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 8px;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.user-nav a {
    text-decoration: none;
    font-size: 14px;
    color: var(--text-main);
}

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

.category-tabs {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    overflow-x: auto;
}

.category-tab {
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    padding: 5px 0;
    position: relative;
}

.category-tab.active {
    color: var(--primary-color);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Main Content */
.main-container {
    padding: 30px 20px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.sort-options {
    font-size: 14px;
    color: var(--text-muted);
}

.sort-options span {
    margin-left: 15px;
    cursor: pointer;
}

.sort-options span.active {
    color: var(--text-main);
    font-weight: 700;
}

/* Deal List */
.deal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deal-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.deal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.deal-thumb {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.deal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.deal-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-site { background: #e9ecef; color: #495057; }
.badge-category { background: #fff5f5; color: var(--primary-color); }

.deal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.current-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

.original-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.discount-rate {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
}

.deal-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    background: #fff;
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    .search-bar {
        width: 100%;
        margin: 0;
    }
    .deal-thumb {
        width: 80px;
        height: 80px;
    }
    .deal-title {
        font-size: 14px;
    }
    .current-price {
        font-size: 16px;
    }
}
