﻿/* ============================================================================
   Bootstrap 3 → 5 호환층                                         2026-11-26

   관리자 화면(index.html)과 업체 로그인 화면은 Bootstrap 5.3.8 을 쓴다.
   아직 옮기지 않은 화면(menus/*.html, pages/*.html)은 Bootstrap 3 마크업이라
   그대로 두면 모양이 깨진다. 여기서 Bootstrap 3 에만 있던 클래스와
   기본 크기를 받아 준다. 화면을 Bootstrap 5 로 옮기면 이 규칙은 필요 없어진다.

   동작(모달·드롭다운·탭의 data-toggle 등)은 scripts/bs3-compat.js 가 받는다.
   ============================================================================ */

/* ── 기본 크기 : Bootstrap 3 은 14px, 5 는 16px ───────────────────────── */
:root {
    --bs-body-font-size: 14px;
    --bs-body-line-height: 1.42857;
    --bs-link-color-rgb: 51, 122, 183;
    --bs-link-hover-color-rgb: 35, 82, 124;
}

body {
    font-size: 14px;
    line-height: 1.42857;
}

a { text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
.btn:hover, .btn:focus, .nav a:hover, .dropdown-menu a:hover { text-decoration: none; }

h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 30px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 12px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.1; }

label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; }

/* ── 버튼 ─────────────────────────────────────────────────────────── */
.btn {
    --bs-btn-font-size: 14px;
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 12px;
    --bs-btn-line-height: 1.42857;
}
.btn-sm, .btn-group-sm > .btn {
    --bs-btn-font-size: 12px;
    --bs-btn-padding-y: 5px;
    --bs-btn-padding-x: 10px;
}
.btn-xs, .btn-group-xs > .btn {
    --bs-btn-font-size: 12px;
    --bs-btn-padding-y: 1px;
    --bs-btn-padding-x: 5px;
}
.btn-lg { --bs-btn-font-size: 18px; --bs-btn-padding-y: 10px; --bs-btn-padding-x: 16px; }

.btn-default {
    --bs-btn-color: #333;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #ccc;
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: #e6e6e6;
    --bs-btn-hover-border-color: #adadad;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: #e6e6e6;
    --bs-btn-active-border-color: #adadad;
    --bs-btn-disabled-color: #333;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #ccc;
}
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: 5px; }

/* ── 입력 ─────────────────────────────────────────────────────────── */
.form-control {
    font-size: 14px;
    padding: 6px 12px;
    line-height: 1.42857;
}
.input-sm, .form-control.input-sm { height: 30px; padding: 5px 10px; font-size: 12px; }
.input-lg { height: 46px; padding: 10px 16px; font-size: 18px; }

/* Bootstrap 5 는 select.form-control 의 화살표를 없앤다 */
select.form-control { appearance: auto; -webkit-appearance: menulist; -moz-appearance: menulist; }

.form-group { margin-bottom: 15px; }
.control-label { padding-top: 7px; font-weight: bold; }
.help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; }

.checkbox, .radio { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; }
.checkbox label, .radio label { min-height: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; }
.radio-inline, .checkbox-inline { display: inline-block; margin-right: 10px; margin-bottom: 0; font-weight: normal; cursor: pointer; }

/* 입력묶음 : Bootstrap 3 의 span.input-group-btn / .input-group-addon */
.input-group > .input-group-btn { display: flex; }
.input-group > .input-group-btn > .btn { position: relative; z-index: 2; }
.input-group > .input-group-btn:first-child > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-btn:last-child > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .input-group-btn:last-child > .btn { margin-left: -1px; }
.input-group-addon {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.input-group > .input-group-addon:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.input-group > .input-group-addon:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; }

/* ── 격자 ──────────────────────────────────────────────────────────── */
/* Bootstrap 5 는 .row 의 자식을 모두 폭 100% + 좌우 여백으로 만든다.
   3 에서는 col-* 가 아닌 자식(.toolbar-item 등)이 제 폭만 차지했다.
   새로 옮긴 화면은 .row 안에 늘 col 클래스를 쓴다. */
.row > *:not([class*="col"]) {
    width: auto;
    padding-left: 0;
    padding-right: 0;
}

/* col-xs-* , col-sm-offset-* */
.row > [class*="col-xs-"] { flex: 0 0 auto; }
.col-xs-1 { width: 8.33333%; }   .col-xs-2 { width: 16.66667%; }  .col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.33333%; }  .col-xs-5 { width: 41.66667%; }  .col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.33333%; }  .col-xs-8 { width: 66.66667%; }  .col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.33333%; } .col-xs-11 { width: 91.66667%; } .col-xs-12 { width: 100%; }
@media (min-width: 576px) {
    .col-sm-offset-1 { margin-left: 8.33333%; }
    .col-sm-offset-2 { margin-left: 16.66667%; }
    .col-sm-offset-3 { margin-left: 25%; }
}
@media (min-width: 768px) {
    .col-md-offset-1 { margin-left: 8.33333%; }
    .col-md-offset-2 { margin-left: 16.66667%; }
    .col-md-offset-3 { margin-left: 25%; }
}

