/* The storefront layout stylesheet is loaded only by product views.
   Existing JS classes and stock/format visibility remain in the base CSS. */
.shop-page {
    --shop-ivory: #f8f0e6;
    --shop-paper: #fffdf9;
    --shop-red: #8b1a1a;
    --shop-gold: #c9a84c;
    --shop-brown: #493429;
    --shop-muted: #806f62;
    --shop-line: #e5d9c8;
    margin-top: 60px;
    background: var(--shop-ivory);
    color: var(--shop-brown);
    line-height: 1.6;
}

.shop-page *,
.shop-page *::before,
.shop-page *::after {
    box-sizing: border-box;
}

.shop-page main {
    min-width: 0;
}

.shop-page main .container {
    width: 100%;
    max-width: 1280px;
    min-width: 0;
    padding: 0 32px;
}

.shop-page main a:focus-visible,
.shop-page main button:focus-visible,
.shop-page main input:focus-visible {
    outline: 2px solid var(--shop-red);
    outline-offset: 4px;
}

.shop-page main button {
    font: inherit;
    cursor: pointer;
}

.shop-eyebrow {
    color: #9b7833;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.4px;
    line-height: 1.5;
}

/* Intro, breadcrumbs and catalog. */
.shop-intro {
    position: relative;
    padding: 28px 0 48px;
    border-bottom: 1px solid var(--shop-line);
    background: linear-gradient(120deg, #f8f0e6, #eee1cf);
}

.shop-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--shop-muted);
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.shop-breadcrumb a:hover {
    color: var(--shop-red);
}

.shop-intro .shop-breadcrumb {
    margin-bottom: 32px;
}

.shop-intro h1 {
    margin: 12px 0;
    font-family: 'Noto Serif TC', 'Noto Serif SC', serif;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 1.4;
}

.shop-intro-description {
    color: var(--shop-muted);
    font-size: 14px;
    letter-spacing: 1px;
}

.shop-page main .shop-content {
    padding-top: 40px;
    padding-bottom: 80px;
}

.shop-catalog .product_list_container {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 36px;
}

.shop-catalog .product_list_left {
    position: sticky;
    top: 84px;
    width: 100%;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    padding: 24px 20px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
}

.shop-category-heading {
    margin-bottom: 18px;
}

.shop-category-heading h2 {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
}

.shop-all-products {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--shop-line);
    font-size: 14px;
}

.shop-all-products.is-current {
    background: var(--shop-red);
    border-color: var(--shop-red);
    color: #fff;
}

.shop-catalog .product_class_area {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--shop-line);
}

.shop-catalog .product_class_area h4 {
    display: block;
    margin: 0 0 10px;
    padding: 0;
    color: var(--shop-brown);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

.shop-catalog .product_class_area h4::after {
    display: none;
}

.shop-catalog .product_class_area h4 a:hover {
    color: var(--shop-red);
}

.shop-catalog .product_class_list a {
    margin: 4px 0;
    padding: 8px 10px;
    border-left: 2px solid transparent;
    color: var(--shop-muted);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    transition: color .2s, background-color .2s;
}

.shop-catalog .product_class_list a:hover,
.shop-catalog .product_class_list a.is-current {
    color: var(--shop-red);
    border-left-color: var(--shop-gold);
    background: #f8f0e6;
}

.shop-catalog .product_list_right {
    min-width: 0;
}

.shop-toolbar,
.shop-page .section-head.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--shop-line);
}

.shop-toolbar h2 {
    font-size: 22px;
    letter-spacing: 1px;
    line-height: 1.4;
}

.shop-result-count {
    color: var(--shop-muted);
    font-size: 13px;
}

.shop-catalog .sort {
    width: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-catalog .sort>div {
    margin: 0;
    padding: 0;
    border: 0;
}

.shop-catalog .sort a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
    color: var(--shop-muted);
    font-size: 12px;
    font-weight: 400;
}

.shop-catalog .sort .active a,
.shop-catalog .sort a:hover {
    color: var(--shop-red);
    border-color: var(--shop-gold);
    background: #f3e8d5;
}

.shop-empty {
    grid-column: 1 / -1;
    width: 100% !important;
    padding: 64px 24px;
    border: 1px solid var(--shop-line);
    text-align: center;
    background: var(--shop-paper);
}

.shop-empty>i {
    display: block;
    margin-bottom: 16px;
    color: #b49454;
    font-size: 42px;
}

.shop-empty h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.shop-empty p {
    color: var(--shop-muted);
    font-size: 14px;
}

