/* [pliki 테마] 장바구니 — 표준 마크업(sod_bsk) 리스타일 */

#sod_bsk { max-width: var(--max); margin: 0 auto; padding: 26px 20px 40px; }
#sod_bsk::before { content: '장바구니'; display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.8px; text-align: center; margin-bottom: 26px; }

#sod_bsk_list table { width: 100%; border-top: 2px solid #111; }
#sod_bsk_list thead th {
    padding: 13px 8px; font-size: 12px; color: #666; font-weight: 600;
    border-bottom: 1px solid var(--line); text-align: center;
}
#sod_bsk_list tbody td {
    padding: 18px 8px; border-bottom: 1px solid var(--line); font-size: 13px;
    text-align: center; vertical-align: middle;
}
#sod_bsk_list .sod_img img, #sod_bsk_list img { border-radius: 10px; background: var(--bg-thumb); }
#sod_bsk_list .sod_name, #sod_bsk_list td.td_prd { text-align: left; }
#sod_bsk_list a { font-weight: 600; }
#sod_bsk_list .sod_opt { color: var(--gray); font-size: 12px; margin-top: 4px; }
#sod_bsk_list .sod_opt li { padding: 2px 0; }
#sod_bsk_list .td_numbig, #sod_bsk_list .td_num { font-weight: 700; }

/* 수량 인풋/수정 버튼 */
#sod_bsk_list .frm_input { width: 52px; padding: 8px 0; text-align: center; margin: 0 auto; }
#sod_bsk_list .mod_options, #sod_bsk_list .sod_sel_del, #sod_bsk_list button {
    font-size: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
    margin: 2px;
}
#sod_bsk_list .mod_options:hover, #sod_bsk_list .sod_sel_del:hover { border-color: #111; }

/* 하단 액션/삭제 버튼 */
.btn_cart_del { display: flex; gap: 8px; margin: 14px 0 24px; }
.btn_cart_del button, .btn_cart_del a {
    padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: #fff;
}
.btn_cart_del button:hover { border-color: #111; }

/* 합계 박스 */
#sod_bsk #sod_bsk_tot {
    border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft);
    padding: 22px; margin: 0 0 18px;
}
#sod_bsk_tot ul { display: block; }
#sod_bsk_tot li { display: flex; align-items: baseline; gap: 2px; padding: 7px 0; font-size: 13px; }
#sod_bsk_tot li > span:first-child { margin-right: auto; }
#sod_bsk_tot .sod_bsk_cnt { border-top: 1px solid #ddd; margin-top: 10px; padding-top: 14px; font-size: 15px; font-weight: 800; }
#sod_bsk_tot .sod_bsk_cnt strong { color: var(--red); font-size: 20px; }

/* 주문 버튼 */
#sod_bsk_act { display: flex; gap: 10px; }
#sod_bsk_act .btn_submit {
    flex: 2; padding: 16px 0; background: #111; color: #fff; border: 0; border-radius: 12px;
    font-size: 16px; font-weight: 800; cursor: pointer;
}
#sod_bsk_act a, #sod_bsk_act button[type=button]:not(.btn_submit) {
    flex: 1; padding: 16px 0; border: 1px solid var(--line); border-radius: 12px; text-align: center;
    font-size: 14px; font-weight: 600; background: #fff; cursor: pointer;
}

/* 빈 장바구니 */
#sod_bsk .empty_list, #sod_bsk p { text-align: center; }
#sod_bsk .empty_list { padding: 80px 0; color: var(--gray); font-size: 14px; }

@media (max-width: 768px) {
    #sod_bsk { padding: 18px 14px 30px; }
    #sod_bsk::before { font-size: 19px; margin-bottom: 16px; }
    /* 모바일: 표를 카드처럼 — 헤더 숨기고 셀 재배치 */
    #sod_bsk_list thead { display: none; }
    #sod_bsk_list tbody tr { display: grid; grid-template-columns: 84px 1fr; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    #sod_bsk_list tbody td { display: block; border: 0; padding: 2px 0; text-align: left; }
    #sod_bsk_list tbody td:first-child { grid-row: 1 / span 5; }
    #sod_bsk_list img { width: 84px; height: 84px; object-fit: cover; }
    #sod_bsk_act { flex-direction: column-reverse; }
}

