* {
    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: #1a1a1a;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 98%;
    margin: 0 auto;
    padding: 0 10px;
}

/* Header - Sleek Design */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.7rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-icon {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    font-size: 0.85rem;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.nav-menu a:hover:after {
    width: 100%;
}

/* Hero - More Compact */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="white" stroke-opacity="0.05" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.search-container {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.search-box {
    position: relative;
    margin-bottom: 0.8rem;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.3rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.filter-bar {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.filter-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Best Deals Section */
.best-deals-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.deals-title {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: #333;
    font-weight: 700;
}

.best-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.deal-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.deal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.deal-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
}

.deal-card h4 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.deal-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    min-height: 36px;
}

.deal-highlight {
    font-size: 1.4rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 0;
}

/* Comparison Section - ULTRA COMPACT */
.comparison-section {
    padding: 1.5rem 0;
}

.comparison-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.comparison-table th {
    padding: 0.6rem 0.4rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.comparison-table th:first-child {
    border-radius: 12px 0 0 0;
    padding-left: 0.8rem;
    text-align: left;
}

.comparison-table th:last-child {
    border-radius: 0 12px 0 0;
}

.comparison-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.comparison-table td:first-child {
    padding-left: 0.8rem;
    text-align: left;
}

.comparison-table tbody tr {
    transition: all 0.2s;
}

.comparison-table tbody tr:hover {
    background: #f8f9ff;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    position: relative;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sort-arrow {
    display: inline-block;
    margin-left: 0.2rem;
    font-size: 0.65rem;
    opacity: 0.7;
}

.sortable:hover .sort-arrow {
    opacity: 1;
}

/* Product name - very compact */
.product-name-text {
    min-width: 160px;
    max-width: 180px;
}

.product-name-text h4 {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.2;
}

.product-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.rating-cell {
    color: #ffc107;
    font-size: 0.9rem;
    min-width: 75px;
    display: inline-block;
}

.rating-text {
    display: block;
    color: #666;
    font-size: 0.65rem;
    margin-top: 0.15rem;
    font-weight: 500;
}

.badge-yes {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
}

.badge-no {
    color: #ccc;
    font-size: 0.7rem;
}

.flavors-cell {
    font-size: 0.7rem;
    color: #555;
    max-width: 120px;
    line-height: 1.3;
    margin: 0 auto;
}

.nutrition-value {
    font-weight: 700;
    color: #667eea;
    font-size: 0.85rem;
}

.retailer-links-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
    margin: 0 auto;
}

.retailer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}

.retailer-link:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.retailer-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.retailer-price {
    font-weight: 700;
    color: #28a745;
    font-size: 0.8rem;
}

.best-price {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1.5px solid #28a745;
}

.best-price .retailer-price {
    font-size: 0.85rem;
}

/* Footer - Compact */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.2rem 0;
    margin-top: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);
}

footer p {
    color: #666;
    font-size: 0.75rem;
}

/* Responsive */
@media screen and (max-width: 1400px) {
    .comparison-table {
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 768px) {
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .comparison-table {
        font-size: 0.7rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.3rem;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .best-deals-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .deal-card {
        padding: 1rem;
    }
    
    .deals-title {
        font-size: 1.3rem;
    }
}