.shop-empty a {
    display: inline-flex;
    gap: 16px;
    margin-top: 22px;
    padding: 10px 20px;
    background: var(--shop-red);
    color: #fff;
    font-size: 14px;
}

.shop-catalog .pagination {
    margin: 40px 0 0;
}

.shop-catalog .pagination .page-item {
    border-color: var(--shop-line);
    background: var(--shop-paper);
    color: var(--shop-brown);
}

.shop-catalog .pagination .page-item.active {
    border-color: var(--shop-red);
    background: var(--shop-red);
    color: #fff;
}

.shop-search .no-results-found {
    max-width: 640px;
    padding: 40px 24px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
    color: var(--shop-muted);
    font-size: 14px;
}

.shop-search .no-results-found .icon {
    font-size: 64px;
    color: #b49454;
}

.shop-search .sub-search {
    width: 100%;
    min-width: 0;
    margin-top: 24px;
}

.shop-search .sub-search input {
    width: 100%;
    min-width: 0;
    border-color: var(--shop-line);
    font-size: 16px;
}

.shop-search .sub-search .btn {
    background: var(--shop-red);
    color: #fff;
}

/* Product selection. JS owns .active/.show/.noStock display states. */
.shop-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 28px auto 0;
}

.shop-back {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    color: var(--shop-red);
    font-size: 13px;
}

.shop-detail .products-banner {
    width: calc(100% - 64px);
    max-width: 1216px;
    margin: 28px auto 0;
    overflow: hidden;
}

.shop-detail .products-banner img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.shop-detail .full-container {
    min-height: 0;
}

.shop-detail .products-wrapper {
    display: flex;
    flex-direction: row;
    align-items: start;
    gap: 48px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 32px 60px;
}

.shop-detail .products-wrapper>.left-block {
    order: 2;
    flex: 1;
    width: auto;
    min-width: 0;
}

.shop-detail .products-wrapper>.right-block {
    order: 1;
    flex: 1;
    width: auto;
    min-width: 0;
}

.shop-detail .products-wrapper.noImg {
    display: block;
    max-width: 880px;
}

.shop-detail .products-info {
    padding: 28px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
}

.shop-detail .products-info>.shop-eyebrow {
    margin-bottom: 12px;
}

.shop-detail .product-number {
    color: #9c896e;
    font-size: 12px;
    letter-spacing: 1px;
}

.shop-detail .products-info .product-title {
    margin: 6px 0 18px;
    font-family: 'Noto Serif TC', 'Noto Serif SC', serif;
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.shop-detail .products-info .product-price {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 24px;
    color: var(--shop-red);
    font-size: 28px;
    line-height: 1.4;
}

.shop-detail .products-info .product-price p:not(:first-child) {
    margin-left: 0;
    color: var(--shop-muted);
    font-size: 18px;
}

.shop-detail .products-info .note {
    color: var(--shop-muted);
    font-size: 14px;
    line-height: 1.9;
    padding-bottom: 20px;
}

.shop-detail .products-info .important-note {
    color: var(--shop-red);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.shop-detail .important-note:empty {
    padding: 0;
}

.shop-detail .important-line a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #83a48b;
    padding: 8px 14px;
    background: #eff5ef;
    color: #376243;
    font-size: 13px;
}

.shop-detail .products-info .format-table {
    margin-bottom: 20px;
}

.shop-detail .products-info .select-format .format-table>.title {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-color: var(--shop-line);
    color: var(--shop-brown);
    font-size: 14px;
}

.shop-detail .products-info .format-table .list {
    min-height: 48px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--shop-line);
    background: #faf6ef;
    font-size: 14px;
    gap: 8px;
}

.shop-detail .products-info .format-table .list div:last-child {
    width: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.shop-detail .products-info .format-table .list .price {
    color: var(--shop-red);
}

.shop-detail .products-info .format-table .list .price span:not(:first-child) {
    margin-left: 0;
}

.shop-detail .products-info .format-table .list::before,
.shop-detail .products-info .format-table .class_format .item::before {
    flex-shrink: 0;
    border-color: #b8a88f;
}

.shop-detail .products-info .format-table .list:not(.no):hover,
.shop-detail .products-info .format-table .list.active {
    border-color: var(--shop-gold);
    background: #f4e7cf;
}

.shop-detail .products-info .format-table .list.active::before,
.shop-detail .products-info .format-table .class_format .item.active::before {
    background: var(--shop-red);
    border-color: var(--shop-red);
}

.shop-detail .products-info .format-table .list.no {
    color: #958b7e;
    background: #eee9e1;
}

.shop-detail .products-info .format-table .list.no .price {
    color: #958b7e;
}

.shop-detail .products-info .format-table .class_format .item {
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--shop-line);
    background: #faf6ef;
    font-size: 14px;
}

