/*
Theme Name:   JA Selection
Theme URI:    https://www.jaselection.com/
Description:  Storefront child theme for JA Selection, styled after the current www.jaselection.com (docs/design/design-spec.md). The Storefront parent is never edited.
Author:       JA Selection
Template:     storefront
Version:      0.2.0
Text Domain:  jase-theme
*/

/* ------------------------------------------------------------ tokens */

:root {
    --jase-text: #2c2c2c;
    --jase-muted: #666666; /* 5.7:1 on white, 5.3:1 on --jase-soft (WCAG AA) */
    --jase-line: #e6e6e6;
    --jase-bg: #ffffff;
    --jase-soft: #f7f7f7;
    --jase-red: #e02020;
    --jase-red-dark: #c01818;
    --jase-bar: #2c2c2c;
    --jase-font: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    --jase-max: 1140px;
}

/* ------------------------------------------------------------ base */

body,
button,
input,
select,
textarea {
    font-family: var(--jase-font);
    color: var(--jase-text);
}

body {
    background: var(--jase-bg);
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--jase-text);
}

a:hover,
a:focus {
    color: var(--jase-red);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--jase-font);
    color: var(--jase-text);
    font-weight: 400;
}

.col-full {
    max-width: var(--jase-max);
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.wc-block-components-button,
.added_to_cart {
    background-color: var(--jase-red);
    border-color: var(--jase-red);
    color: #fff;
    border-radius: 2px;
    font-weight: 400;
}

button:hover,
input[type="submit"]:hover,
.button:hover,
.added_to_cart:hover {
    background-color: var(--jase-red-dark);
    border-color: var(--jase-red-dark);
    color: #fff;
}

button.alt,
.button.alt,
.single_add_to_cart_button,
.checkout-button,
#place_order {
    background-color: var(--jase-red) !important;
    border-color: var(--jase-red) !important;
    color: #fff !important;
}

/* ------------------------------------------------------------ announcement bar */

.jase-announce {
    background: var(--jase-bar);
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.jase-announce__inner {
    display: flex;
    align-items: center;
}

.jase-announce__track {
    position: relative;
    flex: 1;
    height: 44px;
    overflow: hidden;
}

.jase-announce__nav,
.jase-announce__nav:hover {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    color: #fff;
    opacity: .7;
}

.jase-announce__nav:hover,
.jase-announce__nav:focus-visible {
    opacity: 1;
}

.jase-announce__nav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.jase-announce__nav .jase-icon {
    width: 18px;
    height: 18px;
}

.jase-announce__item {
    position: absolute;
    inset: 0;
    margin: 0;
    line-height: 44px;
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}

/* Items are stacked; only the visible one takes clicks. */
.jase-announce__item.is-active {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
}

.jase-announce__link {
    color: inherit;
    text-decoration: none;
}

.jase-announce__link:hover,
.jase-announce__link:focus-visible {
    color: inherit;
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .jase-announce__item { transition: none; }
}

/* ------------------------------------------------------------ header */

.site-header {
    background: var(--jase-bg);
    border-bottom: 0;
    padding-top: 12px;
    margin-bottom: 0;
}

/* Sticky header; compacts after scrolling (body.jase-header-compact, set in
   inc/header.php), like the current site's header--sticky. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Storefront sets overflow-x: hidden on body and #page, which turns them into
   scroll containers and stops position: sticky. clip still hides sideways
   overflow without that side effect. */
body,
#page {
    overflow-x: clip;
}

.admin-bar .site-header {
    top: var(--wp-admin--admin-bar--height, 32px);
}

/* Storefront's sticky add-to-cart bar on the product page (768 px and up).
   It is fixed at top: 0 above everything, so over the sticky header it covered
   the menu and search. Sit it just under the header instead: inc/header.php
   keeps --jase-header-h current, and a lower z-index lets it slide out from
   beneath the header and keeps the menu's dropdowns on top of it. */
