/*

http://meyerweb.com/eric/tools/css/reset/ 
v2.0 | 20110126
License: none (public domain)

*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {

  margin: 0; padding: 0; border: 0;

  font: inherit; font-size: 100%; 
  vertical-align: baseline;

}

/* HTML5 display-role reset for older browsers */

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }

body { line-height: 1; }

ol, ul { list-style: none; }

blockquote, q { quotes: none; }

blockquote:before, blockquote:after, q:before, q:after {

  content: ''; content: none;

}

table {

  border-collapse: collapse;
  border-spacing: 0;

}

*, *::after, *::before {

  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-transition: all .2s;
  transition: all .2s;

}

html, body { line-height: 1.5; }

/* test */

/* * { outline: 1px solid black; } */

/* customization */

:root {

  --primary: #6A33F8;
  --secondary: #301E5F;

  --black: #000000;
  --white: #FFFFFF;

  --gray-300: #797979;
  --gray-200: #B9B9B9;
  --gray-100: #F8F8F8;

}

img { max-width: 100%; display: block; }

body {

  font-family: 'Noto Sans', sans-serif;
  font-weight: bold;

}

button {

  border-style: none;
  cursor: pointer;

  font-weight: bold;

  &.disabled {

    pointer-events: none;
    cursor: wait;

  }

}

.wrap {

  max-width: 1110px;
  margin: 0 auto;

}

.overflow-wrap {

  overflow-x: scroll;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */

}

.d-flex-end {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: end;

  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;

}

.position-relative { position: relative; }

.text-start { text-align: left; }

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

.text-end { text-align: right; }

.text-muted { color: var(--gray-300); }

.section-title {

  text-align: center;
  font-size: 1.75rem;

  margin: 0 0 30px 0;

}

/* loader (src: https://css-loaders.com/spinner/) */

.loader {

  width: 30px;
  aspect-ratio: 1;
  
  border: 0.5rem solid var(--gray-200);
  border-radius: 50%;
  border-right-color: var(--black);

  animation: l2 1s infinite linear;

}

@keyframes l2 { to { transform: rotate(1turn) } }

/* logo */

.logo {

  padding: 36px 0;
  font-size: 1.5rem;

}

@media (max-width: 767px) {

  .logo { padding: 15px; }

}

/* nav */

.nav {

  border-bottom: 40px solid var(--black);
  margin-bottom: 30px;

}

.nav .wrap {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: justify;
     -ms-flex-pack: justify;
   justify-content: space-between;

  -webkit-box-align: center;
     -ms-flex-align: center;
        align-items: center;

  -ms-flex-wrap: wrap;
      flex-wrap: wrap;

  position: relative;

}

@media (max-width: 1110px) {

  .nav .wrap { padding: 0 15px; }

}

.nav a {

  display: block;
  text-decoration: none;
  color: var(--black); font-size: 1.25rem;

  &:hover {

    color: var(--primary);
    -webkit-transform: scale(1.05);
            transform: scale(1.05);

  }

}

.nav-menu {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  
  background-color: var(--white);

  &.open {

    max-height: 300px;

  }

}

.nav-menu a {

  padding: 36px 24px;
  background-color: var(--white);

  &:hover {

    -webkit-transform: scale(1);
            transform: scale(1);

  }

}

.nav-menu li:last-child a { padding-right: 0; }

@media (max-width: 767px) {

  .nav-menu {

    position: absolute;
    top: 61px; left: 0; right: 0;
    z-index: 10;

    width: 100%;
    max-height: 0;

    overflow: hidden;

    transition: all .2s;
    -webkit-transition: all .2s;

  }

  .nav-menu li { width: 100%; }

  .nav-menu a {

    text-align: center;
    font-size: 1rem;
    padding: 15px;

    &:hover {

      background-color: var(--primary);
      color: var(--white);

    }

  }

  .nav-menu li:last-child a { padding: 15px; }
  
}

.nav-menu-toggle {

  display: none; cursor: pointer;

  &:hover {
    
    color: var(--primary);
  
  }

}

@media (max-width: 767px) {

  .nav-menu-toggle {

    display: block; padding: 15px; font-size: 2rem;

  }

}

/* banner */

.banner {

  position: relative;

  background-image: url("https://github.com/hexschool/js-training/blob/main/%E7%AC%AC%E4%B9%9D%E9%80%B1%E4%B8%BB%E7%B7%9A%E4%BB%BB%E5%8B%99%E5%9C%96%E5%BA%AB/3ewLAKn.png?raw=true");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  
  min-height: 420px;
  margin-bottom: 60px;

}

.banner-text {

  position: absolute;
  left: 50px; bottom: 50px;
  
  color: var(--white);
  font-weight: normal;
  font-size: 2rem;

}

