/* ============================================================================
   UTILITIES MODULE - Layout Utilities and Components
   ============================================================================
   Contains: Main content wrapper, Footer styles, Floating action buttons, Mobile optimizations
   ============================================================================ */

/* Main Content Wrapper */
main, .main-content {
    flex: 1 0 auto;
}

@media (max-width: 768px) {
    .main-content {
        min-height: calc(100vh - 200px);
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
}

/* Floating Action Button */
.floating-action-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-green), var(--primary-green));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-action-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 30px rgba(45, 80, 22, 0.4);
    color: white;
    text-decoration: none;
}

.floating-action-btn:focus {
    outline: 2px solid var(--light-green);
    outline-offset: 2px;
}

.floating-action-btn {
    animation: fabPulse 2s ease-in-out infinite;
}

/* Hide floating action button on very small screens where it might interfere */
@media (max-width: 320px) {
    .floating-action-btn {
        display: none;
    }
}

/* Adjust positioning for larger screens */
@media (min-width: 768px) {
    .floating-action-btn {
        bottom: 30px;
        right: 30px;
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }
}

/* Floating Elements */
.floating-elements {
    position: relative;
    width: 100%;
    height: 100%;
    transform: translateZ(0); /* Create stacking context for mobile stability */
    -webkit-transform: translateZ(0); /* Safari compatibility */
}

/* ===== FOOTER STYLES - MOBILE FIRST ===== */

/* Footer Base Styles */
.site-footer {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    color: var(--warm-white);
    margin-top: 60px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--light-green), var(--accent-green), var(--light-green));
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-main {
    padding: 45px 0 35px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    align-items: start;
}

/* Footer Sections */
.footer-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-section h4 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--warm-white);
    position: relative;
    display: inline-block;
    letter-spacing: 0.5px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 2px;
    background: var(--light-green);
    border-radius: 1px;
}

/* Business Info Section */
.footer-business {
    padding-bottom: 10px;
}

.footer-business .footer-logo {
    margin-bottom: 25px;
}

.footer-business .footer-logo h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--warm-white);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.footer-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-bottom: 0;
    letter-spacing: 0.3px;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    width: 100%;
    max-width: 280px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    transition: background 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.contact-icon {
    font-size: 1.2rem;
    margin-top: 1px;
    flex-shrink: 0;
    opacity: 0.9;
}

.contact-details {
    text-align: center;
    flex: 1;
}

.contact-details p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.9rem;
}

.footer-phone {
    color: var(--warm-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.footer-phone:hover {
    color: var(--light-green);
}

.call-ahead {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-style: italic;
}

/* Quick Links Section */
.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.footer-nav li {
    width: 100%;
    max-width: 200px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 12px 16px;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.footer-nav a:hover {
    color: var(--warm-white);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hours Section */
.hours-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
    max-width: 280px;
}

.hours-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-small);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 48px;
    gap: 12px;
}

.hours-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.hours-item .days {
    font-weight: 700;
    color: var(--warm-white);
    letter-spacing: 0.5px;
    text-align: left;
    flex: 1;
    font-size: 0.9rem;
    margin-right: 8px;
}

.hours-item .times {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: right;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 8px;
}

.hours-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-small);
    margin-top: 5px;
}

/* Social & CTA Section */
.social-links {
    margin-bottom: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: #1877f2;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
    min-width: 140px;
    letter-spacing: 0.3px;
}

.social-link:hover {
    background: #166fe5;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.4);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-cta {
    width: 100%;
    display: flex;
    justify-content: center;
}

.footer-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--light-green);
    color: var(--primary-green);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 176, 105, 0.3);
    min-width: 160px;
    letter-spacing: 0.3px;
}

.footer-order-btn:hover {
    background: var(--warm-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(127, 176, 105, 0.4);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 25px 0;
    margin-top: 10px;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-bottom-content a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
}

.footer-bottom-content a:hover {
    color: var(--light-green);
    background: rgba(255, 255, 255, 0.05);
}

.copyright {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    order: 2;
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.footer-bottom-links a:hover {
    color: var(--light-green);
    background: rgba(255, 255, 255, 0.05);
}

.separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

/* Mobile Optimizations */
@media (prefers-reduced-motion: reduce) {
    /* Disable excessive animations for better mobile performance */
    .cta-button {
        animation: none !important;
    }

    .float-item {
        font-size: 1.5rem;
        opacity: 0.8;
    }

    .welcomeShine,
    .fabPulse {
        animation: none !important;
    }

    /* Reduce gallery animation complexity */
    .gallery-item {
        animation: none !important;
        animation-delay: 0s !important;
    }

    .autumn-glow,
    .pumpkin-corner {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Responsive Utilities for Footer */
@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        padding: 60px 0 40px;
    }

    .footer-section {
        text-align: left;
        align-items: flex-start;
    }

    .footer-section h4::after {
        left: 0;
        transform: none;
    }

    .footer-contact {
        align-items: flex-start;
    }

    .contact-item {
        justify-content: flex-start;
        text-align: left;
    }

    .contact-details {
        text-align: left;
    }

    .footer-nav {
        align-items: flex-start;
    }

    .footer-nav li {
        max-width: none;
    }

    .footer-nav a {
        text-align: left;
    }

    .hours-list {
        max-width: none;
    }

    .social-links {
        justify-content: flex-start;
    }

    .footer-cta {
        justify-content: flex-start;
    }

    .footer-bottom-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (min-width: 1024px) {
    .footer-main {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 50px;
    }
}