/* ===== FOOTER STYLES - SCOPED TO FOOTER ONLY ===== */

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 2.5rem 0 0;
    position: relative;
    margin-top: 3rem;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f8b400, #ff6b35, #f8b400);
}

/* SCOPED: Footer Headings Only */
.footer .footer-heading {
    color: #f8b400;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.3rem;
}

.footer .footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #f8b400;
}

.footer .business-hours-heading,
.footer .emergency-heading,
.footer .office-heading,
.footer .newsletter-heading,
.footer .awards-heading {
    color: #f8b400;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    padding-bottom: 0.3rem;
}

.footer .business-hours-heading::after,
.footer .emergency-heading::after,
.footer .office-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25px;
    height: 2px;
    background: #f8b400;
}

/* SCOPED: Footer Logo Only */
.footer .footer-logo {
    margin-bottom: 1rem;
}

.footer .footer-logo-img {
    max-height: 40px;
    width: auto;
    filter: brightness(1.2);
    display: block;
}

/* SCOPED: Footer Company Information Only */
.footer .company-name {
    color: #f8b400;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

.footer .company-description {
    color: #b8c5d6;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.3rem;
}

.footer .company-tagline {
    color: #8a96a8;
    font-style: italic;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* SCOPED: Footer Contact Information Only - NO IMPACT ON HEADER */
.footer .contact-info {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.footer .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
    width: 100%;
    gap: 8px;
    flex-shrink: 0;
}

.footer .contact-item:last-child {
    margin-bottom: 0;
}

.footer .contact-item i {
    color: #f8b400;
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.footer .contact-text {
    color: #d1dae6;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* SCOPED: Office Information Layout - Footer Only */
.footer .office-row {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .office-details {
    margin-top: 0.75rem;
}

.footer .office-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    width: 100%;
    gap: 10px;
}

.footer .office-item i {
    color: #f8b400;
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.footer .office-text {
    color: #d1dae6;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

/* SCOPED: Emergency Contact Layout - Footer Only */
.footer .emergency-contact {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    width: 100%;
    gap: 10px;
}

.footer .emergency-contact i {
    color: #ff6b6b;
    font-size: 1rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    animation: emergencyPulse 2s infinite;
}

.footer .emergency-text {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.footer .emergency-description {
    color: #b8c5d6;
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
}

.footer .office-map-link {
    color: #f8b400;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    gap: 6px;
}

.footer .office-map-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer .office-map-link i {
    font-size: 0.8rem;
    flex-shrink: 0;
}

@keyframes emergencyPulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* SCOPED: Footer Links Only */
.footer .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer .footer-links li {
    margin-bottom: 0.4rem;
}

.footer .footer-link {
    color: #b8c5d6;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    gap: 6px;
}

.footer .footer-link:hover {
    color: #f8b400;
    text-decoration: none;
    padding-left: 3px;
    transform: translateX(2px);
}

.footer .footer-link i {
    color: #8a96a8;
    transition: color 0.3s ease;
    width: 14px;
    font-size: 0.85rem;
    text-align: center;
    flex-shrink: 0;
}

.footer .footer-link:hover i {
    color: #f8b400;
}

/* SCOPED: Social Media Links - Footer Only */
.footer .social-links {
    margin-bottom: 1.5rem;
}

.footer .social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.footer .social-link {
    display: flex;
    align-items: center;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #b8c5d6;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 6px;
}

.footer .social-link:hover {
    background: rgba(248, 180, 0, 0.1);
    border-color: #f8b400;
    color: #f8b400;
    text-decoration: none;
    transform: translateY(-1px);
}

.footer .social-link i {
    font-size: 1rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.footer .social-link span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* SCOPED: Newsletter Section - Footer Only */
.footer .newsletter-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.footer .newsletter-heading {
    color: #f8b400;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.footer .newsletter-text {
    color: #b8c5d6;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.footer .newsletter-form {
    margin: 0;
}

.footer .newsletter-form .input-group {
    border-radius: 20px;
    overflow: hidden;
    display: flex;
}

.footer .newsletter-input {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.6rem 0.8rem;
    border-radius: 20px 0 0 20px;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}

.footer .newsletter-input:focus {
    box-shadow: none;
    border-color: #f8b400;
    background: #ffffff;
}

.footer .newsletter-btn {
    background: #f8b400;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 0 20px 20px 0;
    transition: background 0.3s ease;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer .newsletter-btn:hover {
    background: #e6a200;
}

/* SCOPED: Awards Section - Footer Only */
.footer .awards-section {
    text-align: center;
}

.footer .awards-heading {
    color: #f8b400;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer .award-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.footer .award-badge {
    height: 32px;
    width: auto;
    max-width: 60px;
    border-radius: 3px;
    transition: transform 0.3s ease;
    object-fit: contain;
    display: block;
}

.footer .award-badge:hover {
    transform: scale(1.1);
}

/* Hide broken images gracefully */
.footer .award-badge[style*="display: none"] {
    display: none !important;
}

/* SCOPED: Business Hours - Footer Only */
.footer .business-hours {
    margin-top: 0.5rem;
}

.footer .hours-item {
    color: #b8c5d6;
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* SCOPED: Footer Bar - Footer Only */
.footer-bar {
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #b8c5d6;
    padding: 1rem 0;
    text-align: center;
    margin-top: 1rem;
}

.footer .copyright-main {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    display: block;
    width: 100%;
}

/* Loading placeholder for footer */
.loading-footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.loading-footer::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #f8b400;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== WHATSAPP WIDGET STYLES ===== */

.whatsapp-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1050;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.whatsapp-float-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #20b358 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: whatsappFloat 4s ease-in-out infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.whatsapp-float-btn:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    color: white;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.whatsapp-float-btn:hover .whatsapp-icon {
    transform: rotate(10deg);
}

.whatsapp-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: whatsappPulse 2s infinite;
    pointer-events: none;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes whatsappFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1051;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.whatsapp-float-btn:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

.whatsapp-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    animation: notificationBounce 2s ease-in-out infinite;
}

@keyframes notificationBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.whatsapp-chat-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1051;
}

.whatsapp-chat-widget.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    position: relative;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    overflow: hidden;
}

.chat-avatar img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.chat-status {
    font-size: 13px;
    opacity: 0.8;
    margin: 2px 0 0;
    line-height: 1;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-body {
    padding: 20px 16px 16px;
    max-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.chat-message {
    display: flex;
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
}

.bot-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8b400 0%, #e6a200 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: white;
    font-size: 14px;
}

.message-content {
    max-width: 75%;
    background: #f1f3f4;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    position: relative;
}

.message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #f1f3f4 transparent transparent;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-content p + p {
    margin-top: 4px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-replies {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-reply-btn {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid #25d366;
    color: #25d366;
    padding: 10px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.quick-reply-btn:hover {
    background: #25d366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.quick-reply-btn i {
    font-size: 11px;
}

.chat-input-area {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #25d366;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: #20b358;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #666;
    font-size: 13px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #25d366;
    animation: typingDots 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDots {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* RESPONSIVE DESIGN - MOBILE FIXES */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 0;
    }
    
    .footer .social-grid {
        grid-template-columns: 1fr;
    }
    
    .footer .award-badges {
        justify-content: center;
    }
    
    .whatsapp-container {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-chat-widget {
        width: 300px;
        bottom: 75px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
    
    .quick-replies {
        grid-template-columns: 1fr;
    }
    
    .quick-reply-btn {
        padding: 12px;
        font-size: 13px;
    }
    
    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .footer .copyright-main {
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.3;
    }
    
    /* Mobile contact layout fixes - Footer only */
    .footer .contact-item,
    .footer .office-item,
    .footer .emergency-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        text-align: left;
    }
    
    .footer .contact-item i,
    .footer .office-item i,
    .footer .emergency-contact i {
        width: auto;
        margin-bottom: 2px;
    }
    
    .footer .contact-text,
    .footer .office-text,
    .footer .emergency-text {
        word-break: break-word;
        font-size: 0.85rem;
        width: 100%;
        margin-left: 0;
    }
    
    .footer .office-row {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

@media (max-width: 576px) {
    .footer .footer-heading {
        font-size: 1rem;
    }
    
    .footer .newsletter-section {
        padding: 0.75rem;
    }
    
    .footer .social-link {
        justify-content: center;
        text-align: center;
        padding: 0.3rem;
    }
    
    .whatsapp-chat-widget {
        width: calc(100vw - 40px);
        right: -15px;
    }
    
    .chat-body {
        max-height: 300px;
    }
    
    .whatsapp-float-btn {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-icon {
        font-size: 26px;
    }
    
    .footer .copyright-main {
        font-size: 0.8rem;
    }
    
    .footer .contact-text,
    .footer .office-text,
    .footer .emergency-text {
        font-size: 0.75rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
    
    .footer .contact-item i,
    .footer .office-item i,
    .footer .emergency-contact i {
        width: 12px;
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 1.5rem 0 0;
    }
    
    .footer .office-row {
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
}

/* Enhanced quick reply grid on larger screens */
@media (min-width: 768px) {
    .whatsapp-chat-widget {
        width: 380px;
    }
    
    .quick-replies {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quick-reply-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .whatsapp-container {
        display: none !important;
    }
    
    .footer {
        background: #333 !important;
        color: #fff !important;
    }
}

/* Accessibility Improvements */
.whatsapp-float-btn:focus,
.chat-send-btn:focus,
.quick-reply-btn:focus,
.chat-input:focus,
.newsletter-btn:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .whatsapp-float-btn,
    .chat-send-btn,
    .quick-reply-btn {
        border: 2px solid #000;
    }
    
    .whatsapp-chat-widget {
        border: 2px solid #000;
    }
    
    .footer {
        background: #000 !important;
        color: #fff !important;
    }
    
    .footer .footer-heading,
    .footer .company-name {
        color: #ffff00 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-float-btn,
    .chat-send-btn,
    .quick-reply-btn,
    .chat-message,
    .whatsapp-chat-widget {
        animation: none !important;
        transition: none !important;
    }
    
    .typing-dots span {
        animation: none !important;
    }
    
    .whatsapp-pulse {
        animation: none !important;
    }
    
    .whatsapp-notification {
        animation: none !important;
    }
    
    .loading-footer::before {
        animation: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .whatsapp-chat-widget {
        background: #1a1a1a;
        color: #fff;
    }
    
    .chat-header {
        background: linear-gradient(135deg, #0a4a42 0%, #0f6b5e 100%);
    }
    
    .message-content {
        background: #2a2a2a;
        color: #fff;
    }
    
    .chat-input {
        background: #2a2a2a;
        color: #fff;
        border-color: #444;
    }
    
    .chat-input:focus {
        border-color: #25d366;
        background: #333;
    }
    
    .quick-reply-btn {
        background: rgba(37, 211, 102, 0.2);
        border-color: #25d366;
        color: #25d366;
    }
}

/* RTL language support */
[dir="rtl"] .footer .contact-item,
[dir="rtl"] .footer .office-item,
[dir="rtl"] .footer .emergency-contact {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer .footer-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .whatsapp-container {
    left: 25px;
    right: auto;
}

[dir="rtl"] .whatsapp-chat-widget {
    left: 0;
    right: auto;
}

[dir="rtl"] .whatsapp-tooltip {
    left: 70px;
    right: auto;
}

[dir="rtl"] .whatsapp-tooltip::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: rgba(0, 0, 0, 0.8);
}

/* Focus management for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Loading states */
.footer .loading-placeholder {
    display: inline-block;
    min-width: 80px;
    color: #8a96a8;
    font-style: italic;
}

.footer .loading-placeholder::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #8a96a8;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Error states */
.footer .error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    padding: 0.5rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    margin: 0.5rem 0;
}

/* Success states */
.footer .success-message {
    color: #28a745;
    font-size: 0.85rem;
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    margin: 0.5rem 0;
}

/* Compact version for smaller screens */
@media (max-width: 480px) {
    .footer {
        padding: 1rem 0 0;
        margin-top: 2rem;
    }
    
    .footer .footer-heading {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .footer .company-name {
        font-size: 0.9rem;
    }
    
    .footer .company-description,
    .footer .company-tagline {
        font-size: 0.8rem;
    }
    
    .footer .contact-item,
    .footer .office-item {
        margin-bottom: 0.4rem;
    }
    
    .footer .social-grid {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    
    .footer .social-link {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
    
    .footer .newsletter-section {
        padding: 0.5rem;
    }
    
    .footer .newsletter-input,
    .footer .newsletter-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .footer .award-badges {
        gap: 0.5rem;
    }
    
    .footer .award-badge {
        height: 24px;
        max-width: 45px;
    }
    
    .footer .office-row {
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
    
    .footer .copyright-main {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .whatsapp-float-btn {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-icon {
        font-size: 22px;
    }
    
    .whatsapp-chat-widget {
        width: calc(100vw - 30px);
        right: -10px;
        max-height: 70vh;
    }
    
    .chat-body {
        max-height: 200px;
        padding: 15px 12px 12px;
    }
    
    .message-content {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .quick-reply-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .chat-input,
    .chat-send-btn {
        font-size: 14px;
    }
}

/* Ultra-wide screen adjustments */
@media (min-width: 1400px) {
    .footer .container {
        max-width: 1320px;
    }
    
    .whatsapp-chat-widget {
        width: 400px;
    }
    
    .footer .social-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation performance optimizations */
.whatsapp-float-btn,
.whatsapp-pulse,
.whatsapp-notification {
    will-change: transform;
}

.whatsapp-chat-widget {
    will-change: transform, opacity;
}

/* Ensure proper layering */
.footer {
    position: relative;
    z-index: 1;
}

.whatsapp-container {
    z-index: 1050;
}

/* Browser-specific fixes */
/* Safari */
@supports (-webkit-appearance: none) {
    .footer .newsletter-input {
        -webkit-appearance: none;
        border-radius: 20px 0 0 20px;
    }
    
    .chat-input {
        -webkit-appearance: none;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    .footer .newsletter-input {
        border-radius: 20px 0 0 20px;
    }
}

/* Edge */
@supports (-ms-ime-align: auto) {
    .footer .newsletter-form .input-group {
        display: -ms-flexbox;
    }
}