/* ============================================================
   footer.css – FurniVerse common footer + chat widget
   Pairs with footer.php (dynamic site_settings build)
   ============================================================ */

:root {
    --footer-bg:        #1a1410;
    --footer-bg-soft:   #221a14;
    --footer-border:    rgba(255, 255, 255, 0.08);
    --footer-text:      #d8cfc6;
    --footer-text-dim:  #a99c8f;
    --footer-heading:   #ffffff;
    --footer-accent:    #d97706;
    --footer-accent-2:  #7b240c;
    --footer-link:      #cfc3b6;
    --footer-link-hover:#ffffff;
    --footer-success:   #0f766e;
    --footer-info:      #334155;
    --footer-error:     #b91c1c;
    --footer-radius:    10px;
    --footer-shadow:    0 10px 30px rgba(0, 0, 0, 0.25);
    --footer-maxw:      1200px;
    --chat-bg:          #ffffff;
    --chat-header-bg:   #7b240c;
    --chat-user-bg:     #7b240c;
    --chat-user-text:   #ffffff;
    --chat-admin-bg:    #f1ece6;
    --chat-admin-text:  #2b211a;
    --chat-border:      #e5ddd3;
}

/* ─── Base ─────────────────────────────────────────────────── */
.footer,
.footer * {
    box-sizing: border-box;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── Footer shell ─────────────────────────────────────────── */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 40px;
    border-top: 3px solid var(--footer-accent-2);
}

.footer a {
    color: var(--footer-link);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer a:hover,
.footer a:focus-visible {
    color: var(--footer-link-hover);
    outline: none;
}

.footer-container {
    max-width: var(--footer-maxw);
    margin: 0 auto;
    padding: 48px 20px 32px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1.1fr 1.1fr;
    gap: 12px;
}

/* ─── Columns ──────────────────────────────────────────────── */
.footer-column {
    min-width: 0;
}

.footer-column h3 {
    color: var(--footer-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 34px;
    height: 2px;
    background: var(--footer-accent-2);
    border-radius: 2px;
}

/* ─── Brand ────────────────────────────────────────────────── */
.footer-brand {
    margin-bottom: 22px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.footer-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.footer-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.footer-logo-fallback i {
    color: var(--footer-accent);
    font-size: 20px;
}

.footer-logo-fallback .accent {
    color: var(--footer-accent);
}

.footer-description {
    color: var(--footer-text-dim);
    margin: 0;
    max-width: 230px;
    font-size: 12.5px;
    line-height: 1.55;
}

/* ─── Social ───────────────────────────────────────────────── */
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--footer-link);
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
    background: var(--footer-accent-2);
    color: #fff;
    transform: translateY(-2px);
}

.footer-social-bottom {
    margin: 0;
    gap: 8px;
    flex-shrink: 0;
}

.footer-social-bottom a {
    width: 32px;
    height: 32px;
}

/* ─── Link lists ───────────────────────────────────────────── */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.footer-links a {
    font-size: 12.75px;
    color: var(--footer-link);
    position: relative;
    padding-left: 0;
    transition: padding-left 0.2s ease, color 0.2s ease;
}

.footer-links a::before {
    content: "›";
    position: absolute;
    left: -14px;
    opacity: 0;
    color: var(--footer-accent);
    transition: opacity 0.2s ease, left 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: #fff;
    padding-left: 8px;
}

.footer-links a:hover::before,
.footer-links a:focus-visible::before {
    opacity: 1;
    left: -4px;
}

/* ─── Contact block ────────────────────────────────────────── */
.footer-contact {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.75px;
    color: var(--footer-text-dim);
}

.contact-item i {
    color: var(--footer-accent);
    width: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    text-align: center;
}

.contact-item a {
    color: var(--footer-link);
    word-break: break-word;
}

.contact-item a:hover {
    color: #fff;
}

/* ─── Newsletter ───────────────────────────────────────────── */
.footer-newsletter h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
}

.footer-newsletter p {
    color: var(--footer-text-dim);
    font-size: 13px;
    margin: 0 0 12px;
}

.newsletter-input-group {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--footer-border);
    border-radius: var(--footer-radius);
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.newsletter-input-group:focus-within {
    border-color: var(--footer-accent);
    background: rgba(255, 255, 255, 0.08);
}

.newsletter-input-group input[type="email"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 13.5px;
    outline: none;
}

.newsletter-input-group input[type="email"]::placeholder {
    color: #8b7f72;
}

