/**
 * 商品列表頁 Figma（node 26:271）— 產品系列
 */

body.layercloud-figma-products .site-header > .container {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

body.layercloud-figma-products .site-header {
    position: static;
    height: 0;
    min-height: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

body.layercloud-figma-products .site-footer {
    display: none !important;
}

body.layercloud-figma-products .main-content {
    padding-top: 0 !important;
}

body.layercloud-figma-products .mobile-nav {
    top: 83px;
    z-index: 600;
}

@media (max-width: 1023px) {
    body.layercloud-figma-products .mobile-nav {
        top: 56px;
    }
}

.figma-products-page {
    --fp-blue: #0059ca;
    --fp-text: #333333;
    --fp-muted: #999999;
    --fp-spec: #0059ca;
    --fp-hot: #b4c537;
    --fp-sale: #e51111;
    --fp-max: 1200px;
    --font-zh: "Noto Sans TC", "Inter", sans-serif;
    background: #ffffff;
    color: var(--fp-text);
    font-family: var(--font-zh);
    position: relative;
    overflow-x: hidden;
}

.figma-products-page .figma-home-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    height: 83px;
    background: #ffffff;
    box-shadow: 0 4px 13.7px rgba(0, 0, 0, 0.25);
}

.figma-products-page .figma-home-header__inner {
    max-width: var(--fp-max);
    margin: 0 auto;
    padding: 0 26px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.figma-products-page .figma-home-header__brand {
    display: flex;
    align-items: center;
    gap: 15.478px;
    text-decoration: none;
    color: inherit;
    grid-column: 2;
    justify-self: center;
}

.figma-products-page .figma-home-header__icon {
    width: 28px;
    height: 36px;
}

.figma-products-page .figma-home-header__logotype {
    width: 120px;
    height: auto;
}

.figma-products-page .figma-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    grid-column: 3;
    justify-self: end;
}

@media (min-width: 1024px) {
    .figma-products-page .figma-menu-toggle {
        margin-right: -14px;
    }
}

.figma-products-page__main {
    padding-top: 83px;
}

@media (max-width: 1023px) {
    .figma-products-page .figma-home-header {
        height: 56px;
    }

    .figma-products-page .figma-home-header__inner {
        padding: 0 8px;
    }

    .figma-products-page .figma-home-header__icon {
        width: 16.8px;
        height: 21.6px;
    }

    .figma-products-page .figma-home-header__logotype {
        width: 72px;
    }

    .figma-products-page__main {
        padding-top: 56px;
    }
}

/* Hero — 與關於頁（.figma-svc-hero）相同：1200×579 比例、桌面滿版 */
.figma-p-hero {
    position: relative;
    width: 100%;
    max-width: var(--fp-max);
    margin: 0 auto;
    aspect-ratio: 1200 / 579;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.figma-p-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.figma-p-hero__media picture {
    display: block;
    width: 100%;
    height: 100%;
}

.figma-p-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.figma-p-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.figma-p-hero__text {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #ffffff;
    font-size: clamp(18px, 3vw, 30px);
    letter-spacing: 8.4px;
    text-shadow: 0 4px 10.1px rgba(0, 0, 0, 0.5), 0 4px 4px rgba(0, 0, 0, 0.5);
    padding: 24px;
}

.figma-p-hero__text .line1 {
    font-family: var(--font-zh);
    font-weight: 700;
    font-size: inherit;
    line-height: 49px;
    margin: 0 0 0.15em;
}

.figma-p-hero__text .line2 {
    font-family: var(--font-zh);
    font-weight: 400;
    font-size: inherit;
    line-height: 49px;
    margin: 0;
    letter-spacing: 8.4px;
}

@media (min-width: 901px) {
    .figma-p-hero {
        height: 579px;
        aspect-ratio: auto;
    }
}

/* 電腦端：BANNER 滿版寬度，維持 1200:579 比例（與關於頁一致） */
@media (min-width: 1024px) {
    .figma-p-hero {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Tabs */
.figma-p-tabs-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: 20px 16px 8px;
}

.figma-p-tabs {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.figma-p-tabs a {
    position: relative;
    display: inline-block;
    padding: 8px 24px 12px;
    font-size: 12px;
    line-height: 1.2;
    text-decoration: none;
    color: var(--fp-muted);
    font-weight: 400;
}

.figma-p-tabs a.is-active {
    color: var(--fp-text);
    font-weight: 700;
}

.figma-p-tabs a.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 72px;
    height: 4px;
    background: var(--fp-blue);
    border-radius: 2px;
}

/* Grid + 背景水紋（水花層與商品區、頁尾同層堆疊，桌面滿版寬並延伸至頁尾） */
.figma-p-water-stack {
    position: relative;
    z-index: 0;
}

.figma-p-grid-section {
    position: relative;
    z-index: 1;
    padding: 28px 16px 64px;
}

/* 桌面 ≥901px：寬度 100vw、高度拉滿整個 stack（商品列表至頁尾頂），圖片底對齊區塊底 */
@media (min-width: 901px) {
    .figma-p-water-stack .figma-p-grid-bg {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 0;
        bottom: 0;
        width: 100vw;
        max-width: none;
        height: auto;
        pointer-events: none;
        z-index: 0;
    }

    .figma-p-water-stack .figma-p-grid-bg picture {
        display: block;
        position: absolute;
        inset: 0;
    }

    .figma-p-water-stack .figma-p-grid-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center bottom;
        opacity: 0.6;
    }

    .figma-p-water-stack .figma-home-footer {
        position: relative;
        z-index: 1;
    }
}

.figma-p-grid-inner {
    position: relative;
    z-index: 1;
    max-width: 870px;
    margin: 0 auto;
}

.figma-p-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 520px) {
    .figma-p-grid {
        grid-template-columns: 1fr;
    }

    /* Figma 行動稿為 375 寬雙欄，窄螢幕維持兩欄（僅商品列表頁） */
    .figma-products-page .figma-p-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 15px;
        row-gap: 18px;
    }
}

