/* ==========================================================================
   JSENSE "MAISON" LUXURY DESIGN SYSTEM v2
   Cormorant Garamond · Jost · Noto Serif TC/SC
   ========================================================================== */

:root {
    /* ── Palette ── */
    --noir:          #070707;
    --onyx:          #101010;
    --charcoal:      #1a1a1a;
    --smoke:         #2a2a2a;
    --gold:          #c9a84c;
    --gold-light:    #e5c97a;
    --gold-dim:      rgba(201,168,76,0.18);
    --ivory:         #f6f0e6;
    --mist:          rgba(246,240,230,0.68);
    --text-main:     #e2ddd6;
    --text-muted:    #7a7568;
    --stroke:        rgba(255,255,255,0.07);
    --stroke-gold:   rgba(201,168,76,0.22);

    /* ── Typography ── */
    --font-display:  'Cormorant Garamond', 'Noto Serif TC', Georgia, serif;
    --font-ui:       'Jost', 'Segoe UI', system-ui, sans-serif;
    --font-tw:       'Noto Serif TC', 'Cormorant Garamond', serif;
    --font-cn:       'Noto Serif SC', 'Cormorant Garamond', serif;

    /* ── Font-size design tokens (overridable via Admin → Settings → Typography) ── */
    --font-size-nav:        0.82rem;
    --font-size-body:       1rem;
    --font-size-heading:    2.5rem;
    --font-size-subheading: 1.5rem;
    --font-size-card:       0.9rem;
    --font-size-footer:     0.85rem;
    --font-size-button:     0.85rem;

    /* ── Easing ── */
    --ease-luxury:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ── Spacing ── */
    --nav-h:         60px;
    --radius-sm:     8px;
    --radius:        16px;
    --radius-lg:     28px;
}

/* ── Foundation ── */
html { scroll-behavior: smooth; }

body {
    background-color: var(--noir);
    background-image:
        radial-gradient(ellipse 120% 60% at 50% -10%, rgba(201,168,76,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 80% 40% at 80% 100%, rgba(201,168,76,0.05) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    font-weight: 300;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--nav-h);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Language body overrides */
html[lang="zh_tw"] body, html[lang="tw"] body { font-family: var(--font-tw); }
html[lang="zh_cn"] body, html[lang="cn"] body { font-family: var(--font-cn); }

/* Protect icon fonts from CJK body font override */
i.fas, i.far, i.fab, i.fal, i.fad, i.fa-solid, i.fa-regular, i.fa-brands,
.fas, .far, .fab, .fal, .fad,
[class*="fa-"] { font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important; }

/* Container */
.container, .container-fluid { padding-left: 2vw !important; padding-right: 2vw !important; }
.navbar .container-xxl, .navbar .container-fluid { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

/* ── Typography ── */
h1, h2, h3, h4, .luxury-title, .luxury-page-title, .hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    color: #fff;
    letter-spacing: 0.04em;
    line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 4rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.8rem); margin-bottom: 1.2rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); margin-bottom: 1rem; }
p.lead { font-size: 1.05rem; color: var(--mist); line-height: 1.9; }

html[lang="zh_tw"] h1, html[lang="zh_tw"] h2, html[lang="zh_tw"] h3,
html[lang="zh_cn"] h1, html[lang="zh_cn"] h2, html[lang="zh_cn"] h3 {
    font-family: var(--font-tw);
    letter-spacing: 0.06em;
}

/* Utility */
.text-gold  { color: var(--gold) !important; }
.text-ivory { color: var(--ivory) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Decorative gold divider line */
.gold-rule {
    display: block;
    width: 60px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1rem auto;
}
/* Ornamental section heading kicker */
.kicker {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-ui);
    font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--gold);
}
.kicker::before, .kicker::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold) 60%);
    display: inline-block; min-width: 30px;
}
.kicker::after { background: linear-gradient(270deg, transparent, var(--gold) 60%); }

/* ── Navbar ── */
.navbar-glass {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 2500;
    height: var(--nav-h);
    background: rgba(7,7,7,0.82) !important;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--stroke) !important;
    box-shadow: 0 1px 0 rgba(201,168,76,0.08) !important;
    transition: background 0.5s var(--ease-luxury), box-shadow 0.5s var(--ease-luxury);
    padding: 0 !important;
}
/* Thin gold line across top */
.navbar-glass::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 100%);
    opacity: 0.6;
}
.navbar-glass.scrolled {
    background: rgba(5,5,5,0.96) !important;
    border-bottom: 1px solid var(--stroke-gold) !important;
    box-shadow: 0 4px 30px rgba(0,0,0,0.7), 0 1px 0 rgba(201,168,76,0.15) !important;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.28em !important;
    text-transform: uppercase;
    color: #fff !important;
    text-shadow: 0 0 30px rgba(201,168,76,0.25);
    transition: letter-spacing 0.4s var(--ease-luxury);
    white-space: nowrap;
}
.brand-text:hover { letter-spacing: 0.35em !important; color: var(--gold-light) !important; }

