/* Componentes reutilizables */

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--light-gray);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.desktop-logo {
    display: block;
}

.mobile-logo {
    display: none;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

/* Búsqueda en header */
.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-form {
    display: flex;
    position: relative;
}

.search-form input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 50px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--light);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 91, 248, 0.1);
    background: white;
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

.nav-main {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--dark);
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(56, 91, 248, 0.1);
}

.nav-link i {
    font-size: 1.1rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--dark);
    font-weight: 500;
}

.dropdown-toggle:hover {
    color: var(--primary);
    background: rgba(56, 91, 248, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    border: 1px solid var(--light-gray);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--dark);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(248, 110, 56, 0.1);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #008489);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* Formularios */
.form-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 91, 248, 0.1);
    background: white;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--dark), #1a1c2f);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        height: 60px;
        padding: 0 15px;
        position: relative;
    }
    
    .logo {
        z-index: 1001;
    }
    
    .desktop-logo {
        display: none;
    }
    
    .mobile-logo {
        display: block;
        height: 40px;
    }
    
    .header-search {
        display: none;
    }
    
    .nav-main {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        z-index: 1000;
        gap: 0;
        overflow-y: auto;
    }
    
    .nav-main.active {
        right: 0;
    }
    
    .nav-link, .dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .nav-link span, .dropdown-toggle span {
        flex: 1;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--light);
        margin-top: 0.5rem;
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-item {
        padding: 0.8rem 1rem 0.8rem 2.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    /* Menú hamburguesa */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    
    .menu-toggle span {
        width: 100%;
        height: 3px;
        background: var(--dark);
        margin: 2px 0;
        transition: var(--transition);
        border-radius: 2px;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Overlay para móvil */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Para tablets pequeñas */
@media (max-width: 480px) {
    .header-container {
        height: 55px;
        padding: 0 10px;
    }
    
    .mobile-logo {
        height: 30px;
    }
    
    .nav-main {
        width: 85%;
        padding: 70px 15px 15px;
    }
    
    .nav-link, .dropdown-toggle {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 0.7rem 1rem 0.7rem 2.2rem;
        font-size: 0.9rem;
    }
}

/* Ocultar menú hamburguesa en desktop */
.menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}
