.order-popup {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.order-popup.is-open {
    display: flex;
}

.order-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 35, 55, 0.65);
}

.order-popup__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 44px 36px 36px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.order-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f2f4f6;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.order-popup__close svg {
    width: 16px;
    height: 16px;
}
.order-popup__close:hover {
    background: #e5e7eb;
    color: var(--color-text);
}

.order-popup__title {
    margin: 0 0 24px;
    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 800;
    color: var(--color-primary-dark);
    text-transform: uppercase;
}

/* ===== Форма (Contact Form 7), светлая тема ===== */

.order-popup__form form {
    display: block;
}
.order-popup__form p {
    margin: 0 0 22px;
}

.order-popup__form .wpcf7-form-control-wrap {
    display: block;
    position: relative;
    padding-left: 28px;
}
.order-popup__form .wpcf7-form-control-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.65;
}
.order-popup__form .wpcf7-form-control-wrap[data-name="your-name"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f93c6' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8'/%3E%3C/svg%3E");
}
.order-popup__form .wpcf7-form-control-wrap[data-name="your-phone"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f93c6' stroke-width='2'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cline x1='11' y1='18' x2='13' y2='18'/%3E%3C/svg%3E");
}
.order-popup__form .wpcf7-form-control-wrap[data-name="your-message"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f93c6' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.order-popup__form input[type="text"],
.order-popup__form input[type="tel"],
.order-popup__form input[type="email"],
.order-popup__form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 2px 0 8px;
    resize: none;
}
.order-popup__form input::placeholder,
.order-popup__form textarea::placeholder {
    color: var(--color-text-muted);
    font-weight: 600;
}
.order-popup__form input:focus,
.order-popup__form textarea:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
}
.order-popup__form textarea {
    min-height: 26px;
}

.order-popup__form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 13px 34px;
    border: none;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.order-popup__form input[type="submit"]:hover {
    background: var(--color-primary-dark);
}

.order-popup__form .wpcf7-spinner {
    margin-left: 12px;
}
.order-popup__form .wpcf7-not-valid-tip {
    color: #d1453b;
    font-size: 12px;
    margin-top: 4px;
}
.order-popup__form .wpcf7-response-output {
    display: none !important;
}

.order-popup__privacy {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-text-muted);
}
.order-popup__privacy a {
    color: var(--color-primary);
    text-decoration: underline dashed;
}

/* ===== Состояние успеха ===== */

.order-popup__success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}
.order-popup.is-success .order-popup__form-state {
    display: none;
}
.order-popup.is-success .order-popup__success-state {
    display: flex;
}

.order-popup__success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: rgba(47, 147, 198, 0.12);
    color: var(--color-primary);
}
.order-popup__success-icon svg {
    width: 30px;
    height: 30px;
}

.order-popup__success-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary-dark);
}

.order-popup__success-text {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .order-popup__panel {
        padding: 36px 22px 28px;
    }
}