.nav-link {
    font-family: var(--font-ui);
    font-size: var(--font-size-nav) !important;
    font-weight: 500;
    letter-spacing: 0.20em;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    padding: 6px 12px !important;
    position: relative;
    transition: color 0.3s ease;
}
/* Underline */
.nav-link::after {
    content: '';
    position: absolute; bottom: 2px; left: 50%;
    width: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: width 0.4s var(--ease-luxury), left 0.4s var(--ease-luxury);
}
.nav-link:hover::after, .nav-link.active::after { width: 70%; left: 15%; }
.nav-link:hover, .nav-link.active { color: var(--ivory) !important; }

html[lang="zh_tw"] .nav-link,
html[lang="zh_cn"] .nav-link { font-family: var(--font-tw) !important; font-size: 0.88rem !important; letter-spacing: 0.14em; }

/* Dropdown */
.dropdown-menu {
    background: rgba(12,12,12,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke-gold) !important;
    border-top: 2px solid var(--gold) !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 8px 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.65), 0 0 40px rgba(201,168,76,0.06);
    min-width: 200px;
}
.dropdown-item {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-main);
    padding: 11px 20px 11px 32px !important;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.22s var(--ease-luxury);
}
.dropdown-item::before {
    content: ''; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 8px; height: 1px;
    background: var(--gold); opacity: 0;
    transition: opacity 0.22s ease, width 0.22s ease;
}
.dropdown-item:hover::before { opacity: 1; width: 12px; }
.dropdown-item:hover {
    background: var(--gold-dim);
    color: var(--gold-light) !important;
    padding-left: 38px !important;
}
.dropdown-item:last-child { border-bottom: none; }

html[lang="zh_tw"] .dropdown-item,
html[lang="zh_cn"] .dropdown-item { font-family: var(--font-tw) !important; font-size: 0.92rem !important; }

/* Navbar right controls */
.icon-link {
    color: var(--text-muted);
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s var(--ease-spring);
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-link:hover { color: var(--gold); transform: translateY(-2px); }

/* Language select */
.lang-select select {
    background: rgba(255,255,255,0.04) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 100px !important;
    padding: 3px 28px 3px 12px !important;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a84c'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 10px) center !important;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.lang-select select:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 2px rgba(201,168,76,0.15) !important; }
.lang-select select option { background: #111 !important; color: #fff !important; }

/* ── Buttons ── */
.btn {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: all 0.35s var(--ease-luxury);
}
.btn-luxury {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--noir) !important;
    border: none;
    border-radius: 100px;
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 20px rgba(201,168,76,0.25);
}
.btn-luxury:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,168,76,0.4);
    color: var(--noir) !important;
}
.btn-outline-gold {
    background: transparent;
    color: var(--gold) !important;
    border: 1px solid var(--gold);
    border-radius: 100px;
    padding: 0.6rem 1.8rem;
}
.btn-outline-gold:hover {
    background: var(--gold-dim);
    transform: translateY(-2px);
    color: var(--gold-light) !important;
}
.btn-warning {
    background: #ffc107;
    color: #000 !important;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-warning:hover {
    background: #ffb800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
    color: #000 !important;
}

/* ── Cards / Surfaces ── */
.luxury-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.5s var(--ease-luxury), box-shadow 0.5s var(--ease-luxury), border-color 0.5s var(--ease-luxury);
}
.luxury-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--stroke-gold);
    border-color: var(--stroke-gold);
}

/* Product & portfolio cards */
.product-card, .portfolio-card {
    background: var(--onyx);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.5s var(--ease-luxury), box-shadow 0.5s var(--ease-luxury), border-color 0.4s ease;
}
.product-card:hover, .portfolio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,168,76,0.3);
    border-color: rgba(201,168,76,0.3);
}
.p-image-wrap { overflow: hidden; position: relative; }
.p-image-wrap img {
    transition: transform 1.2s var(--ease-luxury), filter 0.8s ease;
    filter: brightness(0.9) contrast(1.05) saturate(0.9);
}
.product-card:hover .p-image-wrap img,
.portfolio-card:hover .p-image-wrap img {
    transform: scale(1.06);
    filter: brightness(1) contrast(1.05) saturate(1);
}

/* ── Forms ── */
.form-control, .form-select {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    color: var(--ivory) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.75rem 1rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.form-control:focus, .form-select:focus {
    background: rgba(201,168,76,0.04) !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.10) !important;
    color: #fff !important;
}
::placeholder { color: var(--text-muted) !important; opacity: 0.7; }
.form-label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* ── Tables ── */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(201,168,76,0.05);
    color: var(--text-main);
    border-color: var(--stroke);
}
.table > thead > tr > th {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid var(--stroke-gold);
    padding: 0.85rem 1rem;
}