/* 商品卡 — Figma node 26:702（單卡 270×380；座標與外框縮放同稿） */
.figma-p-card {
    position: relative;
    width: 100%;
    max-width: 270px;
    margin: 0 auto;
    min-height: 380px;
    overflow: visible;
}

/* 裝飾外框向量：稿中 270×380 容器內 img 使用負 inset 溢出，與 node 26:703 一致 */
.figma-p-card__frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.figma-p-card__frame picture {
    display: block;
    position: absolute;
    top: -1.58%;
    right: -5.19%;
    bottom: -3.68%;
    left: -2.22%;
}

.figma-p-card__frame img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.figma-p-card__inner {
    position: relative;
    z-index: 2;
    /* 設計稿 node 26:702：內容 left/top 15；CTA bottom 310+40，卡高 380 → padding-bottom 30 */
    padding: 15px 15px 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 380px;
    box-sizing: border-box;
}

/* 圖片區 240×180（設計稿比例）；欄寬較窄時等比例縮放 */
.figma-p-card__media {
    position: relative;
    width: 100%;
    max-width: 240px;
    aspect-ratio: 240 / 180;
    height: auto;
    flex-shrink: 0;
    /* 15 + 180 + 9 = 204 → 與稿中標題 top-[204px] 對齊 */
    margin: 0 0 9px;
    overflow: hidden;
    background: #f5f5f5;
}

.figma-p-card__media a {
    display: block;
    width: 100%;
    height: 100%;
}

.figma-p-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 徽章：設計稿距卡頂 25px、寬 45、高 22；圖區自內容頂起算 → top 10px、right 10px */
.figma-p-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    min-width: 45px;
    height: 22px;
    padding: 3px 12px;
    font-family: var(--font-zh);
    font-size: 10px;
    font-weight: 400;
    line-height: normal;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    z-index: 2;
}

.figma-p-card__badge--hot {
    background: #b4c537;
}

