/**
 * Сторінка «Заміри» (/zamiry): шапка сторінки, банер, форма заявки, попапи.
 * Усе в просторі імен .wz, щоб не зачепити решту сайту.
 *
 * Залежності: шрифт Montserrat і змінні кольорів теми Gridbox (--primary, --bg-primary)
 * Використовується в: Gridbox-сторінка «Заміри» (custom HTML), zamiry.js
 *
 * Історія змін:
 * - 2026-10-12: Створено за макетом Figma
 */

.wz {
    --wz-blue: #26489E;
    --wz-blue-hover: #193D97;
    --wz-red: #CD3434;
    --wz-text: #ABABAB;
    --wz-line: rgba(255, 255, 255, 0.15);
    --wz-ph: rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
}
.wz *,
.wz *::before,
.wz *::after {
    box-sizing: border-box;
}
/* Як на інших сторінках сайту: на всю ширину секції (макс. 1920px з header.css), поля 30px, від 1250px — 15px */
.wz-wrap {
    width: 100%;
    margin: 0;
    padding-left: 30px;
    padding-right: 30px;
}

/* ---------- Шапка сторінки ---------- */
.wz-head {
    padding-top: 30px;
    padding-bottom: 30px;
}
.wz-bc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 12px;
    line-height: 16px;
    color: var(--wz-text);
}
.wz .wz-bc a {
    color: var(--wz-text);
    text-decoration: none;
    transition: color 0.2s;
}
.wz .wz-bc a:hover {
    color: #FFFFFF;
}
.wz-bc .wz-cur {
    color: #FFFFFF;
    font-weight: 600;
}
/* body .wz ... — щоб перебити gridbox.css «.com_gridbox:not(.modal) h1/h2/p { margin: 0 }» */
body .wz .wz-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.2;
    font-weight: 600;
    color: #FFFFFF;
}
.wz-title span {
    position: relative;
    z-index: 0;
    display: inline;
    background: linear-gradient(var(--wz-blue), var(--wz-blue)) no-repeat 0 92% / 100% 8px;
}

/* ---------- Банер ---------- */
.wz-banner {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    display: flex;
    align-items: center;
    background: #3a3632 url(/images/zamiry/zamiry-banner.webp) center center / cover no-repeat;
}
.wz-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0) 70%);
}
.wz-master {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 61%;
    height: 92%;
    width: auto;
    max-width: none;
}
/* .wz .wz-banner — сильніше за gridbox.css img[width="100"][height="100"] { width: auto } */
.wz .wz-banner .wz-wm {
    position: absolute;
    z-index: 2;
    right: 30px;
    bottom: 22px;
    width: 140px;
    height: auto;
    opacity: 0.95;
}
.wz-banner-text {
    position: relative;
    z-index: 3;
    padding-top: 40px;
    padding-bottom: 40px;
}
.wz-banner-text > * {
    max-width: 540px;
}
.wz .wz-banner h2 {
    max-width: 460px;
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.3;
    font-weight: 600;
    color: #FFFFFF;
}
.wz .wz-banner p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Форма ---------- */
.wz-order {
    padding-top: 60px;
    padding-bottom: 80px;
}
body .wz .wz-h2 {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 600;
    color: #FFFFFF;
}
body .wz .wz-sub {
    margin: 0 0 40px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--wz-text);
}
.wz-sub b {
    color: #FFFFFF;
    font-weight: 600;
}
.wz-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "name   geo"
        "phone  address"
        "comment photo"
        "agree  note"
        "submit note";
    column-gap: 60px;
    row-gap: 26px;
    align-items: start;
}
.wz-geo {
    grid-area: geo;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 30px;
}
.wz-f-name { grid-area: name; }
.wz-f-phone { grid-area: phone; }
.wz-f-comment { grid-area: comment; }
.wz-f-address { grid-area: address; }
.wz-f-photo { grid-area: photo; }
.wz-agree { grid-area: agree; }
.wz-submit-row { grid-area: submit; }
.wz-note { grid-area: note; }

