/**
 * CheckToBuild - Footer Styles
 * Version: 1.0
 * Description: Estilos para el footer principal
 */

/* ========================================
   1. FOOTER BASE
   ======================================== */

.ctb-footer {
    background: var(--ctb-gray-100);
    color: var(--ctb-gray-700);
    margin-top: auto;
    position: relative;
}

/* ========================================
   2. MAIN FOOTER CONTENT
   ======================================== */

.footer-main {
    padding: var(--ctb-space-20) 0 var(--ctb-space-16);
    background: var(--ctb-white);
    border-top: 1px solid var(--ctb-gray-200);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(5, 1fr);
    gap: var(--ctb-space-8);
}

/* ========================================
   3. FOOTER COLUMNS
   ======================================== */

.footer-column {
    display: flex;
    flex-direction: column;
}

/* Company Column */
.footer-company {
    padding-right: var(--ctb-space-8);
}

.footer-logo {
    margin-bottom: var(--ctb-space-4);
}

.footer-logo svg {
    height: 35px;
    width: auto;
}

.footer-description {
    font-size: var(--ctb-text-sm);
    color: var(--ctb-gray-600);
    line-height: 1.6;
    margin-bottom: var(--ctb-space-6);
}

.footer-company-info {
    font-size: var(--ctb-text-sm);
    color: var(--ctb-gray-600);
    margin-bottom: var(--ctb-space-6);
}

.footer-company-info p {
    margin: 0 0 var(--ctb-space-1) 0;
}

.footer-company-info strong {
    color: var(--ctb-gray-700);
    font-weight: 600;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: var(--ctb-space-3);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--ctb-gray-100);
    border-radius: var(--ctb-radius-full);
    color: var(--ctb-gray-600);
    transition: all var(--ctb-transition-fast);
}

.footer-social a:hover {
    background: var(--ctb-primary);
    color: var(--ctb-white);
    transform: translateY(-2px);
}

.footer-social svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   4. FOOTER LINKS
   ======================================== */

.footer-title {
    font-family: var(--ctb-font-heading);
    font-size: var(--ctb-text-base);
    font-weight: 700;
    color: var(--ctb-gray-900);
    margin-bottom: var(--ctb-space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--ctb-space-2);
}

.footer-links a {
    color: var(--ctb-gray-600);
    font-size: var(--ctb-text-sm);
    text-decoration: none;
    transition: all var(--ctb-transition-fast);
    display: inline-block;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ctb-primary);
    transition: width var(--ctb-transition-fast);
}

.footer-links a:hover {
    color: var(--ctb-primary);
}

.footer-links a:hover::after {
    width: 100%;
}

/* ========================================
   5. NEWSLETTER SECTION - SPECIFIC SELECTORS
   ======================================== */

.ctb-footer .footer-newsletter {
    background: linear-gradient(135deg, #004aad 0%, #1561B2 100%) !important;
    padding: var(--ctb-space-12) 0 !important;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
    border: none !important;
}

.ctb-footer .footer-newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.ctb-footer .footer-newsletter .container {
    position: relative !important;
    z-index: 2 !important;
}

.ctb-footer .newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr !important;
    gap: var(--ctb-space-8) !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1 !important;
    max-width: none !important;
    width: 100% !important;
}

.ctb-footer .newsletter-text h3 {
    font-family: var(--ctb-font-heading) !important;
    font-size: var(--ctb-text-2xl) !important;
    font-weight: 700 !important;
    color: var(--ctb-white) !important;
    margin-bottom: var(--ctb-space-2) !important;
    margin-top: 0 !important;
    line-height: 1.2 !important;
}

.ctb-footer .newsletter-text p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: var(--ctb-text-base) !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.ctb-footer .newsletter-form .form-group {
    display: flex;
    gap: var(--ctb-space-3);
    margin-bottom: var(--ctb-space-3);
}

.ctb-footer .newsletter-form .form-control {
    flex: 1;
    padding: var(--ctb-space-4);
    font-size: var(--ctb-text-base);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ctb-radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: var(--ctb-white);
    transition: all var(--ctb-transition-fast);
}

.ctb-footer .newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ctb-footer .newsletter-form .form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.ctb-footer .newsletter-form .btn {
    padding: var(--ctb-space-4) var(--ctb-space-6) !important;
    background: var(--ctb-white) !important;
    color: var(--ctb-primary) !important;
    border: none !important;
    border-radius: var(--ctb-radius-md) !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--ctb-space-2) !important;
    transition: all var(--ctb-transition-base) !important;
    text-decoration: none !important;
    font-size: var(--ctb-text-base) !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
}

.ctb-footer .newsletter-form .btn:hover {
    transform: translateX(4px);
    box-shadow: var(--ctb-shadow-lg);
    text-decoration: none;
}

.ctb-footer .newsletter-form .btn.btn-secondary {
    background: transparent !important;
    border: 2px solid white !important;
    color: var(--ctb-white) !important;
}

.ctb-footer .newsletter-form .btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--ctb-white) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

.ctb-footer .newsletter-form .btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--ctb-transition-fast);
}

