/*
Theme Name: LuperIQ Theme
Author: LuperIQ
Description: General-purpose theme for LuperIQ sites (works with Theme Studio; not industry-specific).
Version: 0.1.0
Text Domain: luperiq-theme
*/

/* Base shell */
body.luperiq-theme {
    margin: 0;
    background: var(--luperiq-primary, #0f1115);
    color: var(--luperiq-text, #111111);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.luperiq-theme *,
body.luperiq-theme *::before,
body.luperiq-theme *::after {
    box-sizing: border-box;
}

body.luperiq-theme img {
    max-width: 100%;
    height: auto;
}

body.luperiq-theme .luperiq-theme-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--luperiq-background, #f6f7f8);
    color: var(--luperiq-text, #111111);
}

body.luperiq-theme.luperiq-theme-has-sticky-footer {
    --luperiq-theme-sticky-footer-h: 78px;
}

body.luperiq-theme.luperiq-theme-has-sticky-footer .luperiq-theme-shell {
    padding-bottom: calc(var(--luperiq-theme-sticky-footer-h, 78px) + env(safe-area-inset-bottom));
}

body.luperiq-theme a {
    color: var(--luperiq-link, #0b57d0);
}

body.luperiq-theme a:hover {
    text-decoration: none;
}

/* Header CTA visibility based on auth state */
body.logged-in .luperiq-ts-cta-group a[href*="wp-login.php"],
body.logged-in .luperiq-ts-cta-group a[href*="wp-signup.php"],
body.logged-in .luperiq-ts-cta-group a[href*="/register"],
body.logged-in .luperiq-ts-cta-group a[href*="/signup"],
body.logged-in .luperiq-ts-cta-group a[href*="/login"] {
    display: none !important;
}

body:not(.logged-in) .luperiq-ts-cta-group a[href*="wp-login.php?action=logout"],
body:not(.logged-in) .luperiq-ts-cta-group a[href*="logout"],
body:not(.logged-in) .luperiq-ts-cta-group a[href*="/inbox"],
body:not(.logged-in) .luperiq-ts-cta-group a[href*="inbox"] {
    display: none !important;
}

/* WooCommerce pages styled to match LuperIQ public catalog */
body.woocommerce.luperiq-theme,
body.woocommerce-page.luperiq-theme {
    background: #0f1115;
}

body.woocommerce.luperiq-theme .luperiq-theme-shell,
body.woocommerce-page.luperiq-theme .luperiq-theme-shell {
    background: linear-gradient(180deg, #f6f2ea 0%, #eef3f1 40%, #f7f7fb 100%);
}

body.woocommerce.luperiq-theme,
body.woocommerce-page.luperiq-theme {
    font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

body.woocommerce.luperiq-theme .luperiq-theme-container,
body.woocommerce-page.luperiq-theme .luperiq-theme-container {
    max-width: 1200px;
}

body.woocommerce.luperiq-theme .woocommerce-breadcrumb,
body.woocommerce-page.luperiq-theme .woocommerce-breadcrumb {
    color: #656b78;
}

body.woocommerce.luperiq-theme .woocommerce ul.products li.product,
body.woocommerce-page.luperiq-theme .woocommerce ul.products li.product,
body.woocommerce.luperiq-theme .wc-block-grid__product,
body.woocommerce-page.luperiq-theme .wc-block-grid__product {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 17, 21, 0.08);
    border: 1px solid rgba(15, 17, 21, 0.06);
}

body.woocommerce.luperiq-theme .woocommerce ul.products li.product .price,
body.woocommerce-page.luperiq-theme .woocommerce ul.products li.product .price,
body.woocommerce.luperiq-theme .wc-block-grid__product-price,
body.woocommerce-page.luperiq-theme .wc-block-grid__product-price {
    color: #f15b2a;
    font-weight: 700;
}

body.woocommerce.luperiq-theme .woocommerce div.product,
body.woocommerce-page.luperiq-theme .woocommerce div.product {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 32px rgba(15, 17, 21, 0.08);
    border: 1px solid rgba(15, 17, 21, 0.06);
}

body.woocommerce.luperiq-theme .woocommerce div.product .product_title,
body.woocommerce-page.luperiq-theme .woocommerce div.product .product_title {
    font-family: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
}

body.woocommerce.luperiq-theme .woocommerce .button,
body.woocommerce-page.luperiq-theme .woocommerce .button,
body.woocommerce.luperiq-theme .woocommerce a.button,
body.woocommerce-page.luperiq-theme .woocommerce a.button,
body.woocommerce.luperiq-theme .woocommerce button.button,
body.woocommerce-page.luperiq-theme .woocommerce button.button,
body.woocommerce.luperiq-theme .woocommerce input.button,
body.woocommerce-page.luperiq-theme .woocommerce input.button {
    border-radius: 999px;
    padding: 12px 18px;
    border: 1px solid #f15b2a;
    background: #f15b2a;
    color: #ffffff;
    font-weight: 700;
}

body.woocommerce.luperiq-theme .woocommerce .button.alt,
body.woocommerce-page.luperiq-theme .woocommerce .button.alt {
    background: #0f1115;
    border-color: #0f1115;
}

body.woocommerce.luperiq-theme .woocommerce .price ins,
body.woocommerce-page.luperiq-theme .woocommerce .price ins {
    color: #f15b2a;
    font-weight: 700;
}

/* Theme Studio blocks (header/footer builder) — minimal theme-side styling */
body.luperiq-theme .luperiq-ts-block {
    background: var(--luperiq-surface, #ffffff);
    color: var(--luperiq-text, #111111);
    border-bottom: 1px solid rgba(15, 17, 21, 0.08);
}

body.luperiq-theme .luperiq-ts-block.is-tone-muted {
    background: rgba(15, 17, 21, 0.04);
}

body.luperiq-theme .luperiq-ts-block.is-tone-accent {
    background: var(--luperiq-accent, #22c55e);
    color: #ffffff;
}

body.luperiq-theme .luperiq-ts-block.is-tone-primary {
    background: var(--luperiq-header-bg, #0f1115);
    color: var(--luperiq-header-text, #ffffff);
}

body.luperiq-theme .luperiq-ts-block-inner {
    max-width: var(--luperiq-container, 1100px);
    margin: 0 auto;
    padding: 12px 18px;
}

/* Header */
.luperiq-theme-header {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 50;
    background: var(--luperiq-header-bg, #0f1115);
    color: var(--luperiq-header-text, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: saturate(1.1);
}

.luperiq-theme-header.is-not-sticky {
    position: relative;
    top: auto;
}

.luperiq-theme-header-inner {
    max-width: var(--luperiq-container, 1100px);
    margin: 0 auto;
    padding: 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.luperiq-theme-header.has-ts-layout .luperiq-theme-header-inner {
    display: block;
}

.luperiq-theme-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.luperiq-theme-brand-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.luperiq-theme-logo {
    max-height: 44px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 10px;
}

.luperiq-theme-brand-name {
    font-size: 18px;
    font-weight: 850;
    letter-spacing: 0.2px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.luperiq-theme-brand-subtitle {
    font-size: 13px;
    opacity: 0.78;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.luperiq-theme-nav-wrap {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: min(520px, 100%);
}

/* Theme Studio nav/button primitives (copied as theme fallback so nav works without the module CSS) */
.luperiq-ts-nav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.luperiq-ts-nav-link,
.luperiq-ts-nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-weight: 850;
    opacity: 0.92;
    padding: 8px 10px;
    border-radius: 10px;
}

.luperiq-ts-nav-link:hover,
.luperiq-ts-nav-menu a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.luperiq-ts-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.luperiq-ts-nav-toggle {
    display: none;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: inherit;
    border-radius: calc(var(--luperiq-radius, 16px) * 0.75);
    padding: 10px 12px;
    font-weight: 850;
    cursor: pointer;
}

.luperiq-ts-nav-toggle-lines {
    width: 18px;
    height: 12px;
    position: relative;
    display: inline-block;
}

.luperiq-ts-nav-toggle-lines::before,
.luperiq-ts-nav-toggle-lines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.luperiq-ts-nav-toggle-lines::before {
    top: 2px;
}

.luperiq-ts-nav-toggle-lines::after {
    bottom: 2px;
}

@media (max-width: 860px) {
    .luperiq-theme-nav-wrap {
        min-width: 100%;
        justify-content: space-between;
    }

    .luperiq-ts-nav-toggle {
        display: inline-flex;
    }

    .luperiq-ts-nav {
        display: none;
        width: 100%;
        justify-content: flex-start;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.10);
        padding: 10px;
        border-radius: calc(var(--luperiq-radius, 16px) * 0.75);
    }

    .luperiq-ts-nav.is-open {
        display: flex;
    }
}

.luperiq-ts-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: calc(var(--luperiq-radius, 16px) * 0.75);
    text-decoration: none;
    font-weight: 850;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.10);
    color: inherit;
    line-height: 1.1;
}

.luperiq-ts-button:hover {
    filter: brightness(1.04);
}

.luperiq-ts-button.is-primary {
    background: var(--luperiq-accent, #22c55e);
    border-color: transparent;
    color: #ffffff;
}

.luperiq-ts-button.is-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.24);
}

.luperiq-ts-button.is-ghost {
    background: transparent;
    border-color: transparent;
    opacity: 0.92;
}

/* Main */
.luperiq-theme-main {
    flex: 1;
}

.luperiq-theme-container {
    max-width: var(--luperiq-container, 1100px);
    margin: 0 auto;
    padding: 26px 18px 50px;
}

.luperiq-theme-page-title {
    margin: 0 0 18px;
    font-size: 32px;
    letter-spacing: -0.5px;
}

/* Simple hero (front page) */
.luperiq-theme-hero {
    border-radius: calc(var(--luperiq-radius, 16px) * 1.1);
    padding: 26px 22px;
    background: var(--luperiq-surface, #ffffff);
    box-shadow: 0 8px 28px rgba(15, 17, 21, 0.08);
    border: 1px solid rgba(15, 17, 21, 0.08);
    margin: 0 0 22px;
}

.luperiq-theme-hero-title {
    margin: 0 0 8px;
    font-size: 34px;
    letter-spacing: -0.8px;
    line-height: 1.08;
}

.luperiq-theme-hero-subtitle {
    margin: 0 0 14px;
    font-size: 15px;
    opacity: 0.86;
}

.luperiq-theme-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.luperiq-theme-hero-actions .luperiq-ts-button {
    border-color: rgba(15, 17, 21, 0.14);
    background: rgba(15, 17, 21, 0.06);
    color: var(--luperiq-text, #111111);
}

.luperiq-theme-hero-actions .luperiq-ts-button.is-primary {
    color: #ffffff;
    background: var(--luperiq-accent, #22c55e);
    border-color: transparent;
}

/* Footer */
.luperiq-theme-footer {
    background: rgba(15, 17, 21, 0.05);
    border-top: 1px solid rgba(15, 17, 21, 0.10);
}

.luperiq-theme-footer-inner {
    max-width: var(--luperiq-container, 1100px);
    margin: 0 auto;
    padding: 22px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.luperiq-theme-footer-note {
    opacity: 0.78;
    font-size: 13px;
}

/* Sticky footer bar */
.luperiq-theme-sticky-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(15, 17, 21, 0.86);
    color: #ffffff;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.luperiq-theme-sticky-footer-inner {
    max-width: var(--luperiq-container, 1100px);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    justify-content: space-between;
}

.luperiq-theme-sticky-footer-text {
    font-weight: 850;
}

.luperiq-theme-sticky-footer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.luperiq-theme-sticky-footer-buttons .luperiq-ts-button {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
}

.luperiq-theme-sticky-footer-buttons .luperiq-ts-button.is-primary {
    background: var(--luperiq-accent, #22c55e);
    border-color: transparent;
}
