/* =========================================================
   MTTS India — Floating "Enquire Now" button + popup form
   Shared by English and Arabic pages.
   ========================================================= */

:root {
    --ep-theme: #025e87;
    --ep-green: #00a859;
    --ep-navy: #001837;
    --ep-grad: linear-gradient(135deg, #025e87 0%, #00a859 100%);
}

/* ---------- Floating button (bottom-right, above back-to-top) ---------- */
.mtts-enquire-fab {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 8px;
    border: 0;
    border-radius: 50px;
    background: var(--ep-grad);
    background-size: 200% 200%;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(2, 94, 135, .38);
    overflow: visible;
    isolation: isolate;
    animation: epFabIn .7s cubic-bezier(.2, .9, .3, 1.3) both,
               epFabGradient 5s ease infinite,
               epFabNudge 6s ease-in-out 2.5s infinite;
    transition: box-shadow .3s ease, transform .3s ease;
}

.mtts-enquire-fab:hover,
.mtts-enquire-fab:focus-visible {
    box-shadow: 0 14px 34px rgba(0, 168, 89, .45);
    transform: translateY(-3px);
    animation: epFabGradient 5s ease infinite;
    outline: none;
}

.mtts-enquire-fab:focus-visible {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ep-theme);
}

/* shine sweep */
.mtts-enquire-fab::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
    background-size: 250% 100%;
    background-position: 150% 0;
    animation: epShine 3.5s ease-in-out 1.5s infinite;
    pointer-events: none;
    z-index: 1;
}

.mtts-fab-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--ep-theme);
    font-size: 17px;
    flex-shrink: 0;
}

.mtts-fab-icon i {
    animation: epIconBeat 2.4s ease-in-out infinite;
}

.mtts-fab-text {
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

/* pulsing ring */
.mtts-fab-ring {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: -1;
}

.mtts-fab-ring::before,
.mtts-fab-ring::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(0, 168, 89, .55);
    animation: epRing 2.4s ease-out infinite;
}

.mtts-fab-ring::after {
    animation-delay: 1.2s;
}

[dir="rtl"] .mtts-enquire-fab,
.mtts-rtl .mtts-enquire-fab {
    padding: 8px 8px 8px 20px;
}

body.mtts-enquiry-open .mtts-enquire-fab {
    visibility: hidden;
    pointer-events: none;
}

@keyframes epFabIn {
    from { opacity: 0; transform: translateY(30px) scale(.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes epFabGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes epFabNudge {
    0%, 86%, 100% { transform: translateY(0) rotate(0); }
    88% { transform: translateY(-6px) rotate(-3deg); }
    90% { transform: translateY(0) rotate(3deg); }
    92% { transform: translateY(-4px) rotate(-2deg); }
    94% { transform: translateY(0) rotate(1deg); }
}

@keyframes epShine {
    0%   { background-position: 150% 0; }
    45%, 100% { background-position: -60% 0; }
}

@keyframes epRing {
    0%   { transform: scale(1);   opacity: .9; }
    100% { transform: scale(1.35, 1.7); opacity: 0; }
}

@keyframes epIconBeat {
    0%, 60%, 100% { transform: scale(1); }
    30% { transform: scale(1.18); }
}

/* ---------- Modal ---------- */
.mtts-enquiry-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility 0s linear .3s;
    font-family: inherit;
}

.mtts-enquiry-modal.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity .3s ease;
}

.mtts-enquiry-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 24, 55, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mtts-enquiry-dialog {
    position: relative;
    width: 100%;
    max-width: 470px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 24, 55, .35);
    transform: translateY(30px) scale(.96);
    transition: transform .4s cubic-bezier(.2, .9, .3, 1.15);
    scrollbar-width: thin;
}

.mtts-enquiry-modal.is-open .mtts-enquiry-dialog {
    transform: translateY(0) scale(1);
}

.mtts-enquiry-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}

.mtts-enquiry-close:hover,
.mtts-enquiry-close:focus-visible {
    background: rgba(255, 255, 255, .32);
    transform: rotate(90deg);
    outline: none;
}

[dir="rtl"] .mtts-enquiry-close {
    right: auto;
    left: 14px;
}

.mtts-enquiry-head {
    position: relative;
    padding: 28px 28px 24px;
    background: var(--ep-grad);
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.mtts-enquiry-head::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    top: -110px;
    left: -60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.mtts-enquiry-head::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    bottom: -90px;
    right: -40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.mtts-enquiry-badge {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: #fff;
    color: var(--ep-theme);
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

.mtts-enquiry-head h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 6px;
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
}

[dir="rtl"] .mtts-enquiry-head h2 {
    text-transform: none;
}

.mtts-enquiry-head h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    opacity: .95;
}

.mtts-enquiry-head p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 14px;
    line-height: 1.6;
}

