/* checkout style */

/* グローバルスタイルの上書き */
.p-wc textarea {
  min-height: auto;
  padding: .75em 16px;
  border:1px solid hsla(0,0%,7%,.8);
  background: #fff;
}

.woocommerce-checkout .wp-block-woocommerce-checkout {
  padding-top: 0px;
}

/* 左カラム */
.woocommerce-checkout .wp-block-woocommerce-checkout .wc-block-components-checkout-step__heading {
  margin-block: 0 20px;
}

.wp-block-woocommerce-checkout .wc-block-components-title.wc-block-components-title {
  font-size: 24px;
  text-align: left;
  margin-top: var(--tcd-half-read);
}

.wp-block-woocommerce-checkout .wc-block-components-checkout-step__description {
  font-size: 16px;
  line-height: 2;
}

.wp-block-woocommerce-checkout .wc-block-components-checkout-step__description:has(+*) {
  margin-bottom: 30px;
}

.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
  font-size: 16px;
  color: #fff;
  background: var(--tcd-accent-color);
  height: 60px;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.wc-block-components-address-card__edit {
  white-space: nowrap;
}

.wc-block-components-checkout-return-to-cart-button {
  color: #000!important;
}

@media (any-hover: hover) {
  .wc-block-components-checkout-return-to-cart-button:hover {
    opacity: 0.7;
    text-decoration: none!important;
  }

  .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:hover {
    background: var(--tcd-accent-color-light);
  }
}

@container (max-width: 699px) {
  .wp-block-woocommerce-checkout .wc-block-components-sidebar {
    margin-block: 0px 36px;
  }

  .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
    margin-top: 0px;
  }

  .wp-block-woocommerce-checkout .wc-block-components-checkout-order-summary__title-icon {
    display: grid;
    margin-top: -2px;
    margin-left: 5px;
  }

  .woocommerce-checkout .wp-block-woocommerce-checkout .wc-block-components-checkout-step__heading {
    margin-bottom: 15px;
  }

  .wp-block-woocommerce-checkout .wc-block-components-title.wc-block-components-title {
    font-size: 20px;
  }

  .wp-block-woocommerce-checkout .wc-block-components-checkout-step__description:has(+*) {
    margin-bottom: 20px;
  }

  .woocommerce-checkout .wc-block-components-form .wc-block-components-text-input:only-child,
  .woocommerce-checkout .wc-block-components-text-input:only-child {
    margin-top: 1em;
  }

  .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
    height: 50px;
  }
}

/* 右カラム */
.wp-block-woocommerce-checkout .wc-block-components-sidebar {
  margin-top: 0px;
}

.wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-text {
  line-height: 1;
}

.wc-block-components-checkout-order-summary__content {
  margin-top: -16px;
}

.wc-block-checkout__sidebar .wc-block-components-order-summary .wc-block-components-order-summary-item {
  padding-top: 0px;
}

.wc-block-checkout__sidebar .wc-block-components-order-summary .wc-block-components-order-summary-item__image>img {
  height: 48px;
  object-fit: cover;
}

.wc-block-checkout__sidebar .wc-block-components-order-summary .wc-block-components-product-name {
  font-size: 16px;
  line-height: 1.4;
  margin-top: 0.3em;
}

.wc-block-checkout__sidebar .wc-block-components-order-summary .wc-block-components-order-summary-item__description p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  height: 1lh;
  overflow: hidden;
  word-break: break-all;
}

.wc-block-checkout__sidebar .wc-block-components-order-summary .wc-block-components-order-summary-item__individual-prices {
  line-height: 1;
}

.wc-block-checkout__sidebar .wc-block-components-product-details.wc-block-components-product-details {
  font-size: 14px;
  line-height: 1.8;
  margin-top: 0;
}

.wc-block-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button {
  color: #fff;
  background: #000;
  border-radius: 5px;
  height: 50px;
}

@container ((min-width: 700px)) {
  .wc-block-checkout__sidebar.is-sticky {
    top: calc(50px + var(--tcd-header-bar-height, 0px));
  }
}

@container (max-width: 699px) {

  .woocommerce-checkout .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-step__heading {
    margin-bottom: 30px;
  }

  .wc-block-components-order-summary .wc-block-components-order-summary-item__image>img {
    height: 48px;
    object-fit: cover;
  }

  .wc-block-components-order-summary-item__description .wc-block-components-product-name {
    font-size: 16px;
    margin-block: 0.3em 0px;
  }

  .wc-block-components-order-summary .wc-block-components-order-summary-item__individual-prices {
    line-height: 1;
  }

  .wc-block-components-order-summary .wc-block-components-order-summary-item__description p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    height: 1lh;
    overflow: hidden;
    word-break: break-all;
  }
}