.storefront-sticky-add-to-cart,
.storefront-sticky-add-to-cart--slideInDown {
    top: var(--jase-header-h, 0px);
    z-index: 99;
    padding: 8px 0;
    background: #fff;
    border-bottom: 1px solid var(--jase-line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.admin-bar .storefront-sticky-add-to-cart,
.admin-bar .storefront-sticky-add-to-cart--slideInDown {
    top: calc(var(--jase-header-h, 0px) + var(--wp-admin--admin-bar--height, 32px));
}

.storefront-sticky-add-to-cart img {
    max-width: 48px;
    margin-right: 16px;
}

.storefront-sticky-add-to-cart__content-title {
    font-size: 15px;
}

.storefront-sticky-add-to-cart__content-price {
    opacity: 1;
    color: var(--jase-red);
    font-weight: 700;
}

.storefront-sticky-add-to-cart__content-price del {
    color: var(--jase-muted);
    font-weight: 400;
}

/* 選擇規格 scrolls the product into view: keep its top clear of the header. */
.single-product div.product {
    scroll-margin-top: calc(var(--jase-header-h, 0px) + 16px);
}

.jase-header-compact .site-header {
    padding-top: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.jase-header-compact .jase-brand {
    margin: 0 0 2px;
}

.jase-header-compact .jase-brand img {
    width: 96px;
}

.jase-header-compact .main-navigation ul.menu > li > a,
.jase-header-compact .main-navigation ul.nav-menu > li > a {
    padding-top: 6px;
    padding-bottom: 6px;
}

.site-header .col-full {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.jase-tools {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.jase-search {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--jase-text);
}

.jase-search input[type="search"] {
    width: 120px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 2px 0;
    font-size: 15px;
}

.jase-search button,
.jase-search button:hover {
    background: transparent;
    border: 0;
    color: var(--jase-text);
    padding: 2px;
}

.jase-tools__link {
    position: relative;
    display: inline-flex;
    color: var(--jase-text);
}

.jase-cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--jase-red);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.jase-cart-count[hidden] {
    display: none;
}

.jase-brand {
    margin: 4px 0 8px;
    font-size: inherit;
    line-height: 1;
}

.jase-brand img {
    display: block;
    width: 160px;
    height: auto;
}

/* Storefront primary navigation, centred like the current site */

.storefront-primary-navigation {
    background: var(--jase-bg);
}

.storefront-primary-navigation .col-full {
    display: block;
}

.main-navigation,
.woocommerce-active .site-header .main-navigation {
    /* Storefront gives the menu 74 % of the header, beside a cart column this
       header does not have; ten top-level items then wrapped onto two lines. */
    width: 100%;
    float: none;
    margin-right: 0;
    text-align: center;
}

@media (min-width: 768px) {
    .main-navigation ul.menu,
    .main-navigation ul.nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a {
    /* Ten top-level items fit on one line from 1200 px with room to spare. */
    padding: 10px 9px;
    color: var(--jase-text);
    font-size: 17px;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
    color: var(--jase-red);
}

.main-navigation ul.menu ul,
.main-navigation ul.nav-menu ul {
    background: #fff;
    border: 1px solid var(--jase-line);
    text-align: left;
}

.main-navigation ul.menu ul a,
.main-navigation ul.nav-menu ul a {
    color: var(--jase-text);
    font-size: 15px;
}

/* ------------------------------------------------------------ product cards */

ul.products li.product {
    text-align: left;
}

ul.products li.product img {
    margin-bottom: 12px;
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 400;
    color: var(--jase-text);
    padding: 0;
    margin-bottom: 4px;
}

/* Card price as on the current site: regular price dark; on sale, the sale
   price red on top and the original price grey and struck through below,
   whatever order the HTML has (Advanced Dynamic Pricing prints del first).
   Prices wrap rather than truncate: a range like "NT$1,280 ~ NT$1,580" is
   wider than a two-column phone card and must stay readable. */
ul.products li.product .price {
    display: block;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    font-weight: 700;
    margin-bottom: 5px;
}

ul.products li.product .price:has(del) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Sale price first, original second, anything else (the member-price label)
   last; the ins/del selectors out-rank the * one regardless of source order. */
ul.products li.product .price:has(del) > * {
    order: 3;
}

ul.products li.product .price:has(del) > ins {
    order: 1;
}

ul.products li.product .price:has(del) > del {
    order: 2;
}

ul.products li.product .price ins,
ul.products li.product .price .jase-price-sale {
    color: #c0392b;
}

ul.products li.product .price del {
    display: block;
    color: #888;
    font-size: 14px;
    font-weight: 400;
    text-decoration: line-through;
    opacity: 1;
}

ul.products li.product .price ins,
.single-product div.product .price ins {
    font-weight: 700;
    text-decoration: none;
    background: none;
    padding: 0;
    margin: 0;
}

.onsale {
    border: 0;
    background: var(--jase-red);
    color: #fff;
    border-radius: 2px;
    font-weight: 400;
}

/* Product page */

.single-product div.product .product_title {
    font-size: 26px;
    font-weight: 400;
}

.single-product div.product .summary p.price,
.single-product div.product .summary span.price {
    color: var(--jase-red);
    font-size: 26px;
    font-weight: 700;
}

.single-product div.product .summary p.price del {
    color: var(--jase-muted);
    font-weight: 400;
    font-size: 18px;
}

/* Section headings on shop and home */

.woocommerce-products-header__title,
.section-title,
.jase-section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 400;
    margin: 32px 0 24px;
}

/* ------------------------------------------------------------ product page */

.single-product div.product .product_title {
    margin-bottom: 16px;
    font-size: 30px;
    line-height: 1.35;
}

.single-product div.product .summary p.price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.single-product div.product .summary p.price del {
    display: inline;
    color: var(--jase-muted);
}

.single-product .woocommerce-product-rating,
.single-product .woocommerce-review-link {
    display: none;
}

/* variant buttons */
.jase-hidden-select {
    position: absolute !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.single-product table.variations,
.single-product table.variations tr,
.single-product table.variations th,
.single-product table.variations td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.single-product table.variations th label {
    color: var(--jase-muted);
    font-size: 15px;
    font-weight: 400;
}

/* Backorder is a lead time, not an alarm. */
.single-product .stock.available-on-backorder {
    color: var(--jase-muted);
}

.jase-swatches__current {
    color: var(--jase-text);
}

.jase-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 20px;
}

.jase-swatches .jase-swatch,
.jase-swatches .jase-swatch:hover {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: var(--jase-text);
    font-size: 16px;
    font-weight: 400;
}

.jase-swatches .jase-swatch.is-selected {
    border-color: var(--jase-red);
    color: var(--jase-red);
}

.jase-swatches .jase-swatch.is-out {
    border-color: #e5e5e5;
    color: #c8c8c8;
}

.single-product .woocommerce-variation-price {
    display: none;
}

.single-product .woocommerce-variation-availability p.stock {
    color: var(--jase-red);
    font-size: 14px;
}

/* quantity and the two buttons */
.single-product form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.single-product form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.single-product form.cart table.variations,
.single-product form.cart .single_variation_wrap,
.single-product form.cart .single_variation {
    width: 100%;
}

.jase-qty {
    display: flex !important;
    width: 100%;
    margin: 0 !important;
}

.jase-qty input.qty {
    flex: 1;
    width: auto;
    height: 40px;
    border: 1px solid #ddd;
    border-width: 1px 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    text-align: center;
}

.jase-qty .jase-qty-btn,
.jase-qty .jase-qty-btn:hover {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--jase-text);
    font-size: 18px;
    line-height: 1;
}

.single-product form.cart .single_add_to_cart_button,
.single-product form.cart .jase-buy-now {
    flex: 1;
    min-width: 140px;
    margin: 0;
    padding: 12px;
    font-size: 15px;
}

.single-product form.cart .jase-buy-now,
.single-product form.cart .jase-buy-now:hover {
    border-color: #fab01e !important;
    background-color: #fab01e !important;
    color: #fff !important;
}

/* share: moved into the gallery by product.js; keep it under the thumbnails */
.single-product .woocommerce-product-gallery {
    display: flex;
    flex-direction: column;
}

.single-product .woocommerce-product-gallery .jase-share {
    order: 10;
}

.jase-qty input.qty::-webkit-outer-spin-button,
.jase-qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.jase-qty input.qty {
    -moz-appearance: textfield;
    appearance: textfield;
}

.jase-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    color: var(--jase-muted);
    font-size: 14px;
}

.jase-share a,
.jase-share button,
.jase-share button:hover {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.jase-share svg {
    display: block;
    width: 20px;
    height: 20px;
}

.jase-share__line { background: #09b305; }
.jase-share__fb { background: #2d4682; }
.jase-share__wa { background: #3cb136; }
.jase-share button,
.jase-share button:hover { background: #1575f0; }

/* copy feedback: product.js toggles .is-copied for 1.5s */
.jase-share__copy.is-copied::after {
    content: attr(data-copied);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 8px;
    border-radius: 4px;
    background: #333;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

/* lightbox (PhotoSwipe), Shopline-like: black, counter left, close right, dots below */
.pswp__bg { background: #000; opacity: 1 !important; }
.pswp__button--share,
.pswp__button--fs,
.pswp__button--zoom,
.pswp__caption { display: none !important; }

.pswp__counter {
    top: 0;
    left: 0;
    height: 44px;
    padding: 0 16px;
    color: #fff;
    font-size: 14px;
    line-height: 44px;
    opacity: 1;
}

.jase-pswp-dots {
    position: absolute;
    right: 0;
    bottom: 16px;
    left: 0;
    z-index: 1550;
    display: flex;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.jase-pswp-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

.jase-pswp-dots span.is-active { background: #fff; }

/* 顧客評價 (inc/reviews.php): no avatar, so the text takes the full width.
   Storefront's full-width product layout sets 86.67% + float: right with two
   more classes, which left a blank avatar column on desktop. */
#reviews .commentlist li .comment_container .comment-text,
#reviews .commentlist li ul.children .comment-text,
.storefront-full-width-content.single-product #reviews .commentlist li .comment_container .comment-text,
.storefront-full-width-content.single-product #reviews .commentlist ul.children .comment-text {
    width: auto;
    float: none;
}

#reviews .commentlist li {
    margin-bottom: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--jase-line);
}

/* 「已購買」 as a visible label. No .verified class: Storefront's icon rule
   (text-indent: -9999px) would hide the text again. */
#reviews .commentlist li p.meta .jase-review-verified {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border: 1px solid var(--jase-red-dark);
    border-radius: 999px;
    color: var(--jase-red-dark);
    font-size: 12px;
    font-style: normal;
    line-height: 18px;
    vertical-align: middle;
}

#reviews .comment-text .description {
    white-space: normal;
    overflow-wrap: anywhere;
}

.jase-review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.jase-review-images__item {
    display: block;
    width: 72px;
    height: 72px;
    border: 1px solid var(--jase-line);
    border-radius: 4px;
    overflow: hidden;
}

.jase-review-images__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#reviews .woocommerce-pagination {
    margin-top: 16px;
}

/* tabs */
.single-product .woocommerce-tabs ul.tabs {
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--jase-line);
}

.single-product .woocommerce-tabs ul.tabs li {
    border: 0;
}

.single-product .woocommerce-tabs ul.tabs li a {
    padding: 12px 8px;
    color: var(--jase-muted);
    font-size: 20px;
    font-weight: 400;
}

.single-product .woocommerce-tabs ul.tabs li.active a {
    color: var(--jase-text);
    box-shadow: inset 0 -3px 0 var(--jase-red);
}

.jase-shipping-tab {
    margin-bottom: 16px;
}

/* Imported Shopline descriptions are text plus long image strips, each at
   least 700 px wide: one strip per row, column wide up to 800 px, centred. */
.single-product .woocommerce-Tabs-panel--description img {
    display: block;
    width: auto;
    max-width: min(100%, 800px);
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .single-product .woocommerce-tabs {
        padding-top: 32px;
    }

    .single-product .woocommerce-tabs ul.tabs {
        float: none;
        width: 100%;
        margin-right: 0;
    }

    .single-product .woocommerce-tabs .panel {
        float: none;
        width: 100%;
        max-width: 900px;
        margin: 32px auto 0;
    }
}

/* ------------------------------------------------------------ shop pages */

.storefront-breadcrumb {
    background: var(--jase-soft);
    padding: 10px 0;
    margin-bottom: 32px;
}

.storefront-breadcrumb .woocommerce-breadcrumb,
.storefront-breadcrumb a {
    color: var(--jase-muted);
    font-size: 14px;
    text-decoration: none;
    margin: 0;
}

.woocommerce-breadcrumb a:first-of-type::before {
    content: none;
}

.woocommerce-products-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding: 0 0 8px;
}

.woocommerce-products-header__title.page-title,
.woocommerce-products-header .woocommerce-products-header__title {
    text-align: left;
    font-size: 20px;
    letter-spacing: 2px;
    margin: 0;
}

.jase-result-count {
    margin: 0;
    color: #999;
    font-size: 12px;
}

/* a category description gets its own line below the header row */
.woocommerce-products-header .term-description,
.woocommerce-products-header .page-description {
    flex-basis: 100%;
}

.woocommerce-result-count {
    display: none;
}

.jase-catnav ul {
    list-style: none;
    margin: 0;
}

.jase-catnav__list > li {
    margin-bottom: 4px;
}

.jase-catnav a {
    display: block;
    padding: 6px 0;
    color: var(--jase-text);
    font-size: 17px;
    text-decoration: none;
}

.jase-catnav .sub-menu {
    margin-left: 8px;
}

.jase-catnav .sub-menu a {
    color: var(--jase-muted);
    font-size: 16px;
}

.jase-catnav .current-menu-item > a,
.jase-catnav a:hover {
    color: var(--jase-red);
}

/* pagination: the current page was dark grey on dark grey (1.4:1) */
.woocommerce-pagination .page-numbers li .page-numbers.current {
    background: var(--jase-text);
    color: #fff;
}

/* --- shop / category toolbar, tags and pagination (stage 44, inc/catalog-toolbar.php) --- */

/* Shopline's breadcrumb separator is a plain "/" (Storefront draws a chevron icon) */
.jase-shop-archive .woocommerce-breadcrumb .breadcrumb-separator {
    display: inline;
    padding: 0;
    text-indent: 0;
}

.jase-shop-archive .woocommerce-breadcrumb .breadcrumb-separator::after {
    content: none;
}

.jase-catnav__title {
    display: inline-block;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--jase-red);
    font-size: 18px;
    font-weight: 400;
}

/* sidebar links are not underlined (Storefront underlines widget links) */
.jase-catnav a,
.jase-catnav .widget a:not(.button) {
    text-decoration: none;
}

.jase-catnav .widget_product_categories ul li::before {
    content: none;
}

/* title, count and the three controls in one row */
.jase-toolbar {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-left: auto;
    align-self: center;
    font-size: 16px;
}

.jase-icon {
    flex: none;
}

.jase-toolbar__filter,
.jase-dropdown > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--jase-line);
    color: var(--jase-text);
    text-decoration: none;
    cursor: pointer;
}