@media (max-width: 767px) {

  .banner { min-height: 210px; }

  .banner-text {

    left: 50%; bottom: 50%;
    transform: translate(-50%, 50%);

    color: var(--black);

  }

}

/* 床墊優勢 ( advantages ) */

.advantages {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;

  margin-bottom: 60px;

}

.advantage-img {

  margin-bottom: 10px;

}

.advantage-text {

  text-align: center;
  font-size: 1.25rem;

}

/* 家具比較 ( comparison ) */

.comparison {

  background-color: var(--gray-100);
  padding: 50px 0 60px 0;

}

@media (max-width: 767px) {

  .comparison { padding: 50px 15px 60px; }
  
}

.comparison-table {

  margin: 0 auto;
  width: 65%;
  text-wrap: nowrap;

  th, td {

    text-align: center;
    padding: 15px;

  }

  th { font-size: 1.25rem; }

  tr { border-bottom: 1px solid var(--gray-200); }

  tr td:first-child {
    
    text-align: left; font-size: 1.25rem;

  }

}

.comparison-table .material-icons {

  color: var(--primary);
  -webkit-transform: scale(1.5);
          transform: scale(1.5);

}

@media (max-width: 767px) {

  .comparison-table {
    
    width: 500px;
  
    th, td { padding: 10px 0; }

    th { font-size: 1rem; }

    tr td:first-child { font-size: 1rem; }

  }
  
}

/* 好評推薦 ( recommendation ) */

.recommendation {

  background-color: var(--secondary);
  padding: 60px 0;

}

.recommendation .section-title { color: var(--white); }

@media (max-width: 767px) {

  .recommendation { padding: 60px 15px; }
  
}

.recommendation-list::-webkit-scrollbar { display: none; }

.upper-list, .lower-list {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

}

.upper-list {

  margin-bottom: 30px;

}

.recommendation-card {

  min-width: 400px;
  background-color: var(--white);

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  margin-left: 30px;

}

.recommendation-card img {

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;

}

.recommendation-content {

  padding-left: 16px;

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-direction: normal;
  -webkit-box-orient: vertical;

  -ms-flex-direction: column;
  flex-direction: column;
  
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;

}

.customer-info {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;

  margin-bottom: .5rem;

}

.customer-info img {

  width: 40px;
  border-radius: 50%;

  margin-right: 1rem;

}

.recommendation-text {

  color: var(--primary);
  font-size: 0.875rem;

}

/* 運送方式 ( transport step ) */

.transport-step { padding: 30px 0; }

@media (max-width: 767px) {

  .transport-step li { margin-bottom: 20px; }
  
}

.transport-step-intro {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;

  max-width: 700px;
  margin: 0 auto;

}

@media (max-width: 767px) {

  .transport-step-intro {

    -webkit-box-direction: normal;
    -webkit-box-orient: vertical;
    -ms-flex-direction: column;
    flex-direction: column;

  }

}

.transport-step-intro li:not(:last-child) {
  
  position: relative;

  &::after {

    content: "";
    position: absolute;
    top: 49px; right: -55px;
    
    border: 10px solid var(--black);
    border-top: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid transparent;

  }

}

@media (max-width: 767px) {
  
  .transport-step-intro li:not(:last-child)::after {

    position: static;
    margin-top: 25px;

    border: 10px solid var(--black);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid transparent;

  }

}

.transport-step-card {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  
  -webkit-box-direction: normal;
  -webkit-box-orient: vertical;
  
  -ms-flex-direction: column;
  flex-direction: column;

  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;

}

.card-icon {

  width: 115px; height: 115px;
  
  border: 3px solid var(--black);
  border-radius: 50%;

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;

  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;

  margin-bottom: 8px;

}

.card-icon .material-icons { font-size: 50px; }

.step-title { font-size: 1.25rem; }

@media (max-width: 767px) {

  .card-icon { width: 150px; height: 150px; }

}

/* 商品列表 ( product list ) */

.product-list { padding: 30px 0px; }

@media (max-width: 900px) {

  .product-list { padding: 30px 15px; }
  
}

.product-filter {

  min-height: 38px;
  min-width: 255px;

  color: var(--gray-300);
  text-indent: 10px;

  border: 1px solid var(--gray-200);
  border-radius: 5px;

  margin-bottom: 30px;

}

.product-list .list {

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 30px 2.5%;

  margin-bottom: 30px;

}

.product-card {

  position: relative;
  width: 100%;

}

@media (max-width: 900px) {

  .product-list .list { grid-template-columns: repeat(2, 1fr); }
  
}

@media (max-width: 540px) {

  .product-list .list { grid-template-columns: repeat(1, 1fr); }
  
}

.product-card img {

  min-height: 300px;
  width: 100%;

  -o-object-fit: cover;
     object-fit: cover;

}

.product-category {

  position: absolute;
  top: 13px; right: 0px;
  
  background-color: var(--black);
  color: var(--white);
  
  padding: 8px 24px;

}

