/* ——— فوق الفوتر: المركات + الأقسام ——— */
.mtp-above-footer {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    direction: rtl;
}

.mtp-above-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    gap: 2rem;
}

.mtp-above-footer-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mtp-above-footer-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
}

.mtp-above-footer-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 48px;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
}

.mtp-above-brands-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

@media (min-width: 480px) {
    .mtp-above-brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 640px) {
    .mtp-above-brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) {
    .mtp-above-brands-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.mtp-above-brand-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-inline-start: 3px solid var(--brand-color, #6366f1);
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.mtp-above-brand-card:hover {
    background: #fafbff;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.mtp-above-brand-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.mtp-above-brand-card:hover .mtp-above-brand-icon {
    border-color: rgba(99, 102, 241, 0.3);
}

.mtp-above-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.mtp-above-brand-emoji {
    font-size: 1.1rem;
}

.mtp-above-brand-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-color, #6366f1), color-mix(in srgb, var(--brand-color, #6366f1) 80%, #000));
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.mtp-above-brand-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .mtp-above-footer {
        padding: 1.5rem 0;
    }
    .mtp-above-footer-section {
        padding: 1rem;
    }
    .mtp-above-footer-title {
        font-size: 0.9375rem;
        margin-bottom: 0.85rem;
    }
    .mtp-above-brands-grid {
        gap: 0.5rem;
    }
    .mtp-above-brand-card {
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
    }
    .mtp-above-brand-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
}

/* --- فوتر احترافي + لمسات بصرية --- */
.site-footer {
    background: #0b3b42; /* بترولي غامق */
    color: #ffffff;
    margin-top: 0;
    padding: 3.5rem 0 0;
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    position: relative;
    overflow: hidden;
    border-top: none;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #12636e 0%, #1f94a4 50%, #12636e 100%);
    opacity: 1;
    z-index: 2;
}

.site-footer::after {
    display: none; /* إزالة الزخارف المعقدة لتبسيط الفوتر */
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 0;
    padding-bottom: 3rem;
    border-bottom: none;
    position: relative;
}

.footer-main::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 15%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.08) 85%, transparent 100%);
    border-radius: 1px;
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 42% 29% 29%;
        gap: 2.5rem;
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-about {
    gap: 1.5rem;
}

.footer-about-text {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.0625rem;
    line-height: 1.85;
    margin: 0;
}

.footer-about-text p {
    margin: 0;
}

.footer-description {
    color: #94a3b8;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
}

.footer-social {
    margin-top: 0.5rem;
}

.footer-social-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 1.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.95;
}

.footer-social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    background: #187b87;
    border-color: #209fae;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(32, 159, 174, 0.3);
}

.footer-social-link svg {
    width: 22px;
    height: 22px;
}

.footer-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    padding-right: 0;
    position: relative;
    letter-spacing: -0.02em;
    border-bottom: none;
}

.footer-section-title::before {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 2px;
}

.footer-section-title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 60px;
    height: 3px;
    background: #209fae;
    border-radius: 3px;
}

.footer-categories-list,
.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-categories-list li,
.footer-links-list li {
    margin: 0;
}

.footer-categories-list a,
.footer-links-list a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.5rem 0;
    border-radius: 10px;
    position: relative;
    border-right: 3px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.footer-categories-list a::before,
.footer-links-list a::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #209fae;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.footer-categories-list a:hover,
.footer-links-list a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border-right-color: #209fae;
    padding-right: 1.25rem;
}

.footer-categories-list a:hover::before,
.footer-links-list a:hover::before {
    width: 12px;
    right: 3px;
}

.footer-bottom {
    width: 100vw;
    position: relative;
    right: 50%;
    margin-right: -50vw;
    margin-left: -50vw;
    left: 50%;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.footer-bottom::before {
    display: none;
}

.footer-copyright {
    text-align: center;
    width: 100%;
    padding: 1.5rem 0;
    background: #082d32; /* بترولي أغمق قليلاً من الفوتر للتميز */
    position: relative;
    border: none;
}

.footer-copyright::before {
    display: none;
}

.footer-copyright-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-copyright-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.65;
    flex: 1;
    font-weight: 500;
}

