/* Smartphone Italia — custom B2B footer (20260704-chat-up) */

:root {
    --si-footer-bg: #f0f9f1;
    --si-footer-bar: #1d1d1f;
    --si-footer-line: rgba(57, 181, 74, 0.12);
    --si-footer-title: #1d1d1f;
    --si-footer-text: #6e6e73;
    --si-footer-accent: #39b54a;
    --si-footer-accent-hover: #0d8224;
    --si-footer-bar-text: #f5f5f7;
}

/* ── Base footer shell ── */
#footer,
footer.footer {
    background: var(--si-footer-bg) !important;
    border-top: 1px solid var(--si-footer-line);
    color: var(--si-footer-text);
    font-family: var(--si-font, Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
}

#footer .footer-container,
#footer .si-footer-container,
#footer .tvcmsfooter-background-image {
    background: transparent !important;
    background-image: none !important;
    padding: 0 !important;
}

#footer .tvcmsfooter-background-image::before,
#footer .tvcmsfooter-background-image::after {
    display: none !important;
}

/* ── Hide ThemeVolty legacy footer output ── */
.si-footer-legacy-hidden,
#footer .si-footer-legacy-hidden,
#footer .tvfooter-storelogo-imformation,
#footer .tvfooter-links-wrapper,
#footer .tvfooter-storelogo-weapper,
#footer .tvfooter-newletter-icon,
#footer .tvfooter-copy-payment-icon-wrapper,
#footer .tvfooter-logo-block,
#footer .tvfooter-contact-link-wrapper,
#footer .tvfooter-account-link,
#footer .block-social.tvcmsfooter-social-icon,
#footer .tvcopylink,
#footer .tv-footer-social-icon,
.tv-footer-social-icon {
    display: none !important;
}

/* ── Custom footer layout ── */
.si-footer {
    width: 100%;
}

.si-footer__main {
    padding: 48px 0 32px;
}

.si-footer__grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr 1.1fr;
    gap: 32px 40px;
    align-items: start;
}

.si-footer__col--brand {
    max-width: 280px;
}

/* Logo — same dark pill as header (logo JPG: white "Italia" on black) */
.si-footer__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d1d1f;
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
    line-height: normal;
    overflow: visible;
    max-width: none;
}

.si-footer__logo img {
    display: block;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: none !important;
}

.si-footer__tagline {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--si-footer-text);
    letter-spacing: -0.01em;
}

.si-footer__title {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--si-footer-title);
    text-transform: none;
}

.si-footer__links,
.si-footer__contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.si-footer__links li,
.si-footer__contact li {
    margin: 0 0 8px;
}

.si-footer__links a,
.si-footer__contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--si-footer-text);
    text-decoration: none;
    transition: color 0.25s ease;
}

.si-footer__links a:hover,
.si-footer__contact-link:hover {
    color: var(--si-footer-accent);
    text-decoration: underline;
}

.si-footer__contact-link--wa {
    color: #0d8224;
    font-weight: 500;
}

.si-footer__contact-link--wa:hover {
    color: #1d1d1f;
}

.si-footer__contact-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Newsletter removed (20260704-footer-text-nl) ── */
.si-footer__newsletter,
#footer .si-footer__newsletter,
#footer .block_newsletter,
#footer .tvcms-newsletter-wrapper {
    display: none !important;
}

/* ── Bottom bar ── */
.si-footer__bar {
    background: var(--si-footer-bar);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.si-footer__bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 16px 15px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0));
}

.si-footer__copy {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--si-footer-bar-text) !important;
}

.si-footer__bar a {
    color: inherit !important;
    text-decoration: none;
}

.si-footer__bar a:hover {
    color: #fff !important;
}

.si-footer__bar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 16px 20px;
    flex: 1 1 auto;
}

.si-footer__payments {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.si-footer__payments .tvfooter-payment-icon-img-block {
    width: auto;
    max-width: none;
    padding: 0;
    float: none;
}

.si-footer__payments .tvfooter-payment-icon-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.si-footer__payments .tvfooter-payment-content-block {
    margin: 0;
}

.si-footer__payments img {
    display: block;
    max-height: 24px;
    width: auto;
    opacity: 0.88;
    transition: opacity 0.25s ease;
}

.si-footer__payments img:hover {
    opacity: 1;
}

/* Social icons in bottom bar */
.si-footer__social .tvcmsfooter-social-icon,
.si-footer__social .block-social {
    display: block !important;
    width: auto;
    padding: 0;
    margin: 0;
}

.si-footer__social .tvfooter-social-icon-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.si-footer__social .tvfooter-social-icon-wrapper li {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    padding: 7px;
    margin: 0;
}

.si-footer__social .tvfooter-social-icon-wrapper li a svg path {
    fill: var(--si-footer-bar-text) !important;
}

.si-footer__social .tvfooter-social-icon-wrapper li:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
}

.si-footer__social .tvfooter-social-icon-wrapper li:hover a svg path {
    fill: #fff !important;
}

