/**
 * K4 Contact Modal – Front-end Styles
 *
 * Full-page modal with call button, callback form, and
 * quick message form. Styled to match the K4 Kitchens brand.
 *
 * @package  K4_Contact_Modal
 * @author   Steve Austen
 * @company  The PCGP
 * @version  1.0.0
 */

/* ═══════════════════════════════════════════
   Modal Overlay & Container
   ═══════════════════════════════════════════ */
.k4cm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Active state */
.k4cm-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* Dark backdrop */
.k4cm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════
   Dialog Box
   ═══════════════════════════════════════════ */
.k4cm-dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    width: 94%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

/* Slide up when open */
.k4cm-modal.is-open .k4cm-dialog {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   Close Button
   ═══════════════════════════════════════════ */
.k4cm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.k4cm-close:hover {
    background: #f0f0f0;
    color: #231f20;
}

/* ═══════════════════════════════════════════
   Scrollable Body
   ═══════════════════════════════════════════ */
.k4cm-body {
    overflow-y: auto;
    padding: 40px 40px 36px;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
.k4cm-body::-webkit-scrollbar {
    width: 6px;
}

.k4cm-body::-webkit-scrollbar-track {
    background: transparent;
}

.k4cm-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* ═══════════════════════════════════════════
   Header
   ═══════════════════════════════════════════ */
.k4cm-header {
    text-align: center;
    margin-bottom: 28px;
}

.k4cm-title {
    font-family: "Poppins", sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: #231f20;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.k4cm-subtitle {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════
   Call Us Button
   ═══════════════════════════════════════════ */
.k4cm-call-section {
    text-align: center;
    margin-bottom: 8px;
}

.k4cm-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f3af2e;
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 18px;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.k4cm-call-btn:hover {
    background: #e2a027;
    transform: scale(1.03);
    color: #fff;
    text-decoration: none;
}

.k4cm-call-btn svg {
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   Divider
   ═══════════════════════════════════════════ */
.k4cm-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 28px 0;
}

/* ═══════════════════════════════════════════
   Form Sections
   ═══════════════════════════════════════════ */
.k4cm-section-heading {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #231f20;
    margin: 0 0 18px 0;
}

/* Callback note text */
.k4cm-note {
    font-family: "Poppins", sans-serif;
    font-style: italic;
    font-size: 13px;
    color: #f3af2e;
    text-align: center;
    margin: 14px 0 0 0;
}

/* ═══════════════════════════════════════════
   CF7 Form Styling Inside Modal
   ═══════════════════════════════════════════ */

/* Labels */
.k4cm-form-wrap label {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #231f20;
    display: block;
    margin-bottom: 5px;
}

/* Text inputs, email, tel, select, textarea */
.k4cm-form-wrap input[type="text"],
.k4cm-form-wrap input[type="email"],
.k4cm-form-wrap input[type="tel"],
.k4cm-form-wrap input[type="url"],
.k4cm-form-wrap input[type="number"],
.k4cm-form-wrap textarea,
.k4cm-form-wrap select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    color: #231f20;
    background: #f7f7f7;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.k4cm-form-wrap input[type="text"]:focus,
.k4cm-form-wrap input[type="email"]:focus,
.k4cm-form-wrap input[type="tel"]:focus,
.k4cm-form-wrap input[type="url"]:focus,
.k4cm-form-wrap input[type="number"]:focus,
.k4cm-form-wrap textarea:focus,
.k4cm-form-wrap select:focus {
    outline: none;
    border-color: #f3af2e;
    box-shadow: 0 0 0 3px rgba(243, 175, 46, 0.15);
    background: #fff;
}

.k4cm-form-wrap textarea {
    min-height: 120px;
    resize: vertical;
}

.k4cm-form-wrap ::placeholder {
    color: #999;
    opacity: 1;
}

/* CF7 paragraph wrappers – spacing between fields */
.k4cm-form-wrap .wpcf7-form p {
    margin-bottom: 16px;
}

/* Two-column field layout for callback form */
.k4cm-form-wrap .k4cm-field-row {
    display: flex;
    gap: 16px;
}

.k4cm-form-wrap .k4cm-field-row > p,
.k4cm-form-wrap .k4cm-field-row > span,
.k4cm-form-wrap .k4cm-field-row > div {
    flex: 1;
}

/* Submit button – K4 yellow brand colour */
.k4cm-form-wrap input[type="submit"] {
    background: #f3af2e;
    color: #fff;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: block;
    margin: 8px auto 0;
    width: auto;
}

.k4cm-form-wrap input[type="submit"]:hover {
    background: #e2a027;
    transform: scale(1.03);
}

/* CF7 validation messages */
.k4cm-form-wrap .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #dc3232;
    margin-top: 4px;
}

.k4cm-form-wrap .wpcf7-response-output {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 16px 0 0 0;
    text-align: center;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .k4cm-body {
        padding: 28px 20px 24px;
    }

    .k4cm-title {
        font-size: 22px;
    }

    .k4cm-subtitle {
        font-size: 14px;
    }

    .k4cm-call-btn {
        font-size: 16px;
        padding: 12px 28px;
    }

    .k4cm-section-heading {
        font-size: 18px;
    }

    /* Stack two-column fields on mobile */
    .k4cm-form-wrap .k4cm-field-row {
        flex-direction: column;
        gap: 0;
    }

    .k4cm-dialog {
        width: 96%;
        max-height: 94vh;
        border-radius: 12px;
    }
}

/* ═══════════════════════════════════════════
   Body Scroll Lock When Modal Open
   ═══════════════════════════════════════════ */
body.k4cm-modal-open {
    overflow: hidden;
}