/* ── 선택사항수정 레이어 (#mod_option_frm) ─────────────
   마크업: h2 > form > section.option_wr(라벨+select)
   > #sit_sel_option(ul#sit_opt_added > li.sit_opt_list
     > .opt_name(.sit_opt_subj) + .opt_count(minus,input,plus,prc,del))
   > #sit_tot_price > .btn_confirm(확인/닫기) */
#mod_option_frm {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 220; width: min(440px, calc(100vw - 32px));
    background: #fff; border-radius: 16px; padding: 24px 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22); text-align: left;
}
#mod_option_frm h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 16px; text-align: left; }
#mod_option_frm .option_wr h3, #mod_option_frm #sit_sel_option h3 {
    font-size: 12px; font-weight: 700; color: #555; margin-bottom: 8px; text-align: left;
}
#mod_option_frm .get_item_options { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
#mod_option_frm .get_item_options label { font-size: 13px; font-weight: 600; min-width: 44px; }
#mod_option_frm .get_item_options span { flex: 1; }
#mod_option_frm select.it_option {
    width: 100%; padding: 12px 14px; border: 1.5px solid #e2e2e2; border-radius: 10px;
    font-size: 14px; background: #f2f3f5; color: #333;
}
/* 선택된 옵션 카드 — 상세 페이지와 동일 톤 */
#mod_option_frm .sit_opt_list {
    background: #f2f3f5; border-radius: 12px; padding: 14px; margin-bottom: 8px; border: 0;
}
#mod_option_frm .opt_name { margin-bottom: 10px; }
#mod_option_frm .sit_opt_subj { font-size: 13px; font-weight: 600; color: #222; }
#mod_option_frm .opt_count { display: flex; align-items: center; gap: 0; }
#mod_option_frm .opt_count .sit_qty_minus,
#mod_option_frm .opt_count .sit_qty_plus {
    width: 28px; height: 30px; border: 1px solid #ddd; background: #fff; color: #555;
    font-size: 11px; padding: 0; margin: 0;
}
#mod_option_frm .opt_count .sit_qty_minus { border-radius: 6px 0 0 6px; }
#mod_option_frm .opt_count .sit_qty_plus { border-radius: 0 6px 6px 0; }
#mod_option_frm .opt_count .num_input {
    width: 42px; height: 30px; text-align: center; border: 1px solid #ddd; border-left: 0; border-right: 0;
    font-size: 13px; font-weight: 600; margin: 0; padding: 0; background: #fff;
}
#mod_option_frm .opt_count .sit_opt_prc { margin-left: auto; font-size: 15px; font-weight: 800; color: #111; }
#mod_option_frm .opt_count .sit_opt_del { border: 0; background: none; color: #aaa; font-size: 14px; margin-left: 10px; padding: 4px; }
/* 총액 */
#mod_option_frm #sit_tot_price {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #111; margin-top: 14px; padding: 14px 2px 4px; font-size: 13px; font-weight: 700;
}
#mod_option_frm #sit_tot_price strong { font-size: 22px; font-weight: 900; color: var(--red); margin-left: auto; margin-right: 2px; }
/* 버튼 */
#mod_option_frm .btn_confirm { display: flex; gap: 8px; margin-top: 16px; }
#mod_option_frm .btn_submit {
    flex: 1; padding: 14px 0; background: #111; color: #fff; border: 0; border-radius: 10px;
    font-size: 15px; font-weight: 800; cursor: pointer;
}
/* 닫기 X — 우상단 */
#mod_option_frm #mod_option_close {
    position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
    border: 0; background: none; color: #999; font-size: 16px; cursor: pointer; padding: 0;
    flex: none;
}
/* 레이어 뒤 딤 */
#mod_option_frm::before { content: none; }

