.interior-projects {
    background: #fff;
    padding: 60px 20px;
    transition: background .3s, color .3s
}

.interior-projects.dark {
    background: #121212;
    color: #fff
}

.interior-projects * {
    box-sizing: border-box
}

.interior-projects .container {
    max-width: 1280px;
    margin: auto
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px
}

.section-header p {
    max-width: 600px
}

.interior-projects.dark .section-header p {
    color: #9ca3af
}

.filters {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filters button {
    border-radius: 5px;
    border: 1px solid #2c3e50;
    cursor: pointer;
    font-weight: 500;
    height: 40px;
    width: 100%;
    white-space: nowrap;        /* không xuống dòng */
    overflow: hidden;           /* ẩn phần dư */
    text-overflow: ellipsis;    /* hiện ... */
}

.filters button:hover {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.filters button.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.filters button,
.card-content button {
    margin-bottom: 0;
}

.projects-grid {
    margin-top: 48px;
    margin-bottom: 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px
}

.project-card {
    background: #f6f7f8;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: .3s;
    cursor: pointer;
}

.interior-projects.dark .project-card {
    background: #1e1e1e
}

/* zoom ảnh */
.image-wrap {
    overflow: hidden;
}

.image-wrap img {
    transition: transform .6s ease;
}

.project-card:hover .image-wrap img {
    transform: scale(1.12);
}

.project-card {
    position: relative;
}

/* khoét góc */
.project-card::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 64px;
    height: 64px;
    background: #fff;
    border-top-left-radius: 32px;
}

/* dark mode */
.interior-projects.dark .project-card::after {
    background: #121212;
}

/* đảm bảo nút nằm trên */
.arrow-btn {
    z-index: 2;
}

/* hover card → arrow đổi màu */
.project-card:hover .arrow-btn {
    background: #2c3e50;
    color: #fff;
}


.image-wrap {
    padding: 16px;
    height: 280px;
    overflow: hidden;
    border-radius: 20px;
}

.image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: transform .7s cubic-bezier(.19, 1, .22, 1);
    will-change: transform;
}

.card-content {
    padding: 24px;
    padding-top: 6px;
    position: relative;
    width: 80%;
    
}

.index {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #2c3e50;
}

.card-content h3 {
    font-size: 16px;
    margin-top: 8px;
    color: #2c3e50;
}

.arrow-btn {
    position: absolute;
    right: 0px;
    bottom: 2px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #f6f7f8;
    color: #9ca3af;
    cursor: pointer;
    transition: .9s;
    display: flex;
    align-items: center;
    margin: 0;
    margin-bottom: 0;
    justify-content: center;
}

.arrow-btn .material-icons {
    font-size: 20px;
}

.filters button,
.card-content button {
    margin-right: 0;
}

.interior-projects.dark .arrow-btn {
    background: #374151;
    color: #d1d5db
}

.dark-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #1e6f42;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .25);
    z-index: 999
}

.image-wrap {
    padding: 16px;
    height: 280px;
    border-radius: 20px;
}

/* lớp khóa vùng zoom */
.image-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

/* ảnh */
.image-inner img {
    transform: scale(1) translateZ(0);
    transition:
        transform .8s cubic-bezier(.19, 1, .22, 1),
        filter .8s cubic-bezier(.19, 1, .22, 1);
    will-change: transform;
}

/* hover */
.project-card:hover .image-inner img {
    transform: scale(1.15) translateY(-3%);
    filter: brightness(1.05) contrast(1.05);
}

.btn-view-more-du-an {
    background-color: #d7f4f9 !important;
    box-shadow: 3px 3px 0 #4ca1af;
    display: inline-block;
    margin-top: 10px;
    padding: 8px 30px;
    font-size: 16px;
    border-radius: 5px;
    color: #2c3e50;
    background: #2C3E50;
    text-decoration: none;
    transition: .2s ease;
}

.btn-view-more-du-an:hover {
    transform: translate(2px, 2px);
    box-shadow:
        2px 2px 0 #8fd0da;
}

.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

/* grid phải có position */
.projects-grid {
    position: relative;
    min-height: 300px; /* đảm bảo có chiều cao */
}

/* overlay phủ toàn grid */
.duan-loading-overlay {
    position: absolute;
    inset: 0; /* top right bottom left = 0 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff; /* hoặc rgba(255,255,255,.6) nếu muốn mờ */
    z-index: 10;
}

/* ===== EDGE DOT LOADING ===== */
.edge-dots {
    position: relative;
    width: 20px;
    height: 20px;
}

.edge-dots span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #2c3e50;
    border-radius: 50%;
    transform-origin: -10px 0;
    animation: edgeOrbit 1.6s cubic-bezier(.4,0,.2,1) infinite;
    opacity: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.edge-dots span:nth-child(1) { animation-delay: 0s; }
.edge-dots span:nth-child(2) { animation-delay: .15s; }
.edge-dots span:nth-child(3) { animation-delay: .3s; }
.edge-dots span:nth-child(4) { animation-delay: .45s; }
.edge-dots span:nth-child(5) { animation-delay: .6s; }
.edge-dots span:nth-child(6) { animation-delay: .75s; }

@keyframes edgeOrbit {
    0% {
        transform: rotate(0deg) translateX(14px);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    75% {
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) translateX(14px);
        opacity: 0;
    }
}


@media (max-width: 768px) {
    .filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .filters button {
        width: 100%;
        text-align: center;
        height: 40px;
        font-size: 8px;
        line-height: 12px;
            white-space: unset;
    }

    .interior-projects .container {
        padding: 0;
    }

    .section-header h2 {
        font-size: 26px;
    }

    .interior-projects {
        padding: 30px 15px;
    }

    .section-header h2 {
        margin-bottom: 6px;
    }

    .section-header p {
        margin-bottom: 10px;
    }

    .filters {
        margin-top: 0;
    }

    .projects-grid {
        margin-top: 20px;
        margin-bottom: 20px;
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
    }

    .image-wrap {
        height: 120px;
        padding: 8px;
    }

    .card-content h3 {
        font-size: 12px;
        margin-top: 4px;
    }

    .card-content {
        padding: 10px;
        padding-top: 5px;
        width: 100%;
    }

    .arrow-btn {
        display: none;
    }

    .project-card::after {
        display: none;
    }

    .btn-view-more-du-an {
        padding: 6px 20px;
    }

}