/* ============================================================
   KTECH - PRODUCT QUOTE POPUP CSS
   File: assets/css/builder/product_quote_popup.css
   ============================================================ */

body.ktech-quote-popup-open {
    overflow: hidden;
}


/* ============================================================
   TRIGGER BUTTON (Builder / Default)
   ============================================================ */

.ktech-product-quote-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 24px;

    border: 0;
    border-radius: 30px;

    background: #0052ff;
    color: #ffffff;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(0, 82, 255, 0.2);
}

.ktech-product-quote-trigger:hover {
    background: #0043d4;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 82, 255, 0.3);
}

.product-quote-button-wrapper .ktech-product-quote-trigger {
    display: none !important;
}

/* ============================================================
   UX BUILDER EDITOR CANVAS PREVIEW
   ============================================================ */

.ux-builder-active .ktech-product-quote-popup,
body.ux-builder-active .ktech-product-quote-popup {
    display: block !important;
    min-height: 44px;
}

.ux-builder-active .ktech-product-quote-trigger,
body.ux-builder-active .ktech-product-quote-trigger,
.ux-builder-active .product-quote-button-wrapper .ktech-product-quote-trigger,
body.ux-builder-active .product-quote-button-wrapper .ktech-product-quote-trigger {
    display: inline-flex !important;
}


/* ============================================================
   OVERLAY BACKDROP
   ============================================================ */

.ktech-product-quote-overlay {
    position: fixed;
    inset: 0;

    z-index: 99998;

    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.ktech-product-quote-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ============================================================
   MODAL WINDOW
   ============================================================ */

.ktech-product-quote-modal {
    position: fixed;

    top: 50%;
    left: 50%;

    width: min(960px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);

    transform: translate(-50%, -46%) scale(.96);

    z-index: 99999;

    background: #ffffff;

    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);

    overflow-y: auto;
    overflow-x: hidden;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .3s cubic-bezier(.16, 1, .3, 1),
        transform .3s cubic-bezier(.16, 1, .3, 1),
        visibility .3s ease;
}

.ktech-product-quote-modal.active {
    opacity: 1;
    visibility: visible;

    transform: translate(-50%, -50%) scale(1);
}


/* ============================================================
   CLOSE BUTTON (Top Right in White Padding Area)
   ============================================================ */

.ktech-product-quote-close {
    position: absolute;

    top: 18px;
    right: 22px;

    z-index: 10;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: #0052ff;

    font-size: 24px;
    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    transition: background .2s ease, color .2s ease;
}

.ktech-product-quote-close:hover {
    background: #eff6ff;
    color: #0043d4;
}

.ktech-product-quote-close span {
    display: block;
    line-height: 1;
    margin-top: -2px;
}


/* ============================================================
   INNER LAYOUT GRID
   ============================================================ */

.ktech-product-quote-inner {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    position: relative;
}

.ktech-product-quote-inner.has-image {
    grid-template-columns: 1.15fr 0.85fr;
}


/* ============================================================
   LEFT CONTENT
   ============================================================ */

.ktech-product-quote-content {
    padding: 44px 36px 44px 44px;
}

.ktech-product-quote-title {
    margin: 0 0 12px;

    color: #2b3674;

    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ktech-product-quote-intro {
    margin-bottom: 24px;

    color: #64748b;

    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
}

.ktech-product-quote-intro p {
    margin: 0;
}


/* ============================================================
   RIGHT IMAGE (Padded container, top right white space for close)
   ============================================================ */

.ktech-product-quote-image {
    padding: 44px 44px 44px 0;
    display: flex;
    align-items: stretch;
    height: 100%;
    box-sizing: border-box;
}

.ktech-product-quote-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 10px;
}


/* ============================================================
   CONTACT FORM 7 STYLING
   ============================================================ */

