/* ===============================================
   GLOBAL STYLES & CSS VARIABLES — REDESIGNED
   Hino Batam — Premium Automotive Aesthetic
   =============================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    /* Primary palette — bold automotive */
    --primary-red: #C41E3A;
    --dark-red: #8B0000;
    --light-red: #fef2f2;
    --accent-crimson: #E63946;
    
    /* Neutrals — warm charcoal system */
    --dark-gray: #1a1a2e;
    --medium-gray: #555770;
    --light-gray: #f5f5f7;
    --border-gray: #e5e5ea;
    --white: #ffffff;
    --off-white: #fafafa;
    
    /* Functional */
    --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06), 0 1px 2px rgba(26, 26, 46, 0.04);
    --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 12px 48px rgba(26, 26, 46, 0.12);
    --shadow-xl: 0 24px 64px rgba(26, 26, 46, 0.16);
    --shadow-red: 0 8px 32px rgba(196, 30, 58, 0.2);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--white);
    color: var(--dark-gray);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-gray);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.35s var(--transition-smooth);
}

/* Visually Hidden (SEO) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* ===============================================
   SCROLL REVEAL ANIMATIONS
   =============================================== */

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}


/* ===============================================
   NAVBAR — Dark Premium
   =============================================== */

.navbar-hino {
    background: var(--dark-gray);
    backdrop-filter: blur(24px);
    padding: 0;
    border-bottom: none;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s var(--transition-smooth);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-hino::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-red), var(--accent-crimson), transparent);
    opacity: 0.7;
}

/* Brand */
.navbar-brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hino-logo-img {
    height: 42px;
    transition: transform 0.4s var(--transition-bounce);
    filter: brightness(0) invert(1);
}

.navbar-brand:hover .hino-logo-img {
    transform: scale(1.08) rotate(-2deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-main {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
}

.brand-sub {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Nav Links */
.navbar-nav {
    gap: 4px;
}

.navbar-nav .nav-link {
    position: relative;
    font-weight: 500;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 1.1rem 1rem !important;
    border-radius: 0;
    transition: all 0.35s var(--transition-smooth);
    letter-spacing: 0.3px;
}

.navbar-nav .nav-link i {
    margin-right: 6px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: all 0.35s var(--transition-smooth);
    transform: translateX(-50%);
}

/* Remove the old ::before underline */
.navbar-nav .nav-link::before {
    display: none;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.06);
}

.navbar-nav .nav-link:hover::after {
    width: 60%;
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(196, 30, 58, 0.15);
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    width: 60%;
    background: var(--primary-red);
}

/* Dropdown */
.dropdown-menu-hino {
    border: none;
    border-radius: var(--radius-lg);
    padding: 8px;
    margin-top: 8px;
    box-shadow: var(--shadow-xl);
    background: var(--white);
    backdrop-filter: blur(20px);
    animation: dropdownReveal 0.3s var(--transition-smooth);
}

@keyframes dropdownReveal {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item-hino {
    padding: 0.7rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.25s var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-sm);
    color: var(--dark-gray);
}

.dropdown-item-hino i {
    color: var(--primary-red);
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
}

.dropdown-item-hino:hover {
    background: var(--light-red);
    color: var(--primary-red);
    padding-left: 1.4rem;
}

.dropdown-item-hino.active {
    background: var(--light-red);
    color: var(--primary-red);
    font-weight: 600;
}

.dropdown-divider {
    margin: 4px 12px;
    opacity: 0.1;
}

/* WhatsApp CTA Button */
.btn-whatsapp-nav {
    background: var(--primary-red);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.3);
    transition: all 0.35s var(--transition-smooth);
    letter-spacing: 0.3px;
}

.btn-whatsapp-nav i {
    margin-right: 6px;
}

.btn-whatsapp-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.4);
    background: var(--accent-crimson);
    color: #fff;
}

/* Mobile Navbar */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar-toggler-icon {
    width: 22px;
    height: 18px;
    filter: invert(1);
}


/* ===============================================
   FOOTER — Dark & Structured
   =============================================== */

.footer-hino {
    background: var(--dark-gray);
    color: rgba(255, 255, 255, 0.7);
    border-top: none;
    padding: 80px 0 0;
    margin-top: 0;
    position: relative;
}

.footer-hino::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--accent-crimson), var(--primary-red));
}

.footer-brand h5 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: 1px;
    font-family: 'Space Grotesk', sans-serif;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.footer-brand small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Space Grotesk', sans-serif;
}

