/**
 * LM Call Button - Frontend Styles
 * 35 effects + Map Form + action badges, tooltips, modal, widget integrations
 * @version 3.5.0
 */

:root {
    --lm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --lm-modal-z: 1000000;
}

/* Scroll lock while a panel or the modal is open */
body.lm-modal-open {
    overflow: hidden;
}

/* Hidden source container for popup embeds */
#lm-embed-store {
    display: none !important;
}

/* ============================================
   RESPONSIVE VISIBILITY PER ITEM
   ============================================ */

.lm-only-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .lm-only-desktop {
        display: none !important;
    }

    .lm-only-mobile {
        display: flex !important;
    }
}

/* ============================================
   CALL BUTTON LAYOUT
   ============================================ */

.lm-call-buttons {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
}

.lm-call-buttons[data-position="right"] {
    right: 20px;
}

.lm-call-buttons[data-position="left"] {
    left: 20px;
}

.lm-btn-container {
    position: fixed;
    z-index: 99998;
    pointer-events: auto;
}

.lm-call-buttons[data-position="right"] .lm-btn-container {
    right: 20px;
}

.lm-call-buttons[data-position="left"] .lm-btn-container {
    left: 20px;
}

/* Overlay */
.lm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lm-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Button */
.lm-main-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--lm-transition);
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.lm-main-btn:hover {
    transform: scale(1.1);
}

.lm-main-btn i {
    font-size: 24px;
    line-height: 1;
}

.lm-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Legacy style classes removed in v3.2.0 — see presets.css */

/* ============================================
   SECOND EFFECT LAYER
   Slot 2 of the effect stack lives on this nested layer. Two `animation`
   declarations on one element don't merge — the later rule simply wins — so
   the second effect needs its own element. The layer fills the button and
   inherits its radius, which keeps ring/glow effects on the same edge while
   transform effects compose with the parent's.
   ============================================ */

.lm-fx-layer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    /* Never intercept the click meant for the button itself */
    pointer-events: none;
}

/* ============================================
   ITEM BADGE ("Hot", "24/7", "-20%"…)
   ============================================ */

.lm-item-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 3;
}

.lm-main-btn,
.lm-dock-item-icon {
    position: relative;
}

/* Inside a text row the badge sits inline at the end instead of floating */
.lm-btn-item .lm-item-badge {
    position: static;
    margin-left: auto;
    top: auto;
    right: auto;
    box-shadow: none;
}

/* ============================================
   TOOLTIP (icon-only contexts)
   Rendered as a real element, not ::after — the effect classes already own
   the ::before/::after pseudo-elements on .lm-main-btn.
   ============================================ */

.lm-tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease;
    pointer-events: none;
    z-index: 5;
}

.lm-call-buttons[data-position="left"] .lm-tooltip,
.lm-dock-left .lm-tooltip {
    right: auto;
    left: calc(100% + 12px);
}

.lm-dock-horizontal .lm-tooltip {
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
}

@media (hover: hover) {

    .lm-main-btn:hover>.lm-tooltip,
    .lm-main-btn:focus-visible>.lm-tooltip,
    .lm-dock-item:hover>.lm-tooltip,
    .lm-dock-item:focus-visible>.lm-tooltip {
        opacity: 1;
        visibility: visible;
    }
}

/* Tooltips would overflow the narrow bottom dock — rely on the label there */
@media (max-width: 768px) {
    .lm-tooltip {
        display: none;
    }
}

/* ============================================================
   DIRECT DOCK — Vertical (Desktop side dock)
   ============================================================ */
.lm-direct-dock {
    position: fixed;
    z-index: 99999;
    display: flex;
    box-sizing: border-box;
}

.lm-direct-dock.lm-dock-vertical {
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 2px;
}

.lm-direct-dock.lm-dock-vertical.lm-dock-right {
    right: 0;
}

.lm-direct-dock.lm-dock-vertical.lm-dock-left {
    left: 0;
}

