/* =====================================================================
   GharMilap - animation layer
   Loaded after styles.css. Additive only: nothing here overrides the
   base template's layout, only motion, hover feedback and the few new
   components (hero chips, rotator, nearby-locality cards).
   ===================================================================== */

:root {
    --gm-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --gm-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --gm-primary: #f1913d;
    --gm-primary-soft: rgba(241, 145, 61, 0.14);
    --gm-primary-line: rgba(241, 145, 61, 0.35);
    --gm-ink: #2c2e33;
    --gm-muted: #5c5e61;
}

/* ---------------------------------------------------------------------
   1. Scroll reveal
   Elements start hidden and are unhidden by IntersectionObserver adding
   .is-visible. If JS never runs, the .no-js fallback below keeps
   everything visible so the page degrades safely.
   --------------------------------------------------------------------- */
.gm-reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.75s var(--gm-ease), transform 0.75s var(--gm-ease);
    will-change: opacity, transform;
}

.gm-reveal.gm-from-left {
    transform: translate3d(-34px, 0, 0);
}

.gm-reveal.gm-from-right {
    transform: translate3d(34px, 0, 0);
}

.gm-reveal.gm-zoom {
    transform: scale(0.92);
}

.gm-reveal.gm-blur {
    filter: blur(9px);
    transition: opacity 0.8s var(--gm-ease), transform 0.8s var(--gm-ease),
        filter 0.8s var(--gm-ease);
}

.gm-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

html.gm-no-js .gm-reveal {
    opacity: 1;
    transform: none;
    filter: none;
}

/* ---------------------------------------------------------------------
   2. Hero - rotating word + locality chips
   --------------------------------------------------------------------- */
.gm-hero-title {
    position: relative;
}

.gm-rotator {
    position: relative;
    display: inline-block;
    color: var(--gm-primary);
    white-space: nowrap;
}

.gm-rotator::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.08em;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--gm-primary), rgba(241, 145, 61, 0));
    transform: scaleX(0);
    transform-origin: left center;
    animation: gm-underline 3.2s var(--gm-ease) infinite;
}

@keyframes gm-underline {
    0% { transform: scaleX(0); opacity: 0; }
    18% { transform: scaleX(1); opacity: 1; }
    78% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; transform-origin: right center; }
}

.gm-rotator .gm-word {
    display: inline-block;
    animation: gm-word-in 0.55s var(--gm-ease) both;
}

.gm-rotator .gm-word.gm-out {
    animation: gm-word-out 0.4s var(--gm-ease-soft) both;
}

@keyframes gm-word-in {
    from { opacity: 0; transform: translateY(0.5em) rotateX(-45deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

@keyframes gm-word-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-0.45em); }
}

.gm-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.gm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    transition: transform 0.35s var(--gm-ease), background 0.35s var(--gm-ease),
        border-color 0.35s var(--gm-ease);
}

.gm-chip i {
    font-size: 12px;
    opacity: 0.85;
}

.gm-chip:hover {
    transform: translateY(-3px);
    background: var(--gm-primary);
    border-color: var(--gm-primary);
}

/* ---------------------------------------------------------------------
   3. Animated counters
   --------------------------------------------------------------------- */
.gm-count {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--gm-ink);
}

/* ---------------------------------------------------------------------
   4. Card motion - lift, image zoom, light sweep
   Scoped to the template's own card classes so it applies everywhere
   without touching their markup.
   --------------------------------------------------------------------- */
.box-house,
.box-house-list,
.categories-item,
.blog-article-item,
.box-location {
    transition: transform 0.5s var(--gm-ease), box-shadow 0.5s var(--gm-ease);
}

.box-house:hover,
.box-house-list:hover,
.blog-article-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 48px -22px rgba(44, 46, 51, 0.32);
}

.categories-item:hover {
    transform: translateY(-6px);
}

.box-house .image-wrap img,
.box-house-list .image-wrap img,
.blog-article-item .image-wrap img,
.box-location .image-wrap img {
    transition: transform 1.1s var(--gm-ease);
}

.box-house:hover .image-wrap img,
.box-house-list:hover .image-wrap img,
.blog-article-item:hover .image-wrap img,
.box-location:hover .image-wrap img {
    transform: scale(1.075);
}

/* light sweep across card images */
.box-house .image-wrap,
.box-location .image-wrap {
    position: relative;
    overflow: hidden;
}

.box-house .image-wrap::after,
.box-location .image-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.32) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-18deg);
    opacity: 0;
}

.box-house:hover .image-wrap::after,
.box-location:hover .image-wrap::after {
    animation: gm-sweep 0.95s var(--gm-ease-soft) forwards;
}

@keyframes gm-sweep {
    from { left: -70%; opacity: 0; }
    25% { opacity: 1; }
    to { left: 130%; opacity: 0; }
}

/* price pulse on hover */
.box-house .price,
.box-house-list .price {
    transition: color 0.35s var(--gm-ease), transform 0.35s var(--gm-ease);
    display: inline-block;
}

