body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #334155;
    min-height: 100vh;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

input,
select,
textarea {
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #475569;
    transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    width: 100%;
    margin-bottom: 0.5rem;
}

button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

button.danger {
    background-color: #ef4444;
}

button.danger:hover {
    background-color: #dc2626;
}

button.secondary {
    background-color: #6366f1;
}

button.secondary:hover {
    background-color: #4f46e5;
}

.search-bar-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.search-bar-container fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    padding-top: .6rem;
    margin-top: 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar-container fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
    color: #475569;
}

.search-bar-container fieldset div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar-container fieldset input[type=radio] {
    width: auto;
    margin: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.product-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.product-card-header {
    padding: .6rem 1rem;
    color: white;
    position: relative;
}

.product-name {
    font-size: 1.25rem;
    max-width: 74vw;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: #fbbf24;
}

.expand-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.product-date-status {
    position: absolute;
    bottom: 1rem;
    right: 1.6rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;

    &.old {
        background-color: #dc2626;
    }

    &.avg {
        background-color: #fbbf24;
    }

    &.new {
        background-color: #34d399;
    }
}

.product-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.product-details {
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.product-card.expanded .product-details {
    max-height: 500px;
}

.product-card:not(.expanded) .product-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.product-details-content {
    padding: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #475569;
}

.detail-value {
    color: #64748b;
    text-align: right;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions button {
    width: auto;
    flex: 1;
    margin-bottom: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: .6rem;
}

.tab-button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #e2e8f0;
    color: #475569;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.tab-button.active {
    background-color: #3b82f6;
    color: white;
}

.tab-button:hover {
    background-color: #475569;
    color: white;
}

.message-box {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: #34d399;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.message-box.show {
    opacity: 1;
}

.message-box.error {
    background-color: #ef4444;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

@media (min-width: 640px) {
    .search-bar-container {
        flex-direction: row;
        align-items: end;
    }

    .search-bar-container input {
        margin-bottom: 0;
    }

    .search-bar-container fieldset {
        margin-left: 1rem;
        flex-shrink: 0;
    }

    button {
        width: auto;
        margin-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}