/* ==========================================================================
   LAYOUT - HEADER E FOOTER (VET HEROES)
   Antes ficava dentro de header.js/footer.js; agora é CSS estático.
   ========================================================================== */

/* HEADER STYLES */
header {
    background: var(--white-clinical);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
}

.navbar-brand {
    flex-shrink: 0;
}

.logo img {
    height: 50px;
    width: auto;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    flex-direction: column;
    gap: 4px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--gray-dark);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--gray-dark);
    font-weight: 500;
    font-size: 16px;
    padding: var(--spacing-xs) 0;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    color: var(--primary-orange);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-orange);
}

/* DROPDOWN */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white-clinical);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 280px;
    width: max-content; /* cresce conforme o maior item, sem quebrar linha */
    padding: var(--spacing-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    margin-top: var(--spacing-xs);
}

/* "Ponte" invisível entre o link e o menu, para o hover não fechar no vão */
.dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: calc(var(--spacing-xs) + 4px);
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--gray-dark);
    font-size: 15px;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.dropdown-menu a:hover {
    background: var(--gray-light);
    color: var(--primary-orange);
    text-decoration: none;
    transform: translateX(4px);
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    margin-left: 4px;
}

/* NAVBAR ACTIONS */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.phone-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--gray-dark);
    font-weight: 600;
    transition: color 0.2s ease;
}

.phone-link:hover {
    color: var(--primary-orange);
    text-decoration: none;
}

.phone-link .icon {
    font-size: 18px;
}

.nav-cta {
    font-size: 14px;
    padding: 10px 20px;
}

/* MOBILE STYLES */
@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white-clinical);
        flex-direction: column;
        padding: var(--spacing-lg);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .navbar-menu.active {
        transform: translateX(0);
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: var(--spacing-sm);
        font-size: 18px;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--gray-light);
        margin-top: var(--spacing-xs);
        display: none;
        width: auto;
        min-width: 0;
    }

    .dropdown-menu::before {
        display: none;
    }

    .nav-item.active .dropdown-menu {
        display: block;
    }

    /* No celular o texto pode quebrar e os itens ficam maiores para o toque */
    .dropdown-menu a {
        white-space: normal;
        font-size: 16px;
        padding: 12px var(--spacing-sm);
    }

    .navbar-actions {
        flex-direction: column;
        width: 100%;
        margin-top: var(--spacing-lg);
    }

    .phone-link {
        font-size: 20px;
    }

    .nav-cta {
        width: 100%;
        font-size: 16px;
        padding: 14px 28px;
    }
}

@media (max-width: 767px) {
    .phone-text {
        display: none;
    }

    .navbar {
        padding: var(--spacing-xs) 0;
    }

    header {
        padding: var(--spacing-xs) 0;
    }
}

/* FOOTER STYLES */
footer {
    background: var(--gray-dark);
    color: var(--white-clinical);
    padding: var(--spacing-xxl) 0 0;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-column h4 {
    color: var(--white-clinical);
    margin-bottom: var(--spacing-md);
    font-size: 18px;
}

.footer-brand img {
    height: 50px;
    width: auto;
    margin-bottom: var(--spacing-md);
    filter: brightness(0) invert(1);
}

.footer-description {
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.footer-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    opacity: 0.9;
}

.footer-rating .stars {
    color: #FFD700;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: var(--white-clinical);
    opacity: 0.8;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--orange-light);
    transform: translateX(4px);
}

/* Contact Items */
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-item {
    display: flex;
    gap: var(--spacing-sm);
}

.contact-item .icon {
    font-size: 20px;
    flex-shrink: 0;
}

.contact-item p {
    margin: 0;
    line-height: 1.5;
    opacity: 0.9;
}

.contact-item a {
    color: var(--orange-light);
    font-weight: 600;
}

.contact-item a:hover {
    color: var(--white-clinical);
}

/* Newsletter */
.newsletter-text {
    opacity: 0.8;
    margin-bottom: var(--spacing-md);
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.newsletter-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white-clinical);
    padding: 12px 16px;
    border-radius: 6px;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.newsletter-form input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--orange-light);
}

.newsletter-form .btn {
    padding: 12px 20px;
    font-size: 14px;
}

/* Social Links */
.social-links h5 {
    color: var(--white-clinical);
    font-size: 16px;
    margin-bottom: var(--spacing-sm);
}

.social-icons {
    display: flex;
    gap: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--white-clinical);
}

.social-icon:hover {
    background: var(--primary-orange);
    transform: translateY(-2px);
    color: var(--white-clinical);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

/* Insurance Logos */
.footer-insurance {
    padding: var(--spacing-lg) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-insurance h5 {
    color: var(--white-clinical);
    margin-bottom: var(--spacing-md);
    opacity: 0.8;
}

.insurance-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.insurance-logos img {
    height: 40px;
    width: auto;
    opacity: 0.7;
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.insurance-logos img:hover {
    opacity: 1;
}

/* Footer Bottom */
.footer-bottom {
    padding: var(--spacing-md) 0;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 calc(-1 * var(--spacing-md));
    margin-top: var(--spacing-lg);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    text-align: center;
}

.copyright {
    opacity: 0.7;
    margin-bottom: var(--spacing-xs);
}

.footer-legal {
    opacity: 0.6;
    font-size: 14px;
    margin-bottom: var(--spacing-xs);
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    font-size: 14px;
}

.footer-bottom-links a {
    color: var(--white-clinical);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-bottom-links a:hover {
    opacity: 1;
}

.footer-bottom-links span {
    opacity: 0.4;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: #25D366; /* Verde WhatsApp oficial */
    color: var(--white-clinical);
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
    font-weight: 600;
}

.whatsapp-float:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    background: #128C7E; /* Verde escuro WhatsApp */
    color: var(--white-clinical);
    text-decoration: none;
}

.whatsapp-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    animation: pulse-icon 2s infinite;
}

.whatsapp-icon svg {
    width: 24px;
    height: 24px;
}

@keyframes pulse-icon {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .whatsapp-float {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        padding: 10px 16px;
    }

    .whatsapp-text {
        display: none; /* Esconde o texto no mobile */
    }

    .whatsapp-icon svg {
        width: 28px; /* Ícone um pouco maior no mobile */
        height: 28px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .footer-column {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .contact-item {
        justify-content: center;
    }

    .footer-rating {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form .btn {
        width: 100%;
    }

    .social-icons {
        justify-content: center;
    }

    .insurance-logos {
        gap: var(--spacing-md);
    }

    .insurance-logos img {
        height: 30px;
    }

    .emergency-float {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        padding: 10px 16px;
    }

    .emergency-text {
        display: none;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .footer-bottom-links span {
        display: none;
    }
}

/* Item do dropdown da página atual */
.dropdown-menu a.active {
    color: var(--primary-orange);
    font-weight: 600;
}

/* No celular o .container tem padding menor (--spacing-sm); a faixa inferior do
   footer precisa acompanhar, senão fica 8px mais larga que a tela */
@media (max-width: 767px) {
    .footer-bottom {
        margin-left: calc(-1 * var(--spacing-sm));
        margin-right: calc(-1 * var(--spacing-sm));
    }
}
