:root {
    --orange: #ff4b0b;
    --orange-dark: #e94106;
    --ink: #101116;
    --muted: #596174;
    --border: #dfe3eb;
    --field: #fff;
    --soft: #fff0e8;
    --shadow: 0 8px 28px rgba(20, 28, 45, .06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #f5f6f8;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

button, input, select {
    font: inherit;
}

.topbar {
    min-height: 54px;
    background: #171717;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px max(20px, calc((100% - 1180px) / 2));
}

.brand {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -.8px;
    line-height: 1;
}

    .brand span {
        color: var(--orange);
    }

    .brand small {
        display: block;
        font-size: 7px;
        letter-spacing: 1.5px;
        text-align: center;
    }

.track-link {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

    .track-link .pin {
        color: var(--orange);
        margin-right: 8px;
        display: inline-flex;
        vertical-align: middle;
    }

        .track-link .pin svg {
            width: 20px;
            height: 20px;
        }

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 20px 28px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 4px 16px;
}

    .hero h1 {
        margin: 0 0 6px;
        font-size: clamp(28px, 4vw, 43px);
        line-height: 1.08;
        letter-spacing: -1.7px;
        font-weight: 850;
    }

        .hero h1 span {
            color: var(--orange);
        }

    .hero p {
        margin: 0;
        color: var(--muted);
        font-size: clamp(14px, 1.7vw, 17px);
    }

.device-art {
    width: min(31%, 290px);
    min-width: 160px;
    height: auto;
    object-fit: contain;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 14px 15px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.title-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    font-size: 18px;
}

.field {
    margin-bottom: 8px;
    min-width: 0;
}

    .field:last-child {
        margin-bottom: 0;
    }

label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #252a36;
}

.required {
    color: #e52d1b;
}

.control-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #626b7d;
    font-size: 16px;
    pointer-events: none;
    width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

input, select {
    display: block;
    width: 100%;
    min-height: 42px;
    border: 1px solid #cfd5e0;
    border-radius: 5px;
    background: var(--field);
    color: #252a36;
    padding: 9px 12px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(20,30,50,.03);
}

.has-icon input, .has-icon select {
    padding-left: 45px;
}

input::placeholder {
    color: #8790a3;
}

input:focus, select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,75,11,.12);
}

input.is-invalid, select.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
}

.is-invalid + .invalid-feedback {
    display: block;
}

.phone-row {
    display: grid;
    grid-template-columns: 122px 1fr;
    gap: 7px;
}

.country-code {
    padding-left: 36px !important;
}

.delivery {
    grid-column: 1 / -1;
    padding: 0;
    overflow: hidden;
}

.delivery-inner {
    padding: 3px 15px 12px;
}

.delivery .panel-title {
    margin: 0;
    padding: 0 0 5px;
}

.delivery-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.delivery-option {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #cfd5e0;
    border-radius: 5px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
}

    .delivery-option.selected {
        border: 1.5px solid var(--orange);
        background: #fff8f4;
    }

    .delivery-option .delivery-icon {
        color: var(--ink);
        width: 26px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 26px;
    }

.field-icon svg, .delivery-icon svg, .title-icon svg, .help svg, .track-link svg, .notice svg {
    width: 20px;
    height: 20px;
    display: block;
}

.title-icon svg {
    width: 21px;
    height: 21px;
}

.device-art {
    display: block;
}

.delivery-option.selected .delivery-icon {
    color: var(--orange);
}

.delivery-option strong {
    font-size: 12px;
    flex: 1;
}

.delivery-option input {
    width: 19px;
    height: 19px;
    min-height: auto;
    accent-color: var(--orange);
    margin: 0;
}

.notice {
    background: var(--soft);
    color: #6d5a50;
    padding: 7px 10px;
    border-radius: 5px;
    margin-top: 7px;
    font-size: 11px;
}

    .notice b {
        color: var(--orange);
        margin-right: 7px;
        display: inline-flex;
        vertical-align: middle;
    }

        .notice b svg {
            width: 18px;
            height: 18px;
        }

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.help {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    color: #202638;
    font-size: 12px;
}

    .help .headset {
        display: inline-flex;
        align-items: center;
    }

        .help .headset svg {
            width: 22px;
            height: 22px;
        }

    .help a {
        color: inherit;
        text-decoration: none;
        font-weight: 700;
    }

