html, body {
    box-sizing: border-box;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #313638;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Layout Wrapper - Row layout with sidebar */
.layout {
    display: flex;
    flex-direction: row;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    box-sizing: border-box;
    gap: 20px;
}

/* Filter Section - Horizontal above products */
.filter-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
}

.filter-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* Horizontal Filter Form */
.horizontal-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.horizontal-filter-form .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.horizontal-filter-form .filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.horizontal-filter-form .filter-group input,
.horizontal-filter-form .filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.horizontal-filter-form .filter-group input:focus,
.horizontal-filter-form .filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Results Info Bar */
.results-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.results-info-bar .results-count {
    font-size: 0.95rem;
    color: #555;
}

.results-info-bar .cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.results-info-bar .cart-link:hover {
    color: #764ba2;
}

.results-info-bar .cart-link svg {
    width: 18px;
    height: 18px;
}

/* Articles Container - Centered Grid */
.articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
}

/* Individual Article Card */
.article {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.article:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.article h1 {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.article h4 {
    margin: 10px 0;
    color: #667eea;
    font-size: 1.1rem;
}

/* Cart Button inside Article */
.cart_button {
    cursor: pointer;
    margin: 5px auto 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Filter Button Styles */
.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.filter-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filter-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.filter-btn-secondary {
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
}

.filter-btn-secondary:hover {
    background: #e0e0e0;
}

/* Left sidebar */
.lad {
    width: 220px;
    min-width: 220px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lad .sidebar-filter-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lad .sidebar-filter-form h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.lad .sidebar-filter-form .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lad .sidebar-filter-form .filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.lad .sidebar-filter-form .filter-group input,
.lad .sidebar-filter-form .filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.lad .sidebar-filter-form .filter-group input:focus,
.lad .sidebar-filter-form .filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lad .sidebar-filter-form .filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lad .sidebar-filter-form .filter-btn {
    width: 100%;
    text-align: center;
}

.rad {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .layout {
        max-width: 1000px;
    }

    .articles {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .layout {
        padding: 15px 20px;
        max-width: 800px;
    }

    .articles {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .horizontal-filter-form .filter-group {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        padding: 1rem;
    }

    .lad {
        display: none;
    }

    .filter-section {
        padding: 15px;
    }

    .horizontal-filter-form {
        flex-direction: column;
        gap: 12px;
    }

    .horizontal-filter-form .filter-group {
        max-width: 100%;
        min-width: 100%;
    }

    .filter-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .filter-buttons .filter-btn {
        flex: 1;
    }

    .articles {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .results-info-bar {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .articles {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .article {
        padding: 1rem;
    }

    .article h1 {
        font-size: 0.9rem;
    }

    .cart_button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .articles {
        grid-template-columns: 1fr;
    }
}