.footer-heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--primary-red);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-links i {
    color: var(--primary-red);
    margin-top: 4px;
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-bottom {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}


/* ===============================================
   WHATSAPP FLOATING BUTTON — Refined
   =============================================== */

.whatsapp-float-wrapper {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999; /* Increased z-index */
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.whatsapp-float-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex !important; /* Force display */
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.35);
    transition: all 0.4s var(--transition-smooth);
    cursor: pointer;
    animation: gentleFloat 4s ease-in-out infinite;
    text-decoration: none;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.whatsapp-float-btn:hover,
.whatsapp-float-btn:focus,
.whatsapp-float-btn:active {
    background: #128C7E;
    transform: scale(1.12);
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.45);
    color: #fff;
    text-decoration: none;
}

/* Pulse Ring */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #25D366;
    border-radius: 50%;
    animation: pulseRing 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Bubble Chat */
.whatsapp-bubble-chat {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.92);
    transition: all 0.4s var(--transition-smooth);
    overflow: hidden;
    pointer-events: none; /* Prevent interaction with hidden bubble */
}

.whatsapp-float-wrapper:hover .whatsapp-bubble-chat {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Mobile touch support for bubble */
@media (hover: none) and (pointer: coarse) {
    .whatsapp-float-wrapper.active .whatsapp-bubble-chat {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
}

.whatsapp-bubble-chat::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.bubble-header strong {
    color: var(--dark-gray);
    font-size: 0.9rem;
    font-weight: 700;
}

.status-online {
    background: #25D366;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.bubble-body {
    padding: 14px 18px;
}

.bubble-name {
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bubble-message {
    font-size: 0.88rem;
    color: var(--medium-gray);
    line-height: 1.5;
    margin: 0;
}



/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 991px) {
    .navbar-hino {
        padding: 0.5rem 0;
    }
    
    .navbar-nav {
        padding: 1rem 0;
        background: rgba(26, 26, 46, 0.98);
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1.2rem !important;
        border-radius: var(--radius-sm);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .dropdown-menu-hino {
        margin-top: 4px;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-item-hino {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .dropdown-item-hino:hover {
        background: rgba(196, 30, 58, 0.15);
        color: #fff;
    }

    .btn-whatsapp-nav {
        margin-top: 1rem;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-hino {
        padding: 60px 0 0;
    }
}

@media (max-width: 768px) {
    .whatsapp-float-wrapper {
        bottom: 16px;
        right: 16px;
        /* Ensure it's not hidden behind any footer elements */
        z-index: 9999;
    }
    
    .whatsapp-float-btn {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
    
    .whatsapp-bubble-chat {
        width: 240px;
        right: -20px;
        bottom: 62px;
    }

    .footer-hino {
        padding: 50px 0 0;
    }

    .footer-brand,
    .footer-heading {
        text-align: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links li {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .whatsapp-float-wrapper {
        bottom: 15px;
        right: 15px;
        /* Maximum z-index to ensure visibility */
        z-index: 99999;
    }

    .whatsapp-float-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
        /* Slightly smaller on very small screens */
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }

    .whatsapp-bubble-chat {
        width: 220px;
        right: -25px;
        bottom: 58px;
        /* Smaller bubble for small screens */
    }

    .bubble-header,
    .bubble-body {
        padding: 10px 12px;
    }

    .bubble-header strong {
        font-size: 0.85rem;
    }

    .status-online {
        font-size: 0.6rem;
        padding: 2px 8px;
    }

    .bubble-name {
        font-size: 0.68rem;
    }

    .bubble-message {
        font-size: 0.82rem;
    }

    /* Ensure button stays above content */
    .pulse-ring {
        animation: pulseRing 2s ease-out infinite;
    }

    .brand-main {
        font-size: 0.95rem;
    }

    .brand-sub {
        font-size: 0.55rem;
    }

    .hino-logo-img {
        height: 36px;
    }
}


/* ===============================================
   UTILITY CLASSES
   =============================================== */

.text-primary-red {
    color: var(--primary-red) !important;
}

.bg-primary-red {
    background-color: var(--primary-red) !important;
}

.border-primary-red {
    border-color: var(--primary-red) !important;
}

.shadow-custom-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-custom-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg) !important;
}


/* ===============================================
   CUSTOM SCROLLBAR
   =============================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}


/* ===============================================
   SELECTION STYLING
   =============================================== */

::selection {
    background: var(--primary-red);
    color: #fff;
}

::-moz-selection {
    background: var(--primary-red);
    color: #fff;
}
