/* foodmart (남도미식) — v0.2.0
   레이아웃: 모바일 프레임 UX (jeollayouth 스타일)
   원칙: PC 접속에도 모바일 폭(~500px) 센터 정렬, 항상 하단 고정바·카톡FAB, 컴팩트 헤더 */

:root{
  --brand:#111;
  --accent:#e63946;         /* 할인·긴급 */
  --accent-2:#2a9d8f;
  --navy:#0B1B34;
  --line:#eef0f2;
  --line-soft:#f4f5f7;
  --muted:#8a8f97;
  --muted-2:#6b7280;
  --bg:#fff;
  --bg-soft:#fafafa;
  --bg-frame:#f2f2f4;       /* PC 배경 (프레임 밖) */
  --radius:14px;
  --radius-sm:8px;
  --radius-lg:20px;
  --frame:500px;            /* 모바일 프레임 최대폭 */
  --hd-h:52px;
  --nav-h:60px;
  --shadow-sm:0 2px 8px rgba(0,0,0,.05);
  --shadow-md:0 8px 24px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html{ background:var(--bg-frame); }
html,body{ margin:0; padding:0; }
body{ font-family:'Pretendard Variable',Pretendard,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  color:var(--brand); background:var(--bg); font-size:14px; line-height:1.55; letter-spacing:-.01em;
  max-width:var(--frame); margin:0 auto; min-height:100vh; position:relative;
  box-shadow:var(--shadow-md); padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; display:block; }
button{ font:inherit; color:inherit; cursor:pointer; background:none; border:0; padding:0; }

.fm-wrap{ padding:0 14px; }
.fm-skip{ position:absolute; left:-9999px; top:0; }
.fm-skip:focus{ left:8px; top:8px; padding:8px 12px; background:#000; color:#fff; z-index:9999; }

/* 데모 배너 (컴팩트) */
.fm-demo{ display:flex; flex-direction:column; align-items:center; padding:6px 12px;
  background:linear-gradient(90deg,var(--navy),#1e3a8a); color:#fff; font-size:11px; text-align:center; gap:2px; }
.fm-demo b{ background:#B4E56E; color:var(--navy); padding:1px 6px; border-radius:4px; font-weight:800; font-size:10px; margin-right:4px; }
.fm-demo a{ margin-top:4px; padding:3px 10px; border:1px solid rgba(255,255,255,.4); border-radius:999px; font-size:11px; }

/* ============================================================ 헤더 (모바일 상시) */
.fm-header{ position:sticky; top:0; z-index:100; background:#fff; border-bottom:1px solid var(--line); }
.fm-header__in{ display:grid; grid-template-columns:40px 1fr auto; align-items:center; height:var(--hd-h); padding:0 8px; gap:4px; }
.fm-header__burger{ width:40px; height:40px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:4px; }
.fm-header__burger span{ display:block; width:20px; height:2px; background:#111; border-radius:2px; }
.fm-brand{ font-size:17px; font-weight:800; letter-spacing:-.03em; display:flex; flex-direction:column; align-items:center; line-height:1; }
.fm-brand small{ font-size:8px; color:var(--muted); font-weight:600; letter-spacing:.15em; margin-top:2px; }
.fm-gnb{ display:none; }
.fm-header__act{ display:flex; gap:2px; align-items:center; }
.fm-ico{ width:38px; height:38px; display:grid; place-items:center; border-radius:8px; font-size:16px; }
.fm-ico:active{ background:var(--bg-soft); }
.fm-btn{ padding:6px 12px; border-radius:6px; background:#111; color:#fff; font-weight:700; font-size:12px; }
.fm-btn--sm{ padding:5px 10px; font-size:11px; }

/* ============================================================ 히어로 (1:1 정사각) */
.fm-hero{ overflow:hidden; margin-bottom:6px; }
.fm-hero .swiper-slide img{ width:100%; aspect-ratio:1/1; object-fit:cover; }
.fm-hero .swiper-pagination{ bottom:8px !important; }
.fm-hero .swiper-pagination-bullet{ background:#fff; opacity:.5; width:6px; height:6px; }
.fm-hero .swiper-pagination-bullet-active{ opacity:1; width:18px; border-radius:3px; }
.fm-hero .swiper-button-next, .fm-hero .swiper-button-prev{ display:none; }

/* ============================================================ 검색어 제안 */
.fm-keywords{ padding:10px 0; background:#fff; border-bottom:1px solid var(--line-soft); }
.fm-keywords__scroll{ display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; padding:0 14px; }
.fm-keywords__scroll::-webkit-scrollbar{ display:none; }
.fm-kw{ flex:0 0 auto; padding:5px 10px; border-radius:999px; background:var(--bg-soft); font-size:11.5px; color:#4b5563; font-weight:500; }
.fm-kw:active{ background:var(--line); }

/* ============================================================ 섹션 공통 */
.fm-sec{ padding:24px 0 16px; background:#fff; }
.fm-sec + .fm-sec{ border-top:8px solid var(--bg-soft); }
.fm-sec--empty{ padding:18px 14px; color:var(--muted); font-size:12px; }
.fm-sec__hd{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; padding:0 14px; }
.fm-sec__t{ margin:0; font-size:16px; font-weight:800; letter-spacing:-.03em; line-height:1.2; }
.fm-sec__t::after{ content:''; display:inline-block; width:6px; height:6px; background:var(--accent); border-radius:50%; margin-left:6px; vertical-align:middle; transform:translateY(-2px); }
.fm-sec__more{ font-size:12px; color:var(--muted-2); }

/* ============================================================ 상품 그리드 (BEST · 2열) */
.fm-prod-grid{ list-style:none; margin:0; padding:0 14px; display:grid; grid-template-columns:repeat(2, 1fr); gap:16px 10px; }

/* ============================================================ 상품 카드 */
.fm-prod{ position:relative; }
.fm-prod__thumb{ position:relative; display:block; overflow:hidden; border-radius:var(--radius); background:var(--bg-soft); aspect-ratio:1/1; }
.fm-prod__thumb img{ width:100%; height:100%; object-fit:cover; transition:transform .35s ease; }
.fm-prod__thumb:active img{ transform:scale(.98); }
.fm-prod__sale{ position:absolute; left:8px; top:8px; padding:3px 8px; background:var(--accent); color:#fff; font-weight:800; font-size:11px; border-radius:6px; letter-spacing:-.02em; z-index:2; }
.fm-prod__badges{ position:absolute; right:8px; top:8px; display:flex; flex-direction:column; gap:4px; align-items:flex-end; z-index:2; max-width:70%; }
.fm-prod__badges span{ padding:2px 6px; background:rgba(0,0,0,.72); color:#fff; font-size:9.5px; border-radius:4px; letter-spacing:-.01em; font-weight:600; }
.fm-prod__quick{ position:absolute; right:8px; bottom:8px; width:32px; height:32px; border-radius:50%; background:#fff; font-size:18px; font-weight:600; box-shadow:var(--shadow-sm); color:#111; z-index:2; }
.fm-prod__quick:active{ transform:scale(.94); background:#111; color:#fff; }
.fm-prod__body{ display:block; padding:8px 2px 0; }
.fm-prod__name{ margin:0 0 4px; font-size:12.5px; font-weight:600; line-height:1.35; letter-spacing:-.01em;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.7em; }
.fm-prod__origin{ margin:0 0 3px; font-size:10.5px; color:var(--muted); }
.fm-prod__price{ margin:0; display:flex; flex-direction:column; align-items:flex-start; gap:0; }
.fm-prod__cust{ font-size:10.5px; color:var(--muted); text-decoration:line-through; line-height:1.4; }
.fm-prod__price strong{ font-size:15px; font-weight:800; letter-spacing:-.03em; color:#111; line-height:1.2; }

/* ============================================================ 캐러셀 (수평 스크롤, 2열 폭) */
.fm-carousel{ overflow:hidden; padding:0 14px; }
.fm-carousel__wrap{ padding-bottom:4px; }
.fm-carousel .swiper-slide{ width:47%; }
.fm-carousel .swiper-button-next, .fm-carousel .swiper-button-prev{ display:none; }

/* ============================================================ 리뷰 배너 */
.fm-review{ padding:32px 14px; background:linear-gradient(135deg, #FEF3F2, #FFF7ED); text-align:center; border-radius:0; margin:8px 0 0; }
.fm-review a{ display:inline-block; }
.fm-review__eyebrow{ color:var(--accent); font-size:10.5px; letter-spacing:.2em; margin:0 0 6px; font-weight:700; }
.fm-review h2{ margin:0 0 8px; font-size:19px; font-weight:800; letter-spacing:-.03em; }
.fm-review span{ color:#111; font-weight:700; font-size:12.5px; padding:8px 20px; background:#fff; border-radius:999px; display:inline-block; box-shadow:var(--shadow-sm); }

/* ============================================================ 푸터 */
.fm-footer{ padding:28px 14px 20px; background:#111; color:#c9ccd1; margin-top:0; }
.fm-footer .fm-brand{ color:#fff; align-items:flex-start; font-size:18px; margin-bottom:6px; }
.fm-footer__grid{ display:flex; flex-direction:column; gap:20px; margin-bottom:24px; }
.fm-footer__slogan{ margin:8px 0; font-size:12px; }
.fm-footer__slogan strong{ display:block; color:#fff; margin-bottom:4px; font-weight:700; font-size:13px; }
.fm-footer__tel{ display:block; margin-top:10px; font-size:18px; font-weight:800; color:#fff; letter-spacing:-.02em; }
.fm-footer__info{ font-size:11.5px; color:#7d8085; padding-top:14px; border-top:1px solid #262626; }
.fm-footer__info p{ margin:0 0 4px; }
.fm-footer__links{ display:flex; gap:10px; flex-wrap:wrap; font-size:11.5px; padding-top:14px; border-top:1px solid #262626; }
.fm-footer__links a:active{ color:#fff; }
.fm-footer__copy{ padding-top:16px; font-size:10.5px; color:#6b7280; text-align:left; margin:0; }

/* ============================================================ 하단 고정 네비 (상시) */
.fm-float{ position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:var(--frame); z-index:80;
  display:flex; justify-content:space-around; align-items:center;
  padding:6px 0 max(6px, env(safe-area-inset-bottom));
  background:#fff; border-top:1px solid var(--line); box-shadow:0 -4px 16px rgba(0,0,0,.04); }
.fm-float a{ display:flex; flex-direction:column; align-items:center; gap:2px;
  font-size:10px; color:#4b5563; padding:6px 4px; font-weight:600; flex:1; text-align:center; }
.fm-float a::before{ content:''; display:block; width:20px; height:20px; margin-bottom:2px;
  background-repeat:no-repeat; background-position:center; background-size:contain; opacity:.65; }
.fm-float a:nth-child(1)::before{ content:'🏠'; font-size:18px; height:auto; background:none; }
.fm-float a:nth-child(2)::before{ content:'📋'; font-size:18px; height:auto; background:none; }
.fm-float a:nth-child(3)::before{ content:'🛒'; font-size:18px; height:auto; background:none; }
.fm-float a:nth-child(4)::before{ content:'💬'; font-size:18px; height:auto; background:none; }
.fm-float a:nth-child(5)::before{ content:'👤'; font-size:18px; height:auto; background:none; }
.fm-float__cart{ color:var(--accent) !important; font-weight:800 !important; }

/* ============================================================ 카카오 FAB (상시) */
.fm-kakao-fab{ position:fixed; z-index:90;
  left:50%; transform:translateX(calc(var(--frame)/2 - 66px));
  bottom:calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  width:48px; height:48px; border-radius:50%;
  background:#FEE500; font-size:24px; display:grid; place-items:center;
  box-shadow:0 6px 20px rgba(0,0,0,.15); border:0; }
.fm-kakao-fab:active{ transform:translateX(calc(var(--frame)/2 - 66px)) scale(.94); }

/* Top */
.fm-top-btn{ position:fixed; z-index:85;
  left:50%; transform:translateX(calc(var(--frame)/2 - 66px));
  bottom:calc(var(--nav-h) + 68px + env(safe-area-inset-bottom));
  width:38px; height:38px; border-radius:50%; background:#fff;
  border:1px solid var(--line); box-shadow:var(--shadow-sm); font-size:16px; color:#111; }

/* ============================================================ PC 좌우 wing 사이드바 (jeollayouth 스타일) */
.fm-wing{ display:none; position:fixed; top:0; bottom:0; width:260px; padding:20px 14px;
  overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; z-index:70;
  font-size:12.5px; }
.fm-wing::-webkit-scrollbar{ width:6px; }
.fm-wing::-webkit-scrollbar-thumb{ background:#d0d3d8; border-radius:3px; }
.fm-wing__sticky{ display:flex; flex-direction:column; gap:16px; }

/* 좌측 */
.fm-wing--l{ left:calc(50% - var(--frame)/2 - 260px - 12px); }
.fm-wing__brand{ display:flex; flex-direction:column; padding:22px 18px; border-radius:14px;
  background:linear-gradient(135deg,#8B1E3F,#3C1642); color:#fff; text-align:center; }
.fm-wing__logo{ font-size:22px; font-weight:800; letter-spacing:-.03em; margin-bottom:2px; }
.fm-wing__brand small{ font-size:10px; letter-spacing:.2em; opacity:.7; }
.fm-wing__brand p{ font-size:12px; margin:12px 0 0; opacity:.9; }

.fm-wing__search{ display:flex; gap:0; }
.fm-wing__search input{ flex:1; padding:10px 12px; border:2px solid #ff873d; border-right:0;
  border-radius:8px 0 0 8px; font-size:12px; outline:none; background:#fff; font-family:inherit; }
.fm-wing__search button{ width:44px; background:#ff873d; border:0; border-radius:0 8px 8px 0; color:#fff; font-size:14px; cursor:pointer; }

.fm-wing__kwbox{ background:#fff; border-radius:12px; padding:14px; border:1px solid var(--line); }
.fm-wing__kwtitle{ margin:0 0 10px; font-size:11.5px; color:var(--muted-2); text-align:center; font-weight:500; }
.fm-wing__kwgrid{ display:flex; flex-wrap:wrap; gap:5px; justify-content:center; }
.fm-wing__kw{ padding:5px 10px; border-radius:999px; font-size:11px; font-weight:500; line-height:1; }
.fm-wing__kw.is-w{ background:#fff; color:#333; border:1px solid var(--line); }
.fm-wing__kw.is-b{ background:#111; color:#fff; }
.fm-wing__kw:hover{ transform:translateY(-1px); }

.fm-wing__contact{ text-align:center; padding:14px; background:#f7f7f8; border-radius:12px; }
.fm-wing__ctel{ margin:0; font-size:18px; font-weight:800; letter-spacing:-.02em; color:#111; }
.fm-wing__ctime{ margin:4px 0 0; font-size:11px; color:var(--muted); }

/* 우측 */
.fm-wing--r{ left:calc(50% + var(--frame)/2 + 12px); }
.fm-wing__rankhd{ padding:0 4px; }
.fm-wing__eyebrow{ margin:0 0 4px; font-size:10px; letter-spacing:.2em; color:var(--accent); font-weight:700; }
.fm-wing__rankhd h3{ margin:0 0 12px; font-size:15px; font-weight:800; letter-spacing:-.02em; }

.fm-wing__ranklist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.fm-wing__ranklist a{ display:flex; gap:10px; align-items:flex-start; padding:8px; border-radius:10px; background:#fff; border:1px solid var(--line-soft); }
.fm-wing__ranklist a:hover{ border-color:var(--line); }
.fm-wing__thumb{ position:relative; width:66px; height:66px; flex-shrink:0; border-radius:8px; overflow:hidden; background:var(--bg-soft); }
.fm-wing__thumb img{ width:100%; height:100%; object-fit:cover; }
.fm-wing__rank{ position:absolute; left:0; top:0; width:22px; height:22px; background:#111; color:#fff;
  border-radius:0 0 8px 0; font-size:11px; font-weight:800; display:grid; place-items:center; }
.fm-wing__info{ flex:1; min-width:0; }
.fm-wing__name{ margin:0 0 4px; font-size:11.5px; font-weight:600; line-height:1.35; color:#111;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.fm-wing__price{ margin:0; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px; }
.fm-wing__price small{ font-size:10px; color:var(--muted); text-decoration:line-through; }
.fm-wing__price strong{ font-size:13px; font-weight:800; letter-spacing:-.02em; }
.fm-wing__price em{ font-size:11px; font-weight:800; font-style:normal; color:var(--accent); }
.fm-wing__empty{ padding:24px 0; text-align:center; color:var(--muted); font-size:11.5px; }

.fm-wing__cta{ display:flex; flex-direction:column; gap:6px; margin-top:4px; }
.fm-wing__cartbtn, .fm-wing__mybtn{ display:block; padding:11px 12px; border-radius:10px; font-size:12.5px; font-weight:700; text-align:center; }
.fm-wing__cartbtn{ background:var(--accent); color:#fff; }
.fm-wing__mybtn{ background:#fff; color:#111; border:1px solid var(--line); }

/* ============================================================ PC 화면 안내 · wing 노출 breakpoint */
@media (min-width: 1080px){
  .fm-wing{ display:block; }
  html::before{ display:none; }
}
@media (min-width: 520px) and (max-width: 1079px){
  html::before{ content:'📱 모바일 화면 미리보기 · 실제 방문자의 90% 이상이 모바일로 접속합니다';
    position:fixed; top:20px; left:50%; transform:translateX(calc(-1 * var(--frame)/2 - 24px));
    max-width:200px; text-align:right; color:#666; font-size:12px; line-height:1.6;
    font-family:'Pretendard Variable',sans-serif; letter-spacing:-.01em; }
}
@media (max-width: 519px){
  html{ background:#fff; }
  body{ box-shadow:none; }
  html::before{ display:none; }
  .fm-float, .fm-kakao-fab, .fm-top-btn{ left:0; right:0; max-width:100%; transform:none; }
  .fm-kakao-fab{ right:14px; left:auto; }
  .fm-top-btn{ right:14px; left:auto; }
}
