/* global.css — JP Spare Parts Plugin
 * Site-wide styles. Extracted from:
 *  - mu-plugins/jpspareparts-homepage.php (.jps-floating-contact block)
 *  - themes/astra-child/functions.php (astra_child_hide_ast_copyright CSS)
 * Loaded site-wide via class-assets.php (handle: jps-global)
 */

/* Floating Contact — injected on every page via wp_footer */
.jps-floating-contact {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.jps-float-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}
.jps-float-btn:hover {
    transform: scale(1.1);
    color: #fff;
}
.jps-float-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}
.jps-float-btn .jps-float-tooltip {
    position: absolute;
    right: 62px;
    top: 50%;
    transform: translateY(-50%);
    background: #011627;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.jps-float-btn:hover .jps-float-tooltip {
    opacity: 1;
}
.jps-float-whatsapp { background: #25D366; }
.jps-float-email { background: #ff6b35; }

@media (max-width: 767px) {
    .jps-floating-contact {
        right: 10px;
        bottom: 10px;
        top: auto;
        transform: none;
        flex-direction: row;
    }
    .jps-float-btn { width: 46px; height: 46px; }
    .jps-float-btn svg { width: 22px; height: 22px; }
    .jps-float-btn .jps-float-tooltip { display: none; }
}

/* Hide Astra built-in copyright bar (jp-legal-bar outputs copyright instead) */
.ast-footer-copyright, .ast-small-footer-section { display: none !important; }

/* ===== Sticky site header (stays pinned to top while scrolling) =====
 * IMPORTANT: sticky must be on .site-header, whose parent is #page (full
 * page height). Putting it on .ast-main-header-wrap fails because that
 * element's parent (#ast-desktop-header) is only as tall as the header, so
 * there is no scroll room for the sticky to engage.
 * body{overflow-x:clip} is kept as a safety net (Astra's overflow-x:hidden
 * would otherwise turn <body> into a scroll container and break sticky).
 */
body {
    overflow-x: clip !important;
}
.site-header {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    background-color: #ffffff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.ast-main-header-wrap {
    background-color: #ffffff;
}

/* ===== FAQ accordion (shortcode: [jps_faq]) ===== */
.jps-faq { max-width: 860px; margin: 0 auto; }
.jps-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 0 18px;
    background: #fff;
}
.jps-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 28px 16px 0;
    list-style: none;
    position: relative;
}
.jps-faq-item summary::-webkit-details-marker { display: none; }
.jps-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 14px;
    font-size: 1.4rem;
    line-height: 1;
    color: #ff6b35;
}
.jps-faq-item[open] summary::after { content: "\2212"; }
.jps-faq-answer { padding: 0 0 16px; color: #4a5568; line-height: 1.7; }

/* ===== Legal pages ([jps_disclaimer] / [jps_warranty]) ===== */
.jps-legal-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 0 40px;
    line-height: 1.8;
    color: #2d3748;
}
.jps-legal-page h1 { font-size: 1.9rem; margin: 0 0 18px; color: #0a2540; }
.jps-legal-page h2 { font-size: 1.3rem; margin: 28px 0 10px; color: #0a2540; }
.jps-legal-page ul { margin: 0 0 16px 22px; }
.jps-legal-page li { margin-bottom: 6px; }
.jps-legal-updated { margin-top: 28px; font-size: 0.85rem; color: #888; }

/* ===== Footer legal links row ===== */
.jps-legal-links {
    text-align: center;
    font-size: 0.78rem;
    padding: 8px 20px 24px;
    max-width: 1140px;
    margin: 0 auto;
}
.jps-legal-links a { color: #777; text-decoration: none; }
.jps-legal-links a:hover { color: #ff6b35; text-decoration: underline; }
.jps-legal-sep { color: #ccc; margin: 0 8px; }