.figma-p-card__badge--sale {
    background: #e51111;
}

.figma-p-card__title {
    font-family: var(--font-zh);
    font-size: 16px;
    font-weight: 700;
    /* 204 + 20 + 3 = 227 → 與稿中價格 top-[227px] */
    line-height: 20px;
    color: #000000;
    margin: 0 0 3px;
    width: 100%;
    max-width: 240px;
}

.figma-p-card__title a {
    color: inherit;
    text-decoration: none;
}

.figma-p-card__title a:hover {
    color: var(--fp-blue);
}

.figma-p-card__price {
    font-family: var(--font-zh);
    font-size: 18px;
    font-weight: 700;
    /* 227 + 22 + 16 = 265 → 與稿中規格列 top-[265px] */
    line-height: 22px;
    color: #0059ca;
    margin: 0 0 16px;
    width: 100%;
    max-width: 240px;
}

.figma-p-card__price .woocommerce-Price-amount {
    font-weight: 700;
    color: #0059ca;
}

.figma-p-card__price del {
    opacity: 0.65;
    font-size: 0.85em;
    margin-right: 0.25em;
}

.figma-p-card__price ins {
    text-decoration: none;
}

/* 規格列 node 26:707：265 起、高 20；265+20+25=310 → 按鈕 top-[310px] */
.figma-p-card__tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 25px;
    width: 100%;
    max-width: 240px;
    min-height: 20px;
    box-sizing: border-box;
}

.figma-p-card__tag {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    margin: 0;
    padding: 4px 5px;
    border: 1px solid #0059ca;
    font-family: Consolas, "Noto Sans JP", "Noto Sans TC", monospace, sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: normal;
    color: #0059ca;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.figma-p-card__tag:nth-child(1) {
    flex: 0 0 60px;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 4px 5px;
}

.figma-p-card__tag:nth-child(2) {
    flex: 0 0 55px;
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    padding: 4px 16px;
}

.figma-p-card__tag:nth-child(3) {
    flex: 0 0 55px;
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    padding: 4px 8px;
}

/* CTA：240×40、漸層 #0059CA → #DCD397、字 12px Bold */
.figma-p-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 240px;
    height: 40px;
    margin: 0;
    padding: 10px 20px;
    background: linear-gradient(90deg, #0059ca 0%, #dcd397 100%);
    color: #ffffff !important;
    font-family: var(--font-zh);
    font-size: 12px;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.figma-p-card__btn:hover {
    opacity: 0.92;
    color: #ffffff !important;
}

/* 與 Figma node 26:702 桌面稿一致：固定圖 240×180、CTA padding 10×90（行動版 ≤900px 另覆寫） */
@media (min-width: 901px) {
    .figma-p-card__media {
        width: 240px;
        height: 180px;
        aspect-ratio: auto;
    }

    .figma-p-card__btn {
        width: 240px;
        max-width: 240px;
        padding: 10px 90px;
    }

    /* 稿中標題為單行 whitespace-nowrap（26:705） */
    .figma-p-card__title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 分頁 */
.figma-p-pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.figma-p-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.figma-p-pagination .page-numbers li {
    margin: 0;
}

.figma-p-pagination .page-numbers a,
.figma-p-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 400;
    text-decoration: none;
    color: var(--fp-blue);
    border: 1.5px solid var(--fp-blue);
    background: transparent;
    transition: all 0.2s;
}

.figma-p-pagination .page-numbers a:hover {
    background: rgba(0, 89, 202, 0.06);
}

.figma-p-pagination .page-numbers .current {
    background: var(--fp-blue);
    color: #ffffff;
    border-color: var(--fp-blue);
    font-weight: 600;
}

.figma-p-pagination .page-numbers .prev,
.figma-p-pagination .page-numbers .next {
    border-radius: 29px;
    min-width: 110px;
    padding: 0 24px;
}

.figma-p-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--fp-muted);
}

/* 頁尾 */
.figma-products-page .figma-home-footer {
    position: relative;
    min-height: 420px;
    color: #ffffff;
}

