.portfolio-filter-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: red;
    color: #fff;
    border: none;
    padding: 0px 24px;
    border-radius: 30px;
    z-index: 9999;
    cursor: pointer;
}

#portfolio-filter-container {
    position: fixed;
    right: -100%;
    top: 0;
    width: 50%;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}
.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.portfolio-item {
  width: 100%;
}
.portfolio-filter-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,.8); /* Màu mờ */
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* Khi active */
.portfolio-filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .portfolio-item {
    width: calc(50% - 10px); /* 2 item / hàng trên mobile */
  }
}

@media (min-width: 1024px) {
  .portfolio-item {
    width: calc(25% - 15px); /* 4 item / hàng trên desktop */
  }
}

#portfolio-filter-container.active {
    right: 0 !important;
}

.col-inner {
    overflow: visible !important;
    position: relative;
    /* giữ layout */
}

.portfolio-filter-inner {
    padding: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    float: right;
    cursor: pointer;
    margin: 0;
}

#portfolio-results {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.portfolio-item h3 {
    margin: 5px 0;
    color: #333;
}

.portfolio-filter-inner label,
.portfolio-filter-inner h3 {
    color: #333 !important;
    font-size: 25px;
}

.load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    margin: auto;
    width: 100%;
}

#load-more-button {
    padding: 10px 20px;
    background-color: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}


.portfolio-filter-category {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.filter-cat-item {
    width: calc(20% - 5px);
    cursor: pointer;
    text-align: center;
}

.filter-cat-thumb {
    border: 2px solid transparent;
    padding: 2px;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 100%;
}

/* Làm ảnh vuông đều */
.filter-cat-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* Nếu dùng theme không hỗ trợ aspect-ratio (cũ), fallback */
@supports not (aspect-ratio: 1 / 1) {
    .filter-cat-thumb img {
        height: 0;
        padding-top: 100%; /* fallback aspect ratio 1:1 */
        object-fit: cover;
        position: relative;
    }
}

.filter-cat-thumb.selected {
    border-color: #222;
    background-color: #f0f0f0;
}

.filter-cat-thumb span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: left;
}


#reset-filter {
    color: #333;
    border: 1px solid #333;
    margin-top: 15px;
}

.not_result {
    text-align: center;
    margin: auto;
    font-size: 18px;
}

#portfolio-results h4 {
    padding: 10px 0;
    font-weight: normal;
}

.collection, .country {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
}

.collection label, .country label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
}

.collection input, .country input {
    margin-bottom: 0;
}

.grid-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 40px auto;
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  gap: 20px;
}

.filter-count {
  font-size: 13px;
  color: #888;
}

.filter-reset-btn {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-transform: uppercase;
}

.filter-reset-btn .icon {
  font-size: 13px;
}
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 20px;
  gap: 12px;
  flex-wrap: nowrap; /* 👈 Ngăn chặn bị xuống dòng */
  width: 100%;
}

.filter-title {
  font-size: 30px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #222;
  white-space: nowrap; /* 👈 Ngăn chặn wrap Filters 0 */
}

.filter-count {
  font-size: 13px;
  color: #aaa;
  white-space: nowrap;
}

.filter-reset-btn {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 9px;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0; /* 👈 Ngăn nó co nhỏ nếu không đủ chỗ */
}

@media (max-width: 600px) {
    .collection, .country {
        grid-template-columns: 1fr;
    }
    #portfolio-filter-container {
        width: 100%;
    }
}