/**
 * pages/smoothmaster.css — 한맥 스무스마스터 (/smoothmaster/index.php) 전용
 * ------------------------------------------------------------------
 * 페이지에서 $pageCSS = ['smoothmaster']; 선언 시 layoutHeader 가 자동 로드.
 *
 * 마크업: <div id="body_container" class="sm-container">
 *           <section class="sm-main-kv">           ← KV (PC 레이어 + Mobile picture)
 *           <section class="sm-main-map">          ← 지도 + 패널 (region 선택 → 매장 리스트)
 *             <div class="sm-map-wrap"> <div class="app">
 *               <section class="app-grid">         ← grid: map | panel
 *                 <div class="card card--map">     ← SVG 지도
 *                 <div class="card--panel">        ← 지역 select + 매장 list
 *           <ul class="sm-grid">                   ← 매장 타일 그리드 (호버 시 .tile__overlay)
 *           <dialog class="sm-modal" id="smModal"> ← 매장 상세 모달
 *
 * 이전: pc.css 1192-3343 (sm-v1 + sm-modal flat + sm-v2) → 통합 (2026-06-09)
 */

/* ── App Layout (BEM) ── */
.sm-container { position: relative; color: #fff; }
.sm-container * { box-sizing: border-box; }
.sm-container .app { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }
.sm-container .app-wrap { position: relative; display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0 0 18px; }
.sm-container .app-wrap > * { position: relative; z-index: 1; }
.sm-container .app-wrap .sm-app-icon { width: 25%; aspect-ratio: 52/41; background: url("/resources/images/smoothmaster/hanmac-extra-creamy-draft-beer-logo.png") center/cover no-repeat; z-index: 0; }
.sm-container .app-title { margin: 0; color: #004e3a; font-family: Pretendard; font-size: 28px; font-weight: 700; line-height: 150%; letter-spacing: -0.48px; }
.sm-container .app-subtitle { color: #004e3a; font-size: 20px; font-weight: 500; line-height: 150%; letter-spacing: -0.4px; }
.sm-container .app-subtitle p { font-weight: 500; }
.sm-container .app-grid { display: grid; grid-template-columns: minmax(440px, 1fr) 420px; grid-template-areas: "map panel"; gap: 120px; align-items: center; }

/* ── Card ── */
.sm-container .card--map { grid-area: map; max-width: 100%; width: 600px; height: auto; }
.sm-container .card--panel { grid-area: panel; width: 375px; padding: 16px; text-align: left; }

/* ── Map (SVG region picker) ── */
.sm-container .map-stage { display: block; width: 100%; aspect-ratio: 1488/2310; }
.sm-container .map-image { border-radius: 10px; }
.sm-container .map-region { position: relative; cursor: pointer; }
.sm-container .map-region path { fill: #94b3ab; stroke: #fff; stroke-width: 2; pointer-events: all; transition: stroke 0.25s ease, stroke-width 0.25s ease, fill 0.25s ease; }
.sm-container .map-region[aria-pressed="true"] path { fill: #004d39; stroke: url(#active-stroke); stroke-width: 5; }
.sm-container .map-region:focus-visible path:not(.sm-map-txt) { outline: none; filter: drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.25)); }
.sm-container .map-region:focus,
.sm-container .map-region:focus path { outline: none; }

/* ── Panel (지역 select + 매장 list) ── */
.sm-container .panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sm-container .panel-title { margin: 0; font-size: 18px; font-weight: 800; }
.sm-container .panel-count { color: #cfe6df; font-size: 12px; }
.sm-container .panel-select { width: 100%; height: 50px; padding: 10px 12px; background: #077458; border: none; appearance: none; color: #fff; font-family: Pretendard; font-size: 16px; font-weight: 600; line-height: 120%; letter-spacing: -0.32px; }
.sm-container .panel-select-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.sm-container .panel-btn { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 32px; height: 32px; background: url(/resources/images/smoothmaster/sm-btn-search.png) center/contain no-repeat; pointer-events: none; }
.sm-container .panel-btn:hover { opacity: 0.8; }
.sm-container .panel-list { min-height: 350px; max-height: 520px; margin: 0; padding: 0; color: #000; list-style: none; overflow: auto; }
.sm-container .panel-item { display: flex; align-items: center; height: 50px; background-color: #fff; border-bottom: 1px solid rgba(0, 0, 0, 0.06); font-size: 16px; font-weight: 500; transition: background-color 0.2s, color 0.2s; }
.sm-container .panel-item:last-child { border-bottom: 0; }
.sm-container .panel-item:hover { background: #e5ece7; }
.sm-container .panel-item__link { display: flex !important; align-items: center; justify-content: flex-start; width: 100%; height: 100%; padding: 12px 14px; color: #333; text-decoration: none; }
.sm-container .panel-empty { padding: 10px; color: #cfe6df; }
.sm-container .panel-map-link { display: inline-flex; align-items: center; margin-left: 8px; }
.sm-container .panel-map-icon { display: block; width: 10px; height: 14px; margin-left: 5px; }
.sm-container .u-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; }

/* ── KV (Main visual) ── */
.sm-container .sm-block-list { max-width: 100%; margin: 0 auto; }
.sm-container .sm-main-kv { position: relative; width: 100%; max-height: 900px; overflow: hidden; }
.sm-container .sm-main-kv-picture{ position: absolute; top:0; left:0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.sm-container .sm-main-kv-picture img { display: block; width: 100%; height: 900px; }
.sm-container .sm-main-kv-layers { display: none; }

/* 모바일 전용 전면 비주얼(투명 PNG) — PC는 .sm-main-kv-layers 사용 */
.sm-container .sm-main-kv__mo-overlay { display: none; }
@media (max-width: 768px) {
  .sm-container .sm-main-kv__mo-overlay { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; pointer-events: none; }
}

/* Diagonal shimmer — 배경 위(z1)에서 대각선 좌→우로 천천히 무한 반복 */
.sm-container .sm-main-kv::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: sm-kv-shimmer 6s ease-in-out 0.5s infinite;
}
@keyframes sm-kv-shimmer {
  0%   { transform: translateX(-130%); }
  60%  { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}
@media (prefers-reduced-motion: reduce) {
  .sm-container .sm-main-kv::after { animation: none; }
}
/* 모바일(세로 배경): 띠를 얇게 (넓으면 끝부분이 뭉침) */
@media (max-width: 768px) {
  .sm-container .sm-main-kv::after { background: linear-gradient(120deg, transparent 43%, rgba(255, 255, 255, 0.22) 50%, transparent 57%); }
}
@media (min-width: 769px) {
  .sm-container .sm-main-kv-picture img { object-fit: cover; }
  .sm-container .sm-main-kv-layers { position: relative; z-index: 3; display: block; max-height: 900px; pointer-events: none; }
  .sm-container .sm-main-kv-layers .sm-main-kv-layers-flex { display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-start; gap: 30px; max-width: 90%; width:1107px; height: 100%; max-height: 900px; margin: 0 auto; }
  .sm-container .sm-main-kv-layers .sm-layers-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 43px; width: 50%; max-width: 450px; max-height: 800px; }
  .sm-container .sm-main-kv-layers .sm-layers-wrap img:first-child { width: 63%; margin-left: 20px; }
  .sm-container .sm-main-kv-layers > div > div:last-child { position: relative; display: flex; justify-content: flex-end; width: 50%; }
  .sm-container .sm-main-kv-layers > div > div:last-child > img:last-child { width: 459px; height: 900px; z-index: 1; }
  .sm-container .sm-main-kv-layers > div > div:first-child > img:first-child { width: 190px; height: 150px; }
  .sm-container .sm-main-kv-layers > div > div:last-child > img:first-child { position: absolute; right: 60px; top: calc(50% - 100px); transform:translateY(-50%); width: 632.094px; height: auto; }
}

@media (max-width: 1023px) {
  .sm-container .sm-main-kv-layers > div > div:last-child > img:last-child{ width:100%; height:auto; }
}

@media (max-width: 768px) {
  .sm-container .sm-main-kv-picture{ position: unset; }
}

/* ── Main map section ── */
.sm-container .sm-main-map { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; margin: 0 auto; padding: 90px 0; background: url(/resources/images/smoothmaster/sm-map-bg.jpg?v=20260619) center/cover no-repeat; text-align: center; }
.sm-container .sm-main-map .sm-map-title { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; width: 100%; text-align: center; }
.sm-container .sm-main-map .sm-map-subtitle { width: 80%; margin-bottom: 40px; color: #003523; font-size: 20px; font-weight: 500; line-height: 150%; letter-spacing: -0.4px; }
.sm-container .sm-main-map .sm-map-subtitle p { font-weight: 500 !important; }
.sm-container .sm-map-title img { width: 450px; }

/* ── Grid (매장 타일) ── */
.sm-container .sm-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; }
.sm-container .sm-grid-item { position: relative; aspect-ratio: 1/1; background: #024a37; overflow: hidden; }
.sm-container .sm-grid-item:nth-child(10n + 1),
.sm-container .sm-grid-item:nth-child(10n + 3),
.sm-container .sm-grid-item:nth-child(10n + 5),
.sm-container .sm-grid-item:nth-child(10n + 7),
.sm-container .sm-grid-item:nth-child(10n + 9) { background: #077458; }
.sm-container .sm-grid-item > a { position: absolute; inset: 0; z-index: 4; }
.sm-container .sm-grid-item .tile__media { position: absolute; inset: 0; }
.sm-container .tile__media img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 100%; max-width: 80%; height: auto; max-height: 280px; object-fit: contain; }
.sm-container .tile__media img.has-image { position: absolute; left: 50%; top: 50%; translate: -50% -50%; transform: scale(1.5); transform-origin: center; opacity: 0.1; }
.sm-container .tile__media .tile__photo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%; object-fit: contain; }
.sm-container .tile__logo { position: absolute; height: auto; z-index: 1; }
.sm-container .tile__photo { position: absolute; inset: 0; z-index: 2; transition: opacity 0.35s ease; }
.sm-container .tile__overlay { position: absolute; inset: 0; transform: translateY(100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; height: 100%; padding: 14px; background: rgba(0, 37, 26, 0.9); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.5s ease, transform 0.5s ease; z-index: 3; }
.sm-container .tile__overlay .tile__logo--ov { position: relative; display: block; width: 45%; height: auto; }
.sm-container .tile__brand { width: 100%; max-height: 120px; height: fit-content; }
.sm-container .tile__overlay .tile__brand img { position: absolute; inset: 0; display: block; width: fit-content; max-width: 70%; height: 100%; max-height: 200px; margin: auto; aspect-ratio: 1/1; object-fit: contain; }
.sm-container .tile__addr { position: absolute; bottom: 10%; width: 80%; height: 20%; margin: 0 auto; color: #fff; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.4; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); word-break: keep-all; overflow-wrap: break-word; }
.sm-container .sm-grid-item:hover .tile__overlay { opacity: 1; transform: translateY(0); }
.sm-container .sm-grid .tile__media img.tile__logo.has-image { opacity: 0.15; }

/* ── Modal (매장 상세) ── */
.sm-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.sm-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
.sm-modal[aria-hidden="false"] { display: flex; }
.sm-modal__dialog { position: relative; display: flex; flex-direction: row-reverse; width: min(92vw, 1120px); max-height: 80vh; aspect-ratio: 1113 / 711; background-color: #004e3a; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); overflow: hidden; }
.sm-modal__bg { position: absolute; inset: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; pointer-events: none; z-index: 5; }
.sm-modal__close { position: absolute; right: 30px; top: 30px; width: 24px; height: 24px; background: url(/resources/images/smoothmaster/sm-x-btn.png) no-repeat center/contain; border: 0; color: transparent; cursor: pointer; z-index: 10; }
.sm-modal__close:hover { opacity: 0.9; }
.sm-modal__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sm-modal__media { position: relative; display: flex; flex: 1; justify-content: center; min-width: 36%; padding: 10% 10px 0; background: transparent; overflow: hidden; z-index: 2; }
.sm-modal__media.is-video { padding: 0; }
.sm-modal__media:has(.sm-modal__logo) { padding: 0; }
.sm-modal__media img,
.sm-modal__media video { display: block; object-fit: contain; }
.sm-modal__media img { margin: 0 auto; }
.sm-modal__media img.sm-modal__photo { max-width: 100%; max-height: 93%; object-fit: cover; }
.sm-modal__body { position: relative; padding: 90px 20px 24px; background: transparent; color: #fff; overflow: hidden; z-index: 2; }
.sm-modal__body p img { width: 70%; margin-bottom: 5px; }
.sm-modal__body div { display: flex; align-items: flex-start; font-size: clamp(24px, 3vw, 42px); font-weight: 600; line-height: 150%; }
.sm-modal__body div .sm-modal__badge,
.sm-modal__body div h2 { font-family: Pretendard; font-size: clamp(24px, 3vw, 42px); font-weight: 600; line-height: 150%; letter-spacing: -0.84px; }
.sm-modal__body div p { margin-right: 10px; }
.sm-modal__title { margin: 0 0 16px; color: #fff; font-size: clamp(24px, 2.1vw, 42px); font-weight: 500; line-height: 150%; letter-spacing: -0.32px; }
.sm-modal__desc { display: block; width: 95%; height: 60%; margin: 0; color: #fff; font-size: clamp(14px, 1.8vw, 18px); font-weight: 500; line-height: 150%; letter-spacing: -0.32px; white-space: pre-line; overflow-y: auto; }
.sm-modal__addr { margin: 10px 0 0; color: #fff; font-size: clamp(12px, 1.7vw, 14px); opacity: 0.9; }
.sm-modal__badge { color: #e2bd5a; }
.sm-modal__descbox { max-height: 320px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: #fff #004e3a; overflow-y: auto; }
.sm-modal__descbox::-webkit-scrollbar { width: 8px; }
.sm-modal__descbox::-webkit-scrollbar-thumb { background: #fff; border-radius: 8px; }
.sm-modal__descbox::-webkit-scrollbar-track { background: #004e3a; }
.sm-modal__logo-bg { position: absolute; inset: 0; left: 0; bottom: 40px; opacity: 0.15; pointer-events: none; z-index: 1; }
.sm-modal__logo-bg img { position: absolute; right: 0; bottom: -6%; max-width: 60%; max-height: 85%; object-fit: contain; }

/* ── PC/Mobile toggle ── */
.sm-pc-none { display: block; }
.sm-mo-none { display: none; }

/* ── 모달 desc 클램프 (모바일 3줄) ── */
#smModalDesc { line-height: 1.6; white-space: pre-line; }
#smModalMoreBtn { display: none; }

@media (min-width: 769px) {
  #smModalDesc { display: block; overflow-y: auto; -webkit-line-clamp: unset; white-space: pre-line; }
  #smModalMoreBtn { display: none !important; }
}

@media (max-width: 1279px) {
  .sm-container .tile__addr{ display: none; }
}


@media (max-width: 960px) {
  .sm-container .card--panel{ width: 100%; }
  .sm-container .app-grid { grid-template-columns: 1fr; grid-template-areas: "panel" "map"; gap: 40px; }
}

@media (max-width: 768px) {
  .sm-container .app-grid { justify-items: center; }
  .sm-container .app-title,
  .sm-container .app-subtitle { text-align: center; }
  .sm-container .app-subtitle { font-size: 16px; }
  .sm-container .card--map { width: 80vw; }
  .sm-container .card--panel { width: 90%; padding: 0; }
  .sm-container .panel-list { min-height: unset; max-height: fit-content; }
  .sm-container .sm-main-kv { height: auto; }
  .sm-container .sm-main-kv-picture img { height: auto; }
  .sm-container .sm-main-map { padding: 70px 0 30px; background: url(/resources/images/smoothmaster/sm-map-bg-mo.png?v=20260619) center/cover no-repeat !important; }
  .sm-container .sm-map-title img { width: 80%; }
  .sm-container .sm-map-subtitle { width: 90%; font-size: 16px !important; letter-spacing: -0.32px; }
  .sm-container .sm-mo-none { display: block; }
  .sm-container .sm-pc-none { display: none; }
  .sm-container .sm-map-wrap .app { width: 95vw; }
  .sm-container .sm-grid { grid-template-columns: repeat(2, 1fr); }
  .sm-container .sm-grid-item { background: #077458; }
  .sm-container .sm-grid-item:nth-child(4n + 2),
  .sm-container .sm-grid-item:nth-child(4n + 3) { background: #024a37; }
  .sm-container .tile__addr { margin-top: 6px; font-size: 12px; }

  .sm-modal__dialog { display: block; width: min(79vw, 980px); height: auto; max-height: 57dvh; aspect-ratio: unset; overflow-y: auto; }
  .sm-modal__dialog:has(.is-video) { max-height: 67dvh; }
  .sm-modal__close { right: 10px; top: 10px; width: 20px; height: 20px; line-height: 20px; }
  .sm-modal__body { position: relative; padding: 30px 15px 0; z-index: 3; }
  .sm-modal__body div { align-items: center; font-size: 20px; line-height: 20px; }
  .sm-modal__body div p,
  .sm-modal__body div h2 { font-size: 20px; }
  .sm-modal__body div p img { width: 60%; }
  .sm-modal__body .sm-modal__title { margin: 0; }
  .sm-modal__body #smModalDesc { font-size: 14px; line-height: unset; white-space: unset; }
  .sm-modal__media { padding-bottom: 50px; }
  .sm-modal__media img.sm-modal__photo,
  .sm-modal__media img.sm-modal__logo { max-height: 225px; object-fit: contain; }
  .sm-modal__media:has(.sm-modal__logo) { margin-top: 20px; }
  .sm-modal__media:has(.sm-modal__photo) { margin-bottom: -13%; padding-bottom: unset; }
  .sm-modal__desc { width: 100%; }
  .sm-modal__logo-bg img { bottom: unset; top: 10%; }
  .sm-modal__bg { position: sticky; height: auto; object-fit: cover; }
  #sm-modal__bg { position: sticky; inset: 0; bottom: 0; display: block; width: 100%; height: auto; object-fit: none; object-position: unset; pointer-events: none; z-index: 5; }

  #smModalDescBox:not(.is-expanded) #smModalDesc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; max-height: calc(1.6em * 3); white-space: normal; overflow: hidden; }
  #smModalDescBox.is-expanded #smModalDesc { display: block; -webkit-line-clamp: unset; }
  #smModalMoreBtn { display: inline-block; margin-bottom: 6px; padding: 0; background: none; border: 0; color: #fff; font: inherit; font-size: 12px; opacity: 0.8; cursor: pointer; }

  .smDesWrap { display: flex; flex-direction: column; align-items: flex-end !important; font-size: 14px; }
  .smDesWrap button { font-size: 12px !important; }
}

/* swiper-wrapper height auto (smoothmaster swiper 한정) */
.sm-container .swiper-wrapper { height: auto !important; }