.lm-dock-vertical .lm-dock-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 12px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.lm-dock-vertical.lm-dock-right .lm-dock-item {
    border-radius: 8px 0 0 8px;
    flex-direction: row;
}

.lm-dock-vertical.lm-dock-left .lm-dock-item {
    border-radius: 0 8px 8px 0;
    flex-direction: row-reverse;
}

.lm-dock-vertical .lm-dock-item:hover {
    padding-right: 20px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
}

.lm-dock-vertical.lm-dock-left .lm-dock-item:hover {
    padding-left: 20px;
    padding-right: 14px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.lm-dock-vertical .lm-dock-item i,
.lm-dock-vertical .lm-dock-item img {
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
}

.lm-dock-vertical .lm-dock-item img {
    border-radius: 4px;
    object-fit: contain;
}

/* Icon + label wrappers shared by both dock orientations */
.lm-dock-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lm-dock-item-label {
    display: block;
}

/* An item with no name collapses to an icon-only pill */
.lm-dock-item-label:empty {
    display: none;
}

/* ============================================================
   DIRECT DOCK — Horizontal (Mobile bottom dock)
   ============================================================ */
.lm-direct-dock.lm-dock-horizontal {
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    /* min-height, not height: with border-box the safe-area padding would
       otherwise eat into the 60px and squash the items on notched phones. */
    min-height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.lm-dock-horizontal .lm-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    padding: 6px 8px;
    min-width: 48px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: transparent;
}

.lm-dock-horizontal .lm-dock-item:active {
    transform: scale(0.92);
}

.lm-dock-horizontal .lm-dock-item i,
.lm-dock-horizontal .lm-dock-item img {
    width: 24px;
    height: 24px;
    font-size: 22px;
    line-height: 24px;
    text-align: center;
    flex-shrink: 0;
}

.lm-dock-horizontal .lm-dock-item img {
    border-radius: 4px;
    object-fit: contain;
}

.lm-dock-horizontal .lm-dock-item span {
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   RESPONSIVE VISIBILITY
   ============================================================ */
.lm-dock-desktop-only {
    display: flex;
}

.lm-dock-mobile-only {
    display: none;
}

.lm-floating-desktop-only {
    display: block;
}

.lm-floating-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .lm-dock-desktop-only {
        display: none !important;
    }

    .lm-dock-mobile-only {
        display: flex !important;
    }

    .lm-floating-desktop-only {
        display: none !important;
    }

    .lm-floating-mobile-only {
        display: block !important;
    }
}

/* Button List */
.lm-btn-list {
    position: absolute;
    bottom: calc(100% + 15px);
    background: white;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: var(--lm-transition);
    min-width: 200px;
    max-width: 300px;
    z-index: 1;
}

.lm-btn-list.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lm-btn-list.right-align {
    right: calc(100% + 10px);
    bottom: 0;
}

.lm-btn-list.left-align {
    left: calc(100% + 10px);
    bottom: 0;
}

/* Button Items */
.lm-btn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: var(--lm-transition);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 6px;
}

.lm-btn-item:last-child {
    margin-bottom: 0;
}

.lm-btn-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lm-btn-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lm-btn-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 50%;
}

/* ============================================
   EFFECTS — 35 total, CSS-only
   Uses --lm-button-color for color sync
   ============================================ */

.lm-effect-none {
    animation: none !important;
}

.lm-effect-none::before,
.lm-effect-none::after {
    animation: none !important;
    display: none !important;
}

/* --- Wave --- */
.lm-effect-wave {
    animation: lm-wave 2s ease-in-out infinite;
}

@keyframes lm-wave {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--lm-button-color, #e91e63) 60%, transparent);
    }

    50% {
        box-shadow: 0 0 0 20px color-mix(in srgb, var(--lm-button-color, #e91e63) 0%, transparent);
    }

    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--lm-button-color, #e91e63) 0%, transparent);
    }
}