.mtts-enquiry-form {
    padding: 22px 26px 22px;
}

.mtts-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.mtts-field {
    margin-bottom: 14px;
}

.mtts-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--ep-navy);
    font-size: 14px;
    font-weight: 700;
}

.mtts-field label span {
    color: #e0393e;
}

.mtts-input {
    position: relative;
}

.mtts-input > i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--ep-theme);
    font-size: 15px;
    pointer-events: none;
}

[dir="rtl"] .mtts-input > i {
    left: auto;
    right: 15px;
}

.mtts-input input,
.mtts-input select {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 42px;
    border: 1.5px solid #dfe6ef;
    border-radius: 12px;
    background: #f7f9fc;
    color: var(--ep-navy);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
    -webkit-appearance: none;
    appearance: none;
}

[dir="rtl"] .mtts-input input,
[dir="rtl"] .mtts-input select {
    padding: 0 42px 0 16px;
}

[dir="rtl"] .mtts-input input[type="tel"] {
    text-align: right;
}

.mtts-input input::placeholder {
    color: #8a96a8;
}

.mtts-select select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23025e87' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 38px;
}

[dir="rtl"] .mtts-select select {
    background-position: left 16px center;
    padding-left: 38px;
}

.mtts-select select:invalid {
    color: #8a96a8;
}

.mtts-input input:focus,
.mtts-input select:focus {
    outline: none;
    border-color: var(--ep-theme);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(2, 94, 135, .12);
}

.mtts-field.has-error .mtts-input input,
.mtts-field.has-error .mtts-input select {
    border-color: #e0393e;
    box-shadow: 0 0 0 4px rgba(224, 57, 62, .1);
}

.mtts-enquiry-error {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecec;
    color: #b42318;
    font-size: 14px;
}

.mtts-enquiry-submit {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    background: var(--ep-grad);
    background-size: 200% 100%;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: background-position .5s ease, box-shadow .3s ease, transform .2s ease;
}

[dir="rtl"] .mtts-enquiry-submit {
    text-transform: none;
}

.mtts-enquiry-submit:hover,
.mtts-enquiry-submit:focus-visible {
    background-position: 100% 0;
    box-shadow: 0 10px 24px rgba(2, 94, 135, .3);
    outline: none;
}

.mtts-enquiry-submit:hover i {
    transform: translateX(4px);
}

[dir="rtl"] .mtts-enquiry-submit:hover i {
    transform: translateX(-4px);
}

.mtts-enquiry-submit i {
    transition: transform .3s ease;
}

.mtts-enquiry-submit:active {
    transform: scale(.98);
}

.mtts-enquiry-submit[disabled] {
    opacity: .75;
    cursor: wait;
}

.mtts-enquiry-submit.is-loading i {
    display: none;
}

.mtts-enquiry-submit.is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: epSpin .7s linear infinite;
}

@keyframes epSpin {
    to { transform: rotate(360deg); }
}

.mtts-enquiry-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 14px 0 0;
    color: #6b7789;
    font-size: 13px;
    font-style: italic;
    line-height: 1.55;
}

[dir="rtl"] .mtts-enquiry-note {
    font-style: normal;
}

.mtts-enquiry-note i {
    margin-top: 3px;
    color: var(--ep-green);
}

/* success */
.mtts-enquiry-success {
    padding: 34px 28px 36px;
    text-align: center;
}

.mtts-success-check {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--ep-grad);
    color: #fff;
    font-size: 32px;
    animation: epPop .5s cubic-bezier(.2, .9, .3, 1.5) both;
}

.mtts-enquiry-success h3 {
    margin: 0 0 8px;
    color: var(--ep-navy);
    font-size: 22px;
    font-weight: 800;
}

.mtts-enquiry-success p {
    margin: 0;
    color: #556070;
    font-size: 15px;
    line-height: 1.7;
}