/*
 * 注文完了画面
 */
.woocommerce-order {
  font-size: 16px;
  line-height: 2;
  text-align: center;
}

.woocommerce-order p:has(+ *) {
  margin-bottom: 40px;
}

.woocommerce ul.order_details {
  width: fit-content;
  padding: 20px 0px 20px 40px;
  margin-inline: auto;
  background: #f7f7f7;
}

.woocommerce-order :is(.woocommerce-order-details__title, .woocommerce-column__title) {
  font-size: 28px;
  margin-bottom: 40px;
}

.woocommerce-customer-details,
.woocommerce-order-details {
  margin-top: 60px;
}

.woocommerce .woocommerce-order table.shop_table {
  border: 1px solid #ddd;
  border-collapse: collapse;
}

.woocommerce .woocommerce-order table.shop_table th {
  background: #f9f9f9;
}

.woocommerce .woocommerce-order table.shop_table :is(th, td) {
  padding: calc(20px + var(--tcd-half-read)) 20px;
  font-size: 16px;
}

.woocommerce .woocommerce-order table.shop_table a {
  color: var(--tcd-accent-color);
}

.woocommerce .woocommerce-order table.shop_table .wc-item-meta {
  margin-top: 0px;
  padding-left: 0px;
}

.woocommerce .woocommerce-order .woocommerce-customer-details address {
  padding: 11px 20px;
  border: 1px solid #ddd;
}

.woocommerce .woocommerce-order .woocommerce-customer-details--phone {
  line-height: 1.8;
  margin-bottom: 7px;
}

.woocommerce .woocommerce-order .woocommerce-customer-details--email {
  line-height: 1.8;
}

@media (max-width: 767px) {
  .woocommerce ul.order_details {
    width: 100%;
    padding: 20px 25px;
  }

  .woocommerce-order :is(.woocommerce-order-details__title, .woocommerce-column__title) {
    font-size: 22px;
    margin-bottom: 30px;
  }

  .woocommerce-customer-details,
  .woocommerce-order-details {
    margin-top: 30px;
  }

  .woocommerce ul.order_details li {
    float: none;
    line-height: 1.8;
    border-right: none;
    border-bottom: 1px dashed #cfc8d8;
    padding-block: 0px 10px;
    margin-right: 0;
    margin-bottom: 14px;
  }

  .woocommerce ul.order_details li:last-child {
    padding-bottom: 0px;
    margin-bottom: 0px;
  }

  .woocommerce .woocommerce-order table.shop_table :is(th, td) {
    padding: calc(15px + var(--tcd-half-read)) 15px;
    font-size: 14px;
  }

  .woocommerce .woocommerce-order table.shop_table .woocommerce-table__product-total {
    white-space: nowrap;
  }
}

/* クラシック購入手続き */
.woocommerce-form-login-toggle,
.woocommerce-form-coupon-toggle {
  margin-bottom: 40px;
}

.woocommerce-checkout {
  font-size: 16px;
}

.woocommerce-checkout table.shop_table {
  border-collapse: collapse;
  border-spacing: 0;
  border-color: #ddd;
  border-radius: 0px;
}

.woocommerce-checkout table.shop_table thead th {
  font-weight: 600;
  background: #f9f9f9;
}

#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
  background: #f9f9f9;
}

#add_payment_method #payment div.payment_box,
.woocommerce-cart #payment div.payment_box,
.woocommerce-checkout #payment div.payment_box {
  background: #ebebeb;
}

#add_payment_method #payment div.payment_box::before,
.woocommerce-cart #payment div.payment_box::before,
.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: #ebebeb;
}

.woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before {
  background: transparent;
}

.woocommerce .form-row .button,
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
  color: #fff !important;
  background: var(--tcd-accent-color);
}

@media (max-width: 767px) {
  .woocommerce-checkout {
    font-size: 14px;
  }

  .woocommerce-additional-fields {
    margin-top: 40px;
  }

  .woocommerce #payment #place_order,
  .woocommerce-page #payment #place_order {
    margin-top: 20px;
    height: 45px;
  }
}