.lm-effect-wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: lm-wave-ring 2s ease-out infinite;
    border: 3px solid var(--lm-button-color, #e91e63);
    opacity: 0;
}

@keyframes lm-wave-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* --- Pulse --- */
.lm-effect-pulse {
    animation: lm-pulse 2s ease-in-out infinite;
}

@keyframes lm-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* --- Soft Pulse --- */
.lm-effect-soft-pulse {
    animation: lm-soft-pulse 3s ease-in-out infinite;
}

@keyframes lm-soft-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.04);
        opacity: 0.9;
    }
}

/* --- Double Pulse --- */
.lm-effect-double-pulse {
    animation: lm-double-pulse 2s ease-in-out infinite;
}

@keyframes lm-double-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    35% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    60% {
        transform: scale(1);
    }
}

/* --- Ripple --- */
.lm-effect-ripple {
    position: relative;
}

.lm-effect-ripple::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid var(--lm-button-color, #e91e63);
    animation: lm-ripple 1.5s ease-out infinite;
}

@keyframes lm-ripple {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* --- Ripple Out --- */
.lm-effect-ripple-out {
    position: relative;
}

.lm-effect-ripple-out::before,
.lm-effect-ripple-out::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--lm-button-color, #e91e63);
}

.lm-effect-ripple-out::before {
    animation: lm-ripple 1.5s ease-out infinite;
}

.lm-effect-ripple-out::after {
    animation: lm-ripple 1.5s ease-out 0.5s infinite;
}

/* --- Heartbeat --- */
.lm-effect-heartbeat {
    animation: lm-heartbeat 1.5s ease-in-out infinite;
}

@keyframes lm-heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.15);
    }

    70% {
        transform: scale(1);
    }
}

/* --- Heartbeat Soft --- */
.lm-effect-heartbeat-soft {
    animation: lm-heartbeat-soft 2s ease-in-out infinite;
}

@keyframes lm-heartbeat-soft {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.06);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.06);
    }

    70% {
        transform: scale(1);
    }
}

/* --- Heartbeat Strong --- */
.lm-effect-heartbeat-strong {
    animation: lm-heartbeat-strong 1.2s ease-in-out infinite;
}

@keyframes lm-heartbeat-strong {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.25);
    }

    28% {
        transform: scale(0.95);
    }

    42% {
        transform: scale(1.2);
    }

    70% {
        transform: scale(1);
    }
}

/* --- Bounce --- */
.lm-effect-bounce {
    animation: lm-bounce 2s ease infinite;
}

@keyframes lm-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-8px);
    }
}

/* --- Bounce Soft --- */
.lm-effect-bounce-soft {
    animation: lm-bounce-soft 2.5s ease infinite;
}

@keyframes lm-bounce-soft {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

/* --- Bounce In --- */
.lm-effect-bounce-in {
    animation: lm-bounce-in 2s ease infinite;
}

@keyframes lm-bounce-in {

    0%,
    100% {
        transform: scale(1);
    }

    30% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.95);
    }

    85% {
        transform: scale(1.03);
    }
}

/* --- Bounce Rotate --- */
.lm-effect-bounce-rotate {
    animation: lm-bounce-rotate 2s ease infinite;
}

@keyframes lm-bounce-rotate {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    25% {
        transform: translateY(-10px) rotate(5deg);
    }

    50% {
        transform: translateY(0) rotate(0);
    }

    75% {
        transform: translateY(-6px) rotate(-3deg);
    }
}

/* --- Float --- */
.lm-effect-float {
    animation: lm-float 3s ease-in-out infinite;
}

@keyframes lm-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* --- Swing --- */
.lm-effect-swing {
    transform-origin: top center;
    animation: lm-swing 1.5s ease-in-out infinite;
}

@keyframes lm-swing {
    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0);
    }
}

/* --- Swing Soft --- */
.lm-effect-swing-soft {
    transform-origin: top center;
    animation: lm-swing-soft 2.5s ease-in-out infinite;
}

