/* ============================================================
   カート・チェックアウト・注文完了
   Kiwada Theme
   ============================================================ */

/* ---- 共通ラッパー ---- */
.woocommerce-cart .site-main,
.woocommerce-checkout .site-main,
.woocommerce-order-received .site-main {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-px);
    padding-block: 4rem;
}

/* ---- WC notices ---- */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    list-style: none;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.woocommerce-message { background: #f0faf0; border-left: 3px solid #4caf50; }
.woocommerce-error   { background: #fff5f5; border-left: 3px solid #e53935; }
.woocommerce-info    { background: #f5f9ff; border-left: 3px solid #1e88e5; }
.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button {
    margin-left: auto;
    padding: 0.5rem 1.25rem;
    background: var(--color-foreground);
    color: var(--color-background);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ============================================================
   カートページ
   ============================================================ */
.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}
.woocommerce-cart-form__contents thead th {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-neutral-500);
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--color-neutral-200);
    text-align: left;
}
.woocommerce-cart-form__contents thead .product-price,
.woocommerce-cart-form__contents thead .product-subtotal,
.woocommerce-cart-form__contents thead .product-quantity { text-align: center; }

.woocommerce-cart-form__contents .cart_item td {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-neutral-100);
    vertical-align: middle;
}
.woocommerce-cart-form__contents .product-remove a {
    font-size: 1.25rem;
    color: var(--color-neutral-400);
    line-height: 1;
}
.woocommerce-cart-form__contents .product-remove a:hover { color: #e53935; }
.woocommerce-cart-form__contents .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}
.woocommerce-cart-form__contents .product-name {
    padding-left: 1rem;
}
.woocommerce-cart-form__contents .product-name a {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}
.woocommerce-cart-form__contents .product-name .variation {
    font-size: 0.75rem;
    color: var(--color-neutral-500);
    margin-top: 0.25rem;
}
.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
    font-size: 0.875rem;
    text-align: center;
}
.woocommerce-cart-form__contents .product-quantity { text-align: center; }
.woocommerce-cart-form__contents .product-quantity .qty {
    width: 4rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--color-neutral-300);
    text-align: center;
    font-family: inherit;
    font-size: 0.875rem;
}
.woocommerce-cart-form__cart-coupon {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.woocommerce-cart-form__cart-coupon #coupon_code {
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-neutral-300);
    font-family: inherit;
    font-size: 0.875rem;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}
.actions .button,
.woocommerce-cart-form__cart-coupon .button {
    padding: 0.625rem 1.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    font-family: inherit;
    background: var(--color-foreground);
    color: var(--color-background);
    border: none;
    cursor: pointer;
}
.actions .button:hover,
.woocommerce-cart-form__cart-coupon .button:hover { background: var(--color-neutral-700); }

/* カート合計 */
.cart-collaterals {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}
.cart_totals {
    width: 100%;
    max-width: 400px;
}
.cart_totals h2 {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-neutral-200);
}
.cart_totals .shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
.cart_totals .shop_table tr { border-bottom: 1px solid var(--color-neutral-100); }
.cart_totals .shop_table th,
.cart_totals .shop_table td {
    padding: 0.875rem 0;
    font-size: 0.875rem;
}
.cart_totals .shop_table th {
    font-weight: 400;
    color: var(--color-neutral-600);
    width: 50%;
}
.cart_totals .shop_table .order-total th,
.cart_totals .shop_table .order-total td {
    font-weight: 500;
    font-size: 1rem;
    border-bottom: none;
    padding-top: 1.25rem;
}
.wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--color-foreground);
    color: var(--color-background);
    text-align: center;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-base);
}
.wc-proceed-to-checkout .checkout-button:hover { background: var(--color-neutral-700); }

/* ============================================================
   チェックアウトページ
   ============================================================ */
.woocommerce-checkout .col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .woocommerce-checkout .col2-set { grid-template-columns: 1fr; }
}
.woocommerce-checkout h3 {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-neutral-200);
}
.woocommerce-checkout .form-row { margin-bottom: 1.25rem; }
.woocommerce-checkout .form-row label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--color-neutral-600);
    margin-bottom: 0.375rem;
}
.woocommerce-checkout .form-row label .required { color: #e53935; margin-left: 2px; }
.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row input[type="password"],
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-neutral-300);
    background: var(--color-background);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-foreground);
    outline: none;
    transition: border-color var(--transition-base);
    box-sizing: border-box;
}
.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus { border-color: var(--color-foreground); }

