/* Shared storefront UI: design tokens, controls, dropdowns and article layout. */

/* Delivery has a freight notice rather than a short pickup price. */
.wc-block-checkout .jj-nationwide-delivery-option .wc-block-components-radio-control__label-group {
    flex-wrap: wrap;
    gap: 4px;
}
.wc-block-checkout .jj-nationwide-delivery-option .wc-block-components-radio-control__secondary-label {
    flex-basis: 100%;
    margin-left: 0;
    white-space: normal;
    text-align: left;
    font-weight: 400;
}
.wc-block-checkout .jj-nationwide-delivery-option .wc-block-components-radio-control__secondary-label em {
    font-style: normal;
}
:root {
    --jj-brand: #f37429;
    --jj-brand-hover: #d95f18;
    --jj-brand-text: #c6530b;
    --jj-brand-soft: #ffeadb;
    --jj-card-surface: #fff8f2;
    --jj-card-border: #f6c5a4;
    --jj-focus: #804bb1;
    --jj-action-dark: #2f2f2f;
    --jj-action-dark-hover: #1f1f1f;
    --jj-input-border: #d7dce1;
    --jj-surface: #fff;
    --jj-text: #393439;
    --jj-control-radius: 4px;
    --jj-card-radius: 8px;
    --jj-control-height: 48px;
    --jj-page-title-space: 24px;
}

/* Native WooCommerce controls; exclude icon-only controls, checkboxes and radios. */
body .woocommerce :is(a.button, button.button, input.button),
body .wc-block-components-button {
    box-sizing: border-box;
    min-height: var(--jj-control-height);
    padding: 12px 22px;
    border-radius: var(--jj-control-radius);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

/* Purchase buttons retain their existing stock/backorder semantics. */
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
body.woocommerce-checkout #place_order,
body .wc-block-cart__submit-button,
body .wc-block-components-checkout-place-order-button {
    background-color: var(--jj-brand);
    color: #fff;
}
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
body.woocommerce-checkout #place_order:hover,
body .wc-block-cart__submit-button:hover,
body .wc-block-components-checkout-place-order-button:hover {
    background-color: var(--jj-brand-hover);
}

body .woocommerce :is(input.input-text, textarea.input-text, select),
body .wc-block-components-text-input :is(input, textarea) {
    box-sizing: border-box;
    min-height: var(--jj-control-height);
    border: 1px solid var(--jj-input-border);
    border-radius: var(--jj-control-radius);
    background-color: var(--jj-surface);
    color: var(--jj-text);
    box-shadow: none;
    font-size: 16px;
}
body .woocommerce :is(input.input-text, textarea.input-text, select) {
    padding: 11px 14px;
}
body .woocommerce textarea.input-text {
    min-height: 120px;
}
body .woocommerce .woocommerce-invalid :is(input.input-text, select, textarea) {
    border-color: #b32d2e;
}
body .woocommerce :is(button, input):disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* One focus ring, including mouse focus on checkout. Keep keyboard focus visible. */
body :is(a, button, input, select, textarea, [role="button"]):focus {
    outline: 2px solid var(--jj-focus) !important;
    outline-offset: 3px !important;
}
body :is(a.button, button, input, select, textarea, .wc-block-components-button):focus {
    box-shadow: none !important;
}
@media (max-width: 767px) {
    :root { --jj-page-title-space: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    body .jj-account-shortcut { transition: none; }
    body .jj-account-shortcut:hover { transform: none; }
}

/* Primary navigation dropdowns use the shared site-ui tokens.
   The masthead scope overrides the older Customizer About Us ID rules.
   Max Mega Menu still owns positioning, columns and open/closed states. */
/* Shared by navigation dropdowns and the header mini-cart. */
#masthead {
    --jj-menu-surface: #251f1c;
    --jj-menu-text: #fff;
    --jj-menu-border: rgba(255, 255, 255, .14);
    --jj-menu-hover: #3a3029;
}

#masthead #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu {
    background: var(--jj-menu-surface) !important;
    border: 1px solid var(--jj-menu-border);
    border-radius: var(--jj-card-radius, 8px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
    backdrop-filter: none !important;
}

#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu .mega-sub-menu {
    background: var(--jj-menu-surface);
}

#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu li.mega-menu-item > a.mega-menu-link {
    background: transparent !important;
    color: var(--jj-menu-text) !important;
    border-radius: var(--jj-control-radius, 4px);
    margin: 0;
    padding: 10px 12px;
    height: auto;
    min-height: 44px;
    line-height: 1.5;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
}

/* Brand headings are the first item level in each mega-menu column,
   including brands without children (such as Tiandy). */
#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-menu-column > .mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
    font-weight: 600;
    color: var(--jj-brand, #f37429) !important;
}

#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu li.mega-menu-item > a.mega-menu-link:hover,
#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu li.mega-menu-item > a.mega-menu-link:focus-visible,
#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu li.mega-current-menu-item > a.mega-menu-link {
    background: var(--jj-menu-hover) !important;
    color: var(--jj-brand, #f37429) !important;
}

#masthead #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu a.mega-menu-link:focus-visible {
    outline: 2px solid var(--jj-focus, #804bb1) !important;
    outline-offset: -2px !important;
}