/* ── Badges ── */
.badge {
    font-family: var(--font-ui);
    font-weight: 500;
    letter-spacing: 0.08em;
    border-radius: 4px;
    padding: 0.35em 0.65em;
}

/* Scroll reveal */
.sense-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.sense-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── Glass surface ── */
.glass-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Footer ── */
.sense-footer {
    margin-top: 0;
    padding: 36px 0 24px;
    border-top: 1px solid var(--stroke-gold);
    background: linear-gradient(180deg, rgba(201,168,76,0.03) 0%, transparent 100%);
    position: relative;
}
/* Decorative top ornament */
.sense-footer::before {
    content: '✦';
    position: absolute;
    top: -0.7em;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    font-size: 0.75rem;
    background: var(--noir);
    padding: 0 10px;
    letter-spacing: 8px;
}
.sense-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.sense-footer-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.22em;
    color: var(--ivory);
    text-transform: uppercase;
}
.sense-footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
.sense-footer-links a {
    font-family: var(--font-ui);
    font-size: var(--font-size-footer);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}
.sense-footer-links a:hover { color: var(--gold); }

/* Social icons */
.sense-footer-socials { display: flex; gap: 16px; align-items: center; }
.sense-footer-socials a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--stroke);
    border-radius: 50%;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-spring);
}
.sense-footer-socials a:hover {
    color: var(--gold);
    border-color: var(--stroke-gold);
    transform: translateY(-3px);
}

.sense-fineprint {
    width: 100%;
    text-align: center;
    font-family: var(--font-ui);
    font-size: var(--font-size-footer);
    letter-spacing: 0.12em;
    color: rgba(246,240,230,0.28);
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 20px;
}

/* ── About Us image ── */
.luxury-image-wrapper {
    border-radius: 20px;
    overflow: hidden;
    max-height: 480px;
    position: relative;
}
.luxury-image-wrapper img {
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ── About Us text ── */
.luxury-text {
    color: var(--text-muted, rgba(244,239,231,0.72));
    font-size: 0.97rem;
    line-height: 1.9;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
.luxury-subtitle {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

/* ── Contact map container ── */
.map-container {
    width: 100%;
    height: 440px;
    border-radius: 20px;
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255,255,255,0.08);
}
.map-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block;
    min-height: 440px;
}

/* ── Global overflow protection ── */
html, body { overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; }

/* ── Responsive ── */
/* 17" screen (~1280px) — keep content inside sense-max=1200px, no changes needed */
@media (max-width: 1279.98px) {
    .sense-hero-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    :root { --nav-h: 58px; }
    .navbar-collapse { 
        background: rgba(5,5,5,0.98); 
        border: 1px solid var(--stroke-gold); 
        border-radius: var(--radius-sm);
        padding: 16px;
        margin-top: 8px;
    }
    .nav-link { padding: 10px 8px !important; }
    .luxury-image-wrapper { max-height: 340px; }
    .luxury-image-wrapper img { max-height: 340px; }
    .map-container { height: 320px; }
    .map-container iframe { min-height: 320px; }
}

/* Tablet: ~768–991px */
@media (max-width: 767.98px) {
    h1 { font-size: clamp(1.8rem, 8vw, 3rem); }
    h2 { font-size: clamp(1.4rem, 6vw, 2rem); }
    .sense-footer-inner { flex-direction: column; text-align: center; gap: 12px; }
    .sense-footer-links { justify-content: center; }
    .luxury-image-wrapper { max-height: 260px; border-radius: 12px; }
    .luxury-image-wrapper img { max-height: 260px; }
    .map-container { height: 280px; border-radius: 12px; }
    .map-container iframe { min-height: 280px; }
    /* Prevent table overflow on small screens */
    .table-responsive { font-size: 0.82rem; }
    /* Fix any wide containers */
    .container { padding-left: 16px !important; padding-right: 16px !important; }
}

/* Small mobile: ~360–575px (Android 2016+ baseline) */
@media (max-width: 575.98px) {
    h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
    h2 { font-size: clamp(1.2rem, 5vw, 1.8rem); }
    h3 { font-size: clamp(1rem, 4vw, 1.4rem); }
    .sense-stat-grid { grid-template-columns: 1fr 1fr; }
    .luxury-image-wrapper { max-height: 220px; border-radius: 10px; }
    .luxury-image-wrapper img { max-height: 220px; }
    .map-container { height: 240px; }
    .map-container iframe { min-height: 240px; }
    .sense-button { min-height: 46px; padding: 0 20px; font-size: 0.72rem; }
}