.catalog-section {
    padding: 40px 4%;
    background: #fafafa;
    font-family: 'Segoe UI', sans-serif;
}

/* Layout */
.catalog-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.filter-sidebar {
    flex: 0 0 240px;
    min-width: 200px;
    max-width: 280px;
}

.product-container {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

@media (max-width: 900px) {
    .catalog-layout {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
}

/* Sidebar */
.filter-sidebar {
    flex: 0 0 240px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-select select,
.custom-input {
    width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.3s ease;
}

.custom-select select:hover,
.custom-select select:focus,
.custom-input:hover,
.custom-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Buttons */
.btn-filter,
.clear-filters {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-filter {
    background: linear-gradient(90deg, #e6212b, #014fbb);
    color: white;
    border: none;
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.2);
}

.clear-filters {
    background: none;
    border: none;
    color: #014fbb;
    margin-top: 8px;
}

.clear-filters:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Product Grid */
.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 220px));
    gap: 40px;
    justify-content: center;
}

.product-card{
    max-width: 220px;
}

@media (max-width: 578px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* force exactly 2 columns on mobile */
        gap: 10px;
        justify-content: start;
        width: 100%; /* allow it to stretch */
        margin: 0 auto;
    }

    .product-card {
        padding: 8px;
        max-width: 100%; /* fill the cell */
    }

    .product-card img {
        border-radius: 4px;
        margin-bottom: 6px;
    }

    .product-card h3 {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .product-card .short-desc {
        font-size: 0.7rem;
        line-height: 1.1;
        min-height: 1.8em;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }
}

.product-card {
    background: #fff;
    padding: 4px;
    font-size: 0.8rem;
    border-radius: 3px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.product-card:hover {
    transform: translateY(-3px);
    cursor: pointer;
}

.product-card img {
    max-width: 100%;
    min-height: 210px;
    object-fit: contain;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.product-title {
    font-size: 0.8rem;
    color: #000000;
    min-height: 2.2em;
    line-height: 1.2em;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Product Button (if needed) */
.product-card button {
    padding: 10px 14px;
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.product-card button:hover {
    background: #0d47a1;
}

/* Responsive */
@media (max-width: 768px) {
    .catalog-layout {
        flex-direction: column;
    }

    .filter-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}


#productForm {
    font-family: 'Segoe UI', sans-serif;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

#productForm .form-group {
    margin-bottom: 16px;
}

#productForm label.icon-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    gap: 6px;
    margin-bottom: 6px;
    color: #333;
}

#productForm input[type="text"],
#productForm input[type="url"],
#productForm input[type="file"],
select,
#productForm textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out;
}

#productForm input[type="file"] {
    padding: 8px;
    background-color: #f9f9f9;
}

#productForm textarea {
    resize: vertical;
}

#productForm input:focus,
#productForm textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#productForm button[type="submit"] {
    padding: 10px 16px;
    background-color: #1565c0;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#productForm button[type="submit"]:hover {
    background-color: #0d47a1;
}

/* Filter header visible only on mobile */
.filter-toggle-header {
    display: none;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    background: #efefef;
    color: rgb(114, 114, 114);
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 3px;
    margin-bottom: 15px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .filter-toggle-header {
        display: flex;
    }

    .filter-sidebar {
        display: none;
    }

    .filter-sidebar.show {
        display: block;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.inactive {
    opacity: 0.5;
}

/* CSS for Button */
.button {
  position: relative;
  width: 190px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border: 1px solid #00398a;
  background-color: #014fbb;
}

.button, .button__icon, .button__text {
  transition: all 0.3s;
}

.button .button__text {
  transform: translateX(30px);
  color: #fff;
  font-weight: 600;
}

.button .button__icon {
  position: absolute;
  transform: translateX(149px);
  height: 100%;
  width: 39px;
  background-color: #00398a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button .svg {
  width: 30px;
  stroke: #fff;
}

.button:hover {
  background: #00398a;
}

.button:hover .button__text {
  color: transparent;
}

.button:hover .button__icon {
  width: 190px;
  transform: translateX(0);
}

.button:active .button__icon {
  background-color: #014fbb;
}

.button:active {
  border: 1px solid #014fbb;
}

/* Pagination */
#pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: #014fbb;
    border: 1px solid #014fbb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.page-btn:hover {
    background: #014fbb;
    color: #fff;
}

.page-btn.active {
    background: #014fbb;
    color: #fff;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
    #pagination {
        gap: 6px;
        margin-top: 20px;
    }

    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}