.footer-design-credit {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    font-weight: 500;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    padding-right: 1.25rem;
}

.footer-design-credit::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -8px;
    width: 1px;
    height: 16px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    border-radius: 1px;
}

.footer-design-credit a {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.footer-design-credit a:hover {
    color: #ffffff;
}

@media (min-width: 768px) {
    .footer-copyright {
        text-align: right;
    }

    .footer-copyright-text {
        text-align: right;
    }
}

@media (min-width: 1024px) {
    .footer-copyright-content {
        gap: 3rem;
    }
}

/* أزرار عائمة — مقارنة + طلوع للأعلى */
.mtp-floating-actions {
    position: fixed;
    bottom: 2.25rem;
    left: 1.25rem;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    direction: rtl;
}

.mtp-floating-btn {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mtp-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mtp-floating-compare {
    background: linear-gradient(135deg, #1f94a4 0%, #12636e 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.mtp-floating-compare:hover {
    color: #fff;
}

.mtp-floating-scroll-top {
    background: linear-gradient(135deg, #0b3b42 0%, #082d32 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.mtp-floating-scroll-top:hover {
    color: #fff;
    background: linear-gradient(135deg, #082d32 0%, #12636e 100%);
}

.mtp-floating-btn svg {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

@media (max-width: 767px) {
    .mtp-floating-actions {
        bottom: 1.75rem;
        left: 1rem;
        gap: 0.6rem;
    }

    .mtp-floating-btn {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .mtp-floating-btn svg {
        width: 22px;
        height: 22px;
    }

    .site-footer {
        padding-top: 3rem;
    }

    .footer-main {
        padding-bottom: 2.5rem;
        gap: 2.5rem;
    }

    .footer-main::after {
        width: calc(100% - 2rem);
    }

    .footer-copyright {
        padding: 1.75rem 0;
    }

    .footer-copyright-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0 1rem;
    }

    .footer-copyright-text {
        text-align: center;
        font-size: 0.9rem;
    }

    .footer-design-credit {
        font-size: 0.875rem;
        padding-right: 0;
    }

    .footer-design-credit::before {
        display: none;
    }

    .footer-section-title {
        font-size: 1.125rem;
    }

    .footer-social-link {
        width: 44px;
        height: 44px;
    }

    .footer-social-link svg {
        width: 20px;
        height: 20px;
    }
}

/* ——— الوضع الليلي ——— */
[data-theme="dark"] .mtp-above-footer {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-color) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-above-footer-section {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
}

[data-theme="dark"] .mtp-above-footer-title {
    color: var(--mtp-heading);
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-above-brand-card {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
    color: var(--text-color);
}

[data-theme="dark"] .mtp-above-brand-card:hover {
    background: var(--bg-light);
    border-color: var(--mtp-accent);
}

[data-theme="dark"] .site-footer {
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color);
}

[data-theme="dark"] .footer-section-title {
    color: var(--mtp-heading) !important;
}

[data-theme="dark"] .footer-about-text p,
[data-theme="dark"] .footer-categories-list a,
[data-theme="dark"] .footer-links-list a {
    color: var(--text-color) !important;
}

[data-theme="dark"] .footer-categories-list a:hover,
[data-theme="dark"] .footer-links-list a:hover {
    color: var(--mtp-accent) !important;
}

[data-theme="dark"] .footer-bottom {
    border-color: var(--border-color);
}

[data-theme="dark"] .footer-copyright {
    color: var(--text-light) !important;
    background: var(--bg-light) !important;
}

[data-theme="dark"] .footer-copyright a {
    color: var(--mtp-accent) !important;
}

[data-theme="dark"] .footer-copyright a:hover {
    color: var(--text-color) !important;
}
