/*
 * footer_v2.css — redesigned footer, scoped under .footer-v2 to stay
 * completely isolated from the legacy footer styles in style.css.
 *
 * Design tokens mirror header_v2 / auth_v2 / checkout_v2:
 *   brand primary   #245494   brand hover  #1E4A84
 *   text primary    #111827   muted text   #6B7280   body text  #374151
 *   surface         #F8FAFC   card surface #FFFFFF
 *   border          #E5E7EB   hover bg     #F3F4F6
 *   button radius   8px       card radius  12px
 *
 * Layout philosophy:
 *   - CSS Grid for the main columns (no flex-row-gap hacks).
 *   - Brand column is wider (1.4fr) and hosts logo + tagline + contacts +
 *     app-store badges — all "who we are" info anchored in one spot.
 *   - 4 nav columns: Company, Products, Legal, Follow (social).
 *   - Bottom bar = copyright + LiveInternet counter + segmented language
 *     switcher, hairline separator above.
 *
 * Breakpoints:
 *   >960px   5 columns (1.4fr 1 1 1 1)
 *   ≤960px   2 columns; brand spans full width
 *   ≤600px   1 column; all stacks vertically
 *
 * Known limitation: the back-to-top button is position:fixed. If the site
 * later gets a floating chat widget in the same corner, they'll overlap —
 * easy to adjust (right: 72px) when that happens.
 */

.footer-v2 {
    font-family: inherit;
    color: #374151;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    /*margin-top: 48px;*/
    position: relative;
}

.footer-v2 *,
.footer-v2 *::before,
.footer-v2 *::after {
    box-sizing: border-box;
}

/* Outer-edge alignment with the site's main .container in style.css
 * — same three breakpoints, same caps. Without this the footer was
 * 1280px wide on viewports ≥1717px while the content above it was
 * 1360px, leaving a visible ~40px inset on each side. Horizontal
 * padding stays at 24px (vs 15px in .container) — footer columns
 * need slightly more breathing room around the grid than the
 * content area. */
.footer-v2-container {
    width: 100%;
    max-width: 1088px;
    margin: 0 auto;
    padding: 48px 24px 24px;
}
@media (min-width: 1445px) {
    .footer-v2-container {
        max-width: calc(100vw - 357px);
    }
}
@media (min-width: 1717px) {
    .footer-v2-container {
        max-width: 1360px;
    }
}

/* ============================================================
 * Main grid (columns)
 * ========================================================== */
.footer-v2-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-v2-col { min-width: 0; }

/* Filler track for grid alignment. footer_navigation_v2.tpl.php emits
 * one or more empty .footer-v2-col--filler divs ahead of the visible
 * columns when fewer than 4 nav columns render (currently AZ — no
 * Products column). Each filler occupies a 1fr slot in the desktop
 * 5-column grid, so the visible columns hug the right edge instead
 * of leaving a gap behind them.
 *
 * Hidden on tablet/mobile because the grid collapses to 2-up / 1-up
 * stacking — a filler there would create an awkward empty cell. */
.footer-v2-col--filler {
    visibility: hidden;
}
@media (max-width: 960px) {
    .footer-v2-col--filler { display: none; }
}

/* Brand column — wider, hosts logo + tagline + contacts + apps */
.footer-v2-brand-logo {
    display: inline-block;
    line-height: 0; /* avoid phantom space below inline image */
}

.footer-v2-brand-logo img {
    height: 50px;
    width: auto;
    display: block;
}

.footer-v2-brand-tagline {
    margin: 16px 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    max-width: 360px;
}

.footer-v2-contacts {
    font-style: normal;
    font-size: 13px;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 18px;
}

.footer-v2-contacts a {
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}

.footer-v2-contacts a:hover {
    color: #245494;
    border-bottom-color: #245494;
}

/* Nav columns */
.footer-v2-col-title {
    margin: 0 0 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #6b7280;
}

.footer-v2-col > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-v2-col > ul a {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.12s;
}

