/* ═══════════════════════════════════════════════════════════════
   📱 BAEULHAK MOBILE CSS — 완전 재설계 v3.1
   PC 영향 없음. 900px 이하만 적용.
   ═══════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   🌐 GLOBAL — 모든 페이지 공통 (900px 이하)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* PC GNB / quick-menu / 편집버튼 완전 숨김 */
  .gnb,
  .hd__btn-class,
  .hd__btn-cta,
  .bh-quick-menu,
  #bh-edit-toggle,
  #bh-edit-mode-bar,
  #bh-edit-panel,
  .topbar__ticker {
    display: none !important;
  }

  /* 햄버거 표시 */
  .hd__ham {
    display: block !important;
  }

  /* 헤더 컴팩트 */
  .hd .w {
    height: 56px !important;
    padding: 0 16px !important;
  }
  .hd__logo-mark {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
  .hd__logo-text {
    font-size: 15px !important;
  }
  .hd__logo-sub {
    display: none !important;
  }

  /* 모든 컨테이너 패딩 축소 */
  .w {
    padding: 0 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 섹션 패딩 축소 */
  section.s,
  .s {
    padding: 32px 0 !important;
  }

  /* body 하단 padding (bottom-nav 안 가려지게) */
  body {
    padding-bottom: 70px !important;
    overflow-x: hidden !important;
  }
  body.single-product {
    padding-bottom: 90px !important;
  }
  body.woocommerce-checkout,
  body.woocommerce-cart {
    padding-bottom: 70px !important;
  }

  /* topbar 컴팩트 */
  .topbar {
    padding: 4px 0 !important;
    font-size: 11px !important;
  }
  .topbar .w {
    justify-content: center !important;
  }
  .topbar__right {
    font-size: 11px !important;
  }

  /* 페이지 헤더 (.pg-hd) 컴팩트 */
  .pg-hd {
    padding: 20px 0 !important;
  }
  .pg-hd__t {
    font-size: 20px !important;
  }
  .pg-hd__bc {
    display: none !important;
  }

  /* 큰 타이틀 자동 축소 */
  h1 { font-size: 24px !important; line-height: 1.3 !important; }
  h2 { font-size: 20px !important; line-height: 1.3 !important; }
  h3 { font-size: 17px !important; line-height: 1.4 !important; }
  h4 { font-size: 15px !important; }

  /* 인라인 큰 글씨 자동 축소 */
  [style*="font-size:48px"], [style*="font-size: 48px"] { font-size: 24px !important; }
  [style*="font-size:42px"], [style*="font-size: 42px"] { font-size: 22px !important; }
  [style*="font-size:36px"], [style*="font-size: 36px"] { font-size: 20px !important; }
  [style*="font-size:32px"], [style*="font-size: 32px"] { font-size: 18px !important; }
  [style*="font-size:28px"], [style*="font-size: 28px"] { font-size: 17px !important; }
  [style*="font-size:24px"], [style*="font-size: 24px"] { font-size: 16px !important; }
  [style*="font-size:22px"], [style*="font-size: 22px"] { font-size: 15px !important; }
  [style*="font-size:20px"], [style*="font-size: 20px"] { font-size: 14px !important; }

  /* 단, 가격 강조는 더 큼 */
  [style*="font-size:72px"] { font-size: 38px !important; }
  [style*="font-size:62px"] { font-size: 34px !important; }

  /* 인라인 큰 패딩 자동 축소 */
  [style*="padding:80px"] { padding: 24px 16px !important; }
  [style*="padding:64px"] { padding: 22px 16px !important; }
  [style*="padding:56px"] { padding: 22px 16px !important; }
  [style*="padding:48px"] { padding: 20px 14px !important; }
  [style*="padding:40px"] { padding: 18px 14px !important; }
  [style*="padding:36px"] { padding: 18px 14px !important; }
  [style*="padding:32px"] { padding: 16px 14px !important; }
  [style*="padding:28px"] { padding: 16px 14px !important; }

  /* 다중 컬럼 그리드 → 1컬럼 */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  [style*="grid-template-columns:repeat(5,1fr)"],
  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  [style*="grid-template-columns:1fr 420px"],
  [style*="grid-template-columns: 1fr 420px"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns: 1fr 360px"],
  [style*="grid-template-columns:1fr 380px"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* 버튼 풀와이드 */
  .b, .button {
    font-size: 14px !important;
    padding: 12px 16px !important;
  }
  .b--xl {
    font-size: 15px !important;
    padding: 14px 18px !important;
  }

  /* 챕터 아코디언 */
  details summary {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  /* 푸터 컴팩트 */
  .ft, footer {
    padding: 24px 16px 16px !important;
  }
  footer .footer-grid,
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   📱 메인 페이지 (홈) 모바일
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* 히어로 — 사진 위, 텍스트 아래 */
  #hero,
  section[data-bh-section="hero"] {
    padding: 24px 0 0 !important;
  }
  #hero .w > div[style*="display:flex"],
  section[data-bh-section="hero"] .w > div[style*="display:flex"]:first-child {
    flex-direction: column !important;
    gap: 18px !important;
    text-align: center !important;
  }
  #hero img,
  section[data-bh-section="hero"] img {
    max-width: 200px !important;
    height: auto !important;
    margin: 0 auto !important;
  }
  /* 히어로 사진 박스 */
  #hero [style*="width:260px"],
  section[data-bh-section="hero"] [style*="width:260px"] {
    width: 180px !important;
    height: 230px !important;
    margin: 0 auto !important;
  }

  /* 히어로 통계 바 5개 → 그리드 */
  #hero [style*="grid-template-columns:repeat(5,1fr)"],
  section[data-bh-section="hero"] [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
  }
  #hero [style*="grid-template-columns:repeat(5,1fr)"] > div:nth-child(4),
  #hero [style*="grid-template-columns:repeat(5,1fr)"] > div:nth-child(5) {
    border-top: 1px solid #eee !important;
    padding-top: 12px !important;
    margin-top: 12px !important;
  }

  /* 서브탭 가로 스크롤 */
  .subtab__list {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    justify-content: flex-start !important;
    padding-bottom: 4px !important;
  }
  .subtab__list::-webkit-scrollbar { display: none !important; }
  .subtab__a {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 10px 14px !important;
  }

  /* 카운트다운 */
  .bh-countdown {
    padding: 8px 0 !important;
    font-size: 11px !important;
  }
  .bh-countdown__unit {
    font-size: 13px !important;
    padding: 3px 6px !important;
  }

  /* 플랜 카드 (BASIC/BEST/STANDARD) */
  [data-bh-section="plan_curriculum"] [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  /* CONSULTING 배너 — 1컬럼 + 가운데 */
  section[data-bh-section="home_consult"] [style*="grid-template-columns:1fr auto"] {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }
  section[data-bh-section="home_consult"] [style*="display:flex;flex-direction:column"] {
    align-items: center !important;
  }

  /* CTA 박스 */
  .cta-ban {
    padding: 24px 18px !important;
  }
  .cta-ban__t {
    font-size: 18px !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   🛒 상품 상세 페이지 모바일
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* HTML 테이블 → 블록으로 변환 */
  body.single-product table.bh-product-grid,
  body.single-product table.bh-product-grid > tbody,
  body.single-product table.bh-product-grid > tbody > tr,
  body.single-product table.bh-product-grid td.bh-product-left,
  body.single-product table.bh-product-grid td.bh-product-right {
    display: block !important;
    width: 100% !important;
  }
  body.single-product table.bh-product-grid td.bh-product-left {
    padding: 18px 16px !important;
  }
  body.single-product table.bh-product-grid td.bh-product-right {
    border-left: none !important;
    border-top: 1px solid #eee !important;
    padding: 22px 16px !important;
    width: 100% !important;
  }
  body.single-product .bh-product-outer {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  body.single-product .bh-product-section {
    padding: 0 !important;
    background: #fff !important;
  }

  /* 상품명 */
  body.single-product h1 {
    font-size: 20px !important;
    line-height: 1.3 !important;
  }

  /* 가격 박스 */
  body.single-product [style*="font-size:72px"] { font-size: 44px !important; }
  body.single-product [style*="font-size:62px"] { font-size: 38px !important; }
  body.single-product [style*="font-size:48px"] { font-size: 32px !important; }
  body.single-product [style*="font-size:42px"] { font-size: 28px !important; }
  body.single-product [style*="font-size:32px"] { font-size: 22px !important; }

  /* 모바일 하단 구매 바 항상 표시 */
  body.single-product .bh-mobile-buy-bar {
    display: flex !important;
  }
  body.single-product .bh-bottom-nav,
  body.single-product #bhBottomNav {
    display: none !important;
  }

  /* 챕터 아코디언 모바일 */
  body.single-product details {
    margin: 0 !important;
  }
  body.single-product details summary > span:first-child {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   💳 결제 페이지 (체크아웃) 모바일 — 강의사이트 스타일
   인프런/패스트캠퍼스/클래스101 디자인 참고
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── 1. 페이지 전체 배경 회색 + bottom padding ── */
  body.woocommerce-checkout {
    background: #f7f7f7 !important;
    padding-bottom: 0 !important;
  }
  body.woocommerce-checkout .bh-checkout-wrap {
    background: #f7f7f7 !important;
    padding: 0 0 100px !important;  /* 하단 결제버튼 공간 */
  }
  body.woocommerce-checkout .bh-checkout-wrap .w {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* ── 2. 페이지 헤더 — 흰 배경, 큰 타이틀 ── */
  body.woocommerce-checkout .pg-hd {
    background: #fff !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #eee !important;
  }
  body.woocommerce-checkout .pg-hd .w {
    padding: 0 !important;
  }
  body.woocommerce-checkout .pg-hd__t {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #111 !important;
  }
  body.woocommerce-checkout .pg-hd__bc {
    display: none !important;
  }

  /* ── 3. 결제 진행 단계 (1·2·3) — 흰 배경 박스 ── */
  body.woocommerce-checkout .bh-checkout-wrap > .w > div[style*="display:flex"][style*="margin-bottom:24px"] {
    background: #fff !important;
    margin: 0 0 8px !important;
    padding: 14px !important;
    gap: 4px !important;
    font-size: 11px !important;
    border-bottom: 1px solid #eee !important;
  }
  body.woocommerce-checkout .bh-checkout-wrap > .w > div[style*="display:flex"][style*="margin-bottom:24px"] span {
    font-size: 11px !important;
  }
  body.woocommerce-checkout .bh-checkout-wrap > .w > div[style*="display:flex"][style*="margin-bottom:24px"] span[style*="width:28px"] {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
  }

  /* ── 4. 그리드 → 1컬럼 (block) ── */
  body.woocommerce-checkout .bh-co-grid {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  /* ── 5. 카드 박스 — 흰배경, 회색 사이 간격 ── */
  body.woocommerce-checkout .bh-co-card {
    margin: 0 0 8px !important;
    border-radius: 0 !important;
    border: none !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  body.woocommerce-checkout .bh-co-card-head {
    padding: 14px 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  body.woocommerce-checkout .bh-co-card-head .bh-co-card-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #111 !important;
  }
  body.woocommerce-checkout .bh-co-card-head .bh-co-card-emoji {
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
  }
  body.woocommerce-checkout .bh-co-card-body {
    padding: 14px 16px !important;
  }

  /* ── 6. 주문상품 — 카드형 (썸네일 좌측, 가격 우측) ── */
  body.woocommerce-checkout .bh-co-table thead {
    display: none !important;
  }
  body.woocommerce-checkout .bh-co-table,
  body.woocommerce-checkout .bh-co-table tbody {
    display: block !important;
    width: 100% !important;
  }
  body.woocommerce-checkout .bh-co-table tr {
    display: grid !important;
    grid-template-columns: 56px 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #f5f5f5 !important;
    position: relative !important;
  }
  body.woocommerce-checkout .bh-co-table tr:last-child {
    border-bottom: none !important;
  }
  body.woocommerce-checkout .bh-co-table td {
    display: block !important;
    padding: 0 !important;
    text-align: left !important;
    border: none !important;
    width: auto !important;
  }
  body.woocommerce-checkout .bh-co-table td:first-child {
    grid-row: 1 / 3 !important;
    grid-column: 1 !important;
  }
  body.woocommerce-checkout .bh-co-table td:first-child img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
  }
  body.woocommerce-checkout .bh-co-table td:nth-child(2) {
    grid-row: 1 !important;
    grid-column: 2 / 4 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #111 !important;
    line-height: 1.4 !important;
  }
  body.woocommerce-checkout .bh-co-table td:nth-child(2)::before { content: none !important; }
  body.woocommerce-checkout .bh-co-table td:nth-child(3) {
    grid-row: 2 !important;
    grid-column: 2 !important;
    font-size: 15px !important;
    color: #E8601C !important;
    font-weight: 800 !important;
  }
  body.woocommerce-checkout .bh-co-table td:nth-child(3)::before { content: none !important; }
  body.woocommerce-checkout .bh-co-table td:last-child {
    position: static !important;
    grid-row: 2 !important;
    grid-column: 3 !important;
    text-align: right !important;
  }
  body.woocommerce-checkout .bh-co-table td:last-child a {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }

  /* ── 7. 합계 박스 (총상품 - 즉시할인 = 결제예상) ── */
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"][style*="display:flex"] {
    flex-direction: column !important;
    gap: 0 !important;
    align-items: stretch !important;
    padding: 14px 16px !important;
    margin: 12px -16px -14px !important;  /* 카드 끝까지 확장 */
    background: #fafafa !important;
    border-top: 1px solid #f0f0f0 !important;
    border-bottom: none !important;
  }
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    text-align: left !important;
    padding: 4px 0 !important;
  }
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div > div:first-child {
    font-size: 13px !important;
    color: #666 !important;
    font-weight: 500 !important;
    text-align: left !important;
  }
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div > div:last-child {
    font-size: 14px !important;
    color: #111 !important;
    font-weight: 700 !important;
    text-align: right !important;
  }
  /* +/-/= 기호 숨김 */
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div[style*="color:#aaa"] {
    display: none !important;
  }
  /* 마지막 결제예상금액만 강조 */
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div:last-child {
    border-top: 1px solid #ddd !important;
    margin-top: 8px !important;
    padding-top: 10px !important;
  }
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div:last-child > div:first-child {
    color: #111 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
  }
  body.woocommerce-checkout .bh-co-card-body > div[style*="background:#fff3e0"] > div:last-child > div:last-child {
    color: #E8601C !important;
    font-size: 18px !important;
    font-weight: 900 !important;
  }

  /* ── 8. 입력 필드 — 모던하고 큰 터치영역 ── */
  body.woocommerce-checkout .form-row {
    margin-bottom: 14px !important;
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    clear: both !important;
  }
  body.woocommerce-checkout .form-row-first,
  body.woocommerce-checkout .form-row-last,
  body.woocommerce-checkout .form-row-wide {
    width: 100% !important;
    clear: both !important;
  }
  body.woocommerce-checkout label {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 6px !important;
    display: block !important;
    font-weight: 600 !important;
  }
  body.woocommerce-checkout label .required {
    color: #E8601C !important;
    margin-left: 2px !important;
  }
  body.woocommerce-checkout input[type=text],
  body.woocommerce-checkout input[type=email],
  body.woocommerce-checkout input[type=tel],
  body.woocommerce-checkout input[type=password],
  body.woocommerce-checkout input[type=number] {
    font-size: 16px !important;  /* iOS 줌 방지 */
    padding: 13px 14px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    border: 1px solid #e0e0e0 !important;
    background: #fff !important;
    color: #111 !important;
  }
  body.woocommerce-checkout input:focus {
    border-color: #E8601C !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(232,96,28,.1) !important;
  }

  /* ── 9. 할인쿠폰 박스 ── */
  body.woocommerce-checkout .bh-co-card-body table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  body.woocommerce-checkout .bh-co-card-body table tr {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 4px 0 !important;
  }
  body.woocommerce-checkout .bh-co-card-body table td {
    width: auto !important;
    padding: 6px 0 !important;
    font-size: 13px !important;
    border: none !important;
  }
  body.woocommerce-checkout .bh-co-card-body table td:first-child {
    flex: 1 !important;
    color: #666 !important;
  }
  body.woocommerce-checkout #bh-coupon-show {
    padding: 7px 14px !important;
    font-size: 12px !important;
    border-radius: 50px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #666 !important;
  }
  body.woocommerce-checkout #bh-coupon-input-area {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #f0f0f0 !important;
  }
  body.woocommerce-checkout #bh-coupon-input-area input {
    font-size: 16px !important;
    padding: 12px !important;
  }
  body.woocommerce-checkout #bh-coupon-input-area button {
    padding: 12px 18px !important;
    font-size: 13px !important;
  }

  /* ── 10. 결제수단 선택 ── */
  body.woocommerce-checkout #payment ul.payment_methods {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }
  body.woocommerce-checkout #payment ul.payment_methods li {
    padding: 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    list-style: none !important;
    background: #fff !important;
  }
  body.woocommerce-checkout #payment ul.payment_methods li label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111 !important;
    cursor: pointer !important;
  }
  body.woocommerce-checkout #payment ul.payment_methods li input[type=radio] {
    margin-right: 8px !important;
    transform: scale(1.2) !important;
  }
  body.woocommerce-checkout #payment ul.payment_methods .payment_box {
    background: #fafafa !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    margin-top: 10px !important;
    font-size: 12px !important;
    color: #666 !important;
    line-height: 1.6 !important;
  }

  /* ── 11. 우측 sticky 박스 → 일반 박스로 ── */
  body.woocommerce-checkout .bh-co-side {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  body.woocommerce-checkout .bh-co-final-box {
    position: static !important;
    top: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    margin-bottom: 8px !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div:first-child {
    background: #1E40AF !important;
    color: #fff !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-align: left !important;
  }
  /* 금액 라인들 */
  body.woocommerce-checkout .bh-co-final-box > div[style*="padding:16px"][style*="border-bottom"] {
    padding: 14px 16px !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div[style*="padding:16px"][style*="border-bottom"] > div {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }
  /* 큰 최종금액 표시 */
  body.woocommerce-checkout .bh-co-final-box > div[style*="text-align:center"][style*="background:#fafafa"] {
    padding: 16px !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div[style*="text-align:center"][style*="background:#fafafa"] > div[style*="font-size:28px"] {
    font-size: 26px !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div[style*="text-align:center"][style*="background:#fafafa"] > div[style*="font-size:11px"] {
    font-size: 10px !important;
    line-height: 1.5 !important;
  }
  /* 약관 동의 박스 */
  body.woocommerce-checkout .bh-co-final-box > div[style*="background:#fff3e0"] {
    padding: 14px 16px !important;
    border-top: 1px solid #fed7aa !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div[style*="background:#fff3e0"] label {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }

  /* ── 12. 결제하기 버튼 — 큼지막한 빨간 버튼 ── */
  body.woocommerce-checkout #place_order {
    padding: 16px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    width: 100% !important;
    border-radius: 8px !important;
    background: #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(220,38,38,.25) !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div:last-child {
    padding: 14px 16px !important;
  }

  /* ── 13. 결제 완료 후 안내 박스 ── */
  body.woocommerce-checkout .bh-co-side > div[style*="background:#fff3e0"][style*="border-left"] {
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 12px 16px !important;
    font-size: 11px !important;
    line-height: 1.6 !important;
  }

  /* ── 14. 모바일 하단 고정 결제 바 (옵션) ── */
  /* 결제 페이지에선 sticky 박스가 일반화되어서 자연스럽게 결제 버튼이 보임 */
  body.woocommerce-checkout #bhBottomNav {
    display: none !important;  /* 결제 페이지에선 bottom-nav 숨김 */
  }
}

/* ════════════════════════════════════════════════════════════════
   📱 작은 모바일 (480px 이하)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* 더 좁은 패딩 */
  .w {
    padding: 0 12px !important;
  }
  section.s {
    padding: 24px 0 !important;
  }

  /* 더 작은 글씨 */
  h1 { font-size: 22px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }

  [style*="font-size:48px"] { font-size: 22px !important; }
  [style*="font-size:36px"] { font-size: 18px !important; }
  [style*="font-size:32px"] { font-size: 17px !important; }
  [style*="font-size:72px"] { font-size: 32px !important; }

  /* 결제 페이지 */
  body.woocommerce-checkout .bh-checkout-wrap .w {
    padding: 0 10px !important;
  }
  body.woocommerce-checkout .bh-co-card-body {
    padding: 10px !important;
  }
  body.woocommerce-checkout .bh-co-final-box > div[style*="font-size:28px"] {
    font-size: 22px !important;
  }
  body.woocommerce-checkout .bh-co-table td {
    font-size: 13px !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   📱 v3.3 — 모든 페이지 가로스크롤 차단 + 일반 페이지 최적화
   메인 외 모든 페이지 (교수소개/기술자문/수험정보/교재/고객센터/마이강의실 등)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── 가로 스크롤 완전 차단 ── */
  html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 모든 컨테이너 max-width 강제 */
  body * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 이미지/비디오 모바일 확대 차단 */
  body img,
  body video,
  body iframe,
  body svg,
  body table {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 인라인 width px 자동 무력화 */
  body [style*="width:1200px"],
  body [style*="width:1100px"],
  body [style*="width:1000px"],
  body [style*="width:900px"],
  body [style*="width:800px"],
  body [style*="width:700px"],
  body [style*="width:600px"],
  body [style*="width:500px"],
  body [style*="width: 1200px"],
  body [style*="width: 1100px"],
  body [style*="width: 1000px"],
  body [style*="width: 900px"],
  body [style*="width: 800px"],
  body [style*="width: 700px"],
  body [style*="width: 600px"],
  body [style*="width: 500px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* min-width 무력화 (가로 스크롤 원인) */
  body [style*="min-width:600px"],
  body [style*="min-width:700px"],
  body [style*="min-width:800px"],
  body [style*="min-width:900px"],
  body [style*="min-width: 600px"],
  body [style*="min-width: 700px"],
  body [style*="min-width: 800px"],
  body [style*="min-width: 900px"] {
    min-width: 0 !important;
  }

  /* ── 일반 페이지 — 페이지 헤더 ── */
  body:not(.home):not(.woocommerce-checkout) .pg-hd {
    padding: 16px 0 !important;
  }
  body:not(.home):not(.woocommerce-checkout) .pg-hd__t {
    font-size: 18px !important;
  }
  body:not(.home):not(.woocommerce-checkout) .pg-hd__bc {
    display: none !important;
  }

  /* ── 모든 섹션 패딩 강제 축소 ── */
  body:not(.home):not(.woocommerce-checkout) section,
  body:not(.home):not(.woocommerce-checkout) .s {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }

  /* ── 섹션 헤더 ── */
  .sh__t,
  body:not(.home) [class*="section-title"],
  body:not(.home) h2[style*="font-size"] {
    font-size: 19px !important;
    line-height: 1.3 !important;
  }
  .sh__d {
    font-size: 12px !important;
  }

  /* ── 모든 박스 패딩 자동 축소 ── */
  body:not(.home):not(.woocommerce-checkout) [style*="padding:60px"] { padding: 22px 14px !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="padding:50px"] { padding: 20px 14px !important; }

  /* ── 그리드 강제 1컬럼 (모든 페이지) ── */
  body:not(.home) [style*="display:grid"][style*="grid-template-columns"] {
    gap: 12px !important;
  }
  body:not(.home) [style*="grid-template-columns:repeat(2,"] {
    grid-template-columns: 1fr !important;
  }
  body:not(.home) [style*="grid-template-columns: repeat(2,"] {
    grid-template-columns: 1fr !important;
  }
  body:not(.home) [style*="grid-template-columns:300px"],
  body:not(.home) [style*="grid-template-columns: 300px"],
  body:not(.home) [style*="grid-template-columns:280px"],
  body:not(.home) [style*="grid-template-columns: 280px"],
  body:not(.home) [style*="grid-template-columns:260px"],
  body:not(.home) [style*="grid-template-columns: 260px"],
  body:not(.home) [style*="grid-template-columns:240px"],
  body:not(.home) [style*="grid-template-columns: 240px"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  body:not(.home) [style*="grid-template-columns:220px"],
  body:not(.home) [style*="grid-template-columns:200px"] {
    grid-template-columns: 1fr !important;
  }

  /* ── flex 레이아웃 강제 wrap ── */
  body:not(.home) [style*="display:flex"]:not(.bh-bottom-nav__inner) {
    flex-wrap: wrap !important;
  }

  /* ── 테이블 모바일 최적화 (기본 테이블) ── */
  body:not(.woocommerce-checkout) table:not(.bh-product-grid):not(.bh-co-table) {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    font-size: 12px !important;
  }
  body:not(.woocommerce-checkout) table:not(.bh-product-grid):not(.bh-co-table) th,
  body:not(.woocommerce-checkout) table:not(.bh-product-grid):not(.bh-co-table) td {
    padding: 8px !important;
    white-space: nowrap !important;
  }

  /* ── 교수소개 페이지 ── */
  body.page-template-page-instructors [style*="width:240px"][style*="height:300px"],
  body.page-template-page-instructors [style*="width: 240px"][style*="height: 300px"],
  body.page-template-page-instructors [style*="width:220px"][style*="height:280px"] {
    width: 160px !important;
    height: 200px !important;
    margin: 0 auto !important;
  }

  /* ── 기술자문 페이지 — 3컬럼 → 1컬럼 ── */
  body.page-template-page-consulting [style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  body.page-template-page-consulting [style*="max-width:1100"] {
    max-width: 100% !important;
  }
  body.page-template-page-consulting input,
  body.page-template-page-consulting textarea,
  body.page-template-page-consulting select {
    font-size: 16px !important;
    padding: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ── 수험정보/교재안내 페이지 ── */
  body.page-template-page-exam-info [style*="grid-template"],
  body.page-template-page-textbooks [style*="grid-template"] {
    grid-template-columns: 1fr !important;
  }

  /* ── 고객센터 페이지 ── */
  body.page-template-page-customer-center [style*="grid-template"] {
    grid-template-columns: 1fr !important;
  }
  body.page-template-page-customer-center input,
  body.page-template-page-customer-center textarea,
  body.page-template-page-customer-center select {
    font-size: 16px !important;
    padding: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ── 마이 강의실 ── */
  body.page-template-page-my-classroom [style*="grid-template-columns:repeat(4"],
  body.page-template-page-my-classroom [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  body.page-template-page-my-classroom [style*="grid-template-columns:repeat(3"],
  body.page-template-page-my-classroom [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  /* 강의 카드 */
  body.page-template-page-my-classroom [style*="aspect-ratio"] {
    aspect-ratio: 16/9 !important;
  }

  /* ── 무료강의 리스트 ── */
  body.page-template-page-free-lecture-list [style*="grid-template-columns:repeat(3"],
  body.page-template-page-free-lecture-list [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* ── 무료강의 플레이어 ── */
  body.page-template-page-free-lecture-player .bh-player-layout,
  body.page-template-page-free-lecture-player [style*="grid-template-columns:1fr 360px"] {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  body.page-template-page-free-lecture-player .bh-curriculum {
    position: static !important;
    max-height: none !important;
    margin-top: 14px !important;
  }

  /* ── 회원가입 페이지 ── */
  body.page-template-page-register form {
    max-width: 100% !important;
    padding: 20px 16px !important;
  }
  body.page-template-page-register input {
    font-size: 16px !important;
    padding: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ── 텍스트 줄바꿈 강제 ── */
  body p, body div, body span, body li, body td {
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }

  /* ── 큰 패딩 자동 축소 (인라인) ── */
  body:not(.home):not(.woocommerce-checkout) [style*="padding:80px 0"] { padding: 30px 0 !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="padding:72px 0"] { padding: 28px 0 !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="padding:60px 0"] { padding: 26px 0 !important; }

  /* ── 큰 마진 자동 축소 ── */
  body:not(.home):not(.woocommerce-checkout) [style*="margin-bottom:60px"] { margin-bottom: 24px !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="margin-bottom:48px"] { margin-bottom: 20px !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="margin-top:60px"] { margin-top: 24px !important; }

  /* ── gap 축소 ── */
  body:not(.home):not(.woocommerce-checkout) [style*="gap:48px"] { gap: 16px !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="gap:40px"] { gap: 14px !important; }
  body:not(.home):not(.woocommerce-checkout) [style*="gap:32px"] { gap: 12px !important; }

  /* ── 챕터 아코디언 (모든 페이지) ── */
  body details summary {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }
  body details summary > span:first-child {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }
  body details > div > div[onclick] {
    padding: 10px 14px 10px 38px !important;
    font-size: 12px !important;
  }
}