/* 장바구니 행 디테일 */
#sod_bsk_list .sod_img img, #sod_bsk_list td img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
#sod_bsk_list .mod_options { margin-top: 8px; }
#sod_bsk_list .sod_opt { margin-top: 6px; }
/* 장바구니 페이지에서는 order.css의 '주문내역' 의사 제목 숨김 */
#sod_bsk .tbl_head03::before { display: none; }
#sod_bsk .tbl_head03 { padding: 0; }

/* ══ 장바구니 재설계: 좌측 목록 + 우측 요약(sticky) ══ */
#sod_bsk::before { text-align: left; font-size: 22px; margin-bottom: 18px; }
#sod_bsk_list { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 28px; align-items: start; }
#sod_bsk_list > .tbl_wrap { grid-column: 1; }
#sod_bsk_list > .btn_cart_del { grid-column: 1; margin: 12px 0 0; }
#sod_bsk_list > #sod_bsk_tot { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; margin: 0; }
#sod_bsk_list > #sod_bsk_act { grid-column: 2; grid-row: 3; position: sticky; top: 300px; flex-direction: column-reverse; gap: 8px; }
#sod_bsk_list > #sod_bsk_act .btn_submit { width: 100%; }
#sod_bsk_list > #sod_bsk_act a { width: 100%; }
/* 표 → 행 카드: 체크 | 상품 | 수량 | 배송비 | 소계 (판매가·포인트 숨김) */
#sod_bsk_list table { border-top: 1px solid #111; }
#sod_bsk_list thead th:nth-child(4), #sod_bsk_list thead th:nth-child(5), #sod_bsk_list tbody td:nth-child(4), #sod_bsk_list tbody td:nth-child(5) { display: none; }
#sod_bsk_list thead th { font-size: 12px; padding: 12px 6px; background: #fafafa; }
#sod_bsk_list tbody td { padding: 18px 6px; }
#sod_bsk_list td.td_prd, #sod_bsk_list tbody td:nth-child(2) { display: flex; align-items: center; gap: 14px; text-align: left; }
#sod_bsk_list .sod_img img, #sod_bsk_list tbody td:nth-child(2) img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
#sod_bsk_list .sod_name, #sod_bsk_list tbody td:nth-child(2) > div:not(.sod_img) { min-width: 0; }
#sod_bsk_list .sod_name a, #sod_bsk_list tbody td:nth-child(2) a { font-size: 14px; color: #111; }
#sod_bsk_list .sod_opt { margin-top: 3px; }
#sod_bsk_list .sod_option_btn { margin-top: 8px; }
#sod_bsk_list .mod_options { font-size: 12px; padding: 6px 10px; border-radius: 999px; color: #444; }
#sod_bsk_list .td_numbig:last-child { font-size: 15px; font-weight: 800; }
#sod_bsk_list .chk_box input { width: 16px; height: 16px; accent-color: #111; }
#sod_bsk #sod_bsk_tot { padding: 20px; }
#sod_bsk #sod_bsk_tot::before { content: '주문 예상 금액'; display: block; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.btn_cart_del button { font-size: 12.5px; padding: 8px 12px; border-radius: 999px; }
@media (max-width: 1024px) {
    #sod_bsk_list { grid-template-columns: 1fr; }
    #sod_bsk_list > #sod_bsk_tot, #sod_bsk_list > #sod_bsk_act { grid-column: 1; grid-row: auto; position: static; }
    #sod_bsk_list > #sod_bsk_tot { margin-top: 18px; }
    #sod_bsk_list > #sod_bsk_act { margin-top: 10px; }
}
@media (max-width: 768px) {
    #sod_bsk_list tbody tr { grid-template-columns: 1fr; }
    #sod_bsk_list tbody td:first-child { grid-row: auto; }
    #sod_bsk_list tbody td:nth-child(2) { display: flex; }
    #sod_bsk_list tbody td:nth-child(3)::before { content: '수량 '; color: var(--gray); }
    #sod_bsk_list tbody td:nth-child(6)::before { content: '배송비 '; color: var(--gray); }
    #sod_bsk_list tbody td:nth-child(7)::before { content: '소계 '; color: var(--gray); font-weight: 400; }
    #sod_bsk_list tbody td:nth-child(7) { text-align: right; }
}
/* 장바구니 표는 전역 min-width(주문내역 목록용) 제외 */
#sod_bsk .tbl_wrap { overflow: visible; }
#sod_bsk .tbl_wrap > table { min-width: 0 !important; }
/* 우측 컬럼 래퍼 기준으로 재배치 */
#sod_bsk_list { grid-template-columns: minmax(0, 1fr) 340px; }
#sod_bsk_list > .pk-cart-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; }
#sod_bsk_list > .pk-cart-side #sod_bsk_tot, #sod_bsk_list > .pk-cart-side #sod_bsk_act { position: static; margin: 0; grid-column: auto; grid-row: auto; }
#sod_bsk .tbl_wrap, #sod_bsk .tbl_head03 { width: 100%; max-width: none; margin: 0; padding: 0; }
#sod_bsk .tbl_wrap > table { width: 100% !important; }
@media (max-width: 1024px) { #sod_bsk_list > .pk-cart-side { grid-column: 1; grid-row: auto; position: static; margin-top: 18px; } }

/* [pliki 테마] 모바일: 2단 그리드 해제 + 상품행 카드형 (PC 규칙이 미디어쿼리 뒤에 있어 여기서 재정의) */
@media (max-width: 768px) {
    #sod_bsk_list { display: block; }
    #sod_bsk_list > .tbl_wrap, #sod_bsk_list > .btn_cart_del { width: 100%; }
    .pk-cart-side { display: block; width: 100%; }
    .pk-cart-side #sod_bsk_tot, #sod_bsk_list > #sod_bsk_tot { position: static; margin: 16px 0 0; border-radius: 12px; }
    .pk-cart-side #sod_bsk_act, #sod_bsk_list > #sod_bsk_act { position: static; margin-top: 12px; }
    #sod_bsk_act .btn_submit, #sod_bsk_act a { width: 100%; text-align: center; display: block; }
    #sod_bsk_list tbody tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
    #sod_bsk_list tbody td { display: block; border: 0; padding: 0; text-align: left; }
    #sod_bsk_list td.td_chk { flex: 0 0 26px; padding-top: 32px; }
    #sod_bsk_list td.td_prd { flex: 0 0 calc(100% - 26px); min-width: 0; display: flex; gap: 12px; align-items: flex-start; }
    #sod_bsk_list td.td_prd .sod_img, #sod_bsk_list td.td_prd > a:first-child { flex: 0 0 84px; }
    #sod_bsk_list td.td_prd .sod_name { flex: 1; min-width: 0; }
    #sod_bsk_list .sod_name a { font-size: 14px; display: block; }
    #sod_bsk_list .sod_opt { font-size: 12px; }
    #sod_bsk_list td.td_numbig:not(.text_right) { display: none; }
    #sod_bsk_list td.td_num, #sod_bsk_list td.td_dvr { flex: 0 0 auto; margin: 10px 14px 0 122px; font-size: 13px; color: #444; }
    #sod_bsk_list td.td_num { margin-left: 122px; }
    #sod_bsk_list td.td_dvr { margin-left: 0; }
    #sod_bsk_list td.td_num::before { content: '수량 '; color: var(--gray); }
    #sod_bsk_list td.td_dvr::before { content: '배송비 '; color: var(--gray); }
    #sod_bsk_list td.td_numbig.text_right { flex: 1; margin-top: 10px; text-align: right; font-size: 16px; font-weight: 800; color: #111; }
    #sod_bsk_list td.td_numbig.text_right::after { content: '원'; font-size: 12px; font-weight: 500; }
}