.jase-toolbar__filter:hover,
.jase-dropdown > summary:hover,
.jase-dropdown[open] > summary {
    color: var(--jase-red);
    border-bottom-color: var(--jase-red);
}

.jase-dropdown {
    position: relative;
    width: 196px;
}

.jase-dropdown > summary {
    list-style: none;
    white-space: nowrap;
}

.jase-dropdown > summary::-webkit-details-marker {
    display: none;
}

/* chevron, as Shopline's fa-angle-down */
.jase-dropdown > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: -4px 2px 0 auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.jase-dropdown > ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--jase-line);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.jase-dropdown > ul a {
    display: block;
    padding: 6px 12px;
    color: var(--jase-text);
    font-size: 14px;
    text-decoration: none;
}

.jase-dropdown > ul a:hover {
    color: var(--jase-red);
}

.jase-dropdown > ul a[aria-current] {
    background: var(--jase-red);
    color: #fff;
}

/* 篩選: the block under the sidebar categories (desktop) */
.jase-filter-block {
    /* below the sticky header (157px, 97px once compact; inc/header.php measures it) */
    scroll-margin-top: calc(var(--jase-header-h, 157px) + 24px);
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--jase-line);
}

/* phone-only drawer parts; the block sits in .jase-catnav, whose `a` rule shows links */
.jase-filter-block .jase-filter-block__overlay,
.jase-filter-block .jase-filter__close {
    display: none;
}

.jase-filter__title {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
}

.jase-filter {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jase-filter__apply {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: var(--jase-red);
    color: #fff;
    font-size: 16px;
}

.jase-filter__apply:hover {
    background: var(--jase-red-dark);
    color: #fff;
}

.jase-filter__price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.jase-filter__price legend {
    margin: 0 0 12px;
    padding: 0;
    font-size: 18px;
}

.jase-filter__price input {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 8px;
    font-size: 15px;
}

.jase-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 0 0 16px;
    font-size: 13px;
}