/* Back to top — fixed floating (ThemeVolty markup, SI styling) */
.tvbottom-to-top {
    position: fixed !important;
    bottom: var(--si-scroll-top-bottom) !important;
    right: max(20px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    z-index: var(--si-scroll-top-z, 99985) !important;
    display: none;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: none;
    border-radius: 0;
    opacity: 1;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.2s ease, bottom 0.2s ease;
}

.tvbottom-to-top.si-scroll-top--visible {
    display: block;
}

/* Mobile: above bottom nav bar */
@media (max-width: 991px) {
    body.si-bottom-nav-active .tvbottom-to-top {
        bottom: var(--si-scroll-top-bottom-mobile) !important;
    }

    body.si-bottom-nav-active.si-scroll-top--chat .tvbottom-to-top,
    body.si-bottom-nav-active:has(#chat-widget-container) .tvbottom-to-top,
    body.si-bottom-nav-active:has(#smartsupp-widget-container) .tvbottom-to-top,
    body.si-bottom-nav-active:has(.smartsupp-widget) .tvbottom-to-top,
    body.si-bottom-nav-active:has(#smartsupp-widget) .tvbottom-to-top,
    body.si-bottom-nav-active:has(#si-whatsapp-float) .tvbottom-to-top {
        bottom: var(--si-scroll-top-bottom-with-chat) !important;
    }
}

@media (min-width: 992px) {
    .tvbottom-to-top {
        bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 20px)) !important;
        right: max(28px, env(safe-area-inset-right, 0px)) !important;
    }

    /* Smartsupp / chat widget bottom-right — lift scroll button (desktop, no bottom bar) */
    body.si-scroll-top--chat .tvbottom-to-top,
    body:has(#chat-widget-container) .tvbottom-to-top,
    body:has(#smartsupp-widget-container) .tvbottom-to-top,
    body:has(.smartsupp-widget) .tvbottom-to-top,
    body:has(#smartsupp-widget) .tvbottom-to-top,
    body:has(#si-whatsapp-float) .tvbottom-to-top {
        bottom: max(88px, calc(env(safe-area-inset-bottom, 0px) + var(--si-chat-widget-height))) !important;
    }
}

.tvbottom-to-top .tvbottom-to-top-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px;
    padding: 0;
    margin: 0;
    background: #fff !important;
    background-image: none !important;
    border: 2px solid var(--si-footer-accent);
    border-radius: 50%;
    color: var(--si-footer-accent) !important;
    font-size: 0;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(29, 29, 31, 0.12);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tvbottom-to-top .tvbottom-to-top-icon:hover,
.tvbottom-to-top .tvbottom-to-top-icon:focus-visible {
    background: var(--si-footer-accent) !important;
    border-color: var(--si-footer-accent-hover);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(57, 181, 74, 0.35);
}

.tvbottom-to-top .tvbottom-to-top-icon:active {
    background: var(--si-footer-accent-hover) !important;
    border-color: var(--si-footer-accent-hover);
    transform: translateY(0);
}

.tvbottom-to-top span {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tvbottom-to-top i.material-icons {
    display: block !important;
    font-size: 24px !important;
    line-height: 1;
    color: inherit;
}

/* ── ThemeVolty fallback if legacy hooks leak through ── */
#footer .footer-container li a,
#footer .tvfooter-title,
#footer .block_newsletter p {
    color: var(--si-footer-text) !important;
}

#footer .tvfooter-logo-block .tvfooter-img-block img[src*="logo_white"] {
    opacity: 0;
}

#footer .tvfooter-logo-block .tvfooter-img-block:has(img[src*="logo_white"]) {
    background: transparent url("/img/logo-1767863305.jpg") no-repeat left center;
    background-size: contain;
    min-height: 34px;
    max-width: 200px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .si-footer__main {
        padding: 36px 0 28px;
    }

    .si-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 24px;
    }

    .si-footer__col--brand {
        grid-column: 1 / -1;
        max-width: none;
    }
}

@media (max-width: 767px) {
    .si-footer__main {
        padding: 28px 0 24px;
        padding-left: max(0px, env(safe-area-inset-left, 0));
        padding-right: max(0px, env(safe-area-inset-right, 0));
    }

    .si-footer__main > .container {
        padding-left: max(16px, env(safe-area-inset-left, 0));
        padding-right: max(16px, env(safe-area-inset-right, 0));
    }

    .si-footer__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .si-footer__title {
        margin-bottom: 10px;
    }

    .si-footer__bar-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-left: max(16px, env(safe-area-inset-left, 0));
        padding-right: max(16px, env(safe-area-inset-right, 0));
    }

    .si-footer__copy {
        max-width: 100%;
        word-break: break-word;
    }

    .si-footer__bar-right,
    .si-footer__payments,
    .si-footer__payments .tvfooter-payment-icon-wrapper,
    .si-footer__social .tvfooter-social-icon-wrapper {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 430px) {
    .si-footer__logo {
        padding: 5px 10px;
    }

    .si-footer__logo img {
        max-height: 44px;
    }

    .si-footer__tagline {
        font-size: 0.75rem;
    }
}

/* ── Live chat bubble — lift above bottom nav (Smartsupp + WhatsApp float) ── */
@media (max-width: 991px) {
    body.si-bottom-nav-active #chat-widget-container,
    body.si-bottom-nav-active #smartsupp-widget-container,
    body.si-bottom-nav-active .smartsupp-widget,
    body.si-bottom-nav-active iframe#smartsupp-widget,
    body.si-bottom-nav-active #smartsupp-widget,
    body.si-bottom-nav-active .tv-whatsapp-main-wrapper,
    body.si-bottom-nav-active #si-whatsapp-float,
    body.si-bottom-nav-active #si-whatsapp-widget {
        bottom: var(--si-chat-bottom-mobile) !important;
    }
}

@media (min-width: 992px) {
    #chat-widget-container,
    #smartsupp-widget-container,
    .smartsupp-widget,
    iframe#smartsupp-widget,
    #smartsupp-widget,
    .tv-whatsapp-main-wrapper {
        bottom: var(--si-chat-bottom-desktop) !important;
    }
}