/* .row 없이 col-* 를 바로 넣은 곳.
   3 의 col 은 float 라 .row 가 없어도 나란히 섰다. 5 의 col 은 .row(flex) 안에서만
   나란히 서고, 밖에서는 세로로 쌓인다. 업체 로그인 화면(container-fluid > col-md-*)과
   form-horizontal 의 form-group(> col-sm-2 라벨 + col-sm-10 입력)이 그렇다.
   그런 상자를 flex 줄로 만든다.
   :where() 로 묶어 우선순위를 0 으로 둔다. 그래야 .col-md-3 같은 폭 규칙이 이긴다. */
:where(:is(.container, .container-fluid, .form-horizontal .form-group):has(> [class*="col-"])) {
    display: flex;
    flex-wrap: wrap;
}
:where(:is(.container, .container-fluid, .form-horizontal .form-group):has(> [class*="col-"])) > :where([class*="col-"]) {
    flex: 0 0 auto;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}
:where(:is(.container, .container-fluid, .form-horizontal .form-group):has(> [class*="col-"])) > :where(:not([class*="col-"])) {
    flex: 0 0 100%;
}
.form-horizontal .form-group { margin-left: -15px; margin-right: -15px; }

/* ── 자잘한 클래스 ─────────────────────────────────────────────────── */
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.navbar-right { float: right; }
.navbar-left { float: left; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.img-responsive { display: block; max-width: 100%; height: auto; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
@media (max-width: 767.98px) { .hidden-xs { display: none !important; } }
.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}
.thumbnail {
    display: block;
    padding: 4px;
    margin-bottom: 20px;
    line-height: 1.42857;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.thumbnail > img { display: block; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; }
.badge:not([class*="bg-"]):not([class*="text-bg-"]) { background-color: #777; color: #fff; }
.table-condensed > :not(caption) > * > * { padding: 5px; }

/* 보이기/숨기기 : Bootstrap 3 은 .in, 5 는 .show */
.fade.in { opacity: 1; }
.collapse.in { display: block; }

/* ── 드롭다운 : Bootstrap 3 은 li > a ──────────────────────────────── */
.dropdown-menu { font-size: 14px; }
.dropdown-menu > li > a,
.dropdown-menu > li > label {
    display: block;
    width: 100%;
    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.42857;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-menu > li > label:hover { background-color: #f5f5f5; color: #262626; text-decoration: none; }
.dropdown-menu > .active > a { background-color: #337ab7; color: #fff; }
.dropdown-menu > li > label > input { margin-right: 6px; }
/* 5 의 .dropdown-toggle 은 ::after 로 꺾쇠를 그린다. 3 의 .caret 까지 있으면 둘이 된다. */
.dropdown-toggle .caret { display: none; }

/* ── 탭 : Bootstrap 3 은 li.active > a ─────────────────────────────── */
.nav > li { position: relative; display: block; }
.nav > li > a { position: relative; display: block; padding: 10px 15px; }
.nav-tabs > li { margin-bottom: -1px; }
.nav-tabs > li > a {
    margin-right: 2px;
    line-height: 1.42857;
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: #555;
    cursor: default;
    background-color: #fff;
    border: 1px solid #ddd;
    border-bottom-color: transparent;
}

/* ── 쪽 번호 (bootgrid 가 li > a 로 그린다) ─────────────────────────── */
.pagination > li > a { cursor: pointer; }

/* ── 모달 ──────────────────────────────────────────────────────────── */
/* Bootstrap 3 마크업은 닫기 단추(.close)가 제목보다 앞에 있다.
   5 의 모달 머리는 flex 라 그대로 두면 단추가 왼쪽에 붙는다. */
.modal-header .close { order: 2; margin-left: auto; }
.modal-header .modal-title { order: 1; }
/* 위에서 제목에 순서를 줬으니, 5 의 닫기 단추(.btn-close)도 맨 뒤로 보낸다. */
.modal-header .btn-close { order: 2; }
.close {
    float: right;
    padding: 0;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .2;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.close:hover, .close:focus { opacity: .5; text-decoration: none; }

/* 모달 폭 : Bootstrap 3 은 600px(작은 것 300, 큰 것 900). 5 는 500px 로 묶는다(max-width).
   화면마다 style="width:..." 로 폭을 박아 둔 것이 많아 3 의 방식으로 되돌린다. */
@media (min-width: 768px) {
    .modal-dialog {
        width: 600px;
        max-width: calc(100% - 20px);
        margin: 30px auto;
    }
    .modal-sm { width: 300px; }
    .modal-lg { width: 900px; }
}

/* 휴대폰에서는 박아 둔 폭을 무시하고 화면 폭에 맞춘다. */
@media (max-width: 575.98px) {
    .modal-dialog { width: auto !important; max-width: none !important; margin: .5rem; }
}