.confirm-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 11px;
    color: #343b4d;
}

    .confirm input {
        width: 17px;
        height: 17px;
        min-height: auto;
        accent-color: var(--orange);
    }

.submit-btn {
    border: 0;
    background: var(--orange);
    color: white;
    border-radius: 6px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(255,75,11,.18);
}

    .submit-btn:hover {
        background: var(--orange-dark);
    }

    .submit-btn:disabled {
        opacity: .65;
        cursor: wait;
    }

.status-message {
    display: none;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 6px;
}

    .status-message.success {
        display: block;
        color: #155724;
        background: #d4edda;
    }

    .status-message.error {
        display: block;
        color: #721c24;
        background: #f8d7da;
    }

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 7px;
}

.region-district-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

    .region-district-row .field {
        min-width: 0;
        margin-bottom: 0;
    }

    .region-district-row .control-wrap,
    .region-district-row select {
        width: 100%;
    }

@media (max-width: 760px) {
    .page {
        padding: 18px 14px 24px;
    }

    .hero {
        align-items: flex-start;
    }

    .device-art {
        width: 26%;
        min-width: 105px;
        margin-top: 4px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .delivery {
        grid-column: auto;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .confirm-submit {
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 10px 14px;
    }

    .brand {
        font-size: 22px;
    }

    .track-link {
        font-size: 11px;
    }

    .hero {
        margin: 0 0 14px;
        gap: 8px;
    }

        .hero h1 {
            font-size: 27px;
            letter-spacing: -1px;
        }

        .hero p {
            font-size: 13px;
            line-height: 1.4;
        }

    .device-art {
        min-width: 75px;
        width: 24%;
    }

    .panel {
        padding: 12px;
    }

    .panel-title {
        font-size: 17px;
    }

    .delivery-inner {
        padding: 4px 12px 12px;
    }

    .delivery-options {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .delivery-option {
        min-height: 44px;
    }

    .phone-row {
        grid-template-columns: 104px 1fr;
    }

    .confirm-submit {
        flex-direction: column;
        align-items: stretch;
    }

    .confirm {
        white-space: normal;
    }

    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .region-district-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PRE-ORDER PAGE LAYOUT FIX
========================================= */

.page {
    width: 100%;
    max-width: 1450px;
    margin: 0 auto;
    padding: 28px 24px 36px;
    height: auto;
    min-height: 0;
    overflow: visible;
}

    .page .hero {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        margin: 0 4px 28px;
        min-width: 0;
    }

        .page .hero > div {
            flex: 1 1 auto;
            min-width: 0;
        }

        .page .hero h1 {
            margin: 0 0 12px;
            font-size: clamp(28px, 3.5vw, 48px);
            line-height: 1.2;
            overflow-wrap: anywhere;
        }

        .page .hero p {
            margin: 0;
            line-height: 1.6;
        }

    .page .device-art {
        display: block;
        flex: 0 1 360px;
        width: 100%;
        max-width: 360px;
        min-width: 0;
        height: auto;
        object-fit: contain;
    }

#preOrderForm {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    position: relative;
}

    #preOrderForm .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 16px;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    #preOrderForm .panel {
        display: block;
        position: relative;
        width: 100%;
        min-width: 0;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: visible;
        align-self: stretch;
        padding: 22px;
        margin: 0;
        background: #fff;
        border: 1px solid #dfe3eb;
        border-radius: 12px;
        box-shadow: 0 8px 28px rgba(20, 28, 45, .06);
    }

    #preOrderForm .panel-title {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 20px;
        line-height: 1.4;
        font-size: 20px;
        font-weight: 800;
    }

    #preOrderForm .field {
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0 0 16px;
    }

        #preOrderForm .field:last-child {
            margin-bottom: 0;
        }

        #preOrderForm .field > label {
            display: block;
            margin-bottom: 7px;
            line-height: 1.4;
        }

    #preOrderForm .control-wrap {
        width: 100%;
        min-width: 0;
        position: relative;
    }

        #preOrderForm .control-wrap input,
        #preOrderForm .control-wrap select,
        #preOrderForm .phone-row > input {
            display: block;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            min-height: 44px;
            height: auto;
            padding: 10px 12px;
            box-sizing: border-box;
        }

        #preOrderForm .control-wrap.has-icon input,
        #preOrderForm .control-wrap.has-icon select {
            padding-left: 42px;
        }

    #preOrderForm .region-district-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 12px;
        width: 100%;
        margin-bottom: 16px;
    }

        #preOrderForm .region-district-row .field {
            margin-bottom: 0;
        }

    #preOrderForm .phone-row {
        display: grid;
        grid-template-columns: minmax(100px, 122px) minmax(0, 1fr);
        gap: 8px;
        width: 100%;
    }

    #preOrderForm .country-code {
        padding-left: 36px !important;
    }

    #preOrderForm .delivery {
        grid-column: 1 / -1;
        padding: 0;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    #preOrderForm .delivery-inner {
        display: block;
        width: 100%;
        padding: 22px;
    }

    #preOrderForm .delivery .panel-title {
        margin-bottom: 16px;
    }

    #preOrderForm .delivery-options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
    }

    #preOrderForm .delivery-option {
        display: flex;
        align-items: center;
        min-width: 0;
        min-height: 58px;
        height: auto;
        gap: 10px;
        padding: 12px;
        margin: 0;
        white-space: normal;
    }

        #preOrderForm .delivery-option strong {
            flex: 1 1 auto;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        #preOrderForm .delivery-option input {
            flex: 0 0 19px;
            width: 19px;
            min-height: 19px;
            height: 19px;
            margin: 0;
        }

    #preOrderForm .notice {
        margin-top: 14px;
        line-height: 1.6;
    }

    #preOrderForm .form-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 20px;
        width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 20px;
        padding: 18px 0 0;
        border-top: 1px solid #dfe3eb;
        position: relative;
        clear: both;
    }

    #preOrderForm .help {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        min-width: 0;
    }

    #preOrderForm .confirm-submit {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 16px;
        min-width: 0;
    }

    #preOrderForm .confirm {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        white-space: normal;
    }

        #preOrderForm .confirm input {
            flex: 0 0 19px;
            width: 19px;
            height: 19px;
            min-height: 19px;
            margin: 0;
        }

    #preOrderForm .submit-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 12px 22px;
    }

    #preOrderForm .status-message {
        width: 100%;
        height: auto;
        max-height: none;
        overflow-wrap: anywhere;
    }