.figma-products-page .figma-home-footer__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.figma-products-page .figma-home-footer__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.figma-products-page .figma-home-footer__inner {
    position: relative;
    z-index: 1;
    max-width: var(--fp-max);
    margin: 0 auto;
    padding: 120px 24px 100px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.figma-products-page .figma-home-footer__contact h2 {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 15.888px;
    margin: 0 0 17px;
    color: #ffffff;
}

.figma-products-page .figma-home-footer__contact address {
    font-family: var(--font-zh);
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
}

.figma-products-page .figma-home-footer__contact address p {
    margin: 0 0 0.5em;
}

.figma-products-page .figma-home-footer__contact address p:last-child {
    margin-bottom: 0;
}

.figma-products-page .figma-home-footer__contact a {
    color: #ffffff;
    text-decoration: none;
}

.figma-products-page .figma-home-footer__contact a:hover {
    text-decoration: underline;
}

.figma-products-page .figma-home-footer__copy {
    font-family: var(--font-zh);
    font-size: 14px;
    text-align: center;
    color: #ffffff;
    opacity: 0.85;
}

/* 行動版頁尾：figma-home-footer-mobile.css（Figma 2001:366） */

/* —— 商品列表頁行動版（Figma node 45:843；商品卡 45:874，≤900px；桌面樣式不變） —— */
@media (max-width: 900px) {
    .figma-p-hero {
        min-height: 0;
        aspect-ratio: 375 / 180;
        width: 100%;
        max-width: none;
    }

    .figma-p-hero__media picture {
        display: block;
        width: 100%;
        height: 100%;
    }

    .figma-p-hero__text {
        font-size: 13px;
        letter-spacing: 3.64px;
        line-height: 20px;
        text-shadow: 0 1.25px 3.156px rgba(0, 0, 0, 0.5), 0 1.25px 1.25px rgba(0, 0, 0, 0.5);
        padding: 16px;
    }

    .figma-p-hero__text .line1,
    .figma-p-hero__text .line2 {
        font-size: 13px;
        line-height: 20px;
        letter-spacing: 3.64px;
    }

    .figma-p-hero__text .line1 {
        font-weight: 700;
    }

    .figma-p-hero__text .line2 {
        font-weight: 400;
    }

    .figma-p-tabs-wrap {
        padding: 12px 16px 8px;
    }

    .figma-p-tabs {
        justify-content: center;
        gap: 28px;
        flex-wrap: nowrap;
    }

    .figma-p-tabs a {
        padding: 4px 0 10px;
        font-size: 10px;
    }

    .figma-p-tabs a:not(.is-active) {
        color: #999999;
    }

    .figma-p-tabs a.is-active::after {
        width: 48px;
        height: 2px;
        max-width: 48px;
        border-radius: 0;
        background: transparent url("../img/figma-products-mobile/tab-underline-mobile.svg") no-repeat center / 48px 2px;
        transform: translateX(-50%);
    }

    .figma-p-grid-section {
        padding: 12px 16px 48px;
    }

    /* 滿版寬、高度與 stack 同高（含商品區至 footer），底緣與頁尾貼齊 — 同桌面邏輯 */
    .figma-p-water-stack .figma-p-grid-bg {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 0;
        bottom: 0;
        width: 100vw;
        max-width: none;
        height: auto;
        overflow: hidden;
        pointer-events: none;
        z-index: 0;
    }

    .figma-p-water-stack .figma-p-grid-bg picture {
        display: block;
        position: absolute;
        inset: 0;
    }

    .figma-p-water-stack .figma-p-grid-bg img {
        width: 100%;
        height: 100%;
        max-width: none;
        opacity: 0.6;
        object-fit: cover;
        object-position: center bottom;
    }

    .figma-p-water-stack .figma-home-footer {
        position: relative;
        z-index: 1;
    }

    .figma-p-grid-inner {
        max-width: 303px;
    }

    .figma-p-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 15px;
        row-gap: 18px;
    }

    /* 商品卡 Figma node 45:874（稿 144×202；於 .figma-p-grid-inner 303px 雙欄時單欄約 144px） */
    .figma-p-card {
        max-width: none;
        width: 100%;
        margin: 0;
        min-height: 202px;
        background: #ffffff;
    }

    /* 與稿中 Vector 外框負 inset 一致（node 45:875） */
    .figma-p-card__frame picture {
        display: block;
        position: absolute;
        top: -1.58%;
        right: -5.17%;
        bottom: -3.68%;
        left: -2.21%;
    }

    .figma-p-card__inner {
        min-height: 0;
        padding: 7.97px 8px 15.95px;
        align-items: flex-start;
    }

    .figma-p-card__media {
        width: 128px;
        max-width: 128px;
        aspect-ratio: 128 / 95.684;
        height: auto;
        margin: 0 0 4.786px;
        align-self: flex-start;
        border-radius: 8px;
        overflow: hidden;
    }

    .figma-p-card__media img {
        border-radius: 8px;
    }

    /* 徽章：稿 left 106.67 / top 13.29（相對圖區 128×95.684） */
    .figma-p-card__badge {
        top: 5.32px;
        right: 5.33px;
        left: auto;
        width: 24px;
        min-width: 24px;
        max-width: 24px;
        height: 11.695px;
        min-height: 11.695px;
        padding: 1.595px 6.379px;
        font-size: 5.316px;
        font-weight: 400;
        line-height: normal;
    }

    .figma-p-card__title {
        font-size: 8.505px;
        font-weight: 700;
        line-height: normal;
        margin: 0 0 2.03px;
        max-width: 128px;
    }

    .figma-p-card__price {
        font-size: 9.568px;
        font-weight: 700;
        line-height: normal;
        margin: 0 0 10.632px;
        max-width: 128px;
    }

    .figma-p-card__price .woocommerce-Price-amount {
        font-size: inherit;
    }

    .figma-p-card__tags {
        flex-wrap: nowrap;
        gap: 5.33px;
        min-height: 10.632px;
        margin: 0 0 13.288px;
        max-width: 128px;
    }

    .figma-p-card__tag {
        box-sizing: border-box;
        height: 10.632px;
        min-height: 10.632px;
        max-height: 10.632px;
        padding: 2.126px 2.658px;
        font-size: 5.316px;
        font-weight: 400;
        line-height: normal;
        border-width: 0.532px;
    }

    .figma-p-card__tag:nth-child(1) {
        flex: 0 0 32px;
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        padding: 2.126px 2.658px;
    }

    .figma-p-card__tag:nth-child(2) {
        flex: 0 0 29.333px;
        width: 29.333px;
        min-width: 29.333px;
        max-width: 29.333px;
        padding: 2.126px 8.505px;
    }

    .figma-p-card__tag:nth-child(3) {
        flex: 0 0 29.333px;
        width: 29.333px;
        min-width: 29.333px;
        max-width: 29.333px;
        padding: 2.126px 4.253px;
    }

    /* CTA：128×21.263、漸層與字級 node 45:888–889 */
    .figma-p-card__btn {
        width: 128px;
        max-width: 128px;
        height: 21.263px;
        min-height: 21.263px;
        margin: 0;
        align-self: flex-start;
        box-sizing: border-box;
        padding: 5.316px 47.842px;
        font-size: 6.379px;
        font-weight: 700;
        line-height: normal;
    }

    .figma-p-pagination {
        margin-top: 28px;
    }

    .figma-p-pagination .page-numbers {
        gap: 7px;
    }

    .figma-p-pagination .page-numbers a,
    .figma-p-pagination .page-numbers span {
        min-width: 26px;
        height: 26px;
        padding: 0 5px;
        font-size: 10px;
        border-width: 0.65px;
    }

    .figma-p-pagination .page-numbers .prev,
    .figma-p-pagination .page-numbers .next {
        border-radius: 65px;
        min-width: 52px;
        height: 26px;
        font-size: 10px;
    }
}
