/* tein.com's cart in the theme's dark look (TEIN's WordPress site has no cart to copy): the header's cart button
   (cart.js), the cart panel every add opens (partials/cart_ui.html, cart_drawer.html) and the /cart page's table
   (cart_section.html) on the theme-black page. White on black, TEIN green (#006E3A, the theme's btn-primary) for
   the actions, the theme's .btn for the buttons. */
:root {
  --tc-green: #006E3A;
  --tc-green-light: #3fbf6f;
  --tc-line: #3a3a3a;
  --tc-muted: #a6a6a6;
  --tc-panel: #141414;
}

/* the header's cart button: hidden while the cart is empty, so the header stays the client's */
.tc-hcart { position: relative; display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.tc-hcart.is-empty, .tc-hcart-item:has(.tc-hcart.is-empty), .tc-hcart-sp:has(.tc-hcart.is-empty) { display: none !important; }
.tc-hcart svg { display: block; }
.tc-hcart__n {
  position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--tc-green-light); color: #000; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.tc-hcart__n:empty { display: none; }
.tc-hcart-sp { position: absolute; top: 50%; right: 112px; transform: translateY(-50%); z-index: 2; color: #fff; }

/* the panel */
.tc-cd-overlay { position: fixed; inset: 0; z-index: 9998; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .25s ease; }
.tc-cd-overlay.is-open { opacity: 1; }
.tc-cd {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9999; width: 420px; max-width: 100%;
  background: var(--tc-panel); color: #fff; border-left: 1px solid var(--tc-line); box-shadow: -8px 0 24px rgba(0, 0, 0, .5);
  transform: translateX(100%); transition: transform .25s ease;
  font-family: "Noto Sans JP", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic Pro", Meiryo, sans-serif;
}
.tc-cd.is-open { transform: none; }
.tc-cd[hidden] { display: none; } /* the theme's aside { display: block } would keep a closed panel's shadow on the page's right edge */
.tc-cd__body { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.tc-cd__body.htmx-request { opacity: .6; transition: opacity .2s; }
.tc-cd__head {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 20px;
  border-bottom: 3px solid var(--tc-green);
}
.tc-cd__title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.tc-cd__close { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 4px; }
.tc-cd__close:hover { color: var(--tc-green-light); }
.tc-cd__lines { flex: 1 0 auto; padding: 0 20px; }
.tc-cd__line { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--tc-line); }
.tc-cd__img { flex: 0 0 72px; height: 72px; background: #fff; display: flex; align-items: center; justify-content: center; }
.tc-cd__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tc-cd__info { flex: 1; min-width: 0; }
.tc-cd__row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.tc-cd__total { font-weight: 700; }
.tc-cd__foot { padding: 18px 20px 24px; border-top: 1px solid var(--tc-line); }
.tc-cd__foot .btn, .tc-cart__sum .btn { display: block; width: 100%; margin-top: 10px; padding: 14px 20px; }
.tc-cd__empty { padding: 40px 20px; text-align: center; }
.tc-cd__empty p { margin: 0 0 24px; }

/* a line's words, both places */
.tc-cd .tc-line__title, .tc-cart .tc-line__title { color: #fff; font-weight: 700; line-height: 1.4; text-decoration: none; }
.tc-cd .tc-line__title:hover, .tc-cart .tc-line__title:hover { color: var(--tc-green-light); text-decoration: underline; }
.tc-line__meta { margin: 4px 0 0; color: var(--tc-muted); font-size: 13px; }
.tc-line__flag { margin: 4px 0 0; color: #f99e18; font-size: 13px; font-weight: 700; }
.tc-line__remove {
  margin-top: 8px; padding: 0; background: none; border: 0; color: var(--tc-muted); font: inherit; font-size: 13px;
  text-decoration: underline; cursor: pointer;
}
.tc-line__remove:hover { color: #fff; }

/* the quantity stepper */
.tc-stepper { display: inline-flex; border: 1px solid #666; height: 36px; }
.tc-stepper button { width: 34px; font-family: inherit; background: #000; color: #fff; border: 0; font-size: 18px; cursor: pointer; }
.tc-stepper button:hover { background: var(--tc-green); }
.tc-stepper input {
  width: 46px; border: 0; border-left: 1px solid #666; border-right: 1px solid #666; background: #000; color: #fff;
  text-align: center; font-size: 15px; -moz-appearance: textfield; appearance: textfield;
}
.tc-stepper input::-webkit-inner-spin-button, .tc-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* the money */
.tc-sum { margin: 0; }
.tc-sum > div { display: flex; justify-content: space-between; padding: 4px 0; }
.tc-sum dt, .tc-sum dd { margin: 0; }
.tc-sum__total { margin-top: 6px; padding-top: 10px !important; border-top: 1px solid var(--tc-line); font-size: 18px; font-weight: 700; }
.tc-sum__total small { font-size: 12px; font-weight: 400; color: var(--tc-muted); }
.tc-sum__note { margin: 10px 0 0; color: var(--tc-muted); font-size: 13px; line-height: 1.5; }
.tc-sum__stub { color: #fff; }

/* the /cart page */
.page-cart .article-body .container { max-width: 1000px; }
.tc-cart { color: #fff; }
.tc-cart.htmx-request { opacity: .6; transition: opacity .2s; }
.tc-cart__error { margin: 0 0 20px; padding: 12px 16px; border: 1px solid #e33; color: #ff6b6b; }
.tc-cart__table { width: 100%; border-collapse: collapse; }
.tc-cart__table th {
  padding: 12px 10px; border-bottom: 2px solid var(--tc-green); color: #fff; font-size: 14px; font-weight: 700;
  letter-spacing: .08em; text-align: left; text-transform: uppercase;
}
.tc-cart__table th:nth-child(n+2), .tc-cart__table td:nth-child(n+3) { text-align: center; }
.tc-cart__table th:last-child, .tc-cart__table td:last-child { text-align: right; }
.tc-cart__table td { padding: 20px 10px; border-bottom: 1px solid var(--tc-line); vertical-align: middle; }
.tc-line__img { width: 120px; }
.tc-line__img a { display: flex; width: 100px; height: 100px; align-items: center; justify-content: center; background: #fff; }
.tc-line__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tc-line__total { font-weight: 700; white-space: nowrap; }
.tc-line__total s { display: block; color: var(--tc-muted); font-weight: 400; }
.tc-cart__foot { display: flex; justify-content: space-between; gap: 40px; margin-top: 40px; }
.tc-cart__note { flex: 1; max-width: 460px; }
.tc-cart__note label { display: block; margin-bottom: 8px; font-weight: 700; }
.tc-cart__note textarea { width: 100%; padding: 10px; background: #000; color: #fff; border: 1px solid #666; font: inherit; font-size: 14px; }
.tc-cart__note-status { min-height: 1.5em; margin-top: 4px; color: var(--tc-green-light); font-size: 13px; }
.tc-cart__sum { flex: 0 0 340px; }
.tc-cart__continue { display: block; margin-top: 18px; color: #fff; font-size: 14px; text-align: center; text-decoration: underline; }
.tc-cart__empty { padding: 40px 0 20px; text-align: center; }
.tc-cart__empty p { margin: 0 0 30px; font-size: 18px; }

@media screen and (max-width: 767px) {
  .tc-cart__table thead { display: none; }
  .tc-cart__table, .tc-cart__table tbody { display: block; }
  .tc-line { display: grid; grid-template-columns: 90px 1fr; column-gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--tc-line); }
  .tc-cart__table td { display: block; padding: 4px 0; border: 0; text-align: left !important; }
  .tc-line__img { grid-row: 1 / span 4; width: auto; }
  .tc-line__img a { width: 90px; height: 90px; }
  .tc-line__price::before, .tc-line__total::before { content: attr(data-label) ": "; color: var(--tc-muted); font-weight: 400; }
  .tc-line__total s { display: inline; }
  .tc-cart__foot { flex-direction: column; gap: 30px; margin-top: 30px; }
  .tc-cart__note { max-width: none; }
  .tc-cart__sum { flex: none; }
  .tc-cd { width: 100%; }
}
