/* Reset & Base */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
    background-color: #fdfdfd;
}

header {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e67e22;
}

.controls {
    display: flex;
    gap: 1rem;
}

select,
button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* Language Flags */
.language-flags {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    font-size: 1.5rem;
    /* Large emoji */
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.5;
    filter: grayscale(100%);
}

.lang-btn:hover {
    opacity: 0.8;
    background-color: #f0f0f0;
}

.lang-btn.active {
    opacity: 1;
    filter: none;
    border-color: #ddd;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

button.primary {
    background-color: #e67e22;
    color: white;
    border: none;
}

/* Category Filter */
.categories {
    padding: 1rem 2rem;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    white-space: nowrap;
}

.category-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn.active,
.category-btn:hover {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
}

/* Product Grid (Zig-Zag) */
.product-list {
    max-width: 1000px;
    /* Reduced max-width to make things more compact */
    margin: 2rem auto;
    padding: 0 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    /* Reduced spacing */
    padding-bottom: 2rem;
    /* Inner spacing for border */
    border-bottom: 1px solid #e0e0e0;
    /* Visual separator */
    gap: 2rem;
    /* Reduced gap */
}

/* Even items: Image Left, Text Right (Default) */
/* Odd items: Image Right, Text Left (Reverse) */

.product-item:nth-child(even) {
    flex-direction: row-reverse;
}

.product-image {
    flex: 0 0 40%;
    /* Fixed width to prevent huge images */
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    /* Reduced max-height */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-info {
    flex: 1;
}

.product-title {
    font-size: 1.4rem;
    /* Reduced font size */
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.product-desc {
    font-size: 0.95rem;
    /* Slightly smaller text */
    color: #555;
    white-space: pre-line;
}

/* Print / PDF Styles */
@media print {
    @page {
        margin: 1cm;
        size: A4;
    }

    body {
        font-size: 12px;
        /* Smaller base font for print */
        background: white;
    }

    header,
    .categories,
    .controls {
        display: none !important;
    }

    .product-list {
        margin: 0;
        padding: 0;
        max-width: 100%;
        width: 100%;
    }

    .product-item {
        display: flex !important;
        /* Force flex */
        flex-direction: row !important;
        /* Always image left, text right to save space/consistency? Or keep zig-zag? Zig-zag is fine if small */
        /* Let's keep zig-zag but make it compact */
        margin-bottom: 1cm;
        padding-bottom: 1cm;
        border-bottom: 1px solid #ddd;
        break-inside: avoid;
        /* Prevent splitting */
        page-break-inside: avoid;
    }

    /* Optional: Remove zig-zag for print to save space if desired, but user didn't explicitly ask to remove it, just to fit more. 
       Actually, Zig-zag takes same vertical space. */

    .product-image {
        flex: 0 0 25%;
        /* Smaller image column */
    }

    .product-image img {
        max-height: 150px;
        /* Much smaller images for print */
        box-shadow: none;
        border-radius: 0;
    }

    .product-info {
        flex: 1;
        padding-left: 1cm;
    }

    .product-item:nth-child(even) .product-info {
        padding-left: 0;
        padding-right: 1cm;
    }

    .product-title {
        font-size: 14pt;
        margin-top: 0;
    }

    .product-desc {
        font-size: 10pt;
    }
}