/* Storefront mini-cart: leave hover/touch visibility and cart fragments to WooCommerce. */
#masthead .site-header-cart .widget_shopping_cart {
    background: var(--jj-menu-surface);
    color: var(--jj-menu-text);
    border: 1px solid var(--jj-menu-border);
    border-radius: var(--jj-card-radius, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}

#masthead .site-header-cart .widget_shopping_cart .product_list_widget li {
    border-bottom: 1px solid var(--jj-menu-border);
}

#masthead .site-header-cart .widget_shopping_cart a {
    color: var(--jj-menu-text);
    text-decoration: none;
}

#masthead .site-header-cart .widget_shopping_cart a:hover {
    color: var(--jj-brand, #f37429);
}

#masthead .site-header-cart .widget_shopping_cart .quantity {
    color: #d5cec9;
}

#masthead .site-header-cart .widget_shopping_cart .total,
#masthead .site-header-cart .widget_shopping_cart .buttons {
    background: transparent;
    color: var(--jj-menu-text);
    border-color: var(--jj-menu-border);
}

#masthead .site-header-cart .widget_shopping_cart .total .amount {
    color: var(--jj-brand, #f37429);
    font-weight: 600;
}

#masthead .site-header-cart .widget_shopping_cart a.remove::before {
    color: var(--jj-menu-text);
}

#masthead .site-header-cart .widget_shopping_cart a.remove:hover::before {
    color: var(--jj-brand, #f37429);
}

#masthead .site-header-cart .widget_shopping_cart .buttons a.button {
    min-height: var(--jj-control-height, 48px);
    padding: 12px 16px;
    border: 1px solid var(--jj-menu-border);
    border-radius: var(--jj-control-radius, 4px);
    background: var(--jj-menu-surface);
    color: var(--jj-menu-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

#masthead .site-header-cart .widget_shopping_cart .buttons a.button:hover {
    background: var(--jj-menu-hover);
    color: var(--jj-brand, #f37429);
}

#masthead .site-header-cart .widget_shopping_cart .buttons a.checkout {
    background: var(--jj-brand, #f37429);
    border-color: var(--jj-brand, #f37429);
    color: var(--jj-action-dark, #2f2f2f);
}

#masthead .site-header-cart .widget_shopping_cart .buttons a.checkout:hover {
    background: var(--jj-brand-hover, #d95f18);
    border-color: var(--jj-brand-hover, #d95f18);
    color: var(--jj-action-dark, #2f2f2f);
}

/* =========================================================
   Remove Feature Image in posts
   ========================================================= */

body.single-post img.wp-post-image,
body.single-post .post-thumbnail {
    display: none !important;
}

/* News and case-study article spacing. The Customizer's generic
   .entry-header margin-top: 120px must not push individual posts down.
   Keep editorial spacers and nested cards outside these structural rules. */
body.single-post {
    --jj-article-top-space: 32px;
    --jj-article-title-gap: 16px;
    --jj-article-bottom-space: 32px;
}

body.single-post .site-main > article.type-post > .entry-header {
    margin: var(--jj-article-top-space) 0 var(--jj-article-title-gap);
    /* Keep the title clear of Storefront's header divider. */
    padding: 0 0 12px;
    min-height: 0;
    height: auto;
}

body.single-post .site-main > article.type-post > .entry-header > .entry-title {
    margin-bottom: 0;
}

body.single-post .site-main > article.type-post > .entry-content > .elementor > .elementor-top-section:first-child {
    padding-top: 0;
}

/* Let the content area own the footer gap instead of stacking three margins. */
body.single-post .site-main > article.type-post,
body.single-post #primary > .site-main {
    margin-bottom: 0;
}

body.single-post #primary {
    margin-bottom: var(--jj-article-bottom-space);
}

body.single-post .site-main > article.type-post > .post-navigation {
    padding-top: 24px;
    padding-bottom: 24px;
}

/* Match account pagination using the shared site-ui design tokens. */
body.single-post .site-main .post-navigation .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

body.single-post .site-main .post-navigation .nav-links > :is(.nav-previous, .nav-next) {
    float: none;
    width: auto;
    min-width: 0;
    display: flex;
}

body.single-post .site-main .post-navigation .nav-next {
    grid-column: 2;
    justify-content: flex-end;
}

body.single-post .site-main .post-navigation :is(.nav-previous, .nav-next) a {
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: min(100%, 320px);
    min-height: var(--jj-control-height, 48px);
    padding: 12px 16px;
    border: 1px solid var(--jj-card-border, #f6c5a4);
    border-radius: 0;
    background: var(--jj-surface, #fff);
    color: var(--jj-brand-text, #c6530b);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-decoration: none;
}

body.single-post .site-main .post-navigation .nav-next a {
    justify-content: flex-end;
}

body.single-post .site-main .post-navigation :is(.nav-previous, .nav-next) a:hover {
    background: var(--jj-brand-soft, #ffeadb);
}

body.single-post .site-main .post-navigation a:focus-visible {
    outline: 2px solid var(--jj-focus, #804bb1);
    outline-offset: 3px;
}

body.single-post .site-main .post-navigation .nav-previous a::before,
body.single-post .site-main .post-navigation .nav-next a::after {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    body.single-post {
        --jj-article-top-space: 24px;
        --jj-article-bottom-space: 24px;
    }

    body.single-post .site-main .post-navigation .nav-links {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    body.single-post .site-main .post-navigation .nav-next {
        grid-column: 1;
    }
}
