/* === BEAN 테마 변수 폴백 (스탠드얼론 = 빈 레이아웃 미사용) ===
   빈 레이아웃 사용 시 #bean_root .bean_theme-* 가 더 가까운 조상이라 자동 종속.
   기본 라이트(2차) / 라이믹스 다크모드(body.color_scheme_dark) = 다크(1차).
   배경색 버튼 가독성: --bean-onaccent = #fff (흰 글씨). */
:root{
  --bean-bg:#ffffff;--bean-card:#ffffff;--bean-surf:#eef2fb;--bean-line:#dde6f5;
  --bean-text:#1f2733;--bean-muted:#64748b;
  --bean-accent:#3b6ef0;--bean-accent2:#2554c8;--bean-onaccent:#ffffff;
}
body.color_scheme_dark{
  --bean-bg:#0f1115;--bean-card:#171a21;--bean-surf:#1e222b;--bean-line:#2c313c;
  --bean-text:#e8eaed;--bean-muted:#9aa0aa;
  --bean-accent:#3b6ef0;--bean-accent2:#2554c8;--bean-onaccent:#ffffff;
}

/* Bean Shopping — 상품 상세 페이지 (BEAN 테마) */
/* 모든 색상은 --bean-* 변수에서 파생 */

.bshop_product_detail_container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    color: var(--bean-text);
}

.bshop_product_detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    background: var(--bean-card);
    border: 1px solid var(--bean-line);
    border-radius: 14px;
    padding: 36px;
}