.box-house:hover .price,
.box-house-list:hover .price {
    color: var(--gm-primary);
    transform: scale(1.05);
}

/* tag badge pop-in */
.box-tag .flat-tag {
    animation: gm-badge-pop 0.5s var(--gm-ease) both;
}

.box-tag .flat-tag:nth-child(2) {
    animation-delay: 0.1s;
}

@keyframes gm-badge-pop {
    from { opacity: 0; transform: translateY(-8px) scale(0.85); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------------
   5. Buttons - magnetic nudge + ripple
   --------------------------------------------------------------------- */
.tf-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--gm-ease), box-shadow 0.35s var(--gm-ease),
        background-color 0.35s var(--gm-ease);
}

.tf-btn:hover {
    transform: translateY(-2px);
}

.tf-btn.bg-color-primary:hover {
    box-shadow: 0 14px 28px -12px rgba(241, 145, 61, 0.75);
}

.gm-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: gm-ripple 0.65s var(--gm-ease-soft) forwards;
    pointer-events: none;
}

@keyframes gm-ripple {
    to { transform: scale(2.6); opacity: 0; }
}

/* ---------------------------------------------------------------------
   6. Header - shrink on scroll, animated nav underline
   --------------------------------------------------------------------- */
.header-sticky {
    transition: box-shadow 0.4s var(--gm-ease), background-color 0.4s var(--gm-ease);
}

.header-sticky.gm-shrunk {
    box-shadow: 0 8px 26px -18px rgba(44, 46, 51, 0.45);
}

.header-sticky.gm-shrunk .header-inner {
    transition: padding 0.4s var(--gm-ease);
}

.main-menu .navigation > li > a {
    position: relative;
}

.main-menu .navigation > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--gm-primary);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.4s var(--gm-ease);
}

.main-menu .navigation > li:hover > a::after,
.main-menu .navigation > li.current-menu > a::after {
    transform: scaleX(1);
    transform-origin: left center;
}

/* ---------------------------------------------------------------------
   7. Scroll progress bar
   --------------------------------------------------------------------- */
.gm-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--gm-primary), #ffc48a);
    box-shadow: 0 0 12px rgba(241, 145, 61, 0.6);
    transition: width 0.12s linear;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   8. Nearby-to-Zirakpur section
   --------------------------------------------------------------------- */
.gm-nearby {
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

.gm-nearby::before,
.gm-nearby::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.gm-nearby::before {
    width: 420px;
    height: 420px;
    top: -160px;
    right: -140px;
    background: radial-gradient(circle, var(--gm-primary-soft), transparent 68%);
    animation: gm-float 13s ease-in-out infinite;
}

.gm-nearby::after {
    width: 320px;
    height: 320px;
    bottom: -130px;
    left: -110px;
    background: radial-gradient(circle, rgba(241, 145, 61, 0.1), transparent 68%);
    animation: gm-float 17s ease-in-out infinite reverse;
}

@keyframes gm-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-26px, 24px) scale(1.08); }
}

.gm-nearby .tf-container {
    position: relative;
    z-index: 1;
}

.gm-nearby-head {
    text-align: center;
    margin-bottom: 14px;
}

.gm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 14px;
    border-radius: 999px;
    font-size: 12.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--gm-primary);
    background: var(--gm-primary-soft);
    border: 1px solid var(--gm-primary-line);
}

.gm-eyebrow .gm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gm-primary);
    position: relative;
}

.gm-eyebrow .gm-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--gm-primary);
    opacity: 0;
    animation: gm-pulse-ring 2.2s var(--gm-ease-soft) infinite;
}

@keyframes gm-pulse-ring {
    0% { transform: scale(0.6); opacity: 0.9; }
    75%, 100% { transform: scale(1.5); opacity: 0; }
}

.gm-nearby-sub {
    max-width: 720px;
    margin: 0 auto 44px;
    text-align: center;
    color: var(--gm-muted);
}

.gm-nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 18px;
    margin-bottom: 46px;
}

.gm-place {
    position: relative;
    display: block;
    padding: 22px 20px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(44, 46, 51, 0.09);
    text-decoration: none;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.4s var(--gm-ease), box-shadow 0.4s var(--gm-ease),
        border-color 0.4s var(--gm-ease);
}

.gm-place::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gm-primary);
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 0.45s var(--gm-ease);
}

.gm-place:hover {
    border-color: var(--gm-primary-line);
    box-shadow: 0 18px 40px -22px rgba(44, 46, 51, 0.35);
}

.gm-place:hover::before {
    transform: scaleY(1);
}

.gm-place-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.gm-place-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gm-ink);
    margin: 0;
}

.gm-place-dist {
    font-size: 13px;
    font-weight: 600;
    color: var(--gm-primary);
    white-space: nowrap;
}

.gm-place-meta {
    font-size: 13px;
    color: var(--gm-muted);
    margin: 0 0 14px;
}

.gm-place-bar {
    height: 4px;
    border-radius: 4px;
    background: rgba(44, 46, 51, 0.08);
    overflow: hidden;
}

