/* ========================================
   Sanying Slipform Machine - Components
   Header, Footer, Float Buttons, Navigation
   ======================================== */

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

/* 保留文字Logo样式作为备用 */
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
    line-height: 1;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    padding: 0.5rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.dropdown-menu li a:hover {
    background: var(--light);
    color: var(--primary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions .btn {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.header-actions .icon {
    width: 18px;
    height: 18px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Footer */
.site-footer {
    background: var(--secondary);
    color: var(--white);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-desc {
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contact svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-contact a,
.footer-contact span {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.footer-contact a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Floating Buttons */
.float-buttons {
    position: fixed;
    right: 20px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 998;
}

.float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
}

.float-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.float-btn svg {
    width: 28px;
    height: 28px;
}

.float-whatsapp {
    background: #25D366;
    color: var(--white);
}

.float-facebook {
    background: #1877F2;
    color: var(--white);
}

.float-email {
    background: var(--accent);
    color: var(--dark);
}

.float-label {
    position: absolute;
    right: 70px;
    background: var(--dark);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.float-btn:hover .float-label {
    opacity: 1;
    visibility: visible;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 997;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-grid > div:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        transform: translateX(-100%);
        transition: var(--transition);
        box-shadow: var(--shadow-md);
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-link {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-light);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-actions .btn {
        display: none;
    }
    
    /* Mobile Logo adjustment */
    .logo-img {
        height: 32px;
        max-width: 120px;
    }
    
    .float-buttons {
        right: 10px;
        bottom: 80px;
    }
    
    .float-btn {
        width: 48px;
        height: 48px;
    }
    
    .float-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .float-label {
        display: none;
    }
    
    .back-to-top {
        right: 10px;
        width: 44px;
        height: 44px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