.jase-applied__tag {
    padding: 4px 10px;
    border: 1px solid var(--jase-line);
}

.jase-applied a {
    color: var(--jase-text);
    text-decoration: none;
}

.jase-applied__tag a {
    margin-left: 6px;
}

.jase-applied a:hover {
    color: var(--jase-red);
}

/* pagination: below the list only, right-aligned; current page red, underlined */
.jase-pagination {
    clear: both;
    text-align: right;
    margin: 24px 0;
}

.jase-pagination ul.page-numbers {
    display: inline-flex;
    gap: 4px;
    margin: 0;
    border: 0;
    list-style: none;
}

.jase-pagination ul.page-numbers li {
    border: 0;
}

.woocommerce-pagination.jase-pagination .page-numbers li .page-numbers {
    padding: 6px 12px;
    background: none;
    color: var(--jase-text);
    border-bottom: 2px solid transparent;
}

.woocommerce-pagination.jase-pagination .page-numbers li a.page-numbers:hover {
    color: var(--jase-red);
}

.woocommerce-pagination.jase-pagination .page-numbers li .page-numbers.current {
    background: none;
    color: var(--jase-red);
    border-bottom-color: var(--jase-red);
}

/* --- promotion pages /promotions/<id> (jase-core Catalog\PromotionPage): Shopline's layout ---
   no sidebar (sidebar.php), 每頁顯示 only (inc/catalog-toolbar.php), 3 per row (inc/catalog.php) */

.jase-promotion-page .woocommerce-products-header__title.page-title {
    color: var(--jase-red);
}

/* Shopline's PromotionInfo: icon, qualifications (flex 3), summary (flex 8) */
.jase-promotion-info {
    display: flex;
    margin: 0 0 24px;
    padding: 15px 0;
    background: #f8f8f8;
    color: #5b5b5b;
    font-size: 14px;
    line-height: 1.6;
}

.jase-promotion-info > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10px;
}

.jase-promotion-info p {
    margin: 0;
}

.jase-promotion-info > .jase-promotion-info__icon {
    flex: 1;
    align-items: center;
    color: var(--jase-red);
}

.jase-promotion-info__qualifications {
    flex: 3;
}

.jase-promotion-info__date {
    font-weight: 600;
    border-bottom: 1px dashed #999;
}

.jase-promotion-info__summary {
    flex: 8;
    font-weight: 600;
}

.jase-promotion-info__channels {
    font-weight: 500;
}

@media (max-width: 767px) {
    .jase-promotion-info {
        flex-direction: column;
        gap: 9px;
        padding: 10px 0;
        text-align: center;
    }

    .jase-promotion-info > div {
        align-items: center;
    }

    /* the single 每頁顯示 control stays on the right */
    .jase-promotion-page .jase-toolbar {
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .jase-shop-archive .storefront-breadcrumb { display: none; }

    .jase-toolbar {
        flex-basis: 100%;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .jase-toolbar .jase-dropdown { width: calc(50% - 8px); }
    .jase-toolbar__filter,
    .jase-dropdown > summary { gap: 6px; padding: 8px 0; }
    .jase-toolbar .jase-toolbar__filter { width: 100%; }

    /* 篩選 as a drawer from the right, over a grey overlay */
    .jase-filter-block {
        position: fixed;
        inset: 0;
        z-index: 1000;
        margin: 0;
        padding: 0;
        border: 0;
        visibility: hidden;
    }

    .jase-filter-block:target:not(.is-closed),
    .jase-filter-block.is-open {
        visibility: visible;
    }

    .jase-filter-block .jase-filter__close {
        display: block;
        align-self: flex-end;
        margin: -8px -4px -8px 0;
        padding: 0 8px;
        color: var(--jase-text);
        font-size: 28px;
        line-height: 1;
        text-decoration: none;
    }

    /* the drawer has no title, as Shopline's */
    .jase-filter__title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .jase-filter-block .jase-filter-block__overlay {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, .4);
    }

    .jase-filter-block .jase-filter {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        padding: 16px;
        overflow-y: auto;
        background: #fff;
    }

    .jase-filter__apply { order: 2; margin-top: 16px; }

    .jase-filter__price { flex-direction: column; align-items: stretch; }
    .jase-filter__price span { text-align: center; }

    .jase-applied__clear { display: none; }

    .jase-pagination { text-align: center; }
}

/* --- end shop / category toolbar --- */

/* ------------------------------------------------------------ content pages */

.page .entry-header {
    text-align: center;
}

.page .entry-title {
    font-size: 28px;
    font-weight: 400;
}

.page .entry-content {
    max-width: 900px;
    margin: 0 auto;
}

.page .entry-content img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* FAQ: Shopline's accordions became <details> */
.entry-content details {
    border-bottom: 1px solid var(--jase-line);
    padding: 4px 0;
}

.entry-content summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 32px 12px 0;
    position: relative;
    font-size: 17px;
}

.entry-content summary::-webkit-details-marker {
    display: none;
}

.entry-content summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 8px;
    font-size: 22px;
    color: var(--jase-muted);
}

.entry-content details[open] summary::after {
    content: "\2212";
}

.entry-content details > div {
    padding: 0 0 16px;
    color: #555;
}

/* 企業／大量訂購 form */
.jase-form {
    max-width: 640px;
    margin: 24px auto;
}

.jase-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.jase-form abbr {
    color: var(--jase-red);
    text-decoration: none;
}

.jase-form input[type="text"],
.jase-form input[type="tel"],
.jase-form input[type="email"],
.jase-form select,
.jase-form textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: none;
}

.jase-form__hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.jase-form__error {
    color: var(--jase-red);
}

.jase-form__notice {
    padding: 16px;
    background: var(--jase-soft);
    text-align: center;
}

/* ------------------------------------------------------------ home page */
/* Modelled on the live home page (2026-10-22): cream background, deep green
   actions, yellow highlights, rounded cards. Content lives in the 首頁 page. */

:root {
    --jase-cream: #f6f1e7;
    --jase-green: #2f4a43;
    --jase-yellow: #f6d54b;
    --jase-teal: #3f7f7b;
}

.home .site-content,
.home .storefront-breadcrumb {
    background: var(--jase-cream);
}

.home .storefront-breadcrumb,
.home .entry-header {
    display: none;
}

.home .site-main,
.home .content-area {
    margin-bottom: 0;
}

.home .entry-content > section {
    margin: 0 0 72px;
}

.home.page .entry-content {
    max-width: none;
}

.home .entry-content a,
.home .entry-content a:hover {
    text-decoration: none;
}

.home .hentry {
    margin: 0;
    padding-top: 40px;
}

.jase-pill {
    display: inline-block;
    margin: 0 0 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e3ecea;
    color: var(--jase-green);
    font-size: 13px;
    font-weight: 700;
}