.gm-place-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gm-primary), #ffc48a);
    transition: width 1.1s var(--gm-ease);
}

.gm-place-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--gm-muted);
}

.gm-place-count {
    font-weight: 600;
    color: var(--gm-ink);
}

.gm-place-arrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gm-primary);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.35s var(--gm-ease), transform 0.35s var(--gm-ease);
}

.gm-place:hover .gm-place-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* the office / map panel */
.gm-map-panel {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(44, 46, 51, 0.09);
    box-shadow: 0 26px 60px -34px rgba(44, 46, 51, 0.4);
    background: #fff;
}

.gm-map-info {
    padding: 34px 32px;
}

.gm-map-info h3 {
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--gm-ink);
}

.gm-map-info p {
    color: var(--gm-muted);
    margin: 0 0 20px;
    font-size: 14.5px;
    line-height: 1.65;
}

.gm-map-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.gm-map-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    font-size: 14px;
    color: var(--gm-ink);
    border-bottom: 1px dashed rgba(44, 46, 51, 0.1);
}

.gm-map-list li:last-child {
    border-bottom: 0;
}

.gm-map-list i {
    color: var(--gm-primary);
    margin-top: 3px;
    flex-shrink: 0;
}

.gm-map-frame {
    position: relative;
    min-height: 380px;
    background: #eceff1;
}

.gm-map-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    filter: saturate(0.9);
    transition: filter 0.6s var(--gm-ease);
}

.gm-map-frame:hover iframe {
    filter: saturate(1.05);
}

@media (max-width: 991px) {
    .gm-map-panel {
        grid-template-columns: 1fr;
    }

    .gm-map-frame {
        min-height: 300px;
    }

    .gm-nearby {
        padding: 64px 0;
    }
}

/* ---------------------------------------------------------------------
   9. Marquee strip (locality ticker)
   --------------------------------------------------------------------- */
.gm-ticker {
    overflow: hidden;
    padding: 14px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(44, 46, 51, 0.08);
    border-bottom: 1px solid rgba(44, 46, 51, 0.08);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.gm-ticker-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: gm-marquee 34s linear infinite;
}

.gm-ticker:hover .gm-ticker-track {
    animation-play-state: paused;
}

.gm-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gm-muted);
    white-space: nowrap;
}

.gm-ticker-item i {
    color: var(--gm-primary);
    font-size: 13px;
}

@keyframes gm-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------------
   10. Floating WhatsApp / call button
   --------------------------------------------------------------------- */
.gm-float-call {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--gm-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 30px -10px rgba(241, 145, 61, 0.8);
    transform: translateY(90px);
    opacity: 0;
    transition: transform 0.5s var(--gm-ease), opacity 0.5s var(--gm-ease),
        box-shadow 0.35s var(--gm-ease);
}

.gm-float-call.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.gm-float-call:hover {
    color: #fff;
    box-shadow: 0 16px 36px -8px rgba(241, 145, 61, 0.95);
}

.gm-float-call::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 2px solid var(--gm-primary);
    animation: gm-pulse-ring 2.4s var(--gm-ease-soft) infinite;
    pointer-events: none;
}

@media (max-width: 767px) {
    .gm-float-call span {
        display: none;
    }

    .gm-float-call {
        padding: 14px;
        bottom: 84px;
        right: 16px;
    }
}

/* ---------------------------------------------------------------------
   11. Section heading underline sweep
   --------------------------------------------------------------------- */
.heading-section .title {
    position: relative;
    display: inline-block;
}

.heading-section .title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 62px;
    height: 3px;
    border-radius: 3px;
    background: var(--gm-primary);
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.7s var(--gm-ease) 0.15s;
}

.heading-section.is-visible .title::after {
    transform: translateX(-50%) scaleX(1);
}

/* ---------------------------------------------------------------------
   12. Loader
   --------------------------------------------------------------------- */
#loading .icon img {
    animation: gm-logo-breathe 1.9s var(--gm-ease-soft) infinite;
}

@keyframes gm-logo-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.9); opacity: 0.7; }
}

/* ---------------------------------------------------------------------
   13. Dark theme adjustments
   The template toggles a dark mode; keep the new components readable.
   --------------------------------------------------------------------- */
body.dark-theme .gm-place,
.dark-theme .gm-place,
[data-theme="dark"] .gm-place {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .gm-place-name,
.dark-theme .gm-place-name,
[data-theme="dark"] .gm-place-name,
body.dark-theme .gm-map-info h3,
.dark-theme .gm-map-info h3,
[data-theme="dark"] .gm-map-info h3,
body.dark-theme .gm-count,
.dark-theme .gm-count,
[data-theme="dark"] .gm-count {
    color: #fff;
}

body.dark-theme .gm-map-panel,
.dark-theme .gm-map-panel,
[data-theme="dark"] .gm-map-panel {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------------
   14. Reduced motion
   Anyone who has asked their OS to limit animation gets a static page.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    .gm-reveal,
    .gm-reveal.is-visible {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
