/* Component: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background-color: var(--color-accent);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--color-accent);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: #fff;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
    border: 1px solid var(--color-accent);
}
.btn-primary:hover {
    background-color: var(--color-accent-dark);
    color: #fff;
    border-color: var(--color-accent-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}
.btn-outline:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.75rem;
}

.btn-full { width: 100%; }

/* Component: Property Card (Editorial Style) */
.prop-card {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.prop-img {
    position: relative;
    height: 320px; /* Taller editorial ratio */
    overflow: hidden;
    margin-bottom: 1.5rem;
    background-color: #f0f0f0;
}

.prop-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.prop-card:hover .prop-img img {
    transform: scale(1.05); /* Subtle zoom */
}

.prop-img .tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #FFFFFF;
    color: #1a1a1a;
    padding: 6px 12px;
    font-size: 0.7rem;
    text-transform: uppercase; /* Clean sans */
    letter-spacing: 0.1em;
    font-weight: 500;
    z-index: 2;
}

.prop-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    line-height: 1.25;
}

.prop-info .location {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prop-info .price {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.prop-info .specs {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #777;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* =========================================
   COMPONENT: HEADER (Premium Sticky)
   ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: rgba(255, 255, 255, 0.95); /* Default to slighttransparency white for readability anywhere */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.site-header.transparent {
    background: transparent;
    border-bottom: 1px solid transparent;
    backdrop-filter: none;
}
.site-header.transparent:hover,
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.header-container {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    width: 232px;
    height: 36px;
    flex: 0 0 232px;
    padding-left: 1.5rem; /* User requested logo move right */
}

.brand-logo img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s;
}

/* Desktop Navigation */
.main-nav {
    display: flex;
    gap: 3.5rem;
}

.nav-link {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #999;
}
.lang-toggle a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}
.lang-toggle a.active {
    color: var(--color-text);
}

.btn-list-property {
    background: var(--color-accent);
    color: #fffef6;
    border: 1px solid var(--color-accent);
    padding: 10px 24px;
    border-radius: 14px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-list-property:hover {
    background: var(--color-accent-dark);
    color: #fffef6;
    border-color: var(--color-accent-dark);
}

a.btn.btn-primary,
a.btn-list-property {
    position: relative;
    isolation: isolate;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
    -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.18);
}

a.btn.btn-primary::before,
a.btn-list-property::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
        120% 90% at 50% 50%,
        rgba(0, 0, 0, 0.20) 0%,
        rgba(0, 0, 0, 0.12) 45%,
        rgba(0, 0, 0, 0.00) 88%
    );
}

a.btn-list-property {
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    -webkit-text-stroke: 0;
}

a.btn-list-property::before {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0) 86%
    );
}

/* Mobile Toggle - HIDDEN (Replaced by Bottom Nav) */
.mobile-toggle {
    display: none !important;
}

/* =========================================
   COMPONENT: BOTTOM NAVIGATION (App Style)
   ========================================= */
.mobile-bottom-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.08); /* Subtle border */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 1500; /* Below overlay (2000), above content */
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
    height: calc(3.5rem + env(safe-area-inset-bottom));
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #4a4a4a; /* Much darker grey for visibility */
    padding: 0.5rem 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.bottom-nav-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
    stroke-width: 1.8px; /* Thicker lines */
}

.bottom-nav-item span {
    font-size: 0.65rem;
    font-family: var(--font-primary);
    font-weight: 400; /* Increased weight */
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--color-accent); /* Active Color */
}
.bottom-nav-item.active svg,
.bottom-nav-item:hover svg {
    stroke: var(--color-accent);
}

@media (max-width: 991px) {
    .main-nav { display: none; }
    .header-actions { display: none; }
    /* Show Bottom Nav on Mobile */
    .mobile-bottom-nav { 
        display: flex; 
        justify-content: space-between;
    }
    .header-container { padding: 0 1rem; }
    .brand-logo {
        width: 176px;
        height: 27px;
        flex: 0 0 176px;
        padding-left: 0;
    }
    
    /* Ensure content isn't hidden behind fixed bottom nav */
    body {
        padding-bottom: 5rem;
    }
}

/* =========================================
   COMPONENT: MOBILE MENU (Premium Drawer)
   ========================================= */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    background: rgba(20, 16, 11, 0.28);
    backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    display: grid;
    place-items: end center;
    padding: max(0.8rem, env(safe-area-inset-top, 0px)) 1rem
        calc(max(0.8rem, env(safe-area-inset-bottom, 0px)) + 4.25rem);
}

.mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    width: min(560px, 100%);
    height: min(860px, calc(100% - 0.5rem));
    max-height: calc(100% - 0.5rem);
    border-radius: 26px;
    border: 1px solid rgba(212, 187, 149, 0.36);
    background:
        radial-gradient(440px 230px at 110% -10%, rgba(194, 155, 101, 0.22), rgba(194, 155, 101, 0)),
        radial-gradient(420px 260px at -15% 100%, rgba(194, 155, 101, 0.16), rgba(194, 155, 101, 0)),
        linear-gradient(170deg, #ffffff 0%, #fbf6ee 100%);
    box-shadow: 0 28px 52px rgba(17, 12, 7, 0.24);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    transform: translateY(18px) scale(0.985);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.open .mobile-menu-inner {
    transform: translateY(0) scale(1);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.15rem 0.9rem;
    border-bottom: 1px solid #ebdfce;
}

.menu-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.menu-brand-logo {
    width: 78px;
    height: 78px;
    object-fit: contain;
    margin: -0.25rem 0 -0.15rem;
    filter: drop-shadow(0 10px 20px rgba(166, 138, 100, 0.32));
}

.menu-close-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2d2bb;
    border-radius: 50%;
    color: #4a3c2b;
    cursor: pointer;
    transition: all 0.22s ease;
}

.menu-close-btn:hover {
    background: #f6ebdd;
    transform: rotate(90deg);
}

.mobile-nav-area {
    padding: 0.9rem 1rem 0.7rem;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.62rem;
}

.mobile-nav-item {
    opacity: 0;
    transform: translateY(8px);
}

.mobile-menu-overlay.open .mobile-nav-item {
    animation: mobileNavFadeIn 0.35s ease forwards;
    animation-delay: calc(var(--item-index) * 35ms);
}

@keyframes mobileNavFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.92rem 1rem;
    text-decoration: none;
    border: 1px solid #eadcc8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.link-wrapper {
    display: block;
}

.link-text {
    font-family: var(--font-primary);
    font-size: 1.06rem;
    font-weight: 500;
    color: #2f271e;
    transition: color 0.2s ease;
}

.link-subtext {
    display: block;
    margin-top: 0.18rem;
    max-width: 31ch;
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.35;
    color: #6f5b43;
}

.mobile-nav-link-install .link-wrapper {
    max-width: calc(100% - 44px);
}