@keyframes epPop {
    from { transform: scale(.3); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

body.mtts-enquiry-open {
    overflow: hidden;
}

/* ---------- Mobile ---------- */
@media (max-width: 576px) {
    .mtts-enquire-fab {
        right: 12px;
        bottom: 82px;
        gap: 8px;
        font-size: 14px;
        padding: 6px 16px 6px 6px;
    }

    [dir="rtl"] .mtts-enquire-fab,
    .mtts-rtl .mtts-enquire-fab {
        padding: 6px 6px 6px 16px;
    }

    .mtts-fab-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .mtts-enquiry-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .mtts-enquiry-dialog {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    .mtts-enquiry-head {
        padding: 22px 20px 18px;
    }

    .mtts-enquiry-badge {
        width: 46px;
        height: 46px;
        font-size: 20px;
        margin-bottom: 8px;
    }

    .mtts-enquiry-head h2 {
        font-size: 19px;
    }

    .mtts-enquiry-head h3 {
        font-size: 14.5px;
    }

    .mtts-enquiry-form {
        padding: 18px 18px 18px;
    }

    .mtts-input input,
    .mtts-input select {
        height: 46px;
        font-size: 16px; /* prevents iOS zoom */
    }
}

@media (prefers-reduced-motion: reduce) {
    .mtts-enquire-fab,
    .mtts-enquire-fab::after,
    .mtts-fab-ring::before,
    .mtts-fab-ring::after,
    .mtts-fab-icon i {
        animation: none !important;
    }

    .mtts-enquiry-modal,
    .mtts-enquiry-dialog {
        transition: none !important;
    }
}

/* =========================================================
   Compact layout (v2): 2-column fields on desktop, smaller header
   ========================================================= */
.mtts-enquiry-dialog {
    max-width: 560px;
    border-radius: 18px;
}

.mtts-enquiry-head {
    padding: 18px 56px 16px;
}

.mtts-enquiry-badge {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-size: 19px;
}

.mtts-enquiry-head h2 {
    font-size: 19px;
    margin-bottom: 4px;
}

.mtts-enquiry-head h3 {
    font-size: 14.5px;
    margin-bottom: 4px;
}

.mtts-enquiry-head p {
    font-size: 13px;
    line-height: 1.5;
}

.mtts-enquiry-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 15px;
}

[dir="rtl"] .mtts-enquiry-close {
    right: auto;
    left: 12px;
}

.mtts-enquiry-form {
    padding: 16px 22px 16px;
}

.mtts-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.mtts-fields .mtts-field {
    margin-bottom: 0;
}

.mtts-field label {
    margin-bottom: 5px;
    font-size: 13px;
}

.mtts-input > i {
    left: 13px;
    font-size: 14px;
}

[dir="rtl"] .mtts-input > i {
    left: auto;
    right: 13px;
}

.mtts-input input,
.mtts-input select {
    height: 42px;
    padding: 0 12px 0 36px;
    border-radius: 10px;
    font-size: 14px;
}

[dir="rtl"] .mtts-input input,
[dir="rtl"] .mtts-input select {
    padding: 0 36px 0 12px;
}

.mtts-select select {
    padding-right: 32px;
    background-position: right 12px center;
}

[dir="rtl"] .mtts-select select {
    padding-left: 32px;
    padding-right: 36px;
    background-position: left 12px center;
}

.mtts-enquiry-error {
    margin: 12px 0 0;
    padding: 8px 12px;
    font-size: 13px;
}

.mtts-enquiry-submit {
    height: 46px;
    margin-top: 14px;
    border-radius: 10px;
    font-size: 15px;
}

.mtts-enquiry-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.mtts-enquiry-success {
    padding: 24px 22px 26px;
}

.mtts-success-check {
    width: 60px;
    height: 60px;
    font-size: 26px;
}

@media (max-width: 576px) {
    .mtts-enquiry-dialog {
        max-width: 100%;
    }

    .mtts-enquiry-head {
        padding: 14px 48px 12px;
    }

    .mtts-enquiry-badge {
        display: none;
    }

    .mtts-enquiry-head h2 {
        font-size: 17px;
    }

    .mtts-enquiry-head h3 {
        font-size: 13.5px;
    }

    .mtts-enquiry-head p {
        font-size: 12.5px;
    }

    .mtts-enquiry-form {
        padding: 14px 16px 14px;
    }

    .mtts-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mtts-input input,
    .mtts-input select {
        height: 42px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .mtts-enquiry-submit {
        height: 44px;
        margin-top: 12px;
    }
}

/* =========================================================
   v3: Arabic popup uses the same left-to-right layout as English;
   only the Arabic words read right-to-left inside each line.
   ========================================================= */
.mtts-enquiry-dialog {
    overflow-x: hidden;
}

.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-head h2,
.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-head h3,
.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-head p,
.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-success h3,
.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-success p {
    direction: rtl;
    unicode-bidi: isolate;
    text-transform: none;
}

.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-error,
.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-note > span {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: left;
}

.mtts-enquiry-modal[lang="ar"] .mtts-submit-label {
    direction: rtl;
    unicode-bidi: isolate;
}

.mtts-enquiry-modal[lang="ar"] .mtts-enquiry-note {
    direction: ltr;
    font-style: normal;
}

/* label word reads RTL, the * stays after it on the right (same as English) */
.mtts-enquiry-modal[lang="ar"] .mtts-field label {
    direction: ltr;
    text-align: left;
}

.mtts-enquiry-modal[lang="ar"] .mtts-input input[type="text"],
.mtts-enquiry-modal[lang="ar"] .mtts-input select {
    direction: rtl;
    text-align: left;
}

.mtts-enquiry-modal[lang="ar"] .mtts-input input[type="tel"] {
    direction: ltr;
    text-align: left;
}
