/* Shared storefront design tokens. Page files own layout; this file owns primitives. */
: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. */
#masthead #mega-menu-wrap-primary {
    --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;
}