.shop-detail .products-info .format-table .class_format .item:not(.no):hover,
.shop-detail .products-info .format-table .class_format .item.active {
    border-color: var(--shop-gold);
    background: #f4e7cf;
}

.shop-detail .products-info .select-count {
    margin-top: 24px;
    padding: 10px;
    border: 1px solid var(--shop-line);
    background: #faf6ef;
}

.shop-detail .products-info .select-count>.text {
    justify-content: flex-start;
    flex: 1;
    height: auto;
    flex-wrap: wrap;
    font-size: 14px;
}

.shop-detail .products-info .select-count .price_tip {
    color: var(--shop-red);
    font-size: 12px;
    padding-left: 6px;
}

.shop-detail .products-info .select-count>.count {
    flex: 0 0 144px;
    border: 1px solid var(--shop-line);
    background: #fffdf9;
}

.shop-detail .products-info .select-count .count .minus,
.shop-detail .products-info .select-count .count .plus {
    width: 44px;
    height: 42px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.shop-detail .products-info .select-count .count input {
    width: 54px;
    min-width: 0;
    color: var(--shop-brown);
}

.shop-detail .products-info .action-btn {
    padding-top: 16px;
}

.shop-detail .products-info .action-btn .addCart {
    max-width: none;
    min-height: 52px;
    height: auto;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--shop-red);
    background: var(--shop-red);
    color: #fff;
    font-size: 16px;
    letter-spacing: 2px;
    transition: background-color .2s;
}

.shop-detail .products-info .action-btn .addCart:hover {
    background: #651313;
}

.shop-detail .products-info>.noStock {
    color: var(--shop-muted);
    border: 1px solid var(--shop-line);
    text-align: center;
}

.shop-detail .other-path h3 {
    color: var(--shop-muted);
    font-size: 13px;
    font-weight: 400;
}

.shop-detail .other-path .link {
    gap: 8px;
    margin-top: 12px;
}

.shop-detail .other-path .link a {
    border: 1px solid var(--shop-line);
    font-size: 13px;
}

.shop-detail .products-swiper {
    padding: 0;
}

.shop-detail .productSwiper {
    background: #efe5d7;
    border: 1px solid var(--shop-line);
}

.shop-detail .productSwiper .swiper-slide {
    background: #efe5d7;
}

.shop-detail .productSwiper .swiper-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

.shop-detail .products-swiper .swiper-button-prev,
.shop-detail .products-swiper .swiper-button-next {
    display: flex !important;
    width: 36px;
    height: 36px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
    color: var(--shop-red);
}

.shop-detail .products-swiper .swiper-button-prev::after,
.shop-detail .products-swiper .swiper-button-next::after {
    font-size: 14px;
}

.shop-detail .thumbsSwiper {
    height: auto;
    margin-top: 12px;
}

.shop-detail .thumbsSwiper .swiper-slide {
    opacity: .6;
    border: 1px solid var(--shop-line);
    background: #efe5d7;
    cursor: pointer;
}

.shop-detail .thumbsSwiper .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--shop-gold);
}

.shop-detail .thumbsSwiper img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

/* Content tabs retain the existing scroll handler and its .move state. */
.shop-detail .anchor_menu {
    height: 60px;
    border-top: 1px solid var(--shop-line);
    border-bottom: 1px solid var(--shop-line);
    background: #f0e5d5;
}

.shop-detail .anchor_menu:empty {
    display: none;
}

.shop-detail .anchor_menu a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
    color: var(--shop-brown);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

.shop-detail .anchor_menu a:hover {
    color: var(--shop-red);
    background: #e9dac1;
}

.shop-detail .anchor_menu.move {
    height: 50px;
    top: 60px;
}

.shop-detail section.fix-top {
    padding-top: 134px;
    padding-bottom: 48px;
    scroll-margin-top: 120px;
}

.shop-detail .section-head {
    padding: 0 0 24px;
}

.shop-detail .section-head .title {
    border-left: 3px solid var(--shop-gold);
    padding-left: 14px;
    font-size: 24px;
    color: var(--shop-brown);
}

.shop-detail .section-article {
    padding: 24px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
}

.shop-detail .section-article article {
    max-width: 100%;
}

.shop-detail .shopping-notes {
    padding-top: 104px !important;
    padding-bottom: 72px !important;
}

.shop-detail .notes-wrap {
    padding: 28px;
    border: 1px solid var(--shop-line);
    background: var(--shop-paper);
}

