@media (max-width: 1300px) {
    /* class.index.responsive.css 와 동일: 서브 헤더 상단 여백 (head.responsive 기본값 덮어씀) */
    body.sub-body {
        padding-top: 90px !important;
        margin-top: 0;
    }

    body.sub-body.hide-top-header {
        padding-top: 90px !important;
    }

    #sod_bsk {
        /* 하단 고정 결제바(#sod_bsk_footer)와 겹치지 않게 (cart.css padding-bottom 유지) */
        padding: 0 20px 100px;
    }

    #sod_bsk_footer .footer_wrapper {
        padding: 20px;
        gap: 24px;
    }

    #sod_bsk_footer .footer_right {
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    #sod_bsk {
        margin: 24px auto;
        /* 세로 스택 결제바 높이 + iOS safe-area */
        padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px));
    }

    .category_order_section {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .category_summary {
        justify-content: center;
        flex-wrap: wrap;
    }

    .category_order_btn {
        width: 100%;
    }

    /* cart.css와 동일: 반응형에서도 하단 고정 */
    #sod_bsk_footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: #fff;
        border-top: 1px solid #ddd;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #sod_bsk_footer .footer_wrapper {
        flex-direction: column;
        align-items: stretch;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }

    #sod_bsk_footer .footer_left,
    #sod_bsk_footer .footer_right,
    #sod_bsk_footer #sod_bsk_act {
        width: 100%;
        justify-content: flex-start;
    }

    /* 하단 좌측 액션: 작게·한 줄 */
    #sod_bsk_footer .footer_left {
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
    }

    #sod_bsk_footer .footer_left button {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* 반응형: 견적서출력은 데스크톱(1301px~)에서만 */
    #sod_bsk_footer .footer_left .quote_print_btn {
        display: none !important;
    }

    #sod_bsk_footer .footer_right {
        flex-direction: column;
        gap: 16px;
    }

    /* cart.css #sod_bsk_tot 의 flex-wrap:wrap 이 푸터에도 적용되어 합계 줄이 2행으로 갈라짐 → 한 줄 + 넘치면 가로 스크롤 */
    /* 481px~ : 가로 합계 줄 가운데 정렬 (480 이하는 아래 미디어쿼리에서 세로 스택) */
    #sod_bsk_footer #sod_bsk_tot {
        justify-content: center;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* 메인으로 · 주문하기 한 줄 (cart.css #sod_bsk_act flex-wrap 과 무관하게 푸터만 고정) */
    #sod_bsk_footer #sod_bsk_act {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap !important;
        gap: 8px;
        width: 100%;
        min-width: 0;
        justify-content: stretch;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn01,
    #sod_bsk_footer #sod_bsk_act .btn_submit {
        flex: 1 1 0;
        min-width: 0 !important;
        width: auto !important;
        max-width: none;
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn_submit {
        min-width: 0 !important;
    }
}

