/*
Theme Name: REHUB Child
Template: rehub_tcd099
Description: Child theme for REHUB with custom review button functionality
Version: 1.0
*/

.price-label{
    margin-bottom:10px !important;
    display:block;
    font-weight:bold;
}
/* レビューボタン上部・下部表示用のカスタムスタイル */
.p-single--review-button--top,
.p-single--review-button--bottom {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 20px 0;
    background: rgba(var(--tcd-bg-color, 245, 245, 245), 1);
    border: 1px solid #ddd;
    text-align: center;
}

.p-single--review-button--bottom {
    margin-top: 60px;
    margin-bottom: 20px;
}

/* 統合ボックスのスタイル */
.review-integrated-box {
    background: #fff;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
}

.review-box-title {
    text-align: center;
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.review-coupon-section,
.review-price-section {
    margin-bottom: 20px;
}

.review-button-section {
    text-align: center;
    margin-top: 25px;
}

/* エラー表示 */
.coupon-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.coupon-error p {
    margin: 0;
    font-weight: bold;
}

/* 価格表示の調整 */
.price-display-enhanced {
    /* background: #f8f9fa; */
    /* border: 1px solid #dee2e6;
    border-radius: 8px; */
    padding: 15px;
    margin: 0;
}

/* クーポンフォームの調整 */
.coupon-form-enhanced {
    /* background: #f8f9fa;
    border: 1px solid #dee2e6; */
    /* border-radius: 8px; */
    padding: 15px;
    margin: 0;
}

.p-single--review-button--top .c-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 400px;
    height: 70px;
    border-radius: 35px;
    background: #e74c3c;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 3em;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.p-single--review-button--top .c-button:hover {
    background: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* oldのsdgsテーマを参考にしたAmazonライクなボタンデザイン */
.cart_box a,
.cart_box a:hover,
.review-button-section a,
.review-button-section a:hover {
    display: block;
    margin: 10px auto;
    padding: 15px 20px;
    text-align: center;
    color: #000 !important;
    background: #FFD814;
    border: 1px solid #FCD200;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px 0 rgba(213,217,217,.5);
}

.cart_box a:hover,
.review-button-section a:hover {
    background: #F7CA00 !important;
    border-color: #F2C200;
    box-shadow: 0 4px 8px 0 rgba(213,217,217,.7);
    transform: translateY(-2px);
}

.cart_box a:active,
.review-button-section a:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px 0 rgba(213,217,217,.5);
}

/* 下部ボタンにも同じスタイルを適用 */
.p-single--review-button--bottom .c-button,
.p-single--review-button--bottom a {
    display: block;
    margin: 10px auto;
    padding: 15px 20px;
    text-align: center;
    color: #000 !important;
    background: #FFD814;
    border: 1px solid #FCD200;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px 0 rgba(213,217,217,.5);
}

.p-single--review-button--bottom .c-button:hover,
.p-single--review-button--bottom a:hover {
    background: #F7CA00 !important;
    border-color: #F2C200;
    box-shadow: 0 4px 8px 0 rgba(213,217,217,.7);
    transform: translateY(-2px);
}

/* モバイル対応 */
@media (max-width: 767px) {
    .p-single--review-button--top {
        width: calc(100% + 40px);
        margin-left: -20px;
        border-left: none;
        border-right: none;
        padding: 15px 0;
    }

    .p-single--review-button--top .c-button {
        min-width: 240px;
        height: 50px;
        font-size: 14px;
        border-radius: 50px;
    }
}

/* 上部ボタンと下部ボタンの統一（区別マークを削除） */
.p-single--review-button--top .c-button:before {
    content: "";
    margin-right: 0;
}

/* アニメーション効果 */
.p-single--review-button--top {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 統合レビューボタンエリアのスタイル */
.review-coupon-section {
    margin-bottom: 20px;
}

.review-price-section {
    margin-bottom: 20px;
}

/* レビューボタンエリア内のクーポンフォーム調整 */
.p-single--review-button--top .coupon-form-wrapper {
    margin: 0 0 20px 0;
    background: rgba(255, 255, 255, 0.8);
}

/* レビューボタンエリア内の価格表示調整 */
.p-single--review-button--top .sdgs-price-display {
    margin: 0 0 20px 0;
    background: rgba(255, 255, 255, 0.9);
}

/* 追加のカスタマイズ用クラス */
.review-button-highlight {
    position: relative;
    overflow: hidden;
}

.review-button-highlight:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.review-button-highlight:hover:before {
    left: 100%;
}

/* 統合エリアのモバイル対応 */
@media (max-width: 767px) {
    .p-single--review-button--top,
    .p-single--review-button--bottom {
        width: calc(100% + 40px);
        margin-left: -20px;
        border-left: none;
        border-right: none;
        padding: 15px 0;
    }

    .review-coupon-section,
    .review-price-section {
        margin-bottom: 15px;
    }

    .p-single--review-button--top .coupon-input-group {
        max-width: 100%;
    }

    .cart_box a,
    .review-button-section a,
    .p-single--review-button--bottom a {
        width: 90%;
        font-size: 16px;
        padding: 12px 15px;
    }
}

/* クーポンフォームのスタイル（oldのsdgsテーマ参考） */
.coupon-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.coupon-input {
    width: 200px;
    height: 30px;
    margin: 0;
    border: 1px solid #ccc;
    background: #fff;
    padding: 0 10px;
    box-shadow: 2px 2px 3px 0px #ddd inset;
    border-radius: 4px;
}

.coupon-submit-btn,
.coupon-delete-btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 0.7rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    cursor: pointer;
}