.shop-detail .notes-wrap .notes-block {
    gap: 20px;
}

.shop-detail .notes-wrap .notes-block .title {
    flex: 0 0 120px;
    padding: 6px 0;
    margin: 0;
    font-size: 15px;
    color: var(--shop-red);
}

.shop-detail .notes-wrap .notes-block .content {
    min-width: 0;
    padding: 6px 0 22px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--shop-muted);
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 1023px) {
    .shop-page main .container {
        padding-right: 24px;
        padding-left: 24px;
    }

    .shop-catalog .product_list_container {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 24px;
    }

    .shop-catalog .product_list_left {
        padding: 20px 14px;
    }

    .shop-detail .products-wrapper {
        gap: 24px;
        padding-right: 24px;
        padding-left: 24px;
    }

    .shop-detail .products-info {
        padding: 20px;
    }

    .shop-detail .products-info .select-count {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 767px) {
    .shop-page main .container {
        padding-right: 16px;
        padding-left: 16px;
    }

    .shop-intro {
        padding: 20px 0 32px;
    }

    .shop-intro .shop-breadcrumb {
        margin-bottom: 24px;
    }

    .shop-intro h1 {
        font-size: 30px;
    }

    .shop-intro-description {
        font-size: 13px;
        letter-spacing: .5px;
    }

    .shop-page main .shop-content {
        padding-top: 24px;
        padding-bottom: 48px;
    }

    .shop-catalog .product_list_container {
        display: block;
    }

    .shop-catalog .open_left_menu {
        display: block;
        padding: 0;
        margin: 0 0 24px;
    }

    .shop-catalog .open_left_menu button {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-height: 46px;
        padding: 10px 14px;
        border: 1px solid var(--shop-line);
        color: var(--shop-brown);
        background: var(--shop-paper);
        font-size: 14px;
    }

    .shop-catalog .open_left_menu i {
        font-size: 20px;
    }

    .shop-catalog .product_list_left {
        display: none;
    }

    .shop-catalog .product_list_left.active {
        display: block;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: 24px;
        border: 0;
        background: var(--shop-paper);
        z-index: 120;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .shop-catalog .product_list_left_close {
        display: flex;
        padding: 0 0 16px;
    }

    .shop-catalog .product_list_left_close a {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 10px;
        color: var(--shop-red);
    }

    .shop-toolbar,
    .shop-page .section-head.shop-toolbar {
        margin-bottom: 18px;
        gap: 12px;
    }

    .shop-toolbar h2 {
        font-size: 20px;
    }

    .shop-catalog .sort {
        gap: 6px;
    }

    .shop-catalog .sort a {
        padding: 7px 10px;
    }

    .shop-detail-top {
        align-items: start;
        margin-top: 20px;
        gap: 12px;
        flex-direction: column;
    }

    .shop-detail .products-banner {
        width: calc(100% - 32px);
        margin-top: 24px;
    }

    .shop-detail .products-wrapper {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 24px;
        padding: 24px 16px 36px;
    }

    .shop-detail .products-wrapper>.left-block,
    .shop-detail .products-wrapper>.right-block {
        flex: none;
        width: 100%;
    }

    .shop-detail .products-info {
        padding: 22px 18px;
    }

    .shop-detail .products-info .product-title {
        font-size: 25px;
    }

    .shop-detail .products-info .select-count {
        flex-wrap: nowrap;
    }

    .shop-detail .products-info .select-count>.text {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
    }

    .shop-detail .products-info .select-count .price_tip {
        padding-left: 0;
    }

    .shop-detail .products-info .format-table .list {
        gap: 4px;
        font-size: 13px;
    }

    .shop-detail .products-info .format-table .list div:last-child {
        max-width: 45%;
        font-size: 12px;
    }

    .shop-detail .section-head .title {
        font-size: 21px;
    }

    .shop-detail .section-article {
        padding: 12px;
    }

    .shop-detail section.fix-top {
        padding-top: 134px;
        padding-bottom: 24px;
    }

    .shop-detail .shopping-notes {
        padding-top: 112px !important;
        padding-bottom: 48px !important;
    }

    .shop-detail .notes-wrap {
        padding: 20px;
    }

    .shop-detail .notes-wrap .notes-block {
        flex-direction: column;
        gap: 8px;
    }

    .shop-detail .notes-wrap .notes-block .title {
        width: auto;
        flex: none;
        padding: 0;
        border: 0;
    }

    .shop-detail .notes-wrap .notes-block .content {
        padding: 0 0 18px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .shop-detail .action-btn .addCart {
        transition: none;
    }
}