/*
Theme Name: astra_child
Template:   astra
*/

/* ==========================================================================
   1. WooCommerce 単品商品ページ設定
   ========================================================================== */

/* 1-1. 概要エリア（タイトル・カートボタン・商品情報表等）の左右余白 */
.woocommerce div.product div.summary,
.woocommerce div.product .entry-summary,
.woocommerce div.product {
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box;
}

/* 1-2. カートボタン下の「商品情報」属性テーブル（斜体を標準に修正） */
.custom-single-product-attributes {
    margin-top: 25px;
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.custom-single-product-attributes .custom-attr-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333333;
}

.custom-single-product-attributes table.shop_attributes {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    margin: 0;
}

.custom-single-product-attributes table.shop_attributes th {
    width: 35%;
    background-color: #f9f9f9;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: bold;
    border: 1px solid #e5e5e5;
    text-align: left;
    font-style: normal !important; /* 斜体を解除 */
}

.custom-single-product-attributes table.shop_attributes td,
.custom-single-product-attributes table.shop_attributes td p,
.custom-single-product-attributes table.shop_attributes td p i,
.custom-single-product-attributes table.shop_attributes td p em {
    padding: 8px 12px;
    font-size: 15px;
    font-style: normal !important; /* ★商品情報の文字の斜体を直す */
    border: 1px solid #e5e5e5;
    background-color: #ffffff;
    color: #333333;
}

.custom-single-product-attributes table.shop_attributes td p {
    margin: 0;
    padding: 0;
    border: none;
}

/* 1-3. 下部タブ切り替えの非表示 & Elementorコンテンツの全幅表示 */
.woocommerce div.product .woocommerce-tabs ul.tabs,
.woocommerce div.product .woocommerce-tabs .panel > h2:first-of-type {
    display: none !important;
}

.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .woocommerce-tabs .panel {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 20px !important;
}


/* ==========================================================================
   2. WooCommerce 関連商品エリア設定
   ========================================================================== */

/* 2-1. 関連商品エリア全体 */
.woocommerce section.related.products {
    margin-top: 50px;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box;
}

.woocommerce section.related.products > h2,
.woocommerce .related.products > h2 {
    font-size: 20px !important;
    font-weight: bold !important;
    margin-bottom: 20px !important;
}

/* 2-2. 関連商品リスト（基本：モバイル用） */
.woocommerce section.related.products ul.products,
.woocommerce .related.products ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: stretch !important;
}

.woocommerce section.related.products ul.products li.product,
.woocommerce .related.products ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    width: calc(50% - 6px) !important;
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
    float: none !important;
}

.woocommerce section.related.products ul.products li.product > a:first-of-type,
.woocommerce section.related.products ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce section.related.products ul.products li.product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 0 auto !important;
}

.woocommerce section.related.products ul.products li.product img,
.woocommerce .related.products ul.products li.product img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
}

/* 2-3. テキスト・ボタンサイズ */
.woocommerce section.related.products li.product .ast-woo-product-category,
.woocommerce section.related.products li.product .posted_in {
    font-size: 11px !important;
    color: #888888 !important;
    margin-bottom: 4px !important;
}

.woocommerce section.related.products li.product h2,
.woocommerce section.related.products li.product .woocommerce-loop-product__title {
    font-size: 13px !important;
    font-weight: bold !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
}

.woocommerce section.related.products li.product .price,
.woocommerce section.related.products li.product .price * {
    font-size: 14px !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
}

.woocommerce section.related.products li.product .button,
.woocommerce section.related.products li.product a.button {
    margin-top: auto !important;
    align-self: flex-start !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
}

/* 2-4. 関連商品リスト（PC表示用の上書き） */
@media (min-width: 769px) {
    .woocommerce section.related.products ul.products,
    .woocommerce .related.products ul.products {
        gap: 24px !important;
    }
    .woocommerce section.related.products ul.products li.product,
    .woocommerce .related.products ul.products li.product {
        width: 220px !important;
        margin-bottom: 30px !important;
    }
    .woocommerce section.related.products ul.products li.product img,
    .woocommerce .related.products ul.products li.product img {
        max-width: 190px !important;
    }
}


/* ==========================================================================
   3. 価格デザイン ＆ 配送エリア（重なり完全排除・Flexbox強制版）
   ========================================================================== */

/* 3-1. 通常の価格の後ろにのみ「（税込）」を表示 */
.woocommerce-Price-amount::after {
    content: "（税込）";
    font-size: 0.65em !important;
    font-weight: normal !important;
    color: #666666 !important;
    margin-left: 3px !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

/* 3-2. 配送（送料）部分の「（税込）」は完全削除 */
#shipping_method .woocommerce-Price-amount::after,
.woocommerce-shipping-totals .woocommerce-Price-amount::after,
.cart_totals .shipping .woocommerce-Price-amount::after,
.shop_table .shipping .woocommerce-Price-amount::after {
    content: "" !important;
    display: none !important;
}

/* 3-3. 配送ラジオボタンのラベル全体をFlexbox化（文字と金額を確実に隙間をあけて並べる） */
html body .woocommerce ul#shipping_method li label,
html body .woocommerce-page ul#shipping_method li label,
html body .shipping label,
html body table.shop_table tr.shipping td label {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    white-space: nowrap !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
    float: none !important;
}

/* 3-4. ラベル内の全子要素の絶対配置を解除し、金額に左マージン（8px）を付与 */
html body .woocommerce ul#shipping_method li label *,
html body .woocommerce-page ul#shipping_method li label *,
html body table.shop_table tr.shipping td label * {
    position: static !important;
    float: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

html body .woocommerce ul#shipping_method li label .amount,
html body .woocommerce-page ul#shipping_method li label .amount,
html body table.shop_table tr.shipping td label .amount,
html body table.shop_table tr.shipping td label .woocommerce-Price-amount {
    margin-left: 8px !important; /* 「クリックポスト」と「¥240」の間の隙間 */
    display: inline-block !important;
}

/* 3-5. WooCommerce標準の接尾辞との重複表示を非表示 */
html body .woocommerce-price-suffix {
    display: none !important;
}