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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #1e293b;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --header-bg: #1e293b;
    --header-text: #f8fafc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-primary);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.categories-grid, .subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-tile, .subcategory-tile {
    background-color: var(--card-background);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-tile:hover, .subcategory-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.category-tile:active, .subcategory-tile:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-tile.active, .subcategory-tile.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-tile i, .subcategory-tile i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.back-button {
    background-color: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.back-button:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    /* padding: 1rem; */
}

.product-card {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
    border: none;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 50%;
    object-fit: cover;
    background-color: var(--secondary-color);
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 50%;
}

.product-name {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.detail-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.product-price {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.price-icon {
    font-size: 0.9rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.payment-select {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 200px;
}

.payment-select:hover {
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.payment-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background-color);
    padding: 0.25rem;
    border-radius: 6px;
}

.quantity-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    opacity: 0.9;
}

.quantity-btn:hover {
    background-color: var(--primary-hover);
    opacity: 1;
}

.quantity-display {
    font-size: 0.9rem;
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.buy-btn {
    flex: 1;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    opacity: 0.9;
}

.buy-btn:hover {
    background-color: var(--success-hover);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.buy-btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.error-message h2 {
    color: #ef4444;
    margin-bottom: 1rem;
}
