@charset "UTF-8";
    body {
      color: #AC9E50;
    }
    .modal {
        color: #666;
    }
    .cursor-pointer {
        cursor: pointer;
    }

    #loading-overlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #374039;
      background: linear-gradient(180deg,rgba(55, 64, 57, 1) 0%, rgba(56, 94, 61, 1) 100%);
      z-index: 1050;
      transition: opacity 300ms ease, visibility 300ms ease;
      opacity: 1;
      visibility: visible;
      overflow: hidden;
    }

    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      overflow: hidden;
    }

    #loading-overlay.loaded {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .loading-inner {
      text-align: center;
      position: relative;
      z-index: 2;
    }

    .loading-text {
      margin-top: 0.75rem;
      font-size: 1rem;
      font-family: "Cormorant Garamond", serif;
      font-optical-sizing: auto;
      font-weight: 700;
      font-style: italic;
    }

    .text-cormorant {
        font-family: "Cormorant Garamond", serif;
    }

    body.loading-locked {
      overflow: hidden;
    }

    .loading-decor-left,
    .loading-decor-right {
      position: absolute;
      top: 0;
      bottom: 0;
      width: auto;
      height: 100%;
      z-index: 1;
    }

    .loading-decor-left { left: 0; }
    .loading-decor-right { right: 0; }

    .loading-decor-left img,
    .loading-decor-right img {
      height: 100%;
      width: auto;
      object-fit: contain;
      display: block;
    }

    .loading-logo {
      width: 200px;
      height: auto;
      z-index: 10000;
    }

    .page-decor-left,
    .page-decor-right {
      position: fixed;
      top: 0;
      bottom: 0;
      width: auto;
      height: 100%;
      z-index: 100;
    }

    .page-decor-left { left: 0; }
    .page-decor-right { right: 0; }

    .page-decor-left img,
    .page-decor-right img {
      height: 100%;
      width: auto;
      object-fit: contain;
      display: block;
    }

    .container-fluid {
      background: #374039;
      background: linear-gradient(180deg,rgba(55, 64, 57, 1) 0%, rgba(56, 94, 61, 1) 100%);

    }

    .chest {
        max-width: 850px;
        margin: 0px auto;
        position: relative;
    }

    .chest-top {
        background-image: url("../assets/img/chest-back.png");
        background-repeat: no-repeat;
        background-position: center 20px;
        background-size: 100%;
        padding-top: 36%;
    }

    .chest-mid {
        background-image: url("../assets/img/chest-mid.png");
        background-repeat: repeat-y;
        background-position: center 20px;
        background-size: 100%;
    }

    .chest-bottom {
        background-image: url("../assets/img/chest-footer.png");
        background-repeat: no-repeat;
        background-position: center bottom;
        background-size: 100%;
        padding-bottom: 10%;
    }

    .number {
        font-family: "Cormorant Garamond", serif;
        font-optical-sizing: auto;
        font-weight: bolder;
        font-style: italic;
        font-size: 3.5rem;
        line-height: 3.2rem;
    }

    .product-name {
        font-weight: bolder;
        font-size: 1.1rem;
    }

    .price {
        font-weight: bolder;
        font-style: italic;
        font-size: 1rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        line-height: 1rem;
    }

    .modal .price {
        color: #AC9E50;
        font-size: 1.2rem;
        line-height: 1.5rem;

    }

    /* =======================
       🔹 翻轉卡片效果
       ======================= */
    .key-back {
      perspective: 1000px; /* 建立3D空間 */
    }


    .key-back-img {
        background-image: url("../assets/img/key-back.png");
        background-repeat: no-repeat;
        background-position: center top;
        background-size: 79%;
    }

    .key-wrap {
      position: relative;
      width: 100%;
      transform-style: preserve-3d;
      transition: transform 0.8s ease;
      height: 200px;
    }

    /*.product-card:hover .key-wrap {
      transform: rotateY(180deg);
    }*/
    .product-card.flipped .key-wrap {
      transform: rotateY(180deg);
    }

    .key-front, .key-backside {
      position: absolute;
      width: 100%;
      backface-visibility: hidden; /* 隱藏背面 */
    }

    .key-front {
      z-index: 2;
      transform: rotateY(0deg);
    }

    .key-backside {
      transform: rotateY(180deg);
    }

    /* 🔸 背面商品圖樣式 */
    .diamond-wrapper {
      width: 100px;
      height: 100px;
      overflow: hidden;
      transform: rotate(45deg); /* 外層旋轉 45 度 */
      border: 3px solid #AC9E50;
      margin: 50px auto 50px auto;
    }

    .product-img {
      width: 150%;
      height: 150%;
      object-fit: cover;
      transform: rotate(-45deg); /* 內層反向旋轉讓圖片保持直立 */
      margin-top: -22%;
      margin-left: -22%;
    }

    .product-thumb {
      cursor: pointer;
      opacity: 0.7;
      transition: all 0.2s ease;
    }

    .product-thumb:hover {
      opacity: 1;
      transform: scale(1.05);
    }

    .product-thumb.active {
      border: 2px solid #AC9E50;
      opacity: 1;
    }

    /* 裝飾區塊基礎設定 */
    .star-decor {
      position: fixed;
      top: 0;
      z-index: 200;
      display: flex;
      flex-direction: row;
      gap: 20px;
      pointer-events: none;
    }

    /* 左右位置 */
    .star-decor-left {
      left: 50px;
    }

    .star-decor-right {
      right: 50px;
      flex-direction: row-reverse;
    }

    /* 每條鍊條 */
    .chain {
      width: 60px;
      height: auto;
      transform-origin: top center; /* 以鍊條上端為旋轉軸 */
      animation-timing-function: ease-in-out;
      animation-iteration-count: infinite;
      animation: swingRotate 4s ease-in-out infinite;
      backface-visibility: visible;
  transform-style: preserve-3d;
  filter: brightness(0.9);
    }

    /* 每條不同的動畫與速度 */
    .chain-1 {
      animation: sway-left 4s infinite alternate, spin-left 8s ease-in-out infinite;
      position: relative;
      top: -80px;
    }
    .chain-2 {
      animation: sway-right 5.5s infinite alternate, spin-right 10s ease-in-out infinite;
      position: relative;
      top: -10px;
    }
    .chain-3 {
      animation: sway-left 6.5s infinite alternate, spin-left 9s ease-in-out infinite;
      position: relative;
      top: -100px;
    }
    .chain-4 {
      animation: sway-right 5s infinite alternate, spin-left 7s ease-in-out infinite;
      position: relative;
      top: -100px;
    }
    .chain-5 {
      animation: sway-left 7s infinite alternate, spin-right 11s ease-in-out infinite;
      position: relative;
      top: -30px;
    }
    .chain-6 {
      animation: sway-right 4.5s infinite alternate, spin-left 12s ease-in-out infinite;
      position: relative;
      top: -75px;
    }

    .mainProductImage {
        cursor: pointer;
    }

    @keyframes spin-left {
      0%   { transform: rotateY(1deg); }
      100% { transform: rotateY(359deg); }
    }

    @keyframes spin-right {
      0%   { transform: rotateY(1deg); }
      100% { transform: rotateY(-359deg); }
    }

    /* 定義左右擺動動畫 */
    @keyframes sway-left {
      0% { transform: rotate(2deg); }
      100% { transform: rotate(-4deg); }
    }

    @keyframes sway-right {
      0% { transform: rotate(-3deg); }
      100% { transform: rotate(3deg); }
    }

    @keyframes swingRotate {
      0% {
        transform: rotate(5deg) rotateY(0deg);
      }
      25% {
        transform: rotate(0deg) rotateY(5deg);
      }
      50% {
        transform: rotate(-5deg) rotateY(0deg);
      }
      75% {
        transform: rotate(0deg) rotateY(-5deg);
      }
      100% {
        transform: rotate(5deg) rotateY(0deg);
      }
    }

    /* RWD：小螢幕時隱藏 */
    @media (max-width: 768px) {
      .star-decor {
        display: none;
      }
    }

    @media (max-width: 376px) {
        .key-front img {
            max-width: 200px !important;
        }
        .key-back-img {
            padding-bottom: 30px;
        }
        .page-decor-left {
            left: -45px;
        }
        .page-decor-right {
            right: -45px;
        }
        .page-decor-left, .page-decor-right, .star-decor {
            display: block !important
        }
        .star-decor-left {
            left: -65px;
        }
        .star-decor-right {
            right: -65px;
        }
        .chest-top {
            padding-top: 39%;
        }
        .chest-bottom {
            padding-bottom: 6%;
        }
    }


    @media (max-width: 1025px) {
      .page-decor-left,
      .page-decor-right {
        display: none;
      }
    }

    @media (hover: hover) {
      .product-card:hover .key-wrap {
        transform: rotateY(180deg);
      }
}

    @media (max-width: 767.98px) {
      .loading-decor-left,
      .loading-decor-right {
        display: none;
      }
    }