.ktech-product-quote-form .wpcf7 form {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Unwrap <p> & hide <br> from CF7 auto-formatting */
.ktech-product-quote-form .wpcf7 form > p {
    display: contents;
}

.ktech-product-quote-form .wpcf7 form br {
    display: none !important;
}

/* Labels styling: hide direct text nodes to match placeholder design */
.ktech-product-quote-form .wpcf7 form label {
    display: block;
    margin: 0;
    width: 100%;
    font-size: 0;
    line-height: 0;
    color: transparent;
}

.ktech-product-quote-form .wpcf7 form label > * {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    font-weight: 400;
}

/* Form control wrap */
.ktech-product-quote-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    position: relative;
}

/* Full-width fields (quantity, message, textareas) */
.ktech-product-quote-form .wpcf7 form label:has([name="your-quantity"]),
.ktech-product-quote-form .wpcf7 form label:has([name="your-message"]),
.ktech-product-quote-form .wpcf7-form-control-wrap[data-name="your-quantity"],
.ktech-product-quote-form .wpcf7-form-control-wrap[data-name="your-message"],
.ktech-product-quote-form .wpcf7 form label:has(textarea),
.ktech-product-quote-form .wpcf7-form-control-wrap:has(textarea) {
    grid-column: 1 / -1;
}

/* Input and Textarea fields */
.ktech-product-quote-form .wpcf7 form input:not([type="submit"]):not([type="hidden"]),
.ktech-product-quote-form .wpcf7 form textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 14px;

    border: 1px solid #eaecf0;
    border-radius: 6px;

    background: #ffffff;
    color: #334155;

    font-size: 14px;
    font-weight: 400;
    font-family: inherit;

    transition: border-color .2s ease, box-shadow .2s ease;

    outline: none;
    box-shadow: none;
}

.ktech-product-quote-form .wpcf7 form input:not([type="submit"]):not([type="hidden"]) {
    height: 46px;
}

.ktech-product-quote-form .wpcf7 form textarea {
    height: 90px;
    min-height: 70px;
    resize: vertical;
}

.ktech-product-quote-form .wpcf7 form input:focus,
.ktech-product-quote-form .wpcf7 form textarea:focus {
    border-color: #0052ff;
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.08);
}

.ktech-product-quote-form .wpcf7 form input::placeholder,
.ktech-product-quote-form .wpcf7 form textarea::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}


/* Hidden inputs */
.ktech-product-quote-form .wpcf7 form input[type="hidden"],
.ktech-product-quote-form .wpcf7-form-control-wrap:has(input[type="hidden"]) {
    display: none !important;
}


/* Submit button (Left aligned, pill shape, blue background with icon) */
.ktech-product-quote-form .wpcf7-submit {
    grid-column: 1 / -1;
    justify-self: start;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 8px;

    padding: 10px 22px 10px 20px;

    border: 0;
    border-radius: 50px;

    background-color: #0052ff;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;

    cursor: pointer;

    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(0, 82, 255, 0.25);

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M8 16l8-8'/%3E%3Cpath d='M16 16V8H8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
}

.ktech-product-quote-form .wpcf7-submit:hover {
    background-color: #0043d4;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 82, 255, 0.35);
}

.ktech-product-quote-form .wpcf7-submit:active {
    transform: translateY(0);
}


/* CF7 response output */
.ktech-product-quote-form .wpcf7-response-output {
    grid-column: 1 / -1;
    margin: 12px 0 0 !important;
    padding: 10px 14px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}

.ktech-product-quote-form .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}


/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    .ktech-product-quote-modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 32px);
        border-radius: 14px;
    }

    .ktech-product-quote-inner,
    .ktech-product-quote-inner.has-image {
        grid-template-columns: 1fr;
    }

    .ktech-product-quote-content {
        padding: 36px 20px 24px;
    }

    .ktech-product-quote-title {
        font-size: 22px;
    }

    .ktech-product-quote-image {
        display: none;
    }

    .ktech-product-quote-form .wpcf7 form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ktech-product-quote-form .wpcf7 form label,
    .ktech-product-quote-form .wpcf7-form-control-wrap {
        grid-column: 1 / -1;
    }

    .ktech-product-quote-close {
        top: 12px;
        right: 14px;
    }

}