@import url('https://fonts.googleapis.com/css2?family=Zen+Old+Mincho:wght@900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500&display=swap');

.item-link-list-wrapper {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

#page_item_link.common-style-area {

    a:hover {
        opacity: 0.6;
    }

    /* ====================================================
       買取品目リンク（anchor_link_wrap）
       ==================================================== */
    .anchor_link_wrap {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-top: 60px;
        padding: 10px 0;
        list-style: none;
        background: transparent;
    }

    .anchor_link_card {
        overflow: hidden;
        text-align: left;
        background: #fff;
        border: 2px solid #E60012;
        border-radius: 8px;
        box-shadow: none;

        > a {
            display: flex;
            align-items: stretch;
            justify-content: space-between;
            height: 100%;
            text-decoration: none;
        }

        span.anchor_link_category_name {
            width: auto;
            margin: 0;
            padding: 0;
            font-weight: 700;
            color: #333;
            --f-base: 14;
        }
    }

    /* --- 左側（画像とテキスト） --- */
    .anchor_link_info {
        display: flex;
        flex: 1;
        flex-direction: column;
        justify-content: center;
        padding: 15px;
    }

    .anchor_link_title_area {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 8px;
    }

    .anchor_link_category_img {
        width: clamp(32px, calc(100cqw * 70 / 375), 100px);
        height: auto;
        padding: 0;
        object-fit: contain;
    }

    .anchor_link_category_text {
        margin: 0;
        color: #555;
        line-height: 1.5;
    }

    /* --- 右側（赤背景と矢印） --- */
    .anchor_link_arrow_block {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 55px;
        background: linear-gradient(to right, #FF3242 0%, #E60012 100%);
    }

    .anchor_link_red_btn {
        width: 18px;
        height: auto;
        padding: 0;
        filter: brightness(0) invert(1);
    }

    /* ====================================================
       商品カテゴリ
       ==================================================== */
    .buy_goods_wrap {
        margin-top: 4em;
    }

    .buy_goods_category_block {
        margin-bottom: 6em;
    }

    .buy_goods_category_header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e0e0e0;
    }

    .buy_goods_category_name {
        margin: 0;
        padding: 0;
        font-weight: 700;
        color: #000;
        background: transparent;
    }

    .buy_goods_category_btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 25px;
        font-weight: 700;
        color: #fff;
        text-decoration: none;
        background: linear-gradient(to right, #FF3242 0%, #E60012 100%);
        border-radius: 6px;
        transition: opacity 0.3s ease;

        &:hover {
            opacity: 0.8;
        }
    }

    .buy_goods_category_arrow {
        width: 22px;
        height: auto;
        filter: brightness(0) invert(1);
        transform: rotate(-90deg);
    }

    .buy_goods_card_block {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .buy_goods_card {
        margin: 0;
        padding: 0;
        background-color: #fff;
        border: 2px solid #ccc;
        border-radius: 6px;
        transition: box-shadow 0.3s ease;

        &:hover {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        a {
            position: relative;
            display: flex;
            align-items: center;
            height: 100%;
            padding: 10px;
            gap: 15px;
            color: #333;
            text-decoration: none;
        }

        span.buy_goods_name {
            flex: 1;
            padding-right: 25px;
            font-weight: 700;
            line-height: 1.4;
            --f-base: 14;
        }
    }

    .buy_goods_img {
        width: clamp(45px, calc(100cqw * 60 / 375), 80px);
        height: auto;
        object-fit: contain;
    }

    .buy_goods_red_btn {
        position: absolute;
        right: 15px;
        width: 12px;
        height: auto;
        filter: invert(-14%) sepia(98%) saturate(7446%) hue-rotate(352deg) brightness(97%) contrast(106%);
    }

    /* --- タブナビゲーション --- */
    .buy_goods_tab_nav {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        width: 100%;
        gap: 2%;
        margin: 0 0 1.5em 0;
        padding: 2cqw;
        list-style: none;
    }

    .buy_goods_tab_item {
        display: flex;
        flex: 1 1 30%;
        align-items: center;
        justify-content: center;
        min-height: 15cqw;
        padding: 2cqw 1cqw;
        box-sizing: border-box;
        font-size: 4cqw;
        font-weight: 700;
        line-height: 1.3;
        color: #000;
        text-align: center;
        cursor: pointer;
        background: #E3E3E3;
        border-radius: 1cqw;
        transition: background-color 0.2s ease, color 0.2s ease;

        &.is-active {
            color: #fff;
            background: #E60012;
        }
    }

    .buy_goods_tab_content {
        display: none;
        animation: fadeIn 0.3s ease;

        &.is-active {
            display: block;
        }
    }

    .btn__wrapper__flex {
        display: flex;
        justify-content: center;

        .btn__wrap {
            margin: 0;
        }
    }

    /* ====================================================
       検索ボックス（app_top_search_box）
       ==================================================== */
    .search_section {
        margin-top: 40px;
        overflow: visible !important;

        .wd_predictive_dropdown {
            width: 100% !important;
        }
    }

    #app_top_search_box {
        form {
            display: flex;
            align-items: stretch;
            width: 100%;
            gap: 0 !important;
        }

        .search_box_wrap {
            box-sizing: border-box;
            width: 100%;
            max-width: 1170px;
            margin: 0 auto;
            padding: 30px 40px;
            background-color: #fff;
            border: 2px solid #E60012;
            border-radius: 12px;
        }

        .search_box_head {
            display: block;
            margin: 0 auto 20px;
            padding: 0;
            font-weight: 700;
            color: #333;
            text-align: center;
            letter-spacing: 0.05em;
            background-color: transparent;
            border-radius: 0;

            &::after {
                display: none;
            }
        }

        .search_box_placeholder {
            position: relative;
            display: block;
            flex: 1;
            box-sizing: border-box;
            height: 50px;
            margin: 0 !important;
            padding: 0 15px;
            color: #333;
            background-color: #fff;
            border: 1px solid #ccc !important;
            border-right: none !important;
            border-radius: 6px 0 0 6px !important;
            outline: none;

            &::placeholder {
                font-weight: normal;
                color: #999;
            }
        }

        .search_submit_btn {
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            width: 130px;
            height: auto;
            margin: 0 !important;
            padding: 0;
            gap: 8px;
            cursor: pointer;
            background: #E60012 !important;
            border: 1px solid #E60012 !important;
            border-radius: 0 6px 6px 0 !important;
            box-shadow: none !important;

            svg {
                width: 20px;
                height: 20px;
                transform: none;
            }
        }

        .search_submit_text {
            font-weight: 700;
            color: #fff;
            --f-base: 14 !important;
        }
    }

    /* ====================================================
       バナー（page-item-banner）
       ==================================================== */
    .page-item-banner {
        position: relative;
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px;

        .banner-img {
            display: block;
            width: 100%;
            height: auto;
        }

        .dynamic-text {
            position: absolute;
            z-index: 2;
            font-family: "Zen Old Mincho", serif;
            font-style: italic;
            font-weight: 900;
            line-height: 1;
            color: #B9010F;
            transform: translate(-50%, -50%);
        }

        .small-decimal {
            font-size: 0.7em;
        }

        .banner-annotation {
            position: absolute;
            bottom: 2%;
            left: 50%;
            z-index: 2;
            width: 95%;
            margin: 0;
            font-family: 'Zen Kaku Gothic New', sans-serif, 'Arial';
            font-weight: 500;
            color: #fff;
            text-align: center;
            transform: translateX(-50%);
        }

        .sp-only {
            display: none;
        }

        /* アノテーションバッジ */
        .badge-annotation {
            position: absolute;
            font-size: 0.25em;
            font-weight: 700;
            line-height: 1;
            color: #B9010F;
        }

        .badge-store {
            top: 1em;
            right: -2.3em;
        }

        .badge-review {
            top: 0;
            right: 0;
        }
    }

    /* ====================================================
       バナー上部（appeal_banner_link）
       ==================================================== */
    #appeal_banner_link {
        width: 100%;
        margin: 40px auto 30px;
        text-align: center;

        &::before {
            display: none !important;
            content: none !important;
        }

        .titleMain--main {
            position: relative;
            margin-bottom: 25px;
            padding-bottom: 30px;
            font-size: 2.7cqw !important;
            font-weight: 700;
            line-height: 1.8;
            color: #000;

            span {
                display: inline-block;
                margin-top: 20px;
                color: #000 !important;
                --f-base: 32;
            }

            &::after {
                position: absolute;
                bottom: 0;
                left: 50%;
                width: 250px;
                height: 5px;
                content: '';
                background-color: #E60012;
                border-radius: 5px;
                transform: translateX(-50%);
            }
        }

        .titleMain--lead {
            font-size: var(--font-s) !important;
            line-height: 1.8;
            color: #333;
            text-align: center !important;
        }
    }

    /* ====================================================
       取り扱いブランド一覧
       ==================================================== */
    .brand_list_section {
        margin-top: 40px;
        padding-top: 30px;
    }

    .brand_list_title {
        margin-bottom: 20px;
        font-weight: 700;
        color: #333;
        text-align: center;
    }

    .brand_list_tabs {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-bottom: 25px;
    }

    .brand_tab {
        min-width: 60px;
        padding: 8px 15px;
        font-weight: 700;
        color: #333;
        text-align: center;
        cursor: pointer;
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 4px;
        transition: all 0.2s ease;

        &.is-active {
            color: #fff;
            background: #E60012;
            border-color: #E60012;
        }
    }

    .brand_list_scroll_area {
        height: 350px;
        padding-right: 15px;
        overflow-y: auto;

        &::-webkit-scrollbar {
            width: 8px;
        }
        &::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }
        &::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }
    }

    .brand_list_items {
        display: none;
        grid-template-columns: repeat(2, 1fr);
        gap: 0 40px;
        margin: 0;
        padding: 0;
        list-style: none;

        &.is-active {
            display: grid;
            animation: fadeIn 0.3s ease;
        }

        li {
            border-bottom: 1px dashed #ccc;

            a {
                position: relative;
                display: flex;
                align-items: center;
                padding: 15px 30px 15px 0;
                color: #333;
                text-decoration: none;

                .brand_arrow_img {
                    right: 5px;
                }
            }
        }
    }

    .brand_name_box {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .brand_name_en {
        font-weight: 700;
        color: #000;
    }

    .brand_name_ja {
        color: #777;
    }

    /* ====================================================
       ブランド品：メインタブ切り替えUI
       ==================================================== */
    .brand_main_tabs {
        display: flex;
        justify-content: space-between;
        gap: 5px;
        margin: 0 auto 30px;
        padding: 8px;
        background-color: #e6e6e6;
        border-radius: 40px;
    }

    .brand_main_tab {
        flex: 1;
        padding: 12px 10px;
        font-weight: 700;
        color: #333;
        text-align: center;
        cursor: pointer;
        background: transparent;
        border: none;
        border-radius: 35px;
        transition: all 0.3s;

        &.is-active {
            color: #fff;
            background: linear-gradient(to right, #FF3242 0%, #E60012 100%);
        }

        .sp-br {
            display: none;
        }
    }

    .brand_main_content {
        display: none;
        animation: fadeIn 0.3s ease;

        &.is-active {
            display: block;
        }
    }

    /* ====================================================
       ブランド品：人気のモデル
       ==================================================== */
    .brand_model_group {
        margin-bottom: 40px;
    }

    .brand_model_header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
    }

    .brand_model_title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-weight: 700;
        color: #333;
    }

    .brand_model_red_bar {
        display: inline-block;
        width: 4px;
        height: 1.2em;
        background: linear-gradient(to right, #FF3242 0%, #E60012 100%);
    }

    .brand_model_link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 5px 15px;
        font-weight: 700;
        color: #fff;
        text-decoration: none;
        background: linear-gradient(to right, #FF3242 0%, #E60012 100%);
        border-radius: 4px;
        transition: opacity 0.3s ease;

        &:hover {
            opacity: 0.8;
        }
    }

    /* --- ユーティリティ --- */
    .btn_text_wrap {
        line-height: 1.4;
        text-align: center;
    }

    .inline_text {
        display: inline-block;
    }
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ====================================================
   メディアクエリ（PC/タブレット）
   ==================================================== */
@media (min-width: 768px) {
    #page_item_link.common-style-area {
        max-width: 100%;

        * {
            --f-cq-calc: calc(var(--f-base) * 0.12cqw) !important;
        }

        .item-link-list-wrapper {
            padding: 0 40px;
        }

        .page-item-banner {
            .dynamic-text {
                font-size: calc(var(--f-base) * 0.1cqw);
                --f-base: 40;
            }
            .banner-annotation {
                white-space: nowrap;
                --f-base: 8;
            }
        }

        .dynamic-store-count {
            top: 52%;
            left: 31%;
        }

        .dynamic-review-rate {
            top: 60%;
            left: 52.5%;
        }

        .buy_goods_img {
            width: 6cqw;
            max-width: none;
        }

        .buy_goods_card a {
            gap: 1.5cqw;
            padding: 0.8cqw;
        }
    }
}

