﻿/* ------------------------------------------------------------------
   UI3 footer + back-to-top.

   Loaded only by _Layout_UI3.cshtml. The footer partial is shared with
   _Layout_sme_responsive.cshtml (still used by a few views), so the
   markup keeps its original .footer / .footer-text / .namad hooks and
   this file layers the new design on top for UI3 only.

   Overrides worth knowing about:
     style.css  .footer      -> font-family:"Vazirmatn, tahoma" (quoted
                                as ONE family name, so it never matched
                                and the footer fell back to a default face)
     style.css  .footer p    -> color #A1A1A1, line-height 1.3
     style.css  .footer-text -> color #12c99e (the teal copyright line)
     newDesign  .footer a    -> color var(--primary-color) !important
   ------------------------------------------------------------------ */

.footer {
    height: auto;
    padding: 0;
    /* --surface-alt would drop --text-secondary to 4.41:1; this tone still
       reads as a distinct band against the white body and clears AA */
    background: var(--background, #F8FAFC);
    border-top: 1px solid var(--border, #E5E7EB);
    font-family: Vazirmatn, tahoma, sans-serif;
    color: var(--text, #374151);
    direction: rtl;
    text-align: right;
}

    /* red hairline across the top */
    .footer::before {
        content: "";
        display: block;
        height: 3px;
        background: linear-gradient(90deg, var(--primary, #C1122F) 0%, var(--primary-light, #F25C54) 55%, transparent 100%);
    }

    .footer .ft-container {
        max-width: 1180px;
        margin: 0 auto;
        padding: 52px 20px 0;
    }

/* ------------------------------ grid ----------------------------- */
.footer .ft-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.6fr;
    gap: 40px;
    padding-bottom: 40px;
}

/* --------------------------- brand col --------------------------- */
.footer .ft-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer .ft-brand-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary, #C1122F) 0%, var(--primary-hover, #A10F26) 100%);
    box-shadow: 0 8px 18px rgba(193,18,47,.22);
}

.footer .ft-brand-name {
    font-size: 17px;
    line-height: 1.7;
    font-weight: 700;
    color: var(--text, #374151);
}

.footer p.ft-about {
    margin: 0;
    font-size: 15px;
    line-height: 2.05;
    color: var(--text-secondary, #6B7280);
    max-width: 340px;
}

/* --------------------------- headings ---------------------------- */
.footer h2.ft-title {
    position: relative;
    margin: 0 0 20px;
    padding-bottom: 10px;
    font-size: 17px;
    line-height: 1.7;
    font-weight: 700;
    color: var(--text, #374151);
}

    .footer h2.ft-title::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: 0;
        width: 34px;
        height: 2px;
        border-radius: 2px;
        background: var(--primary, #C1122F);
    }

/* ---------------------------- links ------------------------------ */
.footer ul.ft-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .footer ul.ft-links > li {
        margin: 0 0 12px;
        padding: 0;
        font-size: 15px;
        line-height: 1.9;
        color: var(--text-secondary, #6B7280);
        list-style: none;
    }

        .footer ul.ft-links > li:last-child {
            margin-bottom: 0;
        }

    .footer ul.ft-links a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--text-secondary, #6B7280) !important;
        font-size: 15px;
        line-height: 1.9;
        text-decoration: none;
        transition: color .2s ease, transform .2s ease;
    }

        .footer ul.ft-links a i {
            font-size: 11px;
            color: var(--primary-light, #F25C54);
            transition: transform .2s ease;
        }

        .footer ul.ft-links a:hover {
            color: var(--primary, #C1122F) !important;
            transform: translateX(-4px);
            text-decoration: none;
        }

/* ---------------------------- contact ---------------------------- */
.footer ul.ft-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .footer ul.ft-contact > li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin: 0 0 18px;
        padding: 0;
        color: var(--text, #374151);
        font-size: 15px;
        line-height: 1.95;
        list-style: none;
    }

        .footer ul.ft-contact > li:last-child {
            margin-bottom: 0;
        }

        .footer ul.ft-contact > li > i {
            flex: 0 0 auto;
            width: 34px;
            height: 34px;
            margin-top: 2px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: var(--primary, #C1122F);
            background: var(--surface, #fff);
            border: 1px solid var(--border, #E5E7EB);
        }

.footer .ft-contact-label {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    line-height: 1.7;
    /* --text-muted only reaches ~2.5:1 on --surface-alt, so use the
       secondary tone for anything that has to stay readable */
    color: var(--text-secondary, #6B7280);
}

.footer .ft-contact-value {
    display: block;
    font-size: 15px;
    line-height: 1.95;
    color: var(--text, #374151);
    font-weight: 600;
}

.footer a.ft-contact-value {
    color: var(--text, #374151) !important;
    text-decoration: none;
    transition: color .2s ease;
}

    .footer a.ft-contact-value:hover {
        color: var(--primary, #C1122F) !important;
    }

/* latin runs (phone, postcode, e-mail) must not be reordered by RTL */
.footer .ft-ltr {
    display: inline-block;
    direction: ltr;
    unicode-bidi: embed;
}

.footer p.ft-address {
    margin: 0;
    font-size: 14px;
    line-height: 2;
    color: var(--text-secondary, #6B7280);
    font-weight: 400;
}

/* ---------------------------- bottom ----------------------------- */
.footer .ft-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px 0 24px;
    border-top: 1px solid var(--border, #E5E7EB);
}

.footer .footer-text {
    margin: 0;
    flex: 1 1 auto;
}

    .footer .footer-text p {
        margin: 0;
        font-size: 14px;
        line-height: 2;
        font-weight: 400;
        color: var(--text-secondary, #6B7280);
    }

.footer .ft-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .footer .ft-badges img {
        margin: 0;
        max-height: 56px;
        width: auto;
    }

/* --------------------------- responsive -------------------------- */
@media (max-width: 991px) {
    .footer .ft-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

        .footer .ft-grid .ft-col--brand {
            grid-column: 1 / -1;
        }

    .footer p.ft-about {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .footer .ft-container {
        padding: 36px 16px 0;
    }

    .footer .ft-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-bottom: 28px;
    }

    .footer .ft-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 0 22px;
    }
}

/* ========================== back to top ==========================
   New id on purpose: Content/newDesign/js/custom.js binds a click
   handler to #back-top whose first statement is $(...).tooltip('hide').
   jQuery UI is loaded and its widget bridge throws when a method is
   called on an uninitialised widget, which aborted the handler before
   it ever scrolled. A fresh id keeps that handler off this button.   */
.ui3-back-to-top {
    position: fixed;
    bottom: 28px;
    /* left, not right: RTL copy starts at the right edge, so the old
       right-hand placement sat on top of the footer copyright line */
    left: 28px;
    z-index: 1200;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary, #C1122F) 0%, var(--primary-hover, #A10F26) 100%);
    box-shadow: 0 10px 24px rgba(193, 18, 47, .32);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

    .ui3-back-to-top.is-visible {
        display: flex;
    }

    .ui3-back-to-top:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(193, 18, 47, .42);
        color: #fff;
    }

    .ui3-back-to-top:active {
        transform: none;
    }

    .ui3-back-to-top:focus-visible {
        outline: 3px solid rgba(193, 18, 47, .35);
        outline-offset: 2px;
    }

@media (max-width: 600px) {
    .ui3-back-to-top {
        bottom: 18px;
        left: 18px;
        width: 42px;
        height: 42px;
    }
}