.ctb-footer .newsletter-form .btn:hover svg {
    transform: translateX(2px);
}

.ctb-footer .newsletter-privacy {
    font-size: var(--ctb-text-xs);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    text-align: center;
}

.ctb-footer .newsletter-privacy a {
    color: var(--ctb-white);
    text-decoration: underline;
}

/* ========================================
   6. BOTTOM FOOTER
   ======================================== */

.footer-bottom {
    background: var(--ctb-gray-900);
    padding: var(--ctb-space-6) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: var(--ctb-space-6);
}

.footer-legal p {
    color: var(--ctb-gray-400);
    font-size: var(--ctb-text-sm);
    margin: 0;
}

.legal-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--ctb-space-4);
}

.legal-links li {
    position: relative;
}

.legal-links li:not(:last-child)::after {
    content: '|';
    position: absolute;
    right: calc(var(--ctb-space-4) / -2);
    color: var(--ctb-gray-600);
}

.legal-links a {
    color: var(--ctb-gray-400);
    font-size: var(--ctb-text-sm);
    text-decoration: none;
    transition: color var(--ctb-transition-fast);
}

.legal-links a:hover {
    color: var(--ctb-primary);
}

/* Footer Credits */
.footer-credits {
    display: flex;
    align-items: center;
}

.footer-credits p {
    color: var(--ctb-gray-400);
    font-size: var(--ctb-text-sm);
    margin: 0;
}

.footer-credits span {
    color: var(--ctb-gray-500);
}

.footer-credits a {
    color: var(--ctb-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.footer-credits a:hover {
    opacity: 0.8;
}

.footer-certifications {
    display: flex;
    gap: var(--ctb-space-4);
    align-items: center;
}

.footer-certifications img {
    height: 40px;
    width: auto;
    opacity: 0.6;
    transition: opacity var(--ctb-transition-fast);
}

.footer-certifications img:hover {
    opacity: 1;
}

/* ========================================
   7. BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: var(--ctb-space-6);
    right: var(--ctb-space-6);
    width: 48px;
    height: 48px;
    background: var(--ctb-primary);
    color: var(--ctb-white);
    border: none;
    border-radius: var(--ctb-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ctb-transition-base);
    z-index: var(--ctb-z-fixed);
    box-shadow: var(--ctb-shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--ctb-primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--ctb-shadow-xl);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   8. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1280px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(4, 1fr);
    }
    
    .footer-column:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--ctb-space-6);
    }
    
    .footer-company {
        grid-column: span 3;
        padding-right: 0;
        margin-bottom: var(--ctb-space-6);
        padding-bottom: var(--ctb-space-6);
        border-bottom: 1px solid var(--ctb-gray-200);
    }
    
    .ctb-footer .newsletter-content {
        display:flex;
        flex-direction:column;
        grid-template-columns: 1fr;
        gap: var(--ctb-space-4);
        text-align: center;
    }
}

@media (max-width: 768px) {
    .footer-main {
        padding: var(--ctb-space-12) 0 var(--ctb-space-10);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--ctb-space-8);
    }
    
    .footer-company {
        grid-column: 1;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
    
    .footer-column {
        border-top: 1px solid var(--ctb-gray-200);
        padding-top: var(--ctb-space-6);
    }
    
    .footer-company {
        border-top: none;
        padding-top: 0;
    }
    
    .ctb-footer .newsletter-form .form-group {
        flex-direction: column;
        gap: var(--ctb-space-4);
    }
    
    .ctb-footer .newsletter-form .btn {
        width: 100%;
        justify-content: center;
        transform: none;
    }
    
    .ctb-footer .newsletter-form .btn:hover {
        transform: translateY(-2px);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--ctb-space-4);
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--ctb-space-3);
    }
    
    .legal-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-credits {
        order: -1; /* Credits appear first on mobile */
    }
    
    .back-to-top {
        bottom: var(--ctb-space-4);
        right: var(--ctb-space-4);
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .footer-title {
        font-size: var(--ctb-text-lg);
    }
    
    .ctb-footer .newsletter-text h3 {
        font-size: var(--ctb-text-xl);
        line-height: 1.3;
    }
    
    .ctb-footer .newsletter-text p {
        font-size: var(--ctb-text-sm);
    }
    
    .legal-links li:not(:last-child)::after {
        display: none;
    }
    
    .legal-links {
        gap: var(--ctb-space-2);
    }
}

/* ========================================
   9. DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .ctb-footer {
        background: var(--ctb-gray-900);
    }
    
    .footer-main {
        background: var(--ctb-gray-800);
        border-top-color: var(--ctb-gray-700);
    }
    
    .footer-title {
        color: var(--ctb-white);
    }
    
    .footer-description,
    .footer-company-info,
    .footer-links a {
        color: var(--ctb-gray-400);
    }
    
    .footer-social a {
        background: var(--ctb-gray-700);
        color: var(--ctb-gray-300);
    }
    
    .footer-column {
        border-top-color: var(--ctb-gray-700);
    }
    
    .footer-bottom {
        background: var(--ctb-gray-900);
        border-top-color: var(--ctb-gray-700);
    }
}