.mobile-nav-link-install .link-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Force Thai typography on mobile navigation to avoid fallback mismatch on some devices */
html[lang^="th"] .mobile-nav-link .link-text,
html[lang^="th"] .mobile-nav-link .link-subtext,
html[lang^="th"] .bottom-nav-item span,
html[lang^="th"] .lang-toggle-mobile a {
    font-family: var(--font-th);
    letter-spacing: 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    transform: translateY(-1px);
    border-color: #cfb189;
    background: linear-gradient(145deg, #fff 0%, #f6ecd8 100%);
    box-shadow: 0 10px 18px rgba(66, 48, 24, 0.1);
}

.mobile-nav-link::after {
    content: ">";
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #dfccb0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #91754c;
    line-height: 1;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mobile-nav-link:hover::after,
.mobile-nav-link.active::after {
    transform: translateX(1px);
    border-color: #caac84;
    background: #f9f1e4;
}

.mobile-menu-footer {
    padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #ebdfce;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(249, 241, 228, 0.82) 100%);
}

.lang-toggle-mobile-top {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.btn-mobile-cta {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #b9945f 0%, #a8804a 100%);
    color: #fff;
    border: 1px solid #a8804a;
    text-align: center;
    padding: 0.88rem 1rem;
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
    margin-bottom: 0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(168, 128, 74, 0.28);
}

.btn-mobile-cta:hover {
    background: linear-gradient(135deg, #c39f69 0%, #b88f58 100%);
    color: #fff;
}

.mobile-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #726554;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.lang-toggle-mobile a {
    color: #7f6f5a;
    text-decoration: none;
    margin-right: 0.65rem;
    font-family: "Mitr", var(--font-primary), sans-serif;
    font-weight: 500;
    padding: 0.2rem 0.42rem;
    border-radius: 8px;
}

.lang-toggle-mobile a.active {
    color: #2f281f;
    background: #efe0c8;
}

.social-links-mobile {
    display: flex;
    gap: 0.48rem;
}

.social-link-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e2d2bb;
    color: #7e6a4d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.2s ease;
}

.social-link-sm:hover {
    color: #fff;
    background: linear-gradient(135deg, #b9945f 0%, #a8804a 100%);
    border-color: #a8804a;
    transform: translateY(-1px);
}

@media (max-width: 991px) {
    .main-nav, .header-actions { display: none; }
    .mobile-toggle { display: flex; }
    .header-container { padding: 0 1rem; }

    body.mobile-menu-open {
        overflow: hidden;
    }
}

@media (max-width: 520px) {
    .mobile-menu-overlay {
        padding: max(0.65rem, env(safe-area-inset-top, 0px)) 0.65rem
            calc(max(0.75rem, env(safe-area-inset-bottom, 0px)) + 4.25rem);
    }

    .mobile-menu-inner {
        height: min(860px, calc(100% - 0.5rem));
        border-radius: 20px;
    }

    .mobile-nav-link {
        padding: 0.85rem 0.9rem;
    }

    .link-text {
        font-size: 1rem;
    }
}

@media (max-width: 991px) {
    .bottom-nav-item,
    .bottom-nav-item span {
        color: #3f3f3f;
    }
    .bottom-nav-item.active,
    .bottom-nav-item.active span,
    .bottom-nav-item:hover,
    .bottom-nav-item:hover span {
        color: #8b7251;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    }

    .bottom-nav-item.active svg,
    .bottom-nav-item:hover svg {
        stroke: #8b7251;
    }
}
/* =========================================
   COMPONENT: FOOTER (Modern Editorial Grid)
   ========================================= */
.site-footer {
    position: relative;
    background:
        radial-gradient(1200px 500px at 8% -20%, rgba(201, 169, 97, 0.16), transparent 55%),
        radial-gradient(900px 420px at 90% 5%, rgba(150, 117, 69, 0.12), transparent 60%),
        linear-gradient(180deg, #0e1014 0%, #090b0f 100%);
    color: #e8e9ec;
    border-top: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}

html.pwa-standalone .site-footer,
body.pwa-standalone .site-footer {
    display: none !important;
}

@media all and (display-mode: standalone) {
    .site-footer {
        display: none !important;
    }
}

.footer-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 4rem 1.5rem 1.5rem;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(0, 1.85fr);
    gap: 2rem;
    align-items: start;
}

.footer-brand-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 18px;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
}

.footer-logo {
    width: 232px;
    height: auto;
    max-width: 100%;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.footer-tagline {
    margin: 0 0 1.4rem;
    color: #b2b7c0;
    line-height: 1.72;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: #eceef1;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 169, 97, 0.75);
    background: rgba(201, 169, 97, 0.17);
    color: #fff;
}

.footer-nav-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.footer-col {
    padding: 0.2rem 0.2rem;
}

.footer-col-heading {
    margin: 0 0 1rem;
    font-size: 0.96rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #f7f8fa;
    font-weight: 600;
}

.footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li + li {
    margin-top: 0.62rem;
}

.footer-links a {
    color: #adb2bb;
    text-decoration: none;
    line-height: 1.4;
    transition: color .2s ease, transform .2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
    transform: translateX(2px);
}

.contact-item {
    margin-bottom: 0.8rem;
}

.contact-item p {
    margin: 0;
    color: #b9bec7;
    line-height: 1.55;
}

.contact-label {
    display: inline-block;
    margin-bottom: 0.24rem;
    font-size: .75rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #8f96a2;
}

.footer-contact-col a {
    color: #e9edf4;
    text-decoration: none;
    border-bottom: 1px dashed rgba(233, 237, 244, 0.45);
}

.footer-contact-col a:hover {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.8);
}

.footer-bottom {
    margin-top: 2.3rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #8e94a1;
    font-size: .86rem;
}

.footer-legal a {
    color: #9ca3ae;
    text-decoration: none;
    margin-left: 1rem;
    transition: color .2s ease;
}

.footer-legal a:hover {
    color: #fff;
}

@media (max-width: 1080px) {
    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-nav-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .footer-shell {
        padding: 3rem 1rem 1.3rem;
    }

    .footer-brand-block {
        padding: 1.2rem;
    }

    .footer-nav-columns {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
        width: 100%;
    }

    .copyright {
        width: 100%;
        text-align: left;
    }

    .footer-legal {
        width: 100%;
        display: flex;
        gap: 1rem;
    }

    .footer-legal a {
        margin-left: 0;
    }
}

/* Desktop Header Adjustments */
@media (min-width: 992px) {
    .brand-logo {
        padding-left: 4rem; /* Simple nudge to align with text block inside 1400px grid */
    }
    
    .main-nav {
         /* Ensure gap is consistent */
         gap: 3rem;
    }
}
