@brand: darkblue;
@accent: #ff922b;
@ink: #1f2733;
@line: #eef0f4;
@card-shadow: 0 4px 14px rgba(0, 32, 96, .07);
@card-shadow-hover: 0 12px 26px rgba(0, 32, 96, .14);

.sectionTitle(){
  grid-column: 1 / 3; margin: 8px 0 8px; text-align: center; position: relative; padding-bottom: 12px;
  font-size: clamp(20px, 5vw, 26px); font-weight: 800; letter-spacing: 3px; color: @brand;

  &::after{
    content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 52px; height: 3px; border-radius: 999px; background: @accent;
  }
}

body{

  &.stopScroll{overflow: hidden;}
}

header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; width: 100%; background-color: #fff; padding: 8px 2px 2px;

  > div[data-id="1"]{
    display: flex; align-items: center;

    > div{
      flex: 1;

      > a{display: block;}
  
      img{height: 40px;}      

      > span{
        margin: .3rem 0; display: inline-block; color: #fff; background-color: darkblue; padding: 4px 6px; border-radius: 999px; letter-spacing: 3px;
        text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 2px 2px 2px rgba(0, 0, 0, .45);
        font-size: clamp(14px, 2vw, 18px); text-align: center;

        @media (max-width: 325px){font-size: 11px;}
      }
    }
  
    > a{
      display: flex; flex-direction: column; align-items: center; text-align: center; flex: 0 0 25%; font-size: clamp(14px, 4vw, 20px); letter-spacing: 2px;
      color: darkblue; border-left: 1px solid #e8e8e8; padding: 0 10px;
      
      > i{font-size: 1.5rem;}

      &:nth-of-type(1){border-left: none;}

      @media (max-width: 350px){ flex: 0 0 17%; }
    }

    #cartList{
      position: relative;

      > b{
        position: absolute; top: 0; right: 3px; display: inline-flex; align-items: center; justify-content: center;
        min-width: 18px; height: 18px; padding: 0 4px; background-color: darkred; color: #fff; border-radius: 999px;

        @media (max-width: 350px){font-size: 11px; height: 14px; min-width: unset;}
      }
    }
  }

  .noticeDropdown{
    margin-top: 4px; padding: 0 7px 7px; border-bottom: 2px solid darkblue;

    > summary{
      list-style: none; cursor: pointer; line-height: 1.5;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; position: relative;

      font-size: clamp(16px, 3vw, 20px); letter-spacing: 1px; color: #666; font-weight: 700;
      text-shadow: 0 1px 0 rgba(255, 255, 255, .95), 0 2px 3px rgba(0, 0, 80, .28);

      &::-webkit-details-marker{display: none;}

      &::after{
        content: "點入"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: clamp(16px, 6vw, 24px); color: darkred;
      }
    }

    > p{
      margin: 6px 0 0; color: #333; line-height: 1.6;
    }

    &:not([open]) > p{display: none;}

    &[open] > summary{
      white-space: normal;

      &::after{content: "關閉";}
    }
  }

  > div[data-id="4"]{
    display: flex; flex-wrap: wrap; align-items: center; grid-gap: 0 12px; padding: 2px; margin-top: 6px; background-color: #fff; position: sticky; top: var(--header-height, 0); z-index: 99;

    > a#allCategory{
      display: flex; align-items: end; grid-gap: 6px; padding: 8px; border: 1px solid darkblue; border-radius: 8px; color: darkblue; font-size: 14px; letter-spacing: 1px; white-space: nowrap; background-color: #f8f9ff;

      > i{font-size: 1rem;}

      &.is-active{background-color: darkblue; color: #fff;}
    }

    > div{
      flex: 1; display: flex; align-items: center; grid-gap: 8px; background: #f5f5f5; border: 1px solid #ddd; border-radius: 999px; padding: 8px 14px; min-width: 0;

      > input{flex: 1; border: none; background: transparent; outline: none; font-size: 14px; min-width: 0;}

      > i{color: #999; font-size: .95rem; flex: 0 0 auto;}
    }

    .category-panel{
      display: none; width: 100%; order: 3;

      &.is-open{display: block;}

      > ul{
        margin: 4px 0 0; background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); max-height: 50vh; overflow-y: auto;
      }

      a{
        display: block; padding: 9px 6px; color: #333; border-bottom: 1px solid #f0f0f0;

        &:hover{background: #f8f9ff; color: darkblue;}
      }
    }
  }
}