.footer-v2-col > ul a:hover {
    color: #245494;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.footer-v2-col > ul a:focus-visible {
    outline: 2px solid rgba(36, 84, 148, 0.4);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
 * Social + Apps strip — horizontal section between the column grid
 * and the bottom bar. Two clusters laid out side-by-side on desktop:
 *   left:  social icons row (Follow us)
 *   right: app store badges (Get the app)
 * On narrow viewports the two stack vertically, social first.
 * ========================================================== */
.footer-v2-strip {
    margin-top: 36px;
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-v2-strip-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #6b7280;
}

.footer-v2-strip-social {
    flex: 1 1 auto;
    min-width: 220px;
}

.footer-v2-strip-apps {
    flex: 0 0 auto;
}

/* ============================================================
 * Social icons (now in the horizontal strip, not a column).
 * ========================================================== */
.footer-v2-social {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-v2-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #4b5563;
    transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.12s;
}

.footer-v2-social a:hover {
    color: #245494;
    border-color: #245494;
    background: #f3f4f6;
    transform: translateY(-1px);
}

.footer-v2-social a:focus-visible {
    outline: 2px solid rgba(36, 84, 148, 0.4);
    outline-offset: 2px;
}

.footer-v2-social svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Font-icon fallback. The DB stores meta.icon as `<i class="icon-…">`
 * (Fontello glyph — see inc/data/general_*.inc.php → footer_social_icons,
 * style.css for @font-face). The glyph is rendered by the `:before`
 * pseudo-element of `.icon-*`, so we size via font-size on the <i> and
 * let the pseudo inherit it. NO `display: inline-flex` here — Fontello's
 * `:before` rendering breaks inside a flex container in Safari; the
 * parent <a> is already a flex box that centers this <i>. */
.footer-v2-social a > i {
    font-size: 17px;
    line-height: 1;
    color: inherit;
    font-style: normal;
}
.footer-v2-social a > i::before {
    font-family: "fontello", serif;
    font-style: normal;
    font-weight: normal;
}

/* ============================================================
 * App-store badges — official branded artwork (Apple / Google).
 *
 * Markup is `<a><img src="..."></a>` pointing at the SVG files in
 * /assets/img/app/. We don't recolor or wrap them in a custom
 * container — Apple's and Google's brand guidelines forbid altering
 * the badge artwork, so we just size and align the <a> wrapper.
 *
 * Heights are picked per Apple guideline (App Store badge must be at
 * least 40px high; sized 40px → renders at native ~120×40). Google
 * Play badge has its own aspect (564:168 ≈ 3.36:1) so 40px height
 * gives ~135px width naturally.
 * ========================================================== */
.footer-v2-apps {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.footer-v2-app-badge {
    display: inline-flex;
    align-items: center;
    transition: transform 0.12s, opacity 0.12s;
    /* Subtle interactive feedback without altering the badge artwork
       itself — opacity nudge + lift is the recommended way per both
       Apple and Google brand guidelines. */
}

.footer-v2-app-badge:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.footer-v2-app-badge:focus-visible {
    outline: 2px solid rgba(36, 84, 148, 0.4);
    outline-offset: 3px;
    border-radius: 4px;
}

.footer-v2-app-badge img {
    display: block;
    height: 40px;
    width: auto;
}

/* ============================================================
 * Bottom bar (copyright + language switcher)
 * ========================================================== */
.footer-v2-bottom {
    border-top: 1px solid #e5e7eb;
    padding: 18px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6b7280;
}

.footer-v2-bottom-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-v2-bottom-sep { color: #d1d5db; }

.footer-v2-bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language group — segmented control, one pill per language.
 * Current locale is rendered as a <span class="...--active"> so it visually
 * "owns" the pill without being a link. Borders are collapsed between
 * siblings (negative margin-left on items after the first) for a clean
 * segmented look. */
.footer-v2-lang-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    background: #ffffff;
    border-radius: 6px;
}

.footer-v2-lang-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.footer-v2-lang-item + .footer-v2-lang-item { margin-left: -1px; }
.footer-v2-lang-item:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.footer-v2-lang-item:last-child  { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

.footer-v2-lang-item:hover {
    color: #245494;
    border-color: #245494;
    z-index: 1; /* lift borders on hover above neighbours */
    position: relative;
}

.footer-v2-lang-item--active {
    color: #ffffff;
    background: #245494;
    border-color: #245494;
    cursor: default;
}

.footer-v2-lang-item--active:hover {
    color: #ffffff;
    background: #1E4A84;
    border-color: #1E4A84;
}

/* ============================================================
 * Back-to-top button (position:fixed, fades in past ~600px scroll)
 * ========================================================== */
.footer-v2-back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #245494;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s, background 0.12s, transform 0.12s;
    z-index: 100;
}

.footer-v2-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.footer-v2-back-to-top:hover {
    background: #1E4A84;
    transform: translateY(-2px);
}

.footer-v2-back-to-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* ============================================================
 * Responsive
 * ========================================================== */
@media (max-width: 960px) {
    .footer-v2-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-v2-brand { grid-column: 1 / -1; }
    /* Strip becomes vertical: social row first, apps row second.
       Both stretch to full width and align-items resets so children
       flow naturally without trying to center vertically against a
       missing sibling. */
    .footer-v2-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
    .footer-v2-strip-apps {
        align-self: stretch;
    }
}

@media (max-width: 600px) {
    .footer-v2-container { padding: 32px 16px 20px; }
    .footer-v2-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-v2-strip {
        margin-top: 28px;
        padding: 20px 0;
    }
    .footer-v2-bottom { justify-content: center; text-align: center; }
    .footer-v2-bottom-left,
    .footer-v2-bottom-right { justify-content: center; }
    .footer-v2-back-to-top {
        right: 14px;
        bottom: 14px;
        width: 38px;
        height: 38px;
    }
    /* App badges keep their natural sizes but center as a group on
       phones — they're already shown side-by-side and 40px tall,
       fits in any reasonable viewport. */
    .footer-v2-apps {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* ============================================================
 * Print (strip everything non-essential)
 * ========================================================== */
@media print {
    .footer-v2 {
        background: none;
        border-top: 1px solid #000;
        margin-top: 20px;
        color: #000;
    }
    .footer-v2-grid,
    .footer-v2-back-to-top { display: none !important; }
    .footer-v2-bottom { border: none; padding: 8px 0; }
}