@media (max-width: 768px) {
    #sod_bsk {
        margin: 20px auto;
        padding: 0 14px calc(260px + env(safe-area-inset-bottom, 0px));
    }

    #sod_bsk .btn_cart_del {
        margin-top: 10px;
        padding: 12px 0;
    }

    #sod_bsk table {
        min-width: 100%;
    }

    .category_title {
        font-size: 15px;
    }

    #sod_bsk thead th,
    #sod_bsk tbody td {
        padding: 12px 8px;
        font-size: 13px;
    }

    #sod_bsk .td_prd {
        gap: 10px;
    }

    #sod_bsk .sod_img img {
        width: 64px;
        height: 64px;
    }

    #sod_bsk .prd_name {
        font-size: 14px;
    }

    #sod_bsk .sod_opt {
        font-size: 13px;
    }

    .summary_item {
        font-size: 13px;
    }

    .summary_value {
        font-size: 15px;
    }

    #sod_bsk_footer .footer_left {
        flex-wrap: nowrap;
        gap: 5px;
        min-width: 0;
    }

    #sod_bsk_footer .footer_left button {
        flex: 1 1 0;
        min-width: 0;
        padding: 9px 5px;
        font-size: 12px;
        white-space: nowrap;
    }

    #sod_bsk_footer #sod_bsk_tot {
        justify-content: center;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .tot_summary_item .tot_label,
    .tot_summary_item.total .tot_label {
        font-size: 14px;
    }

    .tot_summary_item .tot_value,
    .tot_summary_item.total .tot_value {
        font-size: 18px;
    }

    .tot_summary_item .tot_unit {
        font-size: 14px;
    }

    #sod_bsk_footer #sod_bsk_act {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap !important;
        gap: 8px;
        width: 100%;
        min-width: 0;
        justify-content: stretch;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn01,
    #sod_bsk_footer #sod_bsk_act .btn_submit {
        flex: 1 1 0;
        min-width: 0 !important;
        width: auto !important;
        max-width: none;
        padding: 11px 10px;
        font-size: 14px;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn_submit {
        min-width: 0 !important;
    }

    #sod_bsk table thead {
        display: none;
    }

    #sod_bsk table,
    #sod_bsk tbody,
    #sod_bsk tbody tr,
    #sod_bsk tbody td {
        display: block;
        width: 100%;
    }

    #sod_bsk tbody tr {
        border: 1px solid #e5e5e5;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 10px;
        background: #fff;
    }

    #sod_bsk tbody td {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 0;
    }

    #sod_bsk tbody td:last-child {
        border-bottom: 0;
    }

    #sod_bsk .td_chk {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    #sod_bsk .td_prd {
        display: flex;
        align-items: flex-start;
        text-align: left;
        padding-top: 6px;
    }

    #sod_bsk .td_num,
    #sod_bsk .td_numbig,
    #sod_bsk .td_dvr,
    #sod_bsk .td_del {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        text-align: right;
        width: 100%;
    }

    #sod_bsk .td_num::before {
        content: "수량";
        color: #666;
        font-weight: 500;
    }

    #sod_bsk .td_numbig:not(.text_right)::before {
        content: "판매가";
        color: #666;
        font-weight: 500;
    }

    #sod_bsk .td_dvr::before {
        content: "배송비";
        color: #666;
        font-weight: 500;
    }

    #sod_bsk .td_numbig.text_right::before {
        content: "소계";
        color: #666;
        font-weight: 500;
    }

    #sod_bsk .td_del::before {
        content: "삭제";
        color: #666;
        font-weight: 500;
    }

    #sod_bsk .td_del .sod_item_del_btn {
        width: 26px;
        height: 26px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #sod_bsk {
        /* 하단 고정바 높이 축소에 맞춤 */
        padding: 0 10px calc(230px + env(safe-area-inset-bottom, 0px));
    }

    #sod_bsk .btn_cart_del {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cart_select_text {
        font-size: 14px;
    }

    .category_order_section {
        padding: 14px 12px;
    }

    .category_summary {
        justify-content: flex-start;
        row-gap: 8px;
    }

    .summary_item {
        width: 100%;
        justify-content: space-between;
    }

    .summary_operator {
        display: none;
    }

    #sod_bsk_footer .footer_wrapper {
        padding: 8px 10px 10px;
        gap: 8px;
    }

    #sod_bsk_footer .footer_right {
        gap: 8px;
    }

    #sod_bsk_footer .footer_left {
        flex-wrap: nowrap;
        gap: 3px;
        min-width: 0;
    }

    #sod_bsk_footer .footer_left button {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 3px;
        font-size: 11px;
        white-space: nowrap;
    }

    #sod_bsk_footer #sod_bsk_tot {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .tot_summary_item {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        width: 100%;
        padding: 1px 0;
        gap: 6px;
        min-height: 0;
    }

    #sod_bsk_footer .tot_summary_item .tot_label,
    #sod_bsk_footer .tot_summary_item.total .tot_label {
        font-size: 12px;
        line-height: 1.2;
    }

    #sod_bsk_footer .tot_summary_item .tot_unit {
        font-size: 11px;
    }

    #sod_bsk_footer .tot_summary_item .tot_value,
    #sod_bsk_footer .tot_summary_item.total .tot_value {
        font-size: 15px;
        line-height: 1.2;
    }

    #sod_bsk_footer .tot_price_group {
        gap: 2px;
    }

    .tot_operator_wrapper {
        display: none;
    }

    #sod_bsk_footer #sod_bsk_act {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap !important;
        gap: 4px;
        width: 100%;
        min-width: 0;
        justify-content: stretch;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn01,
    #sod_bsk_footer #sod_bsk_act .btn_submit {
        flex: 1 1 0;
        min-width: 0 !important;
        width: auto !important;
        max-width: none;
        padding: 8px 6px;
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn_submit {
        min-width: 0 !important;
    }

    #sod_bsk tbody tr {
        padding: 8px;
        border-radius: 8px;
    }

    #sod_bsk .td_prd {
        gap: 8px;
    }

    #sod_bsk .sod_name {
        min-width: 0;
    }

    #sod_bsk .td_num::before,
    #sod_bsk .td_numbig:not(.text_right)::before,
    #sod_bsk .td_dvr::before,
    #sod_bsk .td_numbig.text_right::before,
    #sod_bsk .td_del::before {
        font-size: 12px;
    }
}

@media (max-width: 345px) {
    #sod_bsk {
        padding: 0 8px calc(250px + env(safe-area-inset-bottom, 0px));
    }

    .category_title {
        font-size: 14px;
    }

    #sod_bsk .sod_img img {
        width: 56px;
        height: 56px;
    }

    #sod_bsk .prd_name {
        font-size: 13px;
    }

    #sod_bsk .sod_opt {
        font-size: 12px;
    }

    .summary_label,
    .summary_value,
    .summary_value .won_unit {
        font-size: 12px;
    }

    #sod_bsk_footer .footer_wrapper {
        padding: 6px 8px 8px;
        gap: 6px;
    }

    #sod_bsk_footer .footer_right {
        gap: 6px;
    }

    #sod_bsk_footer .footer_left {
        gap: 2px;
    }

    #sod_bsk_footer .footer_left button {
        padding: 5px 2px;
        font-size: 10px;
    }

    #sod_bsk_footer #sod_bsk_tot {
        gap: 1px;
    }

    #sod_bsk_footer .tot_summary_item {
        padding: 0;
    }

    #sod_bsk_footer .tot_price_group {
        gap: 2px;
    }

    #sod_bsk_footer #sod_bsk_act {
        flex-direction: row;
        flex-wrap: nowrap !important;
        gap: 3px;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn01,
    #sod_bsk_footer #sod_bsk_act .btn_submit {
        flex: 1 1 0;
        min-width: 0 !important;
        width: auto !important;
        max-width: none;
        font-size: 12px;
        padding: 7px 4px;
        line-height: 1.2;
        white-space: nowrap;
        box-sizing: border-box;
    }

    #sod_bsk_footer #sod_bsk_act .btn_submit {
        min-width: 0 !important;
    }

    #sod_bsk_footer .tot_summary_item .tot_label,
    #sod_bsk_footer .tot_summary_item.total .tot_label {
        font-size: 11px;
    }

    #sod_bsk_footer .tot_summary_item .tot_unit {
        font-size: 10px;
    }

    #sod_bsk_footer .tot_summary_item .tot_value,
    #sod_bsk_footer .tot_summary_item.total .tot_value {
        font-size: 14px;
    }
}
