/* =================================================================
   FOOTER STYLES - Professional & Compact for Mobile
================================================================= */

/* Light Mode (Default) */
.footer {
    background-color: #f8f9fa;
    color: #333333;
}

.footer-middle {
    padding: 60px 0 40px;
}

.footer-column {
    margin-bottom: 2rem;
}

.footer-column h6 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--wm-dark-gray, #333333);
}

.footer-column .sub-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column .sub-menu__list li {
    margin-bottom: 0.5rem;
}

.footer-column .menu-link {
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-column .menu-link:hover {
    color: var(--wm-red);
}

.footer-store-info {
    margin-bottom: 2rem;
}

.footer-store-info .logo {
    margin-bottom: 1.5rem;
}

.footer-store-info .logo__image {
    max-width: 150px;
    height: auto;
}

.footer-address {
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-store-info p {
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-store-info p strong {
    color: var(--wm-dark-gray, #333333);
}

.social-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links li a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: var(--wm-dark-gray, #333333);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links li a:hover {
    background-color: var(--wm-red);
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: #e9ecef;
    padding: 20px 0;
    border-top: 1px solid var(--border-color, #eeeeee);
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom span {
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    font-size: 0.85rem;
}

.footer-settings {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-settings a {
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-settings a:hover {
    color: var(--wm-red);
}

.footer-settings a:not(:last-child)::after {
    content: '•';
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    opacity: 0.5;
}

/* Dark Mode Support */
[data-theme="dark"] .footer {
    background-color: #1a1a1a;
}

[data-theme="dark"] .footer-bottom {
    background-color: var(--dm-surface, var(--dm-bg, #111827));
    border-top-color: var(--dm-border);
}

[data-theme="dark"] .footer-column h6 {
    color: var(--dm-text-primary);
}

[data-theme="dark"] .footer-column .menu-link {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .footer-column .menu-link:hover {
    color: var(--wm-red);
}

[data-theme="dark"] .footer-store-info p,
[data-theme="dark"] .footer-address {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .footer-store-info p strong {
    color: var(--dm-text-primary);
}

[data-theme="dark"] .social-links li a {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--dm-text-primary);
}

[data-theme="dark"] .footer-bottom span,
[data-theme="dark"] .footer-bottom .footer-settings a {
    color: var(--dm-text-secondary);
}

/* =================================================================
   MOBILE FOOTER - ULTRA COMPACT PROFESSIONAL STYLE
   Similar to major elevator companies (Schindler, OTIS, etc.)
================================================================= */
@media (max-width: 767.98px) {
    /* Hide all menu columns on mobile */
    .footer-menu {
        display: none;
    }

    /* Compact footer middle section */
    .footer-middle {
        padding: 30px 0 20px;
    }

    /* Company info - centered and compact */
    .footer-store-info {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .footer-store-info .logo {
        margin-bottom: 1rem;
    }

    .footer-store-info .logo__image {
        max-width: 100px;
        margin: 0 auto;
    }

    /* Company name and address - compact single line */
    .footer-address {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
        color: #555555; /* Improved contrast: changed from #777 to #555 for better accessibility */
    }

    /* Contact info - ultra compact with consistent alignment */
    .footer-store-info p {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .footer-store-info p strong {
        font-size: 0.7rem;
        font-weight: 600;
        display: inline-block;
        min-width: 90px;
    }

    .footer-store-info p a {
        font-size: 0.7rem;
        word-break: break-word;
        display: inline;
    }
    
    /* Make email and contact numbers consistent on same line */
    .footer-general-email,
    .footer-contact-item {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
    }
    
    .footer-general-email strong,
    .footer-contact-item strong {
        flex-shrink: 0;
        min-width: 85px;
    }

    /* Social links - compact and centered */
    .social-links {
        gap: 0.5rem;
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-links li a {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* Footer bottom - ultra compact */
    .footer-bottom {
        padding: 12px 0;
        background-color: rgba(0, 0, 0, 0.03);
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0 15px;
    }

    .footer-bottom span {
        font-size: 0.7rem;
        line-height: 1.3;
        display: block;
    }

    /* Footer links - إصلاح التكديس: عرض أفقي */
    .footer-settings {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap !important;
        gap: 0;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .footer-settings a {
        font-size: 0.7rem;
        padding: 0;
        display: inline !important;
        white-space: nowrap;
    }

    /* إزالة جميع الفواصل المضافة */
    .footer-settings a:not(:last-child)::after {
        display: none !important;
    }

    .footer-settings a:not(:last-child) {
        border-right: none !important;
        padding-right: 0;
        margin-right: 0;
    }
    
    .footer-settings a + a::before {
        display: none !important;
    }
}

/* =================================================================
   EXTRA SMALL MOBILE (< 576px) - EVEN MORE COMPACT
================================================================= */
@media (max-width: 575.98px) {
    .footer-middle {
        padding: 25px 0 15px;
    }

    .footer-store-info .logo__image {
        max-width: 80px;
    }

    .footer-address {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .footer-store-info p,
    .footer-store-info p strong,
    .footer-store-info p a {
        font-size: 0.65rem;
    }

    .social-links {
        gap: 0.4rem;
        margin-top: 0.75rem;
    }

    .social-links li a {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .footer-bottom {
        padding: 10px 0;
    }

    .footer-bottom span,
    .footer-settings,
    .footer-settings a {
        font-size: 0.65rem;
    }
}

/* =================================================================
   DARK MODE FOR MOBILE
================================================================= */
@media (max-width: 767.98px) {
    [data-theme="dark"] .footer-bottom {
        background-color: rgba(255, 255, 255, 0.03);
    }
}

/* =================================================================
   RESPONSIVE TEXT & OVERFLOW PROTECTION
   Ensures no text overflow or design breaks on any device
================================================================= */
@media (max-width: 767.98px) {
    /* Prevent text overflow */
    .footer-store-info,
    .footer-address,
    .footer-store-info p,
    .footer-bottom span,
    .footer-settings a {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Ensure links don't break layout */
    .footer-store-info a {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Container padding for small screens */
    .footer-middle .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .footer-bottom .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Row spacing fix */
    .footer-middle .row {
        margin-left: 0;
        margin-right: 0;
    }

    .footer-middle .row > * {
        padding-left: 0;
        padding-right: 0;
    }
}

/* =================================================================
   LANDSCAPE MODE ON MOBILE (e.g. 568x320, 667x375, 736x414)
================================================================= */
@media (max-width: 767.98px) and (orientation: landscape) {
    .footer-middle {
        padding: 20px 0 15px;
    }

    .footer-store-info {
        margin-bottom: 1rem;
    }

    .social-links {
        margin-top: 0.75rem;
    }

    .footer-bottom {
        padding: 8px 0;
    }
}

/* =================================================================
   VERY SMALL SCREENS (< 360px) - e.g. Galaxy Fold, iPhone SE
================================================================= */
@media (max-width: 359.98px) {
    .footer-store-info .logo__image {
        max-width: 70px;
    }

    .footer-address,
    .footer-store-info p,
    .footer-store-info p strong,
    .footer-store-info p a {
        font-size: 0.6rem;
    }

    .social-links li a {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .footer-bottom span,
    .footer-settings,
    .footer-settings a {
        font-size: 0.6rem;
    }
}

/* =================================================================
   MEDIUM MOBILE (576px - 767px) - Better spacing
================================================================= */
@media (min-width: 576px) and (max-width: 767.98px) {
    .footer-store-info .logo__image {
        max-width: 110px;
    }

    .footer-address {
        font-size: 0.8rem;
    }

    .footer-store-info p,
    .footer-store-info p strong,
    .footer-store-info p a {
        font-size: 0.75rem;
    }

    .social-links li a {
        width: 34px;
        height: 34px;
    }

    .footer-bottom span,
    .footer-settings,
    .footer-settings a {
        font-size: 0.72rem;
    }
}

/* =================================================================
   TABLETS (768px - 991px) - Hybrid Layout
   Shows some menu columns but keeps compact design
================================================================= */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Show 2 menu columns on tablets */
    .footer-middle .row {
        display: flex;
        flex-wrap: wrap;
    }

    .footer-store-info {
        width: 100%;
        text-align: center;
        margin-bottom: 2rem;
    }

    .footer-menu {
        width: 50%;
        padding: 0 15px;
        margin-bottom: 1.5rem;
    }

    .footer-menu h6 {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .footer-menu .menu-link {
        font-size: 0.9rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom span,
    .footer-settings a {
        font-size: 0.85rem;
    }
}

/* =================================================================
   FIX FOR TABLETS IN PORTRAIT MODE
================================================================= */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
    .footer-middle {
        padding: 50px 0 35px;
    }

    .footer-menu {
        width: 50%;
    }
}

/* =================================================================
   FIX FOR TABLETS IN LANDSCAPE MODE
================================================================= */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: landscape) {
    .footer-middle {
        padding: 40px 0 30px;
    }

    .footer-menu {
        width: 33.33%;
    }

    .footer-menu:nth-child(n+5) {
        display: none;
    }
}