.bshop_product_images {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* 메인 영역: 래퍼가 박스 모양 담당, 내부 img/video 는 채우기만 */
.bshop_main_image_wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 16px;
    border: 1px solid var(--bean-line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bean-surf);
}
.bshop_main_image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 0;
    margin: 0;
    background: transparent;
}
img.bshop_main_image { object-fit: cover; }
video.bshop_main_image { object-fit: contain; background: #000; }
.bshop_main_image_wrapper[data-media-type="video"] { background: #000; }

.bshop_zoom_hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: color-mix(in srgb, var(--bean-bg) 78%, transparent);
    color: var(--bean-text);
    border: 1px solid var(--bean-line);
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    pointer-events: none;
}

.bshop_sub_images {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.bshop_sub_image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border: 1px solid var(--bean-line);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.bshop_sub_image:hover,
.bshop_sub_image.active {
    border-color: var(--bean-accent);
}

/* 영상 썸네일 */
.bshop_sub_video {
    position: relative;
    display: block;
    overflow: hidden;
    background: #000;
}
.bshop_sub_video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    background: #000;
}
.bshop_sub_video_badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: color-mix(in srgb, #000 70%, transparent);
    color: #fff;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.3;
    pointer-events: none;
    z-index: 1;
}

.bshop_product_info {
    padding: 0;
}

/* 뱃지 */
.bshop_product_badges_detail {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.bshop_badge_detail {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid var(--bean-line);
    background: var(--bean-surf);
    color: var(--bean-muted);
}

/* 뱃지: 테마와 무관한 의미별 고정색 (솔리드 + 흰 글씨) */
.bshop_badge_detail.selling       { background:#16a34a; color:#fff; border-color:transparent; } /* 판매중=초록 */
.bshop_badge_detail.soldout       { background:#64748b; color:#fff; border-color:transparent; } /* 품절=회색 */
.bshop_badge_detail.discount      { background:#dc2626; color:#fff; border-color:transparent; } /* 할인중=빨강 */
.bshop_badge_detail.new           { background:#2563eb; color:#fff; border-color:transparent; } /* 신상품=파랑 */
.bshop_badge_detail.hot           { background:#db2777; color:#fff; border-color:transparent; } /* 인기=핑크 */
.bshop_badge_detail.best          { background:#b45309; color:#fff; border-color:transparent; } /* 베스트=골드 */
.bshop_badge_detail.limited       { background:#7c3aed; color:#fff; border-color:transparent; } /* 한정판=보라 */
.bshop_badge_detail.event         { background:#ea580c; color:#fff; border-color:transparent; } /* 이벤트=주황 */
.bshop_badge_detail.discount_rate { background:#e11d48; color:#fff; border-color:transparent; } /* % OFF=크림슨 */

.bshop_product_title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--bean-text);
    padding-bottom: 18px;
    border-bottom: 1px solid var(--bean-line);
    line-height: 1.35;
}

.bshop_price_section {
    margin-bottom: 26px;
    padding: 20px;
    background: var(--bean-surf);
    border: 1px solid var(--bean-line);
    border-radius: 12px;
}

.bshop_price_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.bshop_price_row:last-child { margin-bottom: 0; }

.bshop_price_label {
    font-size: 15px;
    color: var(--bean-muted);
}

.bshop_original_price {
    font-size: 17px;
    color: var(--bean-muted);
    text-decoration: line-through;
}

.bshop_sale_price {
    font-size: 23px;
    font-weight: 800;
    color: var(--bean-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bshop_discount_rate {
    display: inline-block;
    background: #e11d48; /* % OFF = 크림슨 (의미별 고정색) */
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.bshop_shipping_fee {
    font-size: 16px;
    color: var(--bean-text);
    font-weight: 600;
}

.bshop_shipping_fee .free-shipping {
    color: var(--bean-accent);
    font-weight: 700;
}

.bshop_options_section,
.bshop_quantity_section {
    margin-bottom: 24px;
}

.bshop_options_title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--bean-text);
}

.bshop_option_select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bean-line) !important;
    border-radius: 9px !important;
    font-size: 14px;
    background: var(--bean-surf);
    color: var(--bean-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.bshop_option_select:hover,
.bshop_option_select:focus {
    border-color: var(--bean-accent) !important;
    outline: none;
}

.bshop_quantity_control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--bean-line);
    border-radius: 9px;
    overflow: hidden;
}

.bshop_quantity_btn {
    width: 38px;
    height: 38px;
    border: none !important;
    border-radius: 0 !important;
    background: var(--bean-surf);
    cursor: pointer;
    font-size: 18px;
    color: var(--bean-text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bshop_quantity_btn:hover {
    background: color-mix(in srgb, var(--bean-accent) 14%, var(--bean-surf));
    color: var(--bean-accent);
}

.bshop_quantity_input {
    width: 60px;
    height: 38px;
    text-align: center;
    border: none !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--bean-line) !important;
    border-right: 1px solid var(--bean-line) !important;
    font-size: 14px;
    background: var(--bean-card);
    color: var(--bean-text);
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 좌우에 -+ 버튼이 따로 있으므로 number input 의 기본 스피너(상하 화살표) 제거 */
.bshop_quantity_input::-webkit-outer-spin-button,
.bshop_quantity_input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bshop_quantity_section input[type="number"] {
    border: none !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--bean-line) !important;
    border-right: 1px solid var(--bean-line) !important;
    -moz-appearance: textfield;
    appearance: textfield;
}
.bshop_quantity_section input[type="number"]::-webkit-outer-spin-button,
.bshop_quantity_section input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 최종 결제가격 박스 */
.bshop_total_price {
    padding: 18px 20px;
    background: var(--bean-surf);
    border: 1px solid var(--bean-line);
    border-radius: 12px;
}
.bshop_total_price_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    font-weight: 800;
    color: var(--bean-text);
}
.bshop_total_price_value {
    color: var(--bean-accent);
    font-size: 23px;
}
.bshop_total_price_details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--bean-line);
    font-size: 13.5px;
    color: var(--bean-muted);
}
.bshop_total_price_details > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.bshop_action_buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 상세 페이지 버튼 (그리드 안에서만 적용 — bshop_unified 와 충돌 방지) */
.bshop_product_detail_container .bshop_btn {
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.bshop_product_detail_container .bshop_btn_primary {
    flex: 2;
    background: var(--bean-accent);
    color: var(--bean-onaccent);
}
.bshop_product_detail_container .bshop_btn_primary:hover {
    background: var(--bean-accent2);
}

.bshop_product_detail_container .bshop_btn_secondary {
    flex: 1;
    background: none;
    color: var(--bean-text);
    border-color: var(--bean-text);
}
.bshop_product_detail_container .bshop_btn_secondary:hover {
    border-color: var(--bean-accent);
    color: var(--bean-accent);
}

.bshop_product_detail_container .bshop_btn_outline {
    flex: 1;
    background: var(--bean-surf);
    color: var(--bean-muted);
    border-color: var(--bean-line);
}
.bshop_product_detail_container .bshop_btn_outline:hover {
    border-color: var(--bean-accent);
    color: var(--bean-accent);
}

.bshop_product_content {
    margin-top: 50px;
    padding: 36px;
    background: var(--bean-card);
    border: 1px solid var(--bean-line);
    border-radius: 14px;
}

.bshop_content_title {
    font-size: 19px;
    font-weight: 800;
    color: var(--bean-text);
    margin-bottom: 26px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bean-accent);
}

.bshop_content_body {
    line-height: 1.8;
    color: var(--bean-text);
    font-size: 15px;
}

/* 하단 고정 버튼 */
.bshop_fixed_bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bean-card);
    border-top: 1px solid var(--bean-line);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.28);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.bshop_fixed_bottom.show {
    transform: translateY(0);
}

.bshop_fixed_inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.bshop_fixed_btn {
    padding: 14px 12px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.bshop_fixed_btn.bshop_btn_primary {
    flex: 2;
    background: var(--bean-accent);
    color: var(--bean-onaccent);
}
.bshop_fixed_btn.bshop_btn_primary:hover {
    background: var(--bean-accent2);
}

.bshop_fixed_btn.bshop_btn_secondary {
    flex: 1;
    background: none;
    color: var(--bean-text);
    border-color: var(--bean-text);
}
.bshop_fixed_btn.bshop_btn_secondary:hover {
    border-color: var(--bean-accent);
    color: var(--bean-accent);
}

.bshop_fixed_btn.bshop_btn_outline {
    flex: 1;
    background: var(--bean-surf);
    color: var(--bean-muted);
    border-color: var(--bean-line);
}
.bshop_fixed_btn.bshop_btn_outline:hover {
    border-color: var(--bean-accent);
    color: var(--bean-accent);
}

/* 탭 메뉴 */
.bshop_product_tabs {
    margin-top: 50px;
    background: var(--bean-card);
    border: 1px solid var(--bean-line);
    border-radius: 14px;
    overflow: hidden;
}

.bshop_tab_menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--bean-line);
}

.bshop_tab_menu li {
    flex: 1;
    text-align: center;
    padding: 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--bean-muted);
    transition: all 0.2s;
    position: relative;
    background: var(--bean-surf);
    border-right: 1px solid var(--bean-line);
}

.bshop_tab_menu li:last-child {
    border-right: none;
}

.bshop_tab_menu li:hover {
    color: var(--bean-text);
    background: var(--bean-card);
}

.bshop_tab_menu li.active {
    color: var(--bean-text);
    background: var(--bean-card);
    font-weight: 800;
}

.bshop_tab_menu li.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bean-accent);
}