.add-cart-btn {

  width: 100%;
  background-color: var(--black);
  color: var(--white);

  padding: 10px 0;
  margin-bottom: 8px;

  &:hover { background-color: var(--secondary); }

  &.disabled {

    background-color: var(--gray-300);

  }

}

.add-cart-btn, .product-card h3 { font-size: 1.25rem; }

.origin-price { font-size: 1.25rem; }

.now-price { font-size: 1.75rem; }

/* 購物車 ( cart list ) */

.cart-list {

  background-color: var(--gray-100);
  padding: 60px 0;

}

.cart-mask {

  width: 100%; height: 100%;
  background-color: var(--gray-100);
  
  position: absolute;
  z-index: 10;

  &.disabled {

    display: none;

  }

}

.cart-mask p {

  position: absolute; top: 50%; right: 50%; transform: translate(50%, -50%);
  font-size: 1.25rem;

}

.cart-mask a {

  color: var(--primary);
  text-decoration: none;

}

.cart-table {

  margin: 0 auto;
  border-collapse: collapse; /* 表格邊框合併 */
  font-size: 1.25rem;

  th, td {

    vertical-align: middle; padding: 15px;

  }

  tr {

    border-bottom: 1px solid var(--gray-200);

  }

  tr:last-child { border-bottom: 0; }

}

@media (max-width: 767px) {

  .cart-table { width: 700px; }
  
}

.cart-item-title {

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-align: center;
     -ms-flex-align: center;
        align-items: center;

}

.cart-item-title img {

  max-width: 80px;
  margin-right: 15px;

}

.item-qty-controls {

  width: 100px; position: relative;

}

.item-qty-controls input {

  width: 100%; min-height: 38px;

  border: 1px solid #CED4DA;
  border-radius: 5px;

  font-size: 1rem; text-align: center;

  &::-webkit-inner-spin-button { display: none; }

}

.item-qty-controls button {

  min-height: 38px;

  background-color: var(--black);
  color: var(--white);

  font-size: 1rem; font-weight: bold;

  &.disabled {

    background-color: var(--gray-200);
    color: var(--gray-300);

  }

}

.increase-qty-btn {

  position: absolute;
  top: 0; left: 0;

  border-radius: 5px 0 0 5px;

}

.decrease-qty-btn {

  position: absolute;
  top: 0; right: 0;

  border-radius: 0 5px 5px 0;

}

.item-qty-loader-mask {

  position: absolute;
  width: 100%; height: 100%;
  background-color: var(--gray-100);
  z-index: 10;

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: end;

  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;

  &.disabled { display: none; }
  
}

.remove-item-btn {

  font-size: 2rem;
  color: var(--black);
  
  background-color: var(--gray-100);
  padding: 10px 0 10px 10px;

  &:hover {

    color: var(--primary);
    -webkit-transform: scale(1.3);
            transform: scale(1.3);

  }

  &.disabled {

    color: var(--gray-300);

  }

}

.remove-all-btn {

  background-color: var(--white);
  color: var(--black);

  padding: 5px 15px;

  border: 1.3px solid var(--black);
  border-radius: 5px;

  font-size: 1.25rem;

  &:hover {

    background-color: var(--black);
    color: var(--white);

  }

  &.disabled {

    background-color: var(--gray-200);
    border-color: var(--gray-200);

    color: var(--gray-300);

  }

}

/* order */

.order { padding: 60px 0; }

.order-form { padding: 0 15px; }

.form-group {

  max-width: 365px;
  margin: 0 auto 15px; /* 上 左右 下 */

}

.form-label {

  display: block;
  margin-bottom: 6px;

}

.form-input {

  width: 100%; min-height: 38px;
  text-indent: 1px;

  border: 1px solid #CED4DA;
  border-radius: 5px;

  margin-right: 10px;

}

.form-input-wrap { position: relative; }

.message {

  white-space: no-wrap;
  color: #C72424;

  margin-top: 0.5rem;

}

.order-submit-btn {

  display: block;
  min-width: 255px; min-height: 48px;

  background-color: var(--black);
  color: var(--white);

  border: 0;
  cursor: pointer;
  border-radius: 5px;

  font-size: 1.25rem;

  margin: 50px auto 0;

  &:hover { background-color: var(--secondary); }

  &.disabled {

    pointer-events: none;
    cursor: wait;
    background-color: var(--gray-300);

  }

}

.info-generator {

  font-size: 1rem; font-weight: normal; text-align: center;
  
  margin-bottom: 30px;

}

.create-info-btn {

  display: inline-block;

  background-color: var(--black);
  color: var(--white);

  padding: 0.5rem;

  border: 0;
  cursor: pointer;
  border-radius: 5px;

  &:hover { background-color: var(--secondary); }
  
}