.jase-eyebrow {
    margin: 0 0 6px;
    color: var(--jase-green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
}

.jase-home-title {
    margin: 0 0 12px;
    color: var(--jase-green);
    font-size: 30px;
    font-weight: 700;
}

.jase-home-title mark,
.jase-home-hero__title mark {
    background: linear-gradient(transparent 60%, var(--jase-yellow) 60%);
    color: inherit;
    padding: 0 4px;
}

.jase-line-box .jase-home-title mark {
    background: var(--jase-yellow);
    border-radius: 6px;
}

.jase-home-sub {
    margin: 0 0 24px;
    color: #555;
    font-size: 15px;
}

.jase-center {
    text-align: center;
}

.jase-btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--jase-green);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

.jase-btn--dark { background: var(--jase-green); color: #fff; }
.jase-btn--dark:hover { background: #22372f; color: #fff; }
.jase-btn--outline { background: #fff; color: var(--jase-green); }
.jase-btn--teal { background: var(--jase-teal); border-color: var(--jase-teal); color: #fff; }
.jase-btn--yellow { background: var(--jase-yellow); border-color: #d9b52a; color: var(--jase-green); }

.jase-link {
    color: var(--jase-green);
    font-weight: 700;
    text-decoration: none;
}

/* hero */
.jase-home-hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: center;
}

.jase-home-hero__title {
    margin: 0 0 20px;
    color: var(--jase-green);
    font-size: 48px;
    font-weight: 900;
    line-height: 1.25;
}

.jase-home-hero__lead {
    margin: 0 0 16px;
    color: #555;
    font-size: 17px;
}

.jase-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    list-style: none;
}

.jase-chips li {
    padding: 4px 12px;
    border: 1px solid #ddd5c5;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
}

.jase-home-hero__actions {
    display: flex;
    gap: 12px;
}

.jase-home-hero__photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    height: 480px;
}

.jase-home-hero__photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.jase-home-hero__photo--tall {
    grid-row: span 2;
}

/* banners and image tiles */
.jase-banner img,
.jase-tiles img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
}

.jase-tiles {
    display: grid;
    gap: 20px;
}

.jase-tiles--3 { grid-template-columns: repeat(3, 1fr); }

.jase-tiles a,
.jase-banner {
    display: block;
    transition: transform .2s ease;
}

.jase-tiles a:hover,
.jase-banner:hover {
    transform: translateY(-3px);
}

/* LINE box */
.jase-line-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    padding: 40px;
    border: 1px solid #d6e2d9;
    border-radius: 24px;
    background: #edf3ea;
}

.jase-line-box__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-left: 32px;
    border-left: 1px dashed #c5d4c8;
}

.jase-line-box__qr {
    width: 120px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
}

.jase-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0;
    list-style: none;
    counter-reset: jase-step;
}

.jase-steps li {
    position: relative;
    padding: 16px 16px 16px 56px;
    border-radius: 12px;
    background: #fff;
    counter-increment: jase-step;
}

.jase-steps li::before {
    content: counter(jase-step);
    position: absolute;
    left: 14px;
    top: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 50%;
    background: var(--jase-green);
    color: #fff;
    text-align: center;
    line-height: 30px;
    font-weight: 700;
}

.jase-steps strong,
.jase-steps span,
.jase-cat strong,
.jase-cat span,
.jase-trust strong,
.jase-trust span {
    display: block;
}

.jase-steps span,
.jase-trust span {
    color: #666;
    font-size: 13px;
}

/* category cards */
.jase-home-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.jase-cats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.jase-cat {
    padding: 28px 24px;
    border-radius: 20px;
    color: var(--jase-green);
    text-decoration: none;
    transition: transform .2s ease;
}

