@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

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

:root {
    --red: #ff0033;
    --red-dark: #cc0029;
    --black: #0a0a0a;
    --white: #ffffff;
    --gray-50: #f8f8f8;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-400: #a3a3a3;
    --gray-600: #525252;
    --gray-900: #171717;
    --accent: #ff0033;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #f0f0f0 100%);
    background-attachment: fixed;
    color: var(--black);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* HEADER */
header {
    padding: 80px 0 60px;
    text-align: center;
    background: var(--black);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 0, 51, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 0, 51, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

header h1 {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: var(--white);
    position: relative;
    text-shadow: 0 0 80px rgba(255, 0, 51, 0.3);
}

header .tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--gray-400);
    margin-top: 16px;
    letter-spacing: -0.01em;
    position: relative;
}

/* TICKER */
.ticker-wrapper {
    display: flex;
    align-items: stretch;
    background: var(--black);
    overflow: hidden;
}

.ticker-label {
    flex-shrink: 0;
    background: var(--red);
    color: var(--white);
    padding: 12px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: flex;
    gap: 80px;
    padding: 12px 0;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ticker-item .name {
    font-weight: 600;
}

.ticker-item .price {
    color: var(--red);
    font-weight: 700;
}

.ticker-item .category {
    color: var(--gray-400);
    font-weight: 500;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker:hover .ticker-content {
    animation-play-state: paused;
}

/* CONTROLS */
.controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 40px 0;
    border-bottom: none;
    background: var(--white);
    margin: -20px -24px 0;
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: 40px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab {
    padding: 10px 20px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 8px;
}

.tab:hover {
    border-color: var(--black);
    color: var(--black);
    background: var(--gray-50);
}

.tab.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-control label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
}

.sort-control select {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--white);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.sort-control select:hover {
    border-color: var(--gray-400);
}

.sort-control select:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* PRODUCTS GRID */
main {
    padding-bottom: 80px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    background: transparent;
    margin-top: 40px;
    border: none;
}

/* PRODUCT CARD */
.product-card {
    background: var(--white);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red) 0%, var(--red-dark) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-card:hover {
    background: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image {
    display: none;
}

.product-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    color: var(--black);
}

.product-store {
    font-size: 0.875rem;
    color: var(--gray-400);
    font-weight: 500;
    margin-bottom: 24px;
}

.product-pricing {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
    margin-top: auto;
}

.price-main {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--black);
}

.price-serving {
    display: flex;
    flex-direction: column;
}

.price-serving-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--red);
}

.price-serving-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-details {
    display: flex;
    gap: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 24px;
}

.buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--black) 0%, #1a1a1a 100%);
    color: var(--white);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    transition: all 0.2s ease;
    align-self: flex-start;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.buy-button:hover {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 0, 51, 0.3);
}

.buy-button--disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* LOADING & NO RESULTS */
.loading,
.no-results {
    text-align: center;
    padding: 80px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-400);
    display: none;
}

.loading.show,
.no-results.show {
    display: block;
}

/* FOOTER */
footer {
    background: var(--black);
    padding: 40px 0;
    text-align: center;
    border-top: none;
    margin-top: 40px;
}

footer .disclosure {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 8px;
}

footer .copyright {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* RESPONSIVE */
@media (min-width: 768px) {
    .controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 640px) {
    header {
        padding: 48px 0 40px;
    }

    header h1 {
        font-size: 3rem;
    }

    header .tagline {
        font-size: 1rem;
    }

    .ticker-label {
        padding: 12px 16px;
        font-size: 0.7rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        padding: 24px;
    }

    .product-name {
        font-size: 1.5rem;
    }

    .price-main {
        font-size: 2rem;
    }

    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .tab {
        flex-shrink: 0;
    }
}