/* ====================================================
   メディアクエリ（SP）
   ==================================================== */
@media screen and (max-width: 1200px) {
    #page_item_link.common-style-area .anchor_link_wrap {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767px) {
    #page_item_link.common-style-area {

        section {
            width: 100%;
            padding: 0;
            overflow: hidden;
        }

        .brand_main_tab .sp-br {
            display: block;
        }

        /* --- バナー関連 --- */
        .page-item-banner {
            .dynamic-text {
                font-size: calc(var(--f-base) * 0.1cqw);
                --f-base: 72;
            }
            .pc-only {
                display: none;
            }
            .sp-only {
                display: block;
            }
            .banner-annotation {
                bottom: 1%;
                width: 97.5%;
                font-size: 2vw;
                font-weight: 500;
                line-height: 1.2;
                color: #000;
                text-align: left;
                white-space: normal;
                text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff;
            }
        }

        .dynamic-store-count {
            top: 36%;
            left: 13%;
        }

        .dynamic-review-rate {
            top: 40%;
            left: 53%;
        }

        /* --- バナー上部見出し --- */
        #appeal_banner_link {
            margin: 30px auto 25px;
            padding: 0 10px;

            .titleMain--main {
                font-size: 3.7cqw !important;
                span {
                    margin-top: 8px;
                    --f-base: 24;
                }
                &::after {
                    width: 60%;
                }
            }

            .titleMain--lead {
                font-size: var(--font-s) !important;
                line-height: 2;
                text-align: center !important;
            }
        }

        /* --- ブランドメインタブ・モデルヘッダー --- */
        .brand_main_tab {
            padding: 10px 5px;
            --f-base: 10 !important;
        }

        .brand_model_header {
            justify-content: space-between;
            gap: 10px;
        }

        .brand_model_link {
            display: inline-flex;
            flex-shrink: 0;
            align-items: center;
            justify-content: flex-end;
            max-width: 160px;
            padding: 8px 12px;
            gap: 6px;
            line-height: 1.3;

            .btn_text_wrap {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                text-align: left;
            }

            &.is-long-text {
                padding: 8px 12px;
                --f-base: 10;
            }
        }

        /* --- 買取品目リンク --- */
        .anchor_link_wrap {
            gap: 8px;
            margin: 2cqw auto 0;
            padding: 0 10px;
        }

        .anchor_link_title_area {
            gap: 6px;
            margin-bottom: 5px;
        }

        .anchor_link_card span.anchor_link_category_name {
            font-size: var(--font-m) !important;
            line-height: 1.3;
        }

        .anchor_link_category_text {
            line-height: 1.3;
            --f-base: 7;
        }

        .anchor_link_category_img {
            width: clamp(32px, calc(100cqw * 70 / 375), 50px);
        }

        .anchor_link_arrow_block {
            width: 30px;
        }

        .anchor_link_red_btn {
            width: 10px;
        }

        .anchor_link_info {
            padding: 5px;
        }

        /* --- 検索ボックス --- */
        #app_top_search_box {
            margin-top: 25px;
            padding: 0 2.5%;

            form {
                width: 100%;
                margin: 0 auto;
            }
            .search_box_wrap {
                padding: 20px 10px;
                border-radius: 10px;
            }
            .search_box_head {
                width: 100%;
                margin: 0 auto 12px;
                letter-spacing: -0.02em;
                --f-base: 12;
            }
            .search_box_placeholder {
                --f-base: 14;
                &::placeholder {
                    color: #b3b3b3;
                    font-size: inherit;
                }
            }
            .search_submit_text {
                --f-base: 12;
            }
            .search_submit_btn {
                width: auto;
                padding: 0 5%;
            }
        }

        /* --- 商品カテゴリ・カード一覧 --- */
        .buy_goods_wrap {
            width: 95%;
            margin: 3em auto 0;
        }

        .buy_goods_category_block {
            margin-bottom: 4em;
        }

        .buy_goods_category_header {
            gap: 10px;
            margin-bottom: 15px;
            padding-bottom: 10px;
        }

        .buy_goods_category_btn {
            justify-content: flex-end;
            width: auto;
            padding: 8px 12px;
            gap: 6px;
            --f-base: 12;

            &.is-long-btn .btn_text_wrap {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                text-align: left;
            }
        }

        .buy_goods_card_block {
            grid-template-columns: repeat(1, 1fr);
            gap: 10px;
        }

        .buy_goods_card a {
            gap: 15px;
            padding: 5px 10px;
        }

        .buy_goods_red_btn {
            width: 8px;
        }

        /* --- 取り扱いブランド一覧 --- */
        .brand_list_items.is-active {
            grid-template-columns: 1fr;
        }

        .brand_list_tabs {
            gap: 5px;
        }

        .brand_tab {
            min-width: 50px;
            padding: 8px 10px;
        }

        /* --- ユーティリティ --- */
        .arrow_icon {
            --f-base: 12 !important;
        }

        .buy_goods_category_name {
            flex-shrink: 0;
            --f-base: 18;
        }

        .buy_goods_card span.buy_goods_name {
            --f-base: 14;
        }

        .brand_name_en {
            --f-base: 12;
        }

        .brand_model_title.is-long-text {
            --f-base: 14;
        }

        .buy_goods_category_arrow {
            width: 14px;
        }

        .btn_text_wrap {
            display: inline-block;
            line-height: 1.3;
            text-align: right;
        }
    }
}