.jase-cat:hover { transform: translateY(-3px); color: var(--jase-green); }
.jase-cat strong { font-size: 22px; margin-bottom: 6px; }
.jase-cat span { font-size: 14px; margin-bottom: 18px; }
.jase-cat em { font-style: normal; font-weight: 700; }
.jase-cat--yellow { background: #f5cf55; }
.jase-cat--blue { background: #b8dde0; }
.jase-cat--green { background: #cfe0c6; }
.jase-cat--pink { background: #eba5b0; }

/* product rows */
.jase-home-products {
    margin: 0 0 72px;
    padding: 48px 0 8px;
    background: #fff;
    box-shadow: 0 0 0 100vmax #fff;
    clip-path: inset(0 -100vmax);
}

.jase-rank ul.products {
    counter-reset: jase-rank;
}

.jase-rank ul.products li.product {
    position: relative;
    counter-increment: jase-rank;
}

.jase-rank ul.products li.product::before {
    content: "熱銷 No. " counter(jase-rank);
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--jase-green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.jase-rank ul.products li.product:nth-child(-n+3)::before {
    background: #e8b54a;
}

/* promo cards */
.jase-promos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.jase-promo {
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
}

.jase-promo img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.jase-promo__body {
    padding: 24px;
}

.jase-promo__body h3 {
    margin: 0 0 8px;
    color: var(--jase-green);
    font-size: 22px;
    font-weight: 700;
}

.jase-promo--teal { background: #dde9e8; }
.jase-promo--cream { background: #f3f0e2; }

.jase-promo--wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.jase-promo--wide img {
    aspect-ratio: auto;
    height: 100%;
}

/* trust bar */
.jase-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 32px 0 0;
    list-style: none;
}

.jase-trust li {
    padding: 18px 20px;
    border: 1px solid #e3ddd0;
    border-radius: 14px;
    background: #fff;
}

@media (max-width: 767px) {
    .jase-home-hero,
    .jase-line-box,
    .jase-promos,
    .jase-promo--wide {
        grid-template-columns: 1fr;
    }

    .jase-home-hero__title { font-size: 34px; }
    .jase-home-hero__photos { height: 320px; }
    .jase-home-title { font-size: 24px; }
    .jase-tiles--3,
    .jase-cats,
    .jase-trust { grid-template-columns: 1fr 1fr; }
    .jase-steps { grid-template-columns: 1fr; }
    .jase-line-box { padding: 24px; }
    .jase-line-box__action { padding: 24px 0 0; border-left: 0; border-top: 1px dashed #c5d4c8; }
    .home .entry-content > section { margin-bottom: 48px; }
}

/* ------------------------------------------------------------ cart, checkout, account */
/* Colours and form controls only; the classic WooCommerce flow and its markup
   stay as they are (D-004, D-013). */

.woocommerce-cart .entry-header,
.woocommerce-checkout .entry-header,
.woocommerce-account .entry-header {
    padding-bottom: 8px;
}

/* browser surfaces: focus ring, caret and selection from the palette */
.woocommerce a:focus-visible,
.woocommerce button:focus-visible,
.woocommerce .button:focus-visible,
.woocommerce input[type="checkbox"]:focus-visible,
.woocommerce input[type="radio"]:focus-visible {
    outline: 2px solid var(--jase-text);
    outline-offset: 2px;
}

.woocommerce input,
.woocommerce textarea {
    caret-color: var(--jase-red);
}

::selection {
    background: #fde2e2;
    color: var(--jase-text);
}

/* form controls: one look for inputs, selects and textareas */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row select,
.woocommerce .select2-container .select2-selection--single,
.woocommerce-cart table.cart td.actions .coupon .input-text {
    background: #fff;
    border: 1px solid var(--jase-line);
    border-radius: 2px;
    box-shadow: none;
    padding: 10px 12px;
    min-height: 44px;
    font-size: 15px;
    color: var(--jase-text);
}

.woocommerce form .form-row select,
.woocommerce-page form .form-row select {
    width: 100%;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232c2c2c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 36px;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--jase-text);
    box-shadow: 0 0 0 1px var(--jase-text);
    outline: none;
}

/* checkboxes: 20px box, and the whole label line is the 44px target */
.woocommerce form .form-row input[type="checkbox"],
.woocommerce-form__label-for-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 8px 0 0;
    vertical-align: middle;
    accent-color: var(--jase-red);
}

.woocommerce-form__label-for-checkbox,
.woocommerce form .form-row label.checkbox {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
}

.woocommerce form .form-row label {
    font-size: 14px;
}

.woocommerce form .form-row .required {
    color: var(--jase-red);
    text-decoration: none;
}

/* show-password toggle: a quiet icon inside the field, not a red block */
.woocommerce form .show-password-input,
.woocommerce-page form .show-password-input {
    background: transparent;
    border: 0;
    color: var(--jase-muted);
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 44px;
    height: 44px;
}

.woocommerce form .show-password-input:hover {
    background: transparent;
    color: var(--jase-text);
}

/* notices: neutral grey with a red accent instead of WooCommerce blue */
.woocommerce-info,
.woocommerce-message,
.woocommerce-noreviews,
p.no-comments {
    background: var(--jase-soft);
    border: 1px solid var(--jase-line);
    color: var(--jase-text);
}

/* Storefront paints a link, the icon and the .button inside every notice white
   (it expects a solid coloured box), so each one needs its own colour here. */
.woocommerce-info a,
.woocommerce-message a {
    color: var(--jase-red-dark);
}

.woocommerce-info::before,
.woocommerce-message::before {
    color: var(--jase-red);
}

.woocommerce-message .button,
.woocommerce-info .button {
    background: transparent;
    border: 0;
    color: var(--jase-red-dark);
    text-decoration: underline;
}

.woocommerce-info .button:hover,
.woocommerce-message .button:hover {
    color: var(--jase-red-dark);
}

/* errors: dark red on light pink (5.4:1), red accent bar, underlined links */
.woocommerce-error,
.wc-block-components-notice-banner.is-error {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    border-left: 4px solid var(--jase-red);
    color: var(--jase-red-dark);
}

.woocommerce-error li,
.woocommerce-error a,
.woocommerce-error a:hover,
.wc-block-components-notice-banner.is-error a {
    color: var(--jase-red-dark);
}

.woocommerce-error a,
.wc-block-components-notice-banner.is-error a {
    text-decoration: underline;
}

.woocommerce-error a:hover {
    opacity: 1;
    text-decoration-thickness: 2px;
}

.woocommerce-error::before,
.wc-block-components-notice-banner.is-error > svg {
    color: var(--jase-red-dark);
    fill: var(--jase-red-dark);
    background: transparent;
}

.woocommerce-NoticeGroup {
    background: none;
    color: inherit;
}

/* checkout fields that failed validation */
.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select,
.woocommerce form .form-row.woocommerce-invalid textarea,
.woocommerce form .form-row.woocommerce-invalid .select2-selection {
    border-color: var(--jase-red-dark);
    box-shadow: inset 0 0 0 1px var(--jase-red-dark);
}

.woocommerce form .form-row.woocommerce-invalid > label {
    color: var(--jase-red-dark);
}

.checkout-inline-error-message {
    margin: 4px 0 0;
    color: var(--jase-red-dark);
    font-size: 14px;
}

/* cart table */
table.cart thead th,
table.shop_table thead th {
    background: var(--jase-soft);
    font-weight: 700;
    font-size: 14px;
}

table.cart td.product-name a {
    text-decoration: none;
}

table.cart td.product-price,
table.cart td.product-subtotal {
    white-space: nowrap;
}

table.cart td.product-remove a.remove {
    color: var(--jase-muted) !important;
    width: 44px;
    height: 44px;
    line-height: 44px;
}

table.cart td.product-remove a.remove:hover {
    background: transparent;
    color: var(--jase-red) !important;
}

/* Storefront draws a thick dark rule above the coupon row */
table.cart td.actions {
    border-top: 1px solid var(--jase-line);
    padding-top: 16px;
}

table.cart td.actions .coupon .input-text {
    width: 180px;
}

/* "update cart" is secondary: outlined, and grey while there is nothing to update */
table.cart td.actions button[name="update_cart"] {
    background: #fff;
    border: 1px solid var(--jase-text);
    color: var(--jase-text);
}

table.cart td.actions button[name="update_cart"]:disabled,
table.cart td.actions button[name="update_cart"][disabled] {
    border-color: var(--jase-line);
    color: var(--jase-muted);
    opacity: 1;
}

.cart-collaterals .cart_totals h2,
#order_review_heading,
.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3,
.woocommerce form .jase-invoice h3 {
    font-size: 20px;
    font-weight: 700;
}

.cart_totals .order-total .amount,
#order_review .order-total .amount {
    color: var(--jase-red);
    font-size: 20px;
    font-weight: 700;
}

/* checkout: order summary on a soft panel */
#order_review {
    background: var(--jase-soft);
    padding: 20px 24px;
}

#order_review table.shop_table {
    background: transparent;
}

#order_review table.shop_table th,
#order_review table.shop_table td {
    background: transparent;
    padding: 10px 0;
    border-bottom: 1px solid var(--jase-line);
}

#payment,
#payment .payment_methods,
#payment .payment_methods > li,
#payment .payment_box {
    background: transparent;
}

#payment .payment_methods {
    padding: 0;
    border-bottom: 1px solid var(--jase-line);
}

#payment .payment_methods > li {
    padding: 4px 0;
    list-style: none;
}

/* Storefront paints its own radio on the label's ::before and hides the input;
   keep the real radio, so it can never be covered or mis-aligned. */
#payment .payment_methods > li.wc_payment_method > input[type="radio"]:first-child,
#payment .payment_methods > li.woocommerce-PaymentMethod > input[type="radio"]:first-child {
    display: inline-block;
    position: static;
    clip: auto;
    clip-path: none;
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    accent-color: var(--jase-red);
    vertical-align: middle;
}

#payment .payment_methods > li.wc_payment_method > label::before,
#payment .payment_methods > li.woocommerce-PaymentMethod > label::before {
    display: none;
}

#payment .payment_methods > li.wc_payment_method > label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    cursor: pointer;
}