.wz-field {
    display: block;
    position: relative;
    margin: 0;
    cursor: text;
}
.wz-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 16px;
    color: var(--wz-text);
    transition: color 0.2s;
}
.wz .wz-input {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 6px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--wz-line);
    border-radius: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    transition: border-color 0.2s;
}
.wz .wz-input::placeholder {
    color: var(--wz-ph);
    opacity: 1;
}
.wz .wz-input:focus {
    /* gridbox.css фарбує рамку input:focus у #03ADEB з !important */
    border-color: rgba(255, 255, 255, 0.6) !important;
}
.wz .wz-phone .wz-input:focus {
    border-color: transparent !important;
}
.wz-field.wz-err .wz-input,
.wz-field.wz-err .wz-phone {
    border-bottom-color: var(--wz-red);
}
.wz-field.wz-err .wz-label {
    color: var(--wz-red);
}
.wz-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--wz-line);
    transition: border-color 0.2s;
}
.wz-phone:focus-within {
    border-bottom-color: rgba(255, 255, 255, 0.6);
}
.wz .wz-phone .wz-input {
    border-bottom: 0;
}
.wz-flag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 6px;
    font-size: 14px;
    line-height: 20px;
    color: var(--wz-text);
}
.wz-flag i {
    display: inline-block;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(#0057B7 50%, #FFD700 50%);
}

/* Фото */
.wz-file {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 12px;
    border-bottom: 1px solid var(--wz-line);
    cursor: pointer;
}
.wz-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.wz-plus {
    flex: 0 0 auto;
    position: relative;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: border-color 0.2s, background-color 0.2s;
}
.wz-plus::before,
.wz-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1px;
    background: #FFFFFF;
    transform: translate(-50%, -50%);
}
.wz-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}
.wz-file:hover .wz-plus {
    border-color: var(--wz-blue);
    background-color: var(--wz-blue);
}
.wz-file-text {
    font-size: 14px;
    line-height: 20px;
    color: var(--wz-ph);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wz-file.wz-has-file .wz-file-text {
    color: #FFFFFF;
}
.wz-file.wz-has-file .wz-plus::after {
    transform: translate(-50%, -50%) rotate(45deg);
}
.wz-file.wz-has-file .wz-plus::before {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.wz-field.wz-err .wz-file {
    border-bottom-color: var(--wz-red);
}

/* Згода */
.wz-agree {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    color: #FFFFFF;
    cursor: pointer;
}
.wz-agree input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.wz-check {
    flex: 0 0 auto;
    position: relative;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: border-color 0.2s;
}
.wz-check::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--wz-blue);
    transform: scale(0);
    transition: transform 0.2s;
}
.wz-agree input:checked + .wz-check {
    border-color: var(--wz-blue);
}
.wz-agree input:checked + .wz-check::after {
    transform: scale(1);
}
.wz-agree input:focus-visible + .wz-check {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}
.wz-agree.wz-err .wz-check {
    border-color: var(--wz-red);
}
.wz .wz-agree a {
    color: #FFFFFF;
    font-weight: 600;
    text-decoration: underline;
}

/* Кнопки */
.wz .wz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    height: 40px;
    margin: 0;
    padding: 0 30px;
    border: 1px solid var(--wz-blue);
    border-radius: 20px;
    background: var(--wz-blue);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}
.wz .wz-btn:hover {
    background: var(--wz-blue-hover);
    border-color: var(--wz-blue-hover);
}
.wz .wz-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}
.wz .wz-btn-ghost {
    background: transparent;
    border-color: #1B1B1D;
    color: #1B1B1D;
}
.wz .wz-btn-ghost:hover {
    background: #1B1B1D;
    border-color: #1B1B1D;
    color: #FFFFFF;
}

/* Примітка */
.wz-note {
    display: flex;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #FFFFFF;
}
.wz-note::before {
    content: "i";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--wz-blue);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}