.bshop_tab_content {
    padding: 36px;
    background: var(--bean-card);
    min-height: 300px;
}

.bshop_tab_panel {
    display: none;
}

.bshop_tab_panel.active {
    display: block;
    animation: bshopDetailFade 0.3s;
}

@keyframes bshopDetailFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bshop_no_content {
    text-align: center;
    padding: 60px 20px;
    color: var(--bean-muted);
}

.bshop_no_content p {
    font-size: 15px;
    margin: 0;
}

/* 인라인 스타일을 직접 갖는 보조 버튼 (리뷰/문의 모달 등) — 폰트/박스 정규화용 훅 */
.bean_bshop_ibtn {
    font-family: inherit;
    box-sizing: border-box;
    border-radius: 999px;
}

/* 이미지 확대 모달 */
.bshop_image_modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: color-mix(in srgb, #000 88%, transparent);
    align-items: center;
    justify-content: center;
}
.bshop_image_modal_content {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 8px;
}
.bshop_image_modal_close {
    position: absolute;
    top: 18px;
    right: 26px;
    font-size: 34px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

/* 반응형 */
@media (max-width: 768px) {
    .bshop_product_detail {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .bshop_product_images {
        position: static;
    }

    .bshop_product_detail_container .bshop_btn_primary,
    .bshop_product_detail_container .bshop_btn_secondary,
    .bshop_product_detail_container .bshop_btn_outline {
        flex: 1;
        width: 100%;
    }

    .bshop_fixed_bottom {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .bshop_fixed_inner {
        gap: 8px;
    }

    .bshop_fixed_btn {
        padding: 12px 8px;
        font-size: 14px;
    }

    .bshop_tab_menu {
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .bshop_tab_menu li {
        padding: 14px;
        font-size: 14px;
    }

    .bshop_tab_content {
        padding: 20px;
    }

    .bshop_product_tabs {
        margin-top: 40px;
    }

    .bshop_product_content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .bshop_fixed_btn {
        padding: 11px 6px;
        font-size: 13px;
    }

    .bshop_fixed_inner {
        gap: 6px;
    }
}

/* 플로팅 바 옵션 선택 패널 */
.bshop_fixed_option_panel {
    border-bottom: 1px solid var(--bean-line);
    background: var(--bean-card);
    animation: bshopFloatOptionIn .18s ease;
}
.bshop_fixed_option_inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
}
.bshop_fixed_option_head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bean-text);
}
.bshop_fixed_option_close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--bean-muted);
    padding: 0 4px;
}
#floatingProductOption {
    width: 100%;
}
@keyframes bshopFloatOptionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