@keyframes lm-swing-soft {
    20% {
        transform: rotate(6deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    60% {
        transform: rotate(2deg);
    }

    80% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(0);
    }
}

/* --- Wobble --- */
.lm-effect-wobble {
    animation: lm-wobble 1.5s ease-in-out infinite;
}

@keyframes lm-wobble {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-5px) rotate(-5deg);
    }

    30% {
        transform: translateX(4px) rotate(3deg);
    }

    45% {
        transform: translateX(-3px) rotate(-3deg);
    }

    60% {
        transform: translateX(2px) rotate(2deg);
    }

    75% {
        transform: translateX(-1px) rotate(-1deg);
    }

    100% {
        transform: translateX(0);
    }
}

/* --- Wobble Soft --- */
.lm-effect-wobble-soft {
    animation: lm-wobble-soft 2s ease-in-out infinite;
}

@keyframes lm-wobble-soft {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-2px) rotate(-2deg);
    }

    30% {
        transform: translateX(2px) rotate(1deg);
    }

    45% {
        transform: translateX(-1px) rotate(-1deg);
    }

    60% {
        transform: translateX(1px) rotate(0.5deg);
    }

    100% {
        transform: translateX(0);
    }
}

/* --- Tada --- */
.lm-effect-tada {
    animation: lm-tada 1.5s ease-in-out infinite;
}