#payment .payment_box {
    margin: 6px 0 0 26px;
    padding: 0;
    font-size: 14px;
    color: var(--jase-muted);
}

#payment .place-order {
    padding: 16px 0 0;
}

#order_review #payment {
    margin-top: 8px;
}

/* cart quantity: same box as the other fields */
table.cart .quantity .qty {
    background: #fff;
    border: 1px solid var(--jase-line);
    width: 64px;
    min-height: 44px;
    text-align: center;
}

.woocommerce-privacy-policy-text,
.woocommerce-terms-and-conditions-wrapper {
    font-size: 13px;
    color: var(--jase-muted);
}

#place_order {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    padding: 14px;
}

/* account: login / register */
.woocommerce-account .u-columns.col2-set h2 {
    font-size: 22px;
    font-weight: 700;
}

.woocommerce-account .u-columns.col2-set .col-1,
.woocommerce-account .u-columns.col2-set .col-2 {
    border: 1px solid var(--jase-line);
    padding: 24px;
}

.woocommerce-form-login .woocommerce-form-login__submit,
.woocommerce-form-register .woocommerce-form-register__submit {
    min-width: 120px;
}

.woocommerce-LostPassword a {
    color: var(--jase-muted);
}

/* social login buttons (Nextend, D-017). The Pro addon prints them at the end
   of the login and register forms (my-account and checkout) and on the
   account details page. Its own CSS sizes the grid to the longest label, so
   the buttons end up narrow and left-aligned; here they fill the form width,
   side by side when there is room and one per row on phones. */
.woocommerce-form-login .nsl-container,
.woocommerce-form-register .nsl-container,
.woocommerce-EditAccountForm .nsl-container {
    border-top: 1px solid var(--jase-line);
    padding-top: 12px;
}

.woocommerce-form-login div.nsl-container.nsl-container-block .nsl-container-buttons,
.woocommerce-form-register div.nsl-container.nsl-container-block .nsl-container-buttons,
.woocommerce-EditAccountForm div.nsl-container.nsl-container-block .nsl-container-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    width: 100%;
}

.woocommerce-form-login div.nsl-container-block .nsl-container-buttons a,
.woocommerce-form-register div.nsl-container-block .nsl-container-buttons a,
.woocommerce-EditAccountForm div.nsl-container-block .nsl-container-buttons a {
    margin: 0;
}

/* Nextend sets Helvetica, which has no Chinese glyphs; the labels are
   translated, so use the site font. Its inline <style> comes after this
   file, hence the extra body selector. */
body div.nsl-container .nsl-button-default div.nsl-button-label-container {
    font-family: var(--jase-font);
    font-size: 15px;
}

/* account: navigation once logged in */
.woocommerce-MyAccount-navigation ul {
    border-top: 1px solid var(--jase-line);
}

.woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid var(--jase-line);
}

.woocommerce-MyAccount-navigation ul li a {
    padding: 12px 8px;
    text-decoration: none;
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    color: var(--jase-red);
    font-weight: 700;
}

/* account: dashboard member overview (woocommerce/myaccount/dashboard.php).
   The accent is the brand yellow of the emails (Mail\EmailBranding); text on
   it stays --jase-text (about 10:1). */
.jase-overview {
    --jase-accent: #f6c343;
    --jase-accent-soft: #fdf4db;
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

.jase-overview h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.jase-overview__cards {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 16px;
}

.jase-overview__cards--single {
    grid-template-columns: minmax(0, 1fr);
}

.jase-overview__card {
    border: 1px solid var(--jase-line);
    border-top: 4px solid var(--jase-accent);
    border-radius: 8px;
    padding: 20px;
    background: var(--jase-bg);
}

.jase-overview__card > *:last-child {
    margin-bottom: 0;
}

.jase-overview__eyebrow {
    font-size: 13px;
    color: var(--jase-muted);
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

.jase-overview__note {
    font-size: 13px;
    color: var(--jase-muted);
    margin: 8px 0 0;
}

.jase-overview__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.jase-overview__head a {
    font-size: 14px;
    white-space: nowrap;
}

.jase-tier {
    background: var(--jase-accent-soft);
}

.jase-overview .jase-tier__name {
    font-size: 26px;
    margin-bottom: 12px;
}

.jase-tier__benefits {
    list-style: none;
    margin: 0 0 12px;
}

.jase-tier__benefits li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 4px;
}

.jase-tier__benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jase-accent);
}

.jase-tier__expiry,
.jase-tier__spend,
.jase-tier__next {
    margin: 0 0 8px;
}

.jase-tier__expiry {
    font-weight: 700;
}

.jase-tier__progress {
    height: 10px;
    border-radius: 5px;
    background: var(--jase-bg);
    border: 1px solid var(--jase-line);
    overflow: hidden;
    margin: 12px 0 8px;
}

.jase-tier__progress span {
    display: block;
    height: 100%;
    background: var(--jase-accent);
}

.jase-credit {
    display: flex;
    flex-direction: column;
}

.jase-credit__balance {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0 8px;
}

.jase-credit__soon {
    color: var(--jase-red);
    font-size: 14px;
    margin: 0;
}

.jase-overview .jase-credit__link {
    margin-top: auto;
    align-self: flex-start;
}

.jase-credit__unavailable {
    color: var(--jase-muted);
}

.jase-overview__note + .jase-credit__link,
.jase-credit__unavailable + .jase-credit__link {
    margin-top: 16px;
}

.jase-orders {
    list-style: none;
    margin: 0;
    border-top: 1px solid var(--jase-line);
}

.jase-orders__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--jase-line);
}

.jase-orders__main {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: baseline;
}

.jase-orders__number {
    font-weight: 700;
}

.jase-orders__date {
    color: var(--jase-muted);
    font-size: 14px;
}

.jase-orders__meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jase-orders__status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--jase-soft);
    font-size: 13px;
    white-space: nowrap;
}

.jase-orders__item--processing .jase-orders__status,
.jase-orders__item--on-hold .jase-orders__status,
.jase-orders__item--pending .jase-orders__status {
    background: var(--jase-accent-soft);
}

.jase-orders__total {
    font-weight: 700;
    white-space: nowrap;
}

