/* =========================================================
   КАТАЛОГ МОДЕЛЕЙ, ВОРОТА ПО РАЗМЕРАМ, ГОТОВЫЕ РАБОТЫ
========================================================= */

/* Фильтры */

/* Разделы: ворота, двери, навесы, качели, перила */
.kind-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.kind-tabs a {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: 0.2s;
}

.kind-tabs a:hover { border-color: var(--gold-soft); color: var(--gold); }

.kind-tabs a.active {
    background: var(--gold-grad);
    border-color: var(--gold);
    color: #111;
}

.empty .btn { margin-top: 18px; }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}

.filter {
    height: 60px;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 14px;
    transition: background 0.25s, color 0.25s, transform 0.25s;
}

.filter:hover {
    background: rgba(234, 184, 79, 0.08);
    transform: translateY(-2px);
}

.filter.active {
    background: var(--gold-grad);
    color: #111;
    border-color: var(--gold);
}

.filter-icon {
    color: var(--gold);
    font-size: 19px;
}

.filter.active .filter-icon {
    color: #111;
}


/* Сетка карточек */

.models-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.model-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #071015;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.model-card[hidden] {
    display: none;
}

.model-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-soft);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.40);
}

.model-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1.25 / 1;
    overflow: hidden;
    background: #101010;
}

.model-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.model-card:hover .model-image img {
    transform: scale(1.04);
}

.model-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #111;
    background: var(--gold-grad);
}

.model-info {
    flex: 1;
    min-height: 100px;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, #081116, #050b0f);
}

.model-info h2 {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
}

.model-info p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 14px;
    line-height: 1.3;
}

.model-price {
    margin-top: 10px;
    color: var(--gold);
    font-weight: 700;
    font-size: 15px;
}

.model-card:hover .round-arrow {
    background: var(--gold);
    color: #111;
    transform: translateX(3px);
}


/* Ворота по размерам */

.design-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.design-head h2 {
    font-size: 26px;
}

.size-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.size-filter label {
    color: var(--muted);
    font-size: 14px;
    margin-right: 4px;
}

.chip {
    height: 42px;
    padding: 0 18px;
    border-radius: 21px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.chip:hover {
    border-color: var(--gold-soft);
}

.chip.active {
    background: var(--gold-grad);
    color: #111;
    border-color: var(--gold);
}

.size-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}


/* Готовые работы */

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.work-card .model-image {
    aspect-ratio: 1.3 / 1;
}

.work-zoom {
    display: block;
    padding: 0;
    border: 0;
    cursor: zoom-in;
}

.work-video {
    cursor: pointer;
}

.work-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.work-play {
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    transform: translate(-50%, -50%);
    transition: transform 0.2s;
}

.work-video:hover .work-play {
    transform: translate(-50%, -50%) scale(1.08);
}

.work-zoom-icon {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(5, 11, 15, 0.7);
    color: var(--gold);
    font-size: 18px;
}

.work-info {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

/* «Хочу такие же» + WhatsApp в первом ряду, «Посчитать стоимость» — строкой ниже */
.work-actions {
    display: grid;
    grid-template-columns: 1fr 44px;
    grid-auto-flow: row dense;
    gap: 8px;
}

.work-actions .btn {
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
}

.work-actions .work-calc,
.work-actions > :only-child {
    grid-column: 1 / -1;
}

.work-actions .work-wa {
    padding: 0;
}

.work-wa svg {
    width: 20px;
    height: 20px;
    fill: #25d366;
}

/* Свой размер на странице модели */

.custom-size {
    margin-top: 50px;
    padding: 30px 36px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px 40px;
    align-items: center;
    scroll-margin-top: 110px;
}

/* Тот же блок в каталоге — над карточками моделей */
.catalog-size {
    margin: 0 0 34px;
}

.model-badge[hidden],
.model-price[hidden] {
    display: none;
}

.custom-size h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.custom-size-text p {
    max-width: 520px;
    line-height: 1.5;
}

.custom-size-fields {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.custom-size-fields label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.custom-size-fields input {
    width: 120px;
    height: 54px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: rgba(5, 11, 15, 0.7);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.custom-size-fields input:focus {
    outline: none;
    border-color: var(--gold);
}

.custom-size-x {
    height: 54px;
    display: flex;
    align-items: center;
    color: var(--gold);
    font-size: 20px;
}

.custom-size-result {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 15px;
}

.custom-size-result strong {
    color: var(--gold);
    font-size: 18px;
}

.custom-size-result .error {
    color: var(--error);
}

/* Адаптив */

@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .filters {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .filter {
        height: 52px;
        font-size: 13px;
        gap: 8px;
    }

    .models-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .model-info {
        min-height: 90px;
        padding: 14px 12px;
    }

    .model-info h2 {
        font-size: 14px;
    }

    .model-info p {
        font-size: 12px;
    }

    .model-price {
        font-size: 13px;
    }

    .model-info .round-arrow {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

}

@media (max-width: 900px) {
    .custom-size {
        grid-template-columns: 1fr;
        padding: 24px 20px;
    }

    .custom-size-fields {
        flex-wrap: wrap;
    }

    .custom-size-fields label {
        flex: 1;
    }

    .custom-size-fields input {
        width: 100%;
    }

    .custom-size-fields .btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .models-grid {
        grid-template-columns: 1fr;
    }
}