@keyframes lm-tada {
    0% {
        transform: scale(1) rotate(0);
    }

    10%,
    20% {
        transform: scale(0.9) rotate(-3deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(3deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(-3deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* --- Tada Soft --- */
.lm-effect-tada-soft {
    animation: lm-tada-soft 2s ease-in-out infinite;
}

@keyframes lm-tada-soft {
    0% {
        transform: scale(1) rotate(0);
    }

    10%,
    20% {
        transform: scale(0.97) rotate(-1deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.04) rotate(1deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.04) rotate(-1deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* --- Glow --- */
.lm-effect-glow {
    animation: lm-glow 2s ease-in-out infinite;
}

@keyframes lm-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 20px rgba(255, 255, 255, 0.4), 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* --- Soft Glow --- */
.lm-effect-soft-glow {
    animation: lm-soft-glow 3s ease-in-out infinite;
}

@keyframes lm-soft-glow {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(255, 255, 255, 0.15);
    }

    50% {
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 0 16px rgba(255, 255, 255, 0.15);
    }
}

/* --- Neon Glow --- */
.lm-effect-neon-glow {
    animation: lm-neon-glow 2s ease-in-out infinite;
}

@keyframes lm-neon-glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--lm-button-color, #e91e63), 0 0 10px var(--lm-button-color, #e91e63);
    }

    50% {
        box-shadow: 0 0 10px var(--lm-button-color, #e91e63), 0 0 25px var(--lm-button-color, #e91e63), 0 0 40px var(--lm-button-color, #e91e63);
    }
}

/* --- Breathing Glow --- */
.lm-effect-breathing-glow {
    animation: lm-breathing-glow 4s ease-in-out infinite;
}

@keyframes lm-breathing-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px var(--lm-button-color, #e91e63);
        opacity: 0.85;
    }
}

/* --- Shine Sweep --- */
.lm-effect-shine-sweep {
    position: relative;
    overflow: hidden;
}

.lm-effect-shine-sweep::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: lm-shine-sweep 2.5s ease-in-out infinite;
    z-index: 1;
    border-radius: 50%;
}

@keyframes lm-shine-sweep {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 150%;
    }
}

/* --- Spin --- */
.lm-effect-spin {
    animation: lm-spin 4s linear infinite;
}

@keyframes lm-spin {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

.lm-effect-spin i,
.lm-effect-spin img {
    animation: lm-spin-rev 4s linear infinite;
}

@keyframes lm-spin-rev {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* --- Spin Slow --- */
.lm-effect-spin-slow {
    animation: lm-spin 8s linear infinite;
}

.lm-effect-spin-slow i,
.lm-effect-spin-slow img {
    animation: lm-spin-rev 8s linear infinite;
}

/* --- Rotate Soft --- */
.lm-effect-rotate-soft {
    animation: lm-rotate-soft 3s ease-in-out infinite;
}

@keyframes lm-rotate-soft {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(8deg);
    }

    75% {
        transform: rotate(-8deg);
    }
}

/* --- Ring --- */
.lm-effect-ring {
    animation: lm-ring 2s ease-in-out infinite;
}

@keyframes lm-ring {
    0% {
        transform: rotate(0);
    }

    5% {
        transform: rotate(15deg);
    }

    10% {
        transform: rotate(-12deg);
    }

    15% {
        transform: rotate(10deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    25% {
        transform: rotate(6deg);
    }

    30% {
        transform: rotate(-4deg);
    }

    35% {
        transform: rotate(2deg);
    }

    40%,
    100% {
        transform: rotate(0);
    }
}

/* --- Ring Soft --- */
.lm-effect-ring-soft {
    animation: lm-ring-soft 2.5s ease-in-out infinite;
}

@keyframes lm-ring-soft {
    0% {
        transform: rotate(0);
    }

    10% {
        transform: rotate(6deg);
    }

    20% {
        transform: rotate(-5deg);
    }

    30% {
        transform: rotate(3deg);
    }

    40% {
        transform: rotate(-2deg);
    }

    50%,
    100% {
        transform: rotate(0);
    }
}

/* --- Ring Strong --- */
.lm-effect-ring-strong {
    animation: lm-ring-strong 1.5s ease-in-out infinite;
}

@keyframes lm-ring-strong {
    0% {
        transform: rotate(0);
    }

    5% {
        transform: rotate(25deg);
    }

    10% {
        transform: rotate(-20deg);
    }

    15% {
        transform: rotate(15deg);
    }

    20% {
        transform: rotate(-12deg);
    }

    25% {
        transform: rotate(8deg);
    }

    30% {
        transform: rotate(-4deg);
    }

    35%,
    100% {
        transform: rotate(0);
    }
}

/* --- Pendulum --- */
.lm-effect-pendulum {
    transform-origin: top center;
    animation: lm-pendulum 2s ease-in-out infinite;
}

@keyframes lm-pendulum {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(12deg);
    }

    75% {
        transform: rotate(-12deg);
    }
}

/* --- Shake --- */
.lm-effect-shake {
    animation: lm-shake 0.82s cubic-bezier(.36, .07, .19, .97) infinite;
}

@keyframes lm-shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

/* --- Flash --- */
.lm-effect-flash {
    animation: lm-flash 2s ease-in-out infinite;
}

@keyframes lm-flash {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.4;
    }
}

/* --- Rubber Band --- */
.lm-effect-rubberband {
    animation: lm-rubberband 1.5s ease-in-out infinite;
}

@keyframes lm-rubberband {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }

    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }

    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }

    65% {
        transform: scaleX(0.95) scaleY(1.05);
    }

    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* --- Jello --- */
.lm-effect-jello {
    animation: lm-jello 1.5s ease-in-out infinite;
}

@keyframes lm-jello {

    0%,
    100% {
        transform: skew(0);
    }

    11.1% {
        transform: skew(-12.5deg, -12.5deg);
    }

    22.2% {
        transform: skew(6.25deg, 6.25deg);
    }

    33.3% {
        transform: skew(-3.125deg, -3.125deg);
    }

    44.4% {
        transform: skew(1.5625deg, 1.5625deg);
    }

    55.5% {
        transform: skew(-0.78deg, -0.78deg);
    }

    66.6% {
        transform: skew(0.39deg, 0.39deg);
    }
}

/* ============================================
   MAP FORM — [lm_map_form] shortcode
   Uses CSS variables for dynamic styling
   ============================================ */

.lm-map-form {
    --mf-radius: var(--mf-border-radius, 16px);
    --mf-active: var(--mf-active-color, #4A90D9);
    --mf-active-border: var(--mf-active-border-color, #4A90D9);
    --mf-bg: var(--mf-panel-bg, #ffffff);
    --mf-grid-gap: var(--mf-gap, 24px);
    --mf-map-h: var(--mf-iframe-height, 400px);
    max-width: 1200px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333;
}

.lm-map-form__header {
    text-align: center;
    margin-bottom: 32px;
}

.lm-map-form__title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.lm-map-form__body {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--mf-grid-gap);
    align-items: start;
}

.lm-map-form__list {
    background: var(--mf-bg);
    border-radius: var(--mf-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 24px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    align-self: start;
}

.lm-map-form__list-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown — hidden on desktop, shown on mobile */
.lm-map-form .lm-map-form__dropdown {
    display: none !important;
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    background-color: #fff !important;
    border: 2px solid var(--mf-active-border) !important;
    border-radius: calc(var(--mf-radius) * 0.75);
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    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 d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 12px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
    line-height: 1.4 !important;
    opacity: 1 !important;
    text-indent: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.lm-map-form .lm-map-form__dropdown option {
    color: #1a1a1a !important;
    background: #fff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px;
}

.lm-map-form .lm-map-form__dropdown:focus {
    outline: none;
    border-color: var(--mf-active) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mf-active) 15%, transparent);
}

.lm-map-form__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid #e8ecf1;
    border-radius: calc(var(--mf-radius) * 0.75);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
}

.lm-map-form__item:last-child {
    margin-bottom: 0;
}

.lm-map-form__item:hover {
    border-color: var(--mf-active);
    background: #f8faff;
    transform: translateX(4px);
}

.lm-map-form__item--active {
    border-color: var(--mf-active-border) !important;
    background: color-mix(in srgb, var(--mf-active) 8%, white) !important;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--mf-active) 15%, transparent);
}

.lm-map-form__item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mf-active) 10%, white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--mf-active);
    font-size: 16px;
}

