/* ================================================================
 * Hi Car Match — base.css  (v193)
 * ----------------------------------------------------------------
 * Pretendard 전역 웹폰트 & 브라우저 기본값 정규화
 * @import CDN 제거: jsDelivr가 막히면 이후 CSS 전체가 지연/미적용됨
 * ================================================================ */

/* ---- 1. 박스모델 · 문서 ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    tab-size: 4;
}

html, body, button, input, select, textarea, optgroup {
    font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    letter-spacing: -0.02em;
}
.bi::before,
[class^="bi-"]::before,
[class*=" bi-"]::before {
    font-family: "bootstrap-icons" !important;
    letter-spacing: 0 !important;
}

body {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* 가로 넘침은 자식 max-width로 막는다. html/body에 overflow-x:clip 을 쓰면
   overflow-y 도 clip 으로 계산되어 모바일에서 세로 스크롤이 죽는다. */

/* ---- 2. 텍스트 요소 ---- */
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0; font-size: inherit; font-weight: inherit; }
p, figure, blockquote, dl, dd { margin: 0; }
p { margin-top: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr {
    margin: 0; border: 0; border-top: 1px solid currentColor;
    color: inherit; opacity: .18;
}
abbr[title] { text-decoration: underline dotted; cursor: help; text-decoration-skip-ink: none; }
b, strong { font-weight: bolder; }
small { font-size: .875em; }
sub, sup { position: relative; font-size: .75em; line-height: 0; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }
mark { padding: .1em .25em; background-color: #FFF3CD; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1em; }
pre { margin: 0; overflow: auto; }

/* ---- 3. 링크 ---- */
a { color: inherit; text-decoration: none; }
a:not([href]):not([class]), a:not([href]):not([class]):hover { color: inherit; text-decoration: none; }

/* ---- 4. 미디어 ----
   img를 block으로 강제하면 헤더 로고·국기·브랜드 마크 등 인라인 배치가 전부 깨진다.
   부트스트랩 Reboot와 동일하게 vertical-align만 맞추고 display는 건드리지 않는다.
   블록이 필요한 곳(카드 썸네일 등)은 theme.css가 개별로 지정한다. */
img, svg, video, canvas, audio, iframe, embed, object { vertical-align: middle; }
img, svg, video { max-width: 100%; }
img, video { height: auto; }

/* ---- 5. 표 ---- */
table { border-collapse: collapse; border-color: inherit; caption-side: bottom; }
caption { padding-block: 8px; color: inherit; text-align: start; }
th { text-align: inherit; text-align: -webkit-match-parent; font-weight: 700; }
thead, tbody, tfoot, tr, td, th { border-color: inherit; border-style: solid; border-width: 0; }

/* ---- 6. 폼 ---- */
button, input, optgroup, select, textarea {
    margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; color: inherit;
}
button, select { text-transform: none; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; appearance: button; }
button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) { cursor: pointer; }
button { padding: 0; border: 0; background: none; }
textarea { resize: vertical; }
select { word-wrap: normal; }
select:disabled, input:disabled, textarea:disabled, button:disabled { cursor: not-allowed; opacity: .6; }
label { display: inline-block; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { width: 100%; max-width: 100%; float: none; margin: 0; padding: 0; line-height: inherit; }
[type="search"] { -webkit-appearance: textfield; appearance: textfield; outline-offset: -2px; }
::-webkit-search-decoration, ::-webkit-search-cancel-button { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
::-webkit-datetime-edit-fields-wrapper, ::-webkit-datetime-edit-text, ::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field { padding: 0; }
::-moz-focus-inner { padding: 0; border-style: none; }
progress { vertical-align: baseline; }
::placeholder { color: #9AA1A9; opacity: 1; }
/* 숫자 입력 스피너 제거 — 가격·주행거리 입력에서 잘림 유발 */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- 7. 인터랙티브 ---- */
summary { display: list-item; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
[disabled] { pointer-events: auto; }
dialog { padding: 0; border: 0; }

/* ---- 8. 접근성 ---- */
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- 9. RTL ----
   부트스트랩의 bootstrap.rtl.css 를 쓰지 않으므로 방향 처리는 직접 한다.
   테마 CSS는 margin-inline / inset-inline-* 같은 논리 속성을 쓰기 때문에
   여기서는 방향 상속과 물리 속성이 필요한 몇 가지만 정리한다. */
[dir="rtl"] { direction: rtl; }
[dir="rtl"] .bi { transform: none; }
/* 방향을 가리키는 아이콘만 좌우 반전 */
[dir="rtl"] .bi-arrow-right::before,
[dir="rtl"] .bi-arrow-left::before,
[dir="rtl"] .bi-chevron-right::before,
[dir="rtl"] .bi-chevron-left::before,
[dir="rtl"] .bi-arrow-up-right::before { display: inline-block; transform: scaleX(-1); }
/* 숫자·가격·전화번호는 RTL 안에서도 LTR로 읽어야 한다 */
[dir="rtl"] .gab-price, [dir="rtl"] .gab-car-card-price, [dir="rtl"] .hicm-guard-fig,
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="number"] { direction: ltr; text-align: end; }

/* ---- 10. 인쇄 ---- */
@media print {
    *, *::before, *::after { background: transparent !important; color: #000 !important; box-shadow: none !important; }
    a { text-decoration: underline; }
    img, tr { break-inside: avoid; }
    h2, h3, p { orphans: 3; widows: 3; }
}