.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
    display: inline-block;
    width: calc(50% - 0.5rem);
    vertical-align: top;
}
.woocommerce-checkout .form-row-first { margin-right: 1rem; }

/* 注文確認テーブル */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}
.woocommerce-checkout-review-order-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    font-weight: 500;
    color: var(--color-neutral-500);
    text-transform: uppercase;
    padding: 0 0 0.875rem;
    border-bottom: 1px solid var(--color-neutral-200);
    text-align: left;
}
.woocommerce-checkout-review-order-table thead .product-total { text-align: right; }
.woocommerce-checkout-review-order-table .cart_item td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-neutral-100);
    vertical-align: middle;
}
.woocommerce-checkout-review-order-table .product-total { text-align: right; }
.woocommerce-checkout-review-order-table .cart-subtotal th,
.woocommerce-checkout-review-order-table .cart-subtotal td,
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    padding: 0.875rem 0;
    font-size: 0.875rem;
}
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-weight: 500;
    font-size: 1rem;
    border-top: 1px solid var(--color-neutral-200);
}
.woocommerce-checkout-review-order-table .order-total td { text-align: right; }

/* 支払い方法 */
#payment {
    background: #fafafa;
    padding: 2rem;
    margin-bottom: 2rem;
}
#payment ul.payment_methods {
    list-style: none;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-neutral-200);
    padding-bottom: 1.5rem;
}
#payment ul.payment_methods li {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
#payment ul.payment_methods li label { cursor: pointer; }
#payment .payment_box {
    background: white;
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-neutral-600);
    border: 1px solid var(--color-neutral-200);
}
#place_order {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--color-foreground);
    color: var(--color-background);
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color var(--transition-base);
}
#place_order:hover { background: var(--color-neutral-700); }

/* ============================================================
   注文完了ページ
   ============================================================ */
.woocommerce-order {
    max-width: 680px;
    margin-inline: auto;
}
.woocommerce-order p.woocommerce-thankyou-order-received {
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-neutral-200);
}
.woocommerce-thankyou-order-details {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: #fafafa;
}
@media (max-width: 480px) {
    .woocommerce-thankyou-order-details { grid-template-columns: 1fr; }
}
.woocommerce-thankyou-order-details li { font-size: 0.875rem; }
.woocommerce-thankyou-order-details li strong {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-neutral-500);
    margin-bottom: 0.25rem;
}
.woocommerce-order-details__title,
.woocommerce-customer-details .woocommerce-column__title {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-neutral-200);
}
.woocommerce-order-details .woocommerce-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2.5rem;
    font-size: 0.875rem;
}
.woocommerce-order-details .woocommerce-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    font-weight: 500;
    color: var(--color-neutral-500);
    text-transform: uppercase;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--color-neutral-200);
    text-align: left;
}
.woocommerce-order-details .woocommerce-table thead .product-total { text-align: right; }
.woocommerce-order-details .woocommerce-table td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-neutral-100);
}
.woocommerce-order-details .woocommerce-table .product-total { text-align: right; }
.woocommerce-order-details .woocommerce-table tfoot tr th,
.woocommerce-order-details .woocommerce-table tfoot tr td {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--color-neutral-100);
}
.woocommerce-order-details .woocommerce-table tfoot .order-total th,
.woocommerce-order-details .woocommerce-table tfoot .order-total td {
    font-weight: 500;
    font-size: 1rem;
    border-top: 1px solid var(--color-neutral-200);
    border-bottom: none;
}
.woocommerce-order-details .woocommerce-table tfoot td { text-align: right; }

.woocommerce-customer-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 600px) {
    .woocommerce-customer-details { grid-template-columns: 1fr; }
}
.woocommerce-customer-details address {
    font-style: normal;
    font-size: 0.875rem;
    line-height: 1.8;
    padding: 1.5rem;
    background: #fafafa;
}