.lm-map-form__item--active .lm-map-form__item-icon {
    background: var(--mf-active);
    color: #fff;
}

.lm-map-form__item-info {
    flex: 1;
    min-width: 0;
}

.lm-map-form__item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-map-form__item-address {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel */
.lm-map-form__panel {
    background: var(--mf-bg);
    border-radius: var(--mf-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.lm-map-form__panel-info {
    padding: 24px;
}

.lm-map-form__panel-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}

.lm-map-form__panel-address,
.lm-map-form__panel-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
    margin: 0 0 10px;
}

.lm-map-form__panel-address i,
.lm-map-form__panel-phone i {
    color: var(--mf-active);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.lm-map-form__panel-phone a {
    color: var(--mf-active);
    text-decoration: none;
    font-weight: 600;
}

.lm-map-form__panel-phone a:hover {
    text-decoration: underline;
}

.lm-map-form__panel-desc {
    font-size: 13px;
    color: #777;
    margin: 0 0 16px;
    line-height: 1.5;
}

.lm-map-form__panel-actions {
    margin-top: 16px;
}

.lm-map-form__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.lm-map-form__btn--call {
    background: linear-gradient(135deg, var(--mf-active), color-mix(in srgb, var(--mf-active) 80%, #000));
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--mf-active) 30%, transparent);
}

.lm-map-form__btn--call:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--mf-active) 40%, transparent);
    color: #fff;
}

.lm-map-form__iframe {
    width: 100%;
    border-top: 1px solid #e8ecf1;
}

.lm-map-form__iframe iframe {
    width: 100%;
    height: var(--mf-map-h);
    border: none;
    display: block;
    border-radius: 0 0 var(--mf-radius) var(--mf-radius);
}

