@font-face {
    font-family: 'ABCDiatype';
    src: url('./fonts/ABCDiatype-Regular-Trial.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'ABCDiatype';
    src: url('./fonts/ABCDiatype-Medium-Trial.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'ABCDiatype';
    src: url('./fonts/ABCDiatype-Bold-Trial.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

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

body {
    font-family: 'ABCDiatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #1a1a1a;
}

.search-section {
    margin-bottom: 2rem;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: #fafafa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
    background: #f5f5f5;
}

.search-result-info {
    flex: 1;
}

.search-result-info .name {
    font-size: 0.9rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 0.15rem;
}

.search-result-info .brand {
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
}

.search-result-info .price {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-top: 0.15rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-weight: 400;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}

.tab {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: #666;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab:hover {
    border-color: #1a1a1a;
}

.tab.active {
    background: #f0f0ff;
    color: #5856d6;
    border-color: #5856d6;
}

.tab .count {
    margin-left: 0.25rem;
    font-weight: 400;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.product-card {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
}

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

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

.product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.product-brand {
    font-size: 0.65rem;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.product-name {
    font-size: 0.8rem;
    font-weight: 400;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.product-price {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Admin mode controls */
.admin-controls {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.category-selector {
    flex: 1;
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 400;
    font-family: 'ABCDiatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    cursor: pointer;
}

.category-selector:hover {
    background: white;
}

.remove-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 400;
    font-family: 'ABCDiatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #ff4444;
}

/* Paywall styles */
.product-card.blurred {
    filter: blur(8px);
    opacity: 0.6;
    pointer-events: none;
}

.paywall-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 70%, transparent 100%);
    padding: 3rem 2rem 2rem;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 300px;
}

.paywall-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.paywall-message {
    font-size: 0.875rem;
    font-weight: 400;
    color: white;
    margin-bottom: 0.5rem;
}

.paywall-cta {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.paywall-button {
    display: inline-block;
    background: white;
    color: #111;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.paywall-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0;
    }

    header {
        padding: 0 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .search-section {
        padding: 0 1rem;
    }

    .category-tabs {
        padding: 0 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
    }
}