.newsletter-btn {
    flex: 0 0 auto;
    width: 46px;
    border: 0;
    background: var(--footer-accent-2);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.newsletter-btn:hover,
.newsletter-btn:focus-visible {
    background: #9a2f0f;
    outline: none;
}

.newsletter-status {
    line-height: 1.4;
}

/* ─── Countries strip ──────────────────────────────────────── */
.footer-countries {
    border-top: 1px solid var(--footer-border);
    border-bottom: 1px solid var(--footer-border);
    background: var(--footer-bg-soft);
}

.footer-countries-inner {
    max-width: var(--footer-maxw);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.countries-label {
    color: var(--footer-text-dim);
    font-weight: 600;
    margin-right: 6px;
}

.country-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--footer-border);
    color: var(--footer-link);
    font-size: 12.5px;
}

.country-pill .flag {
    font-size: 14px;
    line-height: 1;
}

/* ─── Footer bottom ────────────────────────────────────────── */
.footer-bottom {
    background: #120d09;
    border-top: 1px solid var(--footer-border);
}

.footer-bottom-container {
    max-width: var(--footer-maxw);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 12.5px;
    color: var(--footer-text-dim);
}

.footer-copyright strong {
    color: #fff;
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom-links a {
    color: var(--footer-text-dim);
    font-size: 12.5px;
}

.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
    color: #fff;
}

.footer-payment {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    color: #b8a99a;
}

.footer-payment i {
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-payment i:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* ─── Back to top ──────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 96px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--footer-accent-2);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
    z-index: 9990;
}

.back-to-top.visible,
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: #9a2f0f;
    outline: none;
}

/* ============================================================
   CHAT WIDGET
   ============================================================ */
.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 9995;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.chat-toggle {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 0;
    background: var(--chat-header-bg);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(123, 36, 12, 0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.chat-toggle:hover,
.chat-toggle:focus-visible {
    background: #9a2f0f;
    transform: translateY(-2px);
    outline: none;
}

.whatsapp-toggle,
.whatsapp-toggle:hover,
.whatsapp-toggle:focus-visible {
    background: #128c7e;
    color: #fff;
    text-decoration: none;
}

.chat-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.chat-whatsapp-link:hover,
.chat-whatsapp-link:focus-visible {
    color: #d1fae5;
    outline: none;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.chat-badge[hidden] {
    display: none;
}

/* ─── Chat popup ───────────────────────────────────────────── */
.chat-popup {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: 520px;
    background: var(--chat-bg);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--chat-border);
    animation: furniChatIn 0.2s ease;
}

.chat-popup[hidden] {
    display: none;
}

@keyframes furniChatIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-header {
    background: var(--chat-header-bg);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.chat-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.chat-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.chat-close:hover,
.chat-close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

/* ─── Messages area ────────────────────────────────────────── */
.chat-messages {
    flex: 1 1 auto;
    min-height: 240px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px;
    background: #faf7f3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d8cdbf;
    border-radius: 3px;
}

.chat-placeholder {
    text-align: center;
    color: #8b7f72;
    font-size: 13px;
    padding: 30px 10px;
    font-style: italic;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    gap: 4px;
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.admin,
.chat-message.bot {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-message.user .chat-bubble {
    background: var(--chat-user-bg);
    color: var(--chat-user-text);
    border-bottom-right-radius: 4px;
}

.chat-message.admin .chat-bubble,
.chat-message.bot .chat-bubble {
    background: var(--chat-admin-bg);
    color: var(--chat-admin-text);
    border-bottom-left-radius: 4px;
}

.chat-time {
    font-size: 10.5px;
    color: #9a8d80;
    padding: 0 4px;
}

/* ─── Input row ────────────────────────────────────────────── */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid var(--chat-border);
    flex-shrink: 0;
}

.chat-input-row input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--chat-border);
    border-radius: 999px;
    background: #faf7f3;
    font-size: 13.5px;
    color: #2b211a;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.chat-input-row input[type="text"]:focus {
    border-color: var(--chat-header-bg);
    background: #fff;
}

.chat-input-row input[type="text"]:disabled {
    opacity: 0.6;
    cursor: wait;
}

.chat-input-row button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--chat-header-bg);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.chat-input-row button:hover,
.chat-input-row button:focus-visible {
    background: #9a2f0f;
    outline: none;
}

.chat-input-row button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
        padding: 40px 20px 28px;
    }
    .footer-description {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 32px 18px 24px;
    }

    .footer-column h3 {
        margin-bottom: 14px;
    }

    .footer-countries-inner {
        padding: 12px 18px;
        font-size: 12.5px;
    }

    .footer-bottom-container {
        padding: 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .footer-bottom-links {
        gap: 12px;
    }

    .footer-payment {
        font-size: 18px;
        gap: 10px;
    }

    /* Chat widget on small screens */
    .chat-widget {
        right: 14px;
        bottom: 16px;
    }

    .chat-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .chat-popup {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 76px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 100px);
    }

    .chat-messages {
        min-height: 180px;
        max-height: none;
    }

    .back-to-top {
        right: 14px;
        bottom: 78px;
        width: 40px;
        height: 40px;
    }
}

/* ─── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .footer *,
    .chat-widget *,
    .back-to-top {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}