.coupon-submit-btn {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.coupon-submit-btn:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.coupon-delete-btn {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.coupon-delete-btn:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* 価格表示のスタイル（oldのsdgsテーマ参考） */
.price-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}
.price-value small{
    font-size:80% !important;
}

.price-before .price-value {
    text-decoration: line-through;
    color: #999;
    font-size: 16px;
}

.price-after .price-value {
    font-size: 110%;
    color: red;
    font-weight: bold;
}

.price-normal .price-value {
    font-size: 140%;
    color: #000;
    font-weight: bold;
}

.price-savings {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

.price-arrow {
    font-size: 18px;
    color: #666;
}

/* 現在適用中のクーポン表示 */
.current-coupon {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

.coupon-info {
    margin: 0 0 10px 0;
    color: #155724;
}

.coupon-label {
    font-weight: bold;
}

.coupon-code {
    font-family: monospace;
    /* background: #f8f9fa; */
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}

/* ヘッダーの企業コード入力フォーム */
.l-header__company-code {
    /* background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px; */
    padding: 8px 12px;
    margin: 0 15px;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
}

.l-header__company-code-form input {
    width: 200px;
    height: 32px;
    border: 1px solid #ccc;
    background: #fff;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 2px 2px 3px 0px #ddd inset;
}

.l-header__company-code-button button {
    background-color: #17a2b8;
    color: #fff;
    border: 1px solid #17a2b8;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.l-header__company-code-button button:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* ヘッダー企業コードフォームの統一デザイン */
.l-header__company-code {
    display: block !important;
    width: 100%;
    /* background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px; */
    padding: 8px;
    margin: 20px 0px;
}

.header-coupon-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.header-coupon-input {
    flex: 1;
    max-width: 200px;
    height: 30px !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    padding: 0 10px !important;
    box-shadow: 2px 2px 3px 0px #ddd inset !important;
    border-radius: 4px !important;
    font-size: 14px;
}

.header-coupon-submit-btn {
    color: #fff !important;
    background-color: #17a2b8 !important;
    border: 1px solid #17a2b8 !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.header-coupon-submit-btn:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
}

.header-current-coupon {
    text-align: center;
    font-size: 12px;
    color: #0073aa;
    line-height: 1.4;
}

.coupon-applied-label {
    font-weight: normal;
}

.coupon-applied-name {
    font-weight: bold;
    color: #0073aa;
}

.coupon-applied-code {
    font-family: monospace;
    /* background: #fff; */
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 11px;
}

.header-coupon-delete-btn {
    background: #dc3545 !important;
    color: #fff !important;
    border: 1px solid #dc3545 !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 11px;
    margin-left: 5px;
}

.header-coupon-delete-btn:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

/* レビューページの企業コードフォームをヘッダーと統一
.coupon-form-enhanced {
     background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin: 0;
} */

.coupon-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.coupon-input {
    flex: 1;
    max-width: 200px;
    height: 30px;
    margin: 0;
    border: 1px solid #ccc;
    background: #fff;
    padding: 0 10px;
    box-shadow: 2px 2px 3px 0px #ddd inset;
    border-radius: 4px;
}

.coupon-submit-btn {
    color: #fff;
    background-color: #17a2b8;
    border: 1px solid #17a2b8;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.coupon-submit-btn:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.coupon-delete-btn {
    background: #dc3545 !important;
    color: #fff !important;
    border: 1px solid #dc3545 !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 11px;
    margin-left: 5px;
}

.coupon-delete-btn:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* 現在適用中のクーポン表示の統一 */
.current-coupon {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.coupon-info {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 14px;
    display: inline;
}
.coupon-delete-form{
    display: inline;
}
.coupon-label {
    font-weight: normal;
}
/*
.coupon-code {
    font-family: monospace;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    font-size: 12px;
} */

/* PC表示 */
@media (min-width: 768px) {
    .l-header__company-code {
        display: block !important;
        width: auto;
        min-width: 280px;
        /* background: #f8f9fa;
        border: 1px solid #ddd; */
    }

    .header-coupon-input-group {
        justify-content: flex-start;
    }
}

.l-header__search-button--sp{
      display: none !important;
        visibility: hidden !important;
}
/* スマートフォン表示 */
@media (max-width: 767px) {
    /* 元の検索ボタンを完全に非表示 */
    .l-header__search-button--sp,
    #js-search-button--sp,
    .js-search-button--sp,
    [id*="search-button"],
    [class*="search-button"] {
        display: none !important;
        visibility: hidden !important;
    }

    .l-header__company-code {
        display: block !important;
        width: 100%;
        /* background: #f8f9fa;
        border: 1px solid #ddd; */
        margin: 5px 0;
    }

    .header-current-coupon {
        display: block !important;
        text-align: center;
        font-size: 12px;
        padding: 5px;
    }

    .header-coupon-input-group {
        display: flex !important;
        width: 100%;
    }

    .header-coupon-input {
        flex: 1 !important;
        max-width: none !important;
    }

    /* レビューページのフォームもスマートフォン対応 */
    .coupon-input-group {
        flex-direction: column;
        gap: 8px;
    }

    .coupon-input {
        max-width: none;
        width: 100%;
    }

    .coupon-submit-btn,
    .coupon-delete-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* PC表示時はモバイルボタンを非表示 */
@media (min-width: 768px) {
    .l-header__company-code-button--sp {
        display: none;
    }
}

/* ヘッダーの適用中企業コード表示 */
.header-current-coupon {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 0 15px;
    font-size: 14px;
    color: #0073aa;
}

.coupon-applied-label {
    font-weight: bold;
    margin-right: 5px;
}

.coupon-applied-name {
    color: #0073aa;
    margin-right: 5px;
}

.coupon-applied-code {
    font-family: monospace;
    /* background: #f8f9fa; */
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

/* .header-coupon-delete-btn {
    background-color: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
} */

.header-coupon-delete-btn:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* モバイル対応 - 適用中企業コード */
@media (max-width: 767px) {
    .header-current-coupon {
        background: #d4edda;
        border: 1px solid #c3e6cb;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 10px 0;
       padding: 8px 12px;

        border: none !important;
        font-size: 12px;
        text-align: center;
        gap: 5px;
        flex-wrap: wrap;
    }

    .coupon-applied-label,
    .coupon-applied-name,
    .coupon-applied-code {
        display: inline-block;
        margin: 1px;
        background: none;
        padding: 0;
    }

    .header-coupon-delete-btn {
        margin: 0;
        padding: 3px 6px;
        font-size: 10px;
        background-color: #6c757d;
        color: #fff;
        border: 1px solid #6c757d;
        border-radius: 3px;
    }
}

/* レビューカテゴリー・商品名の文字切れ対策 */
.review-title,
.review-category-title,
.product-title,
.review-item-title {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
}

/* レビューアーカイブページの商品名 */
.p-archive-review .p-archive-review__item-title,
.p-archive-review .p-archive-review__item-title a {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    display: block;
}

/* レビューカテゴリーページの商品名 */
.review-category .entry-title,
.review-category .entry-title a,
.taxonomy-review_tag .entry-title,
.taxonomy-review_tag .entry-title a {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

/* レビューループ内のタイトル */
.p-loop-review .p-loop-review__item-title,
.p-loop-review .p-loop-review__item-title a {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    height: auto;
    min-height: auto;
}

/* 一般的なタイトル要素の文字切れ対策 */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 特に長い商品名への対応 */
.review-product-name,
.product-name-long {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.5;
    max-width: 100%;
}

/* テーブル内のテキスト */
.p-single--review-table__cell {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* レビューアーカイブページの画像を正方形に表示 */
.p-archive--review-item__image {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* 正方形のアスペクト比 */
    overflow: hidden !important;
    height:100% !important;
    position: relative !important;
}

.p-archive--review-item__image-bg {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* aspect-ratioをサポートしていないブラウザ用のフォールバック */
@supports not (aspect-ratio: 1 / 1) {
    .p-archive--review-item__image {
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 100% !important; /* 正方形を作る */
    }

    .p-archive--review-item__image-bg {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* レビューカテゴリーラベルの位置調整 */
.p-archive--review-item__category {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 2 !important;
}

/* ホバーアニメーション調整 */
.p-archive--review-item__image .c-hover-animation__image {
    transition: transform 0.3s ease !important;
}

.p-archive--review-item__image:hover .c-hover-animation__image {
    transform: scale(1.05) !important;
}