main{
  padding: var(--header-height, 0) 0 16px; 
  
  //width: 100%;

  .hotTag{
    display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; margin: 10px 0 16px; background-color: #f4f6fa; padding: 14px 8px;

    > a{
      display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 6px;
      border: 1px solid @line; border-radius: 12px; background: #fff; color: @brand; box-shadow: @card-shadow;
      font-size: clamp(16px, 2.8vw, 20px); font-weight: 700; letter-spacing: 2px;
      transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;

      &:hover{
        transform: translateY(-2px); box-shadow: @card-shadow-hover;
        background: linear-gradient(135deg, @brand 0%, #2a3fa0 100%); color: #fff;
      }
    }
  }

  .backOld{
    color: darkblue;

    > img{width: 98%; margin: 0 auto; display: block; border-radius: 12px;}

    > ol{
      margin: 0; line-height: 2; letter-spacing: 2px; padding: 6px 12px 6px 30px; border: 2px solid darkblue; border-radius: 8px; list-style-type: disc;

      > li{list-style-type: inherit;}
    }
  }

  #prdAd{
    margin: 20px 0;

    img{display: block; width: 96%; margin: 0 auto; border-radius: 12px;}

    .owl-nav button{
      position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 14px; border: 1px solid rgba(255, 255, 255, .5); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);

      &.owl-prev{left: 8+5px;}
      &.owl-next{right: 8+5px;}
    }

    .owl-dots{
      position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);

      > button.owl-dot{
        width: 8px; height: 8px; padding: 0; border: none; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;

        &:not(:nth-last-of-type(1)){margin-right: 4px;}

        > span{width: 100%; height: 100%; display: block; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 1px solid rgba(0, 0, 0, .2);}

        &.active > span{background: #ff922b; border-color: #ff922b;}
      }
    }
  }

  .prdADList{
    display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; padding: 0 8px;

    > h1, > h2, > h4{.sectionTitle();}

    > a{
      display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 14px; background: #fff; box-shadow: @card-shadow;
      transition: transform .2s ease, box-shadow .2s ease;

      &:hover{transform: translateY(-3px); box-shadow: @card-shadow-hover;}

      > img{
        display: block; width: 100%; height: 100%; object-fit: cover;
      }
    }

    @media (max-width: 600px){
      grid-template-columns: repeat(1, 1fr);

      > h1, > h2, > h4{grid-column: 1 / 1;}

      > a {
        aspect-ratio: auto;

        > img{height: unset; object-fit: unset;}
      }
    }
  }

  .prd{
    display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 12px; padding: 0 8px;

    > h2, > h4{.sectionTitle();}

    > div > div{
      display: flex; flex-direction: column; overflow: hidden; height: 100%;
      border: 1px solid @line; border-radius: 14px; background: #fff; box-shadow: @card-shadow;
      transition: transform .2s ease, box-shadow .2s ease;

      &:hover{transform: translateY(-3px); box-shadow: @card-shadow-hover;}

      > img{display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f8f9ff;}

      > span{
        display: block; padding: 10px 10px 0; text-align: center; line-height: 1.4; color: @ink;
        font-size: 15px; font-weight: 600; letter-spacing: .5px;
      }

      > div{
        margin-top: auto; padding: 10px;

        > a{
          display: flex; align-items: center; justify-content: center; grid-gap: 6px; min-height: 40px; padding: 8px 4px;
          border: none; border-radius: 999px; color: #fff; font-weight: 700; letter-spacing: 1px;
          background: linear-gradient(135deg, @brand 0%, #2a3fa0 100%); box-shadow: 0 4px 10px rgba(0, 26, 128, .25);
          transition: filter .2s ease, transform .1s ease;

          &:hover{filter: brightness(1.08);}

          &:active{transform: scale(.98);}
        }
      }
    }
  }

  .prdShow{
    display: flex; flex-direction: column; align-items: stretch; grid-gap: 12px; padding: 0 8px 0px;

    > div{
      > h2{margin: 0; max-width: 800px; text-align: center;}

      > div{
        position: relative;
  
        > #backVIP{
          position: absolute; right: 0; top: 0; padding: 6px 16px; background-color: #4386a4; color: #fff; border-radius: 0px 10px 0px 10px; letter-spacing: 1px;
        }
  
        > img{width: 100%; border-radius: 12px;}
  
        &:nth-of-type(1), &:nth-of-type(2){max-width: 800px; margin: 0 auto;}

        &.prdShow_info{
          border: 3px solid transparent; border-radius: 14px;
          background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #98b1dc, #dbd2d9, #f8e3d6) border-box;
          padding: 0px 10px 5px; width: 100%; display: flex; flex-direction: column; align-items: baseline; font-size: clamp(20px, 3vw, 24px);
      
          > span{
            display: block; text-align: center; letter-spacing: 1px; margin: 8px 0 ;
      
            &.vip{color: #ff000099; font-weight: 700; font-size: 1.35rem;}
          }

          > button{
            flex: 1; width: 100%; min-height: 40px; border: none; border-radius: 999px; background: #ff922b; color: #fff; font-size: clamp(20px, 5vw, 28px);
            letter-spacing: 1px; cursor: pointer; margin-top: 10px;
      
            &:hover{opacity: .9;}
      
            &:disabled{background: #ccc; cursor: not-allowed;}
          }
        }
      }
    }    
  }
}


#fuction{
  margin: 8px 0 20px; padding: 18px 14px; border: 3px solid #dce6f5; border-radius: 18px;
  background: linear-gradient(180deg, #f9fcff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(0, 32, 96, .08); font-size: clamp(17px, 5vw, 28px);

  > p{
    margin: 0; line-height: 1.8; letter-spacing: 1px; color: #234;

    &:nth-of-type(1){
      padding-bottom: 12px; margin-bottom: 10px; border-bottom: 2px solid #e4ecf7;
      font-size: clamp(20px, 4.8vw, 28px); font-weight: 800; text-align: center; color: darkblue;
      text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
    }

    &:nth-of-type(2){
      margin-bottom: 12px; text-align: center; font-size: clamp(17px, 4.2vw, 22px); font-weight: 700; color: #3a5d92;
    }

    > b{color: darkred; font-size: 1.25rem;}
  }

  > ol{
    margin: 0 0 14px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-gap: 10px;

    > li{
      display: flex; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid #e5edf8; color: #24415f; box-shadow: 0 3px 10px rgba(0, 45, 105, .05);

      &::before{
        content: "✓"; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px;
        width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: #e8f2ff; color: #0b5ed7; font-weight: 700;
      }
    }
  }

  > ul{
    margin: 0 0 14px; padding-left: 20px; list-style: inherit;

    > li{
      list-style: inherit; line-height: 1.8;
    }
  }
}



div[data-id="rightIcon"]{
  bottom: 10px;

  > button, > a#share{
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    padding: 8px; border-radius: 16px; color: #fff; letter-spacing: 1px;
    transition: filter .2s ease, transform .1s ease; opacity: .85;

    &:hover{filter: brightness(1.08);}

    &:active{transform: scale(.98);}
  }

  > button{
    background-color: #888;    
  }

  > a#share{
    grid-gap: 6px; background: #666;
  }
}