/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Language Bar */
.language-bar {
    background-color: white;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-start; /* keep menu toggle on the left */
    align-items: center;
}

.language-selector {
    display: flex;
    gap: 8px;
    margin-left: auto; /* push language buttons to the right */
}

.lang-btn {
    background-color: #f0f0f0;
    border: 2px solid transparent;
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: #667eea;
    color: white;
}

.lang-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background-color: #667eea;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    order: 0; /* ensure toggle stays first */
}

.menu-toggle:hover {
    background-color: #764ba2;
}

.container {
    display: flex;
    flex: 1;
    height: calc(100vh - 70px);
}

/* Sidebar - Categories */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    color: white;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: left;
}

.category-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.category-btn.active {
    background-color: white;
    color: #667eea;
    font-weight: bold;
    border-color: white;
}

/* Main Content Area */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.header {
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

/* Products Grid */
#catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.product-category {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-price {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.empty-state h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* Responsive Design */
/* Tablets and medium devices */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
        padding: 15px;
    }

    .sidebar h2 {
        font-size: 1.3em;
    }

    .content {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    #catalogo {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* Tablets and small devices */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .language-bar {
        padding: 10px;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.3s ease;
    }

    .sidebar.active {
        max-height: 400px;
        padding: 20px;
    }

    .sidebar h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .categories {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .category-btn {
        flex: 0 1 calc(50% - 5px);
        font-size: 0.9em;
        padding: 10px 12px;
    }

    .content {
        flex: 1;
        padding: 15px;
        overflow-y: auto;
    }

    .header {
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }

    #catalogo {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 1em;
        margin-bottom: 6px;
    }

    .product-price {
        font-size: 1.2em;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .language-bar {
        padding: 8px 10px;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }

    .sidebar {
        max-height: 0;
        padding: 0;
    }

    .sidebar.active {
        max-height: 350px;
        padding: 15px;
    }

    .sidebar h2 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }

    .categories {
        gap: 8px;
    }

    .category-btn {
        flex: 1;
        font-size: 0.85em;
        padding: 8px 10px;
    }

    .category-btn:hover {
        transform: none;
    }

    .content {
        padding: 10px;
    }

    .header {
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    #catalogo {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .product-image {
        height: 120px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .product-category {
        font-size: 0.75em;
        margin-bottom: 6px;
    }

    .product-price {
        font-size: 1em;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state h2 {
        font-size: 1.2em;
    }
}
