/* ============================================================
   HEADER
   ============================================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 80px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-font-smoothing: antialiased;
    /* NO transform / will-change:transform — creates stacking context */
}
@media (min-width: 992px) {
    header { height: 95px; }
}

header .navbar {
    padding-top: 0;
    padding-bottom: 0;
    height: 100%;
    align-items: center;
}

header.scrolled {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(229, 84, 0, 0.1);
}

/* Hide desktop nav on mobile/tablet — drawer handles it */
#navbarDesktop {
    display: none !important;
}
@media (min-width: 992px) {
    #navbarDesktop {
        display: flex !important;
        flex: 1;
        align-items: center;
    }
}

/* ============================================================
   LOGO
   ============================================================ */
#hdr-logo-wrap {
    position: relative;
    display: inline-flex !important;
    align-items: flex-end;
    width: fit-content !important;
    overflow: visible;
    animation: logoBreathe 3s ease-in-out infinite;
    transform-origin: center center;
}
#hdr-logo-wrap:hover {
    animation-play-state: paused;
    transform: scale(1.06);
}
#hdr-logo-tm {
    position: absolute;
    bottom: -2px;
    right: -12px;
    font-size: 0.45rem;
    z-index: 2;
}

.logo-tm {
    font-size: 0.5rem;
    font-weight: 700;
    color: #000;
    line-height: 1;
    letter-spacing: 0;
    display: inline-block;
    vertical-align: bottom;
    margin-bottom: 2px;
}

@keyframes logoBreathe {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

/* Logo sizes */
.navbar-brand img,
#hdr-logo-wrap img {
    max-height: 32px;
    width: auto;
    display: block;
}
@media (min-width: 992px) {
    .navbar-brand img,
    #hdr-logo-wrap img { max-height: 36px; }
}
@media (max-width: 991px) {
    .navbar-brand img { height: 28px !important; max-height: 28px !important; }
}
@media (max-width: 767px) {
    .navbar-brand img { height: 26px !important; max-height: 26px !important; }
}
@media (max-width: 575px) {
    .navbar-brand img { height: 24px !important; max-height: 24px !important; }
}

/* Footer logo */
#footer-logo-wrap {
    position: relative;
    display: inline-flex !important;
    align-items: flex-end;
    width: fit-content !important;
    margin-bottom: 1.5rem;
}
#footer-logo-tm {
    position: absolute;
    bottom: 0;
    right: -14px;
    font-size: 0.48rem;
}

@media (max-width: 767px) {
    #hdr-logo-tm,
    #hdr-drawer-logo-tm,
    #footer-logo-tm { font-size: 0.4rem; }
}

/* ============================================================
   DESKTOP NAV LINKS
   ============================================================ */
header .nav-link {
    position: relative;
    font-weight: 500;
    color: #2c3e50 !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.3px;
}
header .nav-link:hover {
    color: rgb(229, 84, 0) !important;
}
header .nav-link.active {
    color: rgb(229, 84, 0) !important;
    font-weight: 600 !important;
}

/* Animated underline */
header .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, rgb(229, 84, 0), rgb(255, 140, 0));
    transition: width 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
    opacity: 0;
}
header .nav-link:hover::after,
header .nav-link.active::after {
    width: 80%;
    opacity: 1;
}

/* ============================================================
   HAMBURGER BUTTON
   ============================================================ */
.hdr-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 6px;
    background: transparent;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.hdr-hamburger span {
    display: block;
    height: 2px;
    background: #2c3e50;
    border-radius: 2px;
    transition: background 0.2s;
}
.hdr-hamburger:hover {
    border-color: rgb(229, 84, 0);
}
.hdr-hamburger:hover span {
    background: rgb(229, 84, 0);
}
.hdr-hamburger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 84, 0, 0.2);
}

/* ============================================================
   MOBILE DRAWER BACKDROP
   — sits BELOW the panel, above everything else
   ============================================================ */
#hdrBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    /* fade out, then hide — delay visibility until opacity done */
    transition: opacity 0.3s ease, visibility 0s ease 0.3s;
    pointer-events: none;
}
#hdrBackdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* show immediately on open, no delay */
    transition: opacity 0.3s ease, visibility 0s ease 0s;
}

/* ============================================================
   MOBILE DRAWER PANEL
   ============================================================ */
#hdrDrawerPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    border-left: 1px solid #e5e7eb;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s ease 0.35s;
    visibility: hidden;
    overflow: hidden; /* always clip — prevents content staggering on close */
}
#hdrDrawerPanel.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s ease 0s;
}

/* Drawer nav — no flex stretch, links sit tight after header */
.hdr-drawer-nav {
    display: flex;
    flex-direction: column;
}

/* Remove bottom border on last nav item — footer border-top handles the divider */
.hdr-nav-link:last-child {
    border-bottom: none;
}

/* Drawer footer — sits right after nav, whitespace below it naturally */
.hdr-drawer-foot {
    padding: 1rem 1.25rem;
    border-top: 1.5px solid #e5e7eb;
    background: #fff;
}

/* Prevent body scroll when drawer open */
body.hdr-no-scroll {
    overflow: hidden;
}

/* Drawer header row */
.hdr-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    flex-shrink: 0;
}
#hdr-drawer-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
}
#hdr-drawer-logo-wrap img {
    height: 28px;
    width: auto;
}
#hdr-drawer-logo-tm {
    position: absolute;
    bottom: -2px;
    right: -10px;
    font-size: 0.42rem;
}
#hdrMenuClose {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
#hdrMenuClose:hover {
    color: rgb(229, 84, 0);
    background: #fff5f0;
}
.hdr-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s, color 0.15s;
}
.hdr-nav-link i {
    font-size: 1.1rem;
    color: #6b7280;
    width: 1.4rem;
    transition: color 0.15s;
}
.hdr-nav-link:hover {
    background: #fff5f0;
    color: rgb(229, 84, 0);
}
.hdr-nav-link:hover i {
    color: rgb(229, 84, 0);
}
.hdr-nav-link.active {
    background: #fff5f0;
    color: rgb(229, 84, 0);
    border-left: 4px solid rgb(229, 84, 0);
    font-weight: 600;
}
.hdr-nav-link.active i {
    color: rgb(229, 84, 0);
}

/* ============================================================
   HEADER CONTACT / WHATSAPP BUTTON
   ============================================================ */
.header-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    color: #2c3e50;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s ease, color 0.3s ease,
                box-shadow 0.3s ease, background 0.3s ease,
                transform 0.3s ease;
}
.header-contact-btn svg {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}
.header-contact-btn span {
    position: relative;
    z-index: 2;
}
/* Shimmer sweep */
.header-contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(229, 84, 0, 0.08) 40%,
        rgba(229, 84, 0, 0.12) 50%,
        rgba(229, 84, 0, 0.08) 60%,
        transparent 100%);
    animation: btnShimmer 1.8s ease-in-out infinite;
    z-index: 1;
    border-radius: 50px;
}
@keyframes btnShimmer {
    0%   { left: -100%; }
    100% { left: 100%; }
}
.header-contact-btn:hover {
    border-color: rgb(229, 84, 0);
    color: rgb(229, 84, 0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 84, 0, 0.25);
    background: #fff8f5;
}
.header-contact-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}
@media (max-width: 991px) {
    .header-contact-btn {
        font-size: 15px;
        padding: 12px 20px;
    }
}

/* ============================================================
   FONT SMOOTHING
   ============================================================ */
header,
.navbar,
.nav-link,
.hdr-nav-link {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