/* Map form empty/placeholder */
.lm-map-form__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--mf-map-h);
    background: #f8f9fa;
    color: #aaa;
    font-size: 14px;
    border-radius: 0 0 var(--mf-radius) var(--mf-radius);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .lm-call-buttons[data-position="right"] {
        right: 15px;
    }

    .lm-call-buttons[data-position="left"] {
        left: 15px;
    }

    .lm-call-buttons[data-position="right"] .lm-btn-container {
        right: 15px;
    }

    .lm-call-buttons[data-position="left"] .lm-btn-container {
        left: 15px;
    }

    .lm-btn-list {
        min-width: 180px;
        padding: 10px;
    }

    .lm-btn-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .lm-main-btn {
        transform: scale(0.9);
    }

    .lm-main-btn:hover {
        transform: scale(1);
    }

    .lm-map-form__body {
        grid-template-columns: 1fr;
    }

    .lm-map-form__list {
        order: 1;
    }

    .lm-map-form__panel {
        order: 2;
    }

    .lm-map-form__iframe iframe {
        height: 280px;
    }

    .lm-map-form__title {
        font-size: 18px;
    }

    /* Mobile: show dropdown, hide card list */
    .lm-map-form .lm-map-form__dropdown {
        display: block !important;
    }

    .lm-map-form .lm-map-form__item {
        display: none !important;
    }

    .lm-map-form .lm-map-form__list {
        padding: 16px;
        position: static;
        box-shadow: none;
        background: transparent;
        margin-bottom: 0;
    }

    .lm-map-form .lm-map-form__list-title {
        margin-bottom: 10px;
        font-size: 13px;
        color: #666;
    }

    .lm-map-form__body {
        gap: 16px;
    }

    .lm-map-form .lm-map-form__panel {
        border-radius: var(--mf-radius);
    }

    .lm-map-form .lm-map-form__panel-info {
        padding: 20px 16px;
    }

    .lm-map-form .lm-map-form__panel-name {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

@media print {

    .lm-call-buttons,
    .lm-btn-container {
        display: none !important;
    }
}

.lm-main-btn:focus,
.lm-btn-item:focus {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    [class*="lm-effect-"] {
        animation: none !important;
    }

    [class*="lm-effect-"]::before,
    [class*="lm-effect-"]::after {
        animation: none !important;
    }

    .lm-btn-list {
        transition: opacity 0.15s ease;
    }
}

/* ============================================
   LONG CONTACT LISTS — keep the panel on screen
   ============================================ */

.lm-btn-list {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The icon-grid preset lays items out in a grid; scrolling still applies */
.lm-btn-list::-webkit-scrollbar {
    width: 6px;
}

.lm-btn-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 3px;
}

/* ============================================
   MODAL — popup embeds & map popup
   ============================================ */

.lm-modal {
    position: fixed;
    inset: 0;
    z-index: var(--lm-modal-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lm-modal[hidden] {
    display: none !important;
}

.lm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: lm-modal-fade 0.2s ease;
}

.lm-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    animation: lm-modal-pop 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.lm-modal__body {
    padding: 20px;
}

.lm-modal__body>.lm-map-form {
    margin: 0;
}

.lm-modal__body iframe {
    max-width: 100%;
    border: 0;
}

.lm-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #334155;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lm-modal__close:hover {
    background: rgba(0, 0, 0, 0.12);
}

@keyframes lm-modal-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes lm-modal-pop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 768px) {
    .lm-modal {
        padding: 12px;
    }

    .lm-modal__dialog {
        max-height: 92vh;
        border-radius: 12px;
    }

    .lm-modal__body {
        padding: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .lm-modal__backdrop,
    .lm-modal__dialog {
        animation: none;
    }
}

/* ============================================
   TOAST (copy feedback, widget loading)
   ============================================ */

.lm-frontend-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translate(-50%, 12px);
    z-index: calc(var(--lm-modal-z) + 1);
    max-width: min(90vw, 360px);
    padding: 12px 20px;
    border-radius: 10px;
    background: #1e293b;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.lm-frontend-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.lm-frontend-toast.success {
    background: #16a34a;
}

.lm-frontend-toast.error {
    background: #dc2626;
}