.jase-overview .jase-orders__view {
    padding: 8px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.jase-overview__empty a {
    margin-left: 8px;
}

.jase-overview__social ul {
    list-style: none;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jase-overview__social li {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--jase-line);
    border-radius: 8px;
}

.jase-overview__state {
    font-size: 13px;
    color: var(--jase-muted);
}

.jase-overview__social .is-connected .jase-overview__state {
    color: var(--jase-text);
    font-weight: 700;
}

@media (max-width: 767px) {
    .jase-overview__cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .jase-orders__item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .jase-orders__meta {
        grid-column: 1;
    }

    .jase-overview .jase-orders__view {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* ------------------------------------------------------------ footer */

.site-footer {
    background: var(--jase-bg);
    color: var(--jase-text);
    border-top: 1px solid var(--jase-line);
    padding: 48px 0 24px;
}

.jase-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.jase-footer__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.jase-footer ul {
    list-style: none;
    margin: 0;
}

.jase-footer li {
    margin-bottom: 8px;
    font-size: 15px;
}

.site-footer a {
    color: var(--jase-text);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--jase-red);
}

.jase-footer__social {
    display: flex;
    gap: 4px;
    margin-left: -10px;
}

.jase-footer__social li {
    margin: 0;
}

.jase-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.jase-fraud {
    margin: 32px 0 0;
    text-align: center;
    font-size: 14px;
}

.site-footer .jase-fraud a {
    color: var(--jase-red-dark);
}

/* back to top; the LINE card (#jb-line) comes from GTM, see .jase-float offsets */
.jase-float {
    position: fixed;
    right: 16px;
    /* clears the GTM LINE card (#jb-line, ~60px tall, bottom 20px) */
    bottom: 96px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.jase-float a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    text-decoration: none;
}

.jase-float__top {
    background: #fff;
    color: var(--jase-text);
    border: 1px solid var(--jase-line);
}

.jase-float__top:hover {
    color: var(--jase-red);
}

.jase-float a:focus-visible {
    outline: 2px solid var(--jase-text);
    outline-offset: 2px;
}

/* back to top only once there is somewhere to go back to */
body:not(.jase-header-compact) .jase-float__top {
    visibility: hidden;
}

.jase-copyright {
    margin: 12px 0 0;
    text-align: center;
    color: var(--jase-muted);
    font-size: 13px;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 767px) {
    .jase-announce { font-size: 13px; }

    .site-header .col-full {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .jase-brand { order: 1; margin: 0; }
    .jase-brand img { width: 110px; }
    .jase-tools { order: 2; align-self: center; gap: 14px; }
    .jase-search input[type="search"] { width: 80px; }

    .jase-footer { grid-template-columns: repeat(2, 1fr); gap: 24px; }

    /* Mobile menu: a plain outlined toggle, not the red action button. */
    .main-navigation .menu-toggle,
    .main-navigation .menu-toggle:hover {
        float: none;
        margin: 8px auto;
        padding: 8px 16px 8px 2.8em;
        border: 1px solid var(--jase-line);
        background: #fff;
        color: var(--jase-text);
        font-size: 15px;
        font-weight: 400;
    }

    .main-navigation .menu-toggle span::before,
    .main-navigation .menu-toggle span::after,
    .main-navigation .menu-toggle::before,
    .main-navigation .menu-toggle::after {
        background-color: var(--jase-text);
    }

    .site-header {
        padding-top: 8px;
        padding-bottom: 0;
    }

    .storefront-primary-navigation .col-full {
        padding-top: 0;
        padding-bottom: 0;
    }

    .main-navigation {
        text-align: left;
    }

    .main-navigation .handheld-navigation ul.menu > li > a,
    .main-navigation .handheld-navigation ul.menu ul a {
        padding: 10px 0;
        border-bottom: 1px solid var(--jase-line);
        font-size: 16px;
    }

    .home .hentry {
        padding-top: 16px;
    }

    ul.products li.product .price { font-size: 16px; }

    /* The header is sticky, so an open menu taller than the screen could
       never be scrolled to its end: let the menu scroll inside itself. */
    .main-navigation.toggled .handheld-navigation {
        max-height: calc(100vh - 200px);
        max-height: calc(100dvh - 200px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* two products per row, as on the current site's phone layout */
    .site-main ul.products {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .site-main ul.products::before,
    .site-main ul.products::after {
        display: none;
    }

    .site-main ul.products li.product {
        width: auto;
        float: none;
        margin: 0;
    }

    ul.products li.product .woocommerce-loop-product__title { font-size: 14px; }
    ul.products li.product .price del { font-size: 14px; }

    .jase-header-compact .jase-brand img { width: 80px; }
    .jase-announce__nav { width: 36px; }
    .jase-float { right: 12px; bottom: 96px; }

    table.cart td.actions .coupon .input-text { width: 100%; margin-bottom: 8px; }
    table.cart td.actions .coupon .button { width: 100%; }
    #order_review { padding: 16px; }

    /* one social login button per row, full width */
    .woocommerce-form-login div.nsl-container.nsl-container-block .nsl-container-buttons,
    .woocommerce-form-register div.nsl-container.nsl-container-block .nsl-container-buttons,
    .woocommerce-EditAccountForm div.nsl-container.nsl-container-block .nsl-container-buttons {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------ 加價購 strip
   jase-core templates/cart-addons/: cards with WooCommerce's own 加購
   button under the cart table; checkboxes in the product page's form.cart.
   Phones: the cart cards scroll sideways, buttons at least 44 px high. */

.jase-addons {
    width: 100%;
    margin: 24px 0;
}

.jase-addons__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.jase-addons__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.jase-addons__item {
    /* Contains the absolutely positioned .screen-reader-text spans: without
       it, cards scrolled off to the side on phones widen the whole page. */
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--jase-line);
    background: var(--jase-bg);
}

.jase-addons__image img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.jase-addons__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.jase-addons__name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--jase-text);
    font-size: 14px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.jase-addons__price {
    margin: 0;
    font-size: 14px;
}

.jase-addons__price del {
    margin-right: 6px;
    color: var(--jase-muted);
    font-size: 13px;
}

.jase-addons__promo {
    color: var(--jase-red);
    font-weight: 700;
    text-decoration: none;
    background: none;
}

.jase-addons__limit {
    margin: 0;
    color: var(--jase-muted);
    font-size: 12px;
}

.jase-addons .jase-addons__add,
.jase-addons .jase-addons__choose {
    align-self: flex-start;
    min-height: 44px;
    margin-top: 4px;
    padding: 10px 20px;
    font-size: 14px;
    line-height: 24px;
}

/* cart: a grid of cards under the cart table */
.jase-addons--cart {
    padding-top: 16px;
    border-top: 1px solid var(--jase-line);
}

.jase-addons--cart .jase-addons__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* product page: one row per add-on, inside form.cart (a flex row) */
.jase-addons--product {
    flex: 1 0 100%;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--jase-line);
    background: var(--jase-soft);
}

.jase-addons--product .jase-addons__title {
    padding: 0 4px;
    font-size: 15px;
}

.jase-addons__hint {
    margin: 0 0 8px;
    color: var(--jase-muted);
    font-size: 13px;
}

.jase-addons--product .jase-addons__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jase-addons--product .jase-addons__item {
    align-items: center;
    padding: 8px 12px;
}

.jase-addons--product .jase-addons__image img {
    width: 48px;
    height: 48px;
}

.jase-addons__check {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--jase-red);
}

/* the whole name line is the checkbox's label: a 44 px touch target */
.jase-addons--product label.jase-addons__name {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
}

@media (max-width: 767px) {
    .jase-addons--cart .jase-addons__list {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .jase-addons--cart .jase-addons__item {
        flex: 0 0 78%;
        scroll-snap-align: start;
    }
}