/* Пастка для ботів */
.wz-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ---------- Попапи ---------- */
.wz-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}
.wz-modal.wz-open {
    display: flex;
}
.wz-box {
    position: relative;
    width: 100%;
    max-width: 780px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 40px 40px;
    background: #FFFFFF;
    color: #1B1B1D;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.wz-box-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    font-size: 11px;
    line-height: 14px;
}
.wz-box-logo {
    width: 86px;
    height: auto;
}
.wz .wz-close {
    justify-self: end;
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.wz-close::before,
.wz-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 1px;
    background: #1B1B1D;
    transform: translate(-50%, -50%) rotate(45deg);
}
.wz-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.wz .wz-box h3 {
    margin: 0 0 22px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 300;
    color: #1B1B1D;
}
.wz .wz-box p,
.wz .wz-box li {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #1B1B1D;
}
.wz .wz-box .wz-muted {
    color: #6E6E73;
}
.wz .wz-box p + p {
    margin-top: 12px;
}
.wz .wz-box .wz-dt {
    margin: 0 0 4px;
    font-weight: 600;
}
.wz .wz-box ul {
    margin: 0 0 22px;
    padding-left: 18px;
}
.wz .wz-box ul li {
    list-style: disc;
    color: #6E6E73;
}
.wz-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 40px;
}
.wz-actions .wz-btn {
    width: 100%;
}
.wz-actions-one {
    grid-template-columns: minmax(0, 340px);
    justify-content: center;
}
/* Малий попап з повідомленням */
.wz-box-sm {
    max-width: 600px;
    padding: 44px 50px;
    text-align: center;
}
.wz-box-sm .wz-close {
    position: absolute;
    top: 14px;
    right: 14px;
}
body.wz-lock {
    overflow: hidden;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1250px) {
    .wz-wrap {
        padding-left: 15px;
        padding-right: 15px;
    }
    .wz .wz-banner .wz-wm {
        right: 15px;
    }
    .wz-form {
        column-gap: 40px;
    }
}
@media (max-width: 1024px) {
    .wz .wz-title {
        font-size: 30px;
    }
    .wz-master {
        left: 56%;
    }
}
@media (max-width: 800px) {
    .wz-form {
        grid-template-areas:
            "name    geo1"
            "phone   geo2"
            "comment address"
            "photo   photo"
            "agree   agree"
            "submit  note";
        column-gap: 30px;
    }
    .wz-geo {
        display: contents;
    }
    .wz-f-region { grid-area: geo1; }
    .wz-f-city { grid-area: geo2; }
    .wz-banner {
        min-height: 340px;
    }
    .wz-banner-text > * {
        max-width: 50%;
    }
    .wz .wz-banner h2 {
        font-size: 24px;
    }
    .wz-master {
        left: 52%;
        height: 88%;
    }
    .wz .wz-banner .wz-wm {
        width: 110px;
    }
    .wz-box {
        max-width: 600px;
        padding: 24px 30px 32px;
    }
}
@media (max-width: 460px) {
    .wz-head {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    .wz .wz-title {
        font-size: 20px;
    }
    .wz-title span {
        background-size: 100% 5px;
    }
    .wz-banner {
        min-height: 300px;
        align-items: flex-start;
    }
    .wz-banner::before {
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.1) 100%);
    }
    .wz-banner-text {
        padding-top: 30px;
    }
    .wz-banner-text > * {
        max-width: 72%;
    }
    .wz .wz-banner h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    .wz .wz-banner p {
        font-size: 11px;
    }
    .wz-master {
        left: auto;
        right: -40px;
        height: 72%;
    }
    .wz .wz-banner .wz-wm {
        width: 90px;
        bottom: 14px;
    }
    .wz-order {
        padding-top: 40px;
        padding-bottom: 60px;
    }
    .wz .wz-h2 {
        font-size: 20px;
    }
    .wz .wz-sub {
        margin-bottom: 30px;
    }
    .wz-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "phone"
            "geo1"
            "geo2"
            "address"
            "comment"
            "photo"
            "agree"
            "submit"
            "note";
        row-gap: 22px;
    }
    .wz-submit-row .wz-btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        display: flex;
    }
    .wz-file-text {
        white-space: normal;
        font-size: 12px;
    }
    .wz-box {
        padding: 20px 20px 24px;
    }
    .wz-box-top {
        grid-template-columns: 1fr auto;
        margin-bottom: 20px;
    }
    .wz-box-top .wz-box-logo {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }
    .wz-box-top .wz-close {
        grid-row: 1;
        grid-column: 2;
    }
    .wz-box-top .wz-num {
        grid-row: 2;
        grid-column: 1 / -1;
    }
    .wz .wz-box h3 {
        font-size: 20px;
    }
    .wz-actions {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 28px;
    }
    .wz-box-sm {
        padding: 36px 30px;
    }
}

/* ---------- Списки «Область» / «Місто» (2026-10-13) ---------- */
/* .wz .wz-input задає display: block — без цього атрибут hidden не ховав би поле */
.wz [hidden] {
    display: none !important;
}

.wz .wz-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 24px;
    cursor: pointer;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FFFFFF' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 2px top 13px;
}

/* Поки нічого не вибрано — колір як у placeholder */
.wz .wz-select:invalid {
    color: var(--wz-ph);
}

.wz .wz-select option {
    color: #1D1D1B;
    background: #FFFFFF;
}

.wz .wz-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Підказки населених пунктів (Закарпаття) */
.wz .wz-ac {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 280px;
    overflow-y: auto;
    margin: 4px 0 0;
    padding: 6px 0;
    list-style: none;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.wz .wz-ac li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    padding: 9px 14px;
    color: #1D1D1B;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer;
}

.wz .wz-ac li b {
    font-weight: 500;
}

.wz .wz-ac li span {
    flex: 0 0 auto;
    color: #8A8A8A;
    font-size: 12px;
}

.wz .wz-ac li:hover,
.wz .wz-ac li.wz-ac-on {
    background: #EEF2FB;
}

.wz .wz-ac li.wz-ac-none {
    color: #8A8A8A;
    cursor: default;
    background: none;
}

@media (max-width: 460px) {
    .wz .wz-ac li {
        flex-direction: column;
        gap: 2px;
    }
}
