/* Main Footer Styles */
.main-footer {
    background-color: var(--primary);
    color: var(--white);
    padding: 2rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

.main-footer .container {
    background-color: var(--primary);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.social-icons {
    display: flex;
    width: 90%;
    gap: 1.5rem;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

.main-footer .grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .main-footer .grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3rem;
    }

    .main-footer .grid > * {
        flex: 1 1 calc(25% - 3rem);
    }

}

@media (max-width: 767px) {

    .main-footer .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Increase social icon spacing and size on mobile */
    .main-footer > div > div:first-child > div:last-child {
        gap: 4rem;
        justify-content: center;
    }
    
    .main-footer > div > div:first-child > div:last-child a {
        padding: 0.75rem;
        flex-direction: column;
        text-align: left;
        min-width: 60px;
    }
    
    .main-footer img {
        width: 1.5rem;
        height: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Even more spacing on very small screens */
    .main-footer > div > div:first-child > div:last-child {
        gap: 2.5rem;
    }
    
    .main-footer > div > div:first-child > div:last-child a {
        min-width: 70px;
        padding: 1rem;
    }
    
    .main-footer img {
        width: 2rem;
        height: 2rem;
    }
}

/* Typography */
.main-footer h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.main-footer p {
    font-size: 0.875rem;
    line-height: 1.625;
    margin-bottom: 0.5rem;
}

/* Links */
.main-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 300ms ease;
}

.main-footer a:hover {
    color: var(--accent);
}

/* Lists */
.main-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-footer li {
    margin-bottom: 0.5rem;
}

/* Social Icons Container */
.main-footer > div > div:first-child > div:last-child {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

/* Social Icon Links */
.main-footer > div > div:first-child > div:last-child a {
    display: flex;
    align-items: left;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 300ms ease;
}

.main-footer > div > div:first-child > div:last-child a:hover {
    background-color: rgba(var(--white-rgb), 0.1);
}

/* Social Icon Images */
.main-footer img {
    width: 2rem;
    height: 2rem;
}

@media (min-width: 641px) {
    .main-footer img {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Address Styling */
.main-footer address {
    color: var(--text-color3);
    font-style: normal;
    font-size: 0.875rem;
    line-height: 1.6;
}

.main-footer address p {
    margin-bottom: 0.25rem;
}

.main-footer address p span h3{
    display: inline-block;
    margin: 0;
    padding: 0;
}

.main-footer address a {
    display: inline-block;
    margin-bottom: 0.25rem;
    
}

.main-footer address a:hover {
    color: var(--white);
}

/* Newsletter Section */
.main-footer > div > div:last-child > div:nth-child(2) {
    margin-top: 1.5rem;
}

.main-footer > div > div:last-child > div:nth-child(2) > p {
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-align: left;
}

.main-footer > div > div:last-child > div:nth-child(2) > div {
    width: 100%;
}

/* Newsletter Form */
.main-footer form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
}

.main-footer input[type="email"] {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: var(--primary);
    color: var(--text-color);
    border: 1px solid var(--secondary);
    outline: none;
    box-sizing: border-box;
}

.main-footer input[type="email"]:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.main-footer button[type="submit"] {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 300ms ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-footer button[type="submit"]:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Horizontal Rule */
.main-footer hr {
    border: none;
    border-top: 1px solid var(--secondary);
    margin: 3rem 0 1.5rem 0;
}

/* Copyright Text */
.main-footer > div > div:last-child > div:last-child {
    text-align: center;
    font-size: 0.875rem;
}

/* Get in Touch Section Specific Alignment */
.main-footer > div > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main-footer > div > div:last-child h3 {
    margin-bottom: 1rem;
    width: 100%;
}

/* Hide screen reader text visually but keep for accessibility */
.main-footer span:not(:only-child) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Newsletter Message Styling */
.newsletter-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    transition: all 0.3s ease;
}

.newsletter-message.success {
    background-color: var(--carousel-slide-green);
    color: var(--green-success);
    border: 1px solid var(--gray-light-border);
}

.newsletter-message.error {
    background-color: var(--carousel-slide-red);
    color: var(--red-danger);
    border: 1px solid var(--gray-light-border);
}

/* Loading state for newsletter button */
#newsletter-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

#newsletter-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
