/* Header & Navigation Styles */

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
    height: 70px;
    contain: layout style;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
    contain: layout style;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    min-width: 150px;
    min-height: 45px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 140px;
    display: inline-block;
    line-height: 1.2;
}

.logo-image {
    max-height: 45px;
    width: auto;
    height: 45px;
    aspect-ratio: auto;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: var(--space-sm);
    transition: transform var(--transition);
}

.nav-dropdown:hover .dropdown-toggle::after {
    transform: rotate(-135deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Theme Toggle Switch */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid var(--border-color);
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--bg-card);
    border-radius: 50%;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-slider i {
    font-size: 12px;
    color: var(--warning);
}

[data-theme="dark"] .theme-toggle-slider {
    left: calc(100% - 24px);
}

[data-theme="dark"] .theme-toggle-slider i::before {
    content: "\f186";
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: all var(--transition);
}

.theme-toggle .sun-icon {
    left: 8px;
    color: var(--warning);
    opacity: 1;
}

.theme-toggle .moon-icon {
    right: 8px;
    color: var(--primary-light);
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
}

/* Contact Button */
.btn-contact {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 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(5px, -5px);
}

/* Mobile Navigation - Modal Style */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Mobile Menu Backdrop */
    .nav::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
        z-index: -1;
    }
    
    .nav.active::before {
        opacity: 1;
        visibility: visible;
    }
    
    .nav {
        position: fixed;
        top: 60px;
        right: var(--space-md);
        left: auto;
        bottom: auto;
        width: 240px;
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 80px);
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-sm);
        gap: 0;
        border-radius: var(--radius-lg);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
        border: none;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.25s ease;
        overflow-y: auto;
        z-index: var(--z-fixed);
    }
    
    [data-theme="dark"] .nav {
        background: #1e293b;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
    
    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: stretch;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 12px 16px;
        justify-content: flex-start !important;
        text-align: left !important;
        border-radius: var(--radius);
        font-size: 0.9375rem;
        color: #1e293b;
        gap: 10px;
    }
    
    [data-theme="dark"] .nav-link {
        color: #f1f5f9;
    }
    
    .nav-link:hover {
        background: #f1f5f9;
        color: var(--primary);
    }
    
    [data-theme="dark"] .nav-link:hover {
        background: #334155;
    }
    
    .nav-link.active {
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary);
    }
    
    .nav-link i {
        width: 18px;
        text-align: center;
        flex-shrink: 0;
        color: #64748b;
    }
    
    [data-theme="dark"] .nav-link i {
        color: #94a3b8;
    }
    
    .nav-link:hover i,
    .nav-link.active i {
        color: var(--primary);
    }
    
    .dropdown-toggle::after {
        margin-left: auto;
        border-color: #64748b;
    }
    
    [data-theme="dark"] .dropdown-toggle::after {
        border-color: #94a3b8;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown.open .dropdown-toggle {
        background: #f1f5f9;
    }
    
    [data-theme="dark"] .nav-dropdown.open .dropdown-toggle {
        background: #334155;
    }
    
    .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        padding-left: 28px;
        margin: 0;
        background: transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        min-width: auto;
    }
    
    .nav-dropdown.open .dropdown-menu {
        max-height: 300px;
        padding-bottom: var(--space-xs);
    }
    
    .dropdown-item {
        display: flex;
        align-items: center;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 10px 16px;
        font-size: 0.875rem;
        color: #1e293b;
    }
    
    [data-theme="dark"] .dropdown-item {
        color: #f1f5f9;
    }
    
    .dropdown-item:hover {
        background: #f1f5f9;
        color: var(--primary);
    }
    
    [data-theme="dark"] .dropdown-item:hover {
        background: #334155;
    }
    
    .dropdown-item i {
        width: 18px;
        text-align: center;
        font-size: 0.8125rem;
        color: #64748b;
    }
    
    [data-theme="dark"] .dropdown-item i {
        color: #94a3b8;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: var(--space-md);
        margin-top: var(--space-sm);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        gap: var(--space-sm);
    }
    
    [data-theme="dark"] .header-actions {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .btn-contact {
        flex: 1;
        justify-content: center;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .theme-toggle {
        width: 50px;
        height: 26px;
    }
    
    .theme-toggle-slider {
        width: 20px;
        height: 20px;
    }
    
    [data-theme="dark"] .theme-toggle-slider {
        left: calc(100% - 22px);
    }
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: var(--space-2xl);
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
        width: 100%;
    }
    
    .footer-description {
        text-align: center !important;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-section h4 {
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .footer-links a:hover {
        transform: none;
    }
}

.footer-brand {
    max-width: 320px;
}

@media (max-width: 768px) {
    .footer-brand {
        max-width: 100% !important;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-links i {
    font-size: 0.75rem;
    width: 16px;
}

.footer-bottom {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
}

.footer-legal a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-legal a:hover {
    color: var(--primary);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
    z-index: var(--z-sticky);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all var(--transition);
    z-index: var(--z-sticky);
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    color: white;
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: #25D366;
    animation: whatsappPulse 2s infinite;
    z-index: -1;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    z-index: 2;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 18px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.modal-title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Contact Form in Modal */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form .form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.contact-form .form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.contact-form .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.contact-form .form-control::placeholder {
    color: var(--text-muted);
}

.contact-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.contact-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.contact-form .btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.contact-form .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.contact-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.contact-form .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Form Response Messages */
.form-response {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9375rem;
    display: none;
}

.form-response:not(:empty) {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-response.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.form-response.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Modal Responsive */
@media (max-width: 540px) {
    .modal {
        padding: 16px;
    }
    
    .modal-content {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .modal-title {
        font-size: 1.375rem;
    }
    
    .contact-form .form-control {
        padding: 12px 14px;
    }
    
    .contact-form .btn {
        padding: 14px 20px;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--space-md) var(--space-lg);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success-color, #10b981);
}

.toast-error {
    border-left: 4px solid var(--danger-color, #ef4444);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

/* Responsive Modal */
@media (max-width: 576px) {
    .modal-content {
        padding: var(--space-lg);
        margin: var(--space-sm);
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}