.delivery-address-field {
    margin-top: 12px;
    width: 100%;
}

    .delivery-address-field textarea {
        display: block;
        width: 100%;
        min-height: 90px;
        padding: 12px;
        border: 1px solid #cfd5e0;
        border-radius: 5px;
        background: #fff;
        color: var(--ink);
        font-family: inherit;
        font-size: 13px;
        line-height: 1.5;
        resize: vertical;
        box-sizing: border-box;
    }

        .delivery-address-field textarea::placeholder {
            color: #8790a3;
        }

        .delivery-address-field textarea:focus {
            outline: none;
            border-color: var(--orange);
            box-shadow: 0 0 0 3px rgba(255, 75, 11, .12);
        }

        .delivery-address-field textarea.is-invalid {
            border-color: #dc3545;
        }


@media (max-width: 900px) {
    .page {
        padding: 24px 18px 30px;
    }

        .page .hero {
            gap: 16px;
        }

        .page .device-art {
            flex-basis: 260px;
            max-width: 260px;
        }

    #preOrderForm .panel {
        padding: 18px;
    }

    #preOrderForm .delivery-inner {
        padding: 18px;
    }

    #preOrderForm .delivery-options {
        grid-template-columns: 1fr;
    }

    #preOrderForm .form-footer {
        align-items: flex-start;
    }

    #preOrderForm .confirm-submit {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .page {
        padding: 20px 14px 28px;
    }

        .page .hero {
            flex-direction: column;
            align-items: flex-start;
            margin: 0 0 22px;
        }

            .page .hero .device-art {
                align-self: center;
                flex: 0 1 auto;
                width: 100%;
                max-width: 300px;
                min-width: 0;
            }

    #preOrderForm .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    #preOrderForm .panel,
    #preOrderForm .delivery {
        grid-column: 1;
        width: 100%;
    }

    #preOrderForm .panel {
        padding: 16px;
    }

    #preOrderForm .delivery-inner {
        padding: 16px;
    }

    #preOrderForm .region-district-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    #preOrderForm .phone-row {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    #preOrderForm .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    #preOrderForm .help {
        gap: 8px;
    }

    #preOrderForm .confirm-submit {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    #preOrderForm .confirm {
        align-items: flex-start;
    }

    #preOrderForm .submit-btn {
        width: 100%;
    }
}
