.portfolio-list-container {
    display: flex;
}
.portfolio-list {
    display: flex;
    flex-direction: column;
    padding: 0 0.4rem;
    width: 100%;
    margin: 0 auto;
    gap: 2rem;
}
.portfolio-list-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.search-wrapper {
    position: relative;
    height: 40px;
    width: 100%;
}
.search-wrapper input {
    width: 100%;
    font-size: 0.8rem;
    border-radius: 10px;
    padding: 0.6rem 0.8rem 0.6rem 2.4rem;
    background-color: var(--bg-secondary);
    color: white;
    border: none;
    outline: 1px solid var(--line);
}
.search-wrapper input:focus {
    outline-color: var(--primary-color);
}
.search-wrapper i {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-60%);
    color: var(--font-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}
.portfolio-list-header-filter {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 1rem;
}
.portfolio-list-header-filter button {
    background-color: unset;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--line-secondary);
    cursor: pointer;
}
.portfolio-list-header-filter button:hover {
    background-color: var(--bg-secondary);
}
.portfolio-list-header-filter .active {
    border: 1px solid var(--bg-secondary);
    background-color: var(--bg-secondary);
}
.portfolio-list-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
    grid-auto-rows: 180px;
    align-items: stretch;
}
.portfolio-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
    cursor: pointer;
}
.portfolio-card:focus {
    box-shadow: 0 0 0 3px var(--primary-color, #26bbff);
}
.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.portfolio-card:hover img {
    transform: scale(1.04);
}
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    pointer-events: none;
    text-align: center;
    white-space: pre-line;
    padding: 1rem;
    max-width: 100%;
}
.portfolio-card.wide {
    grid-column: span 2;
}
.portfolio-card.tall {
    grid-row: span 2;
}
@media (max-width: 900px) {
    .portfolio-card.wide,
    .portfolio-card.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    .portfolio-list-body {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
}
@media (max-width: 600px) {
    .portfolio-list-body {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
    }
}
@media (min-width: 568px) {
    .portfolio-list {
        padding: 0;
        width: 90%;
    }
    .card-price-old {
        display: flex;
    }
    .portfolio-list-body {
        gap: 0.6rem;
    }
}
@media (min-width: 768px) {
}
@media (min-width: 992px) {
    .portfolio-list-header {
        flex-direction: row-reverse;
    }
    .portfolio-list-header-filter {
        width: 100%;
    }
    .search-wrapper {
        max-width: 400px;
    }
}
@media (min-width: 1200px) {
}
@media (min-width: 1600px) {
    .portfolio-list {
        width: 80%;
    }
}
.portfolio-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.portfolio-modal {
    background: #18181c;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 1rem;
    display: flex;
    flex-direction: row;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 70vh;
    position: relative;
    animation: modalIn 0.2s;
}
@keyframes modalIn {
    from {
        transform: scale(0.96) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
.modal-image {
    flex: 3;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-height: 100%;
    overflow: hidden;
}
.modal-image img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}
.modal-content {
    flex: 1;
    padding: 0 0 0 1rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    max-height: 100%;
}
.modal-content h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: bold;
}
.modal-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--font-secondary);
}
.modal-close {
    position: absolute;
    top: 0rem;
    right: -2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--primary-color, #26bbff);
}
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 0.4rem;
}
.modal-tags span {
    background-color: var(--line);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}
.modal-content .modal-actions {
    display: flex;
    flex-direction: row;
    position: sticky;
    bottom: 0;
    background: #18181c;
    z-index: 2;
}
.modal-content button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 0 1.6rem;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    border: 2px solid var(--line);
    color: white;
    background-color: unset;
    transition: all 0.2s ease;
    cursor: pointer;
}
.modal-content button:hover {
    background-color: white;
    color: black;
}
.modal-description {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}
.modal-description::-webkit-scrollbar {
    width: 6px;
}
.modal-description::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
@media (max-width: 700px) {
    .portfolio-modal {
        flex-direction: column;
        max-width: 98vw;
    }
    .modal-image img {
        max-width: 100vw;
        max-height: 40vh;
    }
    .modal-content {
        padding: 1.2rem 1rem;
    }
}