/* Juvo app shell — PWA install banner, Help Centre and live chat widget. */

/* ---------------------------------------------------------------- Install bar */

.jv-install-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1080;
    width: min(680px, calc(100vw - 24px));
    background: #12131a;
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    animation: jv-install-in 0.35s ease;
}

@keyframes jv-install-in {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.jv-install-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.jv-install-ico { border-radius: 9px; flex: 0 0 auto; }

.jv-install-text { display: flex; flex-direction: column; line-height: 1.3; font-size: 13px; }
.jv-install-text strong { font-size: 14px; }
.jv-install-text span { color: #c7c9d3; }

.jv-install-cta {
    margin-left: auto;
    background: #f68b1e;
    color: #12131a;
    border: 0;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.jv-install-close {
    background: transparent;
    border: 0;
    color: #9ca0ad;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

@media (max-width: 560px) {
    .jv-install-text span { display: none; }
}

/* -------------------------------------------------------------- Offline page */

.jv-offline {
    max-width: 460px;
    margin: 12vh auto;
    text-align: center;
    padding: 0 16px;
}

.jv-offline-ico {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff4e6;
    color: #f68b1e;
    font-size: 34px;
}

.jv-offline h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.jv-offline p { color: #6b7280; font-size: 14px; margin-bottom: 22px; }
.jv-offline-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.jv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.jv-btn-dark { background: #12131a; color: #fff; }
.jv-btn-dark:hover { background: #26283a; color: #fff; }
.jv-btn-outline { background: #fff; border-color: #d8dbe2; color: #12131a; }
.jv-btn-outline:hover { border-color: #12131a; color: #12131a; }

/* -------------------------------------------------------------- Help Centre */

.jv-help-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, #fff4e6, #fffaf3);
    border: 1px solid #f6e3ca;
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 18px;
}

.jv-help-hero h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.jv-help-hero p { margin: 0; color: #6b7280; font-size: 14px; }

.jv-help-topics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.jv-help-topic {
    background: #fff;
    border: 1px solid #eceff3;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.jv-help-topic-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #fff4e6;
    color: #f68b1e;
    font-size: 20px;
    margin-bottom: 12px;
}

.jv-help-topic h6 { font-weight: 700; margin-bottom: 6px; }
.jv-help-topic p { font-size: 13px; color: #6b7280; margin-bottom: 12px; }
.jv-help-topic ul li { margin-bottom: 6px; font-size: 13px; }
.jv-help-topic ul a { color: #12131a; text-decoration: none; }
.jv-help-topic ul a:hover { color: #f68b1e; text-decoration: underline; }

.jv-faq .accordion-button { font-size: 14px; font-weight: 600; }
.jv-faq .accordion-button:not(.collapsed) { color: #12131a; background: #fff8f0; box-shadow: none; }
.jv-faq .accordion-button:focus { box-shadow: none; }

/* ------------------------------------------------------------- Chat widget */

.jv-chat-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1070;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: #f68b1e;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(246, 139, 30, 0.42);
    display: grid;
    place-items: center;
    transition: transform 0.18s ease;
}

.jv-chat-fab:hover { transform: scale(1.06); }

.jv-chat-fab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #e11d48;
    border: 2px solid #fff;
}

.jv-chat-open .jv-chat-fab { display: none; }

.jv-chat-panel {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1085;
    width: min(370px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 40px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: jv-chat-in 0.22s ease;
}

@keyframes jv-chat-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.jv-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #12131a;
    color: #fff;
}

.jv-chat-head strong { display: block; font-size: 15px; }
.jv-chat-status { font-size: 12px; color: #b8bcc9; }

.jv-chat-x {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.jv-chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.jv-chat-start { padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.jv-chat-start input,
.jv-chat-start textarea {
    width: 100%;
    border: 1px solid #dfe2e8;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
}

.jv-chat-start input:focus,
.jv-chat-start textarea:focus { outline: none; border-color: #f68b1e; }

.jv-chat-intro { font-size: 13px; color: #6b7280; margin: 0 0 2px; }
.jv-chat-intro a { color: #f68b1e; }

.jv-chat-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.jv-chat-ref {
    padding: 8px 16px;
    font-size: 12px;
    color: #6b7280;
    background: #f7f8fa;
    border-bottom: 1px solid #eceff3;
}

.jv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafbfc;
}

.jv-chat-msg { display: flex; }
.jv-chat-me { justify-content: flex-end; }
.jv-chat-agent { justify-content: flex-start; }

.jv-chat-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.42;
    white-space: pre-wrap;
    word-break: break-word;
}

.jv-chat-me .jv-chat-bubble { background: #f68b1e; color: #fff; border-bottom-right-radius: 4px; }
.jv-chat-agent .jv-chat-bubble { background: #fff; color: #12131a; border: 1px solid #e7e9ee; border-bottom-left-radius: 4px; }

.jv-chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eceff3;
    background: #fff;
}

.jv-chat-compose textarea {
    flex: 1;
    resize: none;
    border: 1px solid #dfe2e8;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    max-height: 110px;
}

.jv-chat-compose textarea:focus { outline: none; border-color: #f68b1e; }

.jv-chat-compose button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 0;
    background: #12131a;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

.jv-chat-compose button:hover { background: #26283a; }

.jv-chat-error {
    margin: 0 16px 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

@media (max-width: 560px) {
    .jv-chat-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: min(78vh, 620px);
        border-radius: 16px 16px 0 0;
    }

    .jv-chat-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* ------------------------------------------------ Responsive safety net
   Guarantees the storefront fits whatever screen the visitor is using:
   no accidental horizontal scroll, and media/typography that scales. */

/* Flex and grid children may shrink below their content width instead of
   forcing the page wider than the viewport. */
.jv-main,
.jv-main *,
.jv-section,
.jv-product-row {
    min-width: 0;
}

/* Images and media never overflow their column. */
.jv-main img,
.jv-main svg,
.jv-main video,
.jv-main iframe {
    max-width: 100%;
    height: auto;
}

/* Very long words (URLs, SKUs) wrap instead of pushing the layout wide. */
.jv-main h1, .jv-main h2, .jv-main h3,
.jv-main h4, .jv-main h5, .jv-main h6,
.jv-product-name,
.jv-ac-name {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Keep notch/home-indicator offsets consistent across overlays. */
@media (max-width: 820px) {
    .jv-install-banner {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    }
}

/* Landscape phones are short: let tall hero/panels shrink to the viewport. */
@media (max-height: 480px) and (orientation: landscape) {
    .jv-hero-slider .jv-slide { min-height: auto; }
    .jv-chat-panel { height: min(90vh, 420px); }
}

/* Ultra-narrow devices: single-column rows, tighter gutters. */
@media (max-width: 360px) {
    .jv-container { padding-left: 10px; padding-right: 10px; }
    .jv-row-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