/* ============================================
   EXTERNAL WIDGET CONTAINERS
   Zalo OA / Facebook Messenger stay out of sight until one of our buttons
   asks for them, so a site doesn't end up with two floating bubbles.
   ============================================ */

/* A transform on the wrapper makes it the containing block for the widget's
   position:fixed iframe, so this genuinely parks it off-screen instead of
   only moving an empty box. Removing the transform snaps it back. */
.lm-widget-hidden {
    transform: translateX(-200vw);
    opacity: 0;
    pointer-events: none;
}

.lm-widget-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

/* Facebook also appends its bubble to <body>, outside our wrapper */
html.lm-fb-hide-native:not(.lm-fb-open) .fb_dialog {
    display: none !important;
}

html.lm-zalo-hide-native:not(.lm-zalo-open) .zalo-chat-widget-fixed,
html.lm-zalo-hide-native:not(.lm-zalo-open) #ZaloWidget {
    display: none !important;
}

.lm-custom-embed {
    display: contents;
}

/* ============================================
   PRINT — never print floating UI
   ============================================ */

@media print {

    .lm-direct-dock,
    .lm-modal,
    .lm-frontend-toast,
    .lm-zalo-wrap,
    .lm-fb-wrap {
        display: none !important;
    }
}   CONTACT FORM POPUP
   ============================================ */

/* Overlay */
.lm-cf7-popup__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 250ms ease;
}

.lm-cf7-popup__overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.lm-cf7-popup {
    position: absolute;
    z-index: 999999;
    width: 350px;
    min-width: 320px;
    max-width: 380px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 250ms ease, transform 250ms cubic-bezier(0.4, 0, 0.2, 1), visibility 250ms ease;
    will-change: opacity, transform;
}

.lm-cf7-popup.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

/* Popup Header */
.lm-cf7-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    position: relative;
}

.lm-cf7-popup__header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.lm-cf7-popup__header-content > i {
    font-size: 24px;
    flex-shrink: 0;
}

.lm-cf7-popup__header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lm-cf7-popup__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-cf7-popup__subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close Button */
.lm-cf7-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    color: inherit;
    padding: 0;
}

.lm-cf7-popup__close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.lm-cf7-popup__close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Popup Body */
.lm-cf7-popup__body {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(500px - 72px);
}

/* Error Message */
.lm-cf7-popup__error {
    text-align: center;
    padding: 24px 16px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}


/* Tạm dừng các hiệu ứng động (animation infinite) của nút khi popup form đang mở.
   Các hiệu ứng này chạy liên tục, tiêu tốn GPU và gây giật/lag khi mở form. */
body.lm-modal-open [class*="lm-effect-"],
body.lm-modal-open [class*="lm-effect-"]::before,
body.lm-modal-open [class*="lm-effect-"]::after {
    animation-play-state: paused !important;
}

/* Animation Keyframes */
@keyframes lm-cf7-popup-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes lm-cf7-popup-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ============================================
   CONTACT FORM POPUP — RESPONSIVE
   ============================================ */

/* Desktop (>768px) */
@media (min-width: 769px) {
    .lm-cf7-popup {
        max-height: 500px;
    }

    .lm-cf7-popup__body {
        max-height: calc(500px - 72px);
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    .lm-cf7-popup {
        position: fixed;
        bottom: 0;
        left: 16px;
        right: 16px;
        top: auto;
        width: auto;
        min-width: unset;
        max-width: unset;
        max-height: 85vh;
        border-radius: 12px 12px 0 0;
        transform: translateY(20px);
        opacity: 0;
    }

    .lm-cf7-popup.active {
        transform: translateY(0);
        opacity: 1;
    }

    .lm-cf7-popup__body {
        max-height: calc(85vh - 72px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lm-cf7-popup,
    .lm-cf7-popup__overlay {
        transition: opacity 0.15s ease;
    }

    .lm-cf7-popup {
        transform: none;
    }

    .lm-cf7-popup.active {
        transform: none;
    }
}
