/* 산지프라임 · sjprime.kr 모바일 중심 1차 UI (기존 상품/주문 PHP 유지) */
:root{--sj-green:#208963;--sj-orange:#ff921e;--sj-ink:#202020}
.sjprime-brand-side{display:none}
.sjprime-app-tabs{display:flex;align-items:center;justify-content:space-around;gap:2px;background:#fff;border-bottom:1px solid #ededed;min-height:49px;}
.sjprime-app-tabs a{padding:14px 8px;font-weight:750;font-size:13px;white-space:nowrap}
.sjprime-app-tabs a:hover{color:var(--sj-green)}
.sjprime-mark{width:38px;height:38px;border-radius:50%;object-fit:cover;flex:0 0 auto}
.header-row .logo{display:flex;align-items:center;gap:5px}
.header-row .logo b{font-weight:950;letter-spacing:-1px;white-space:nowrap;font-size:20px;color:#222}
@media(min-width:760px){
 body{background:#f6f0eb!important}
 .topbar{display:none!important}
 body>.header,body>main,body>.support,body>footer,body>.mobile-bottom{max-width:470px!important;margin-left:auto!important;margin-right:auto!important;background:#fff}
 body>main{min-height:80vh;overflow:hidden;box-shadow:0 1px 24px rgba(0,0,0,.04)}
 body>.header{position:relative;box-shadow:0 0 20px rgba(0,0,0,.04);z-index:25}
 body>footer{padding-bottom:85px}
 body>.mobile-bottom{position:fixed;left:50%;transform:translateX(-50%);bottom:0;z-index:30;width:470px;display:flex!important}
 .sjprime-brand-side{display:flex;position:fixed;top:14%;left:calc(50% + 282px);width:290px;align-items:center;flex-direction:column;gap:9px;text-align:center;z-index:1}
 .sjprime-brand-side>img:first-child{display:block;width:170px;height:170px;object-fit:contain;mix-blend-mode:multiply;border-radius:12px}
 .sjprime-brand-side h2{font-size:24px;letter-spacing:-1.1px;font-weight:600;line-height:1.35;margin:4px 0 0}
 .sjprime-brand-side h2 strong{color:var(--sj-green);font-weight:900;font-size:33px}
 .sjprime-brand-side .sjprime-qr{width:132px;height:132px;object-fit:contain;border-radius:15px;background:white;padding:8px;box-shadow:0 5px 22px rgba(0,0,0,.05)}
 .sjprime-brand-side p{font-size:13px;color:#666;margin:0}
 .header-row{padding:0 14px!important;max-width:470px!important;height:58px!important;gap:11px!important}
 .header-row .search{display:none!important}
 .header-row .quick{display:none!important}
 .header-row .mobile-auth-state{display:block!important;font-size:12px}
 .wrap{width:calc(100% - 24px)!important;max-width:none!important}
 .nav-scroll{display:none!important}
 .main-slider{height:270px!important;min-height:0!important;max-height:none!important}
 .main-slide img{object-fit:cover!important}
 .prime-quick{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:6px!important;margin-top:18px!important}
 .prime-quick a{padding:12px 4px!important;min-width:0!important;border-radius:12px!important}
 .prime-quick a span{font-size:21px!important}
 .prime-quick a b{font-size:11px!important}
 .prime-quick a small{display:none!important}
 .category-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 .product-grid{grid-template-columns:repeat(1,minmax(0,1fr))!important;gap:16px!important}
 .section-title h2{font-size:22px!important;line-height:1.3}
 .prime-story,.prime-benefit{display:none!important}
 .footer-grid{grid-template-columns:1fr!important}
}
@media (min-width:760px) and (max-width:1240px){.sjprime-brand-side{display:none}}
@media(max-width:759px){
 body{background:#fff!important}
 .topbar{display:none!important}
 .header-row{height:58px!important}
 .header-row .logo b{font-size:20px!important}
 .header-row .search{display:none!important}
 .header-row .mobile-auth-state{display:block!important}
 .nav-scroll{display:none!important}
 .main-slider{height:60vw!important;max-height:300px!important;min-height:200px!important}
 .main-slide img{object-fit:cover!important}
 .prime-quick{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
 .prime-quick a{padding:9px 3px!important;min-width:0!important}
 .prime-quick a small{display:none!important}
 .prime-quick a b{font-size:11px!important}
 .product-grid{grid-template-columns:1fr!important}
}
@media(min-width:760px) and (max-width:940px){.header-row .logo b{font-size:18px}}

/* 산지프라임 PC 모바일형 레이아웃 안정화 / 2026-11-02
   이 파일 내용은 sjprime-mobile.css의 맨 아래에 적용됩니다. */
@media (min-width:760px) {
  /* PC에서도 쇼핑몰 콘텐츠는 470px 모바일 앱 패널로 유지 */
  body > .header,
  body > main,
  body > .support,
  body > footer {
    box-sizing: border-box !important;
    width: 470px !important;
    max-width: 470px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* 기존 PC용 가로 배치가 470px 안에서 글자를 한 글자씩 줄바꿈하던 오류 수정 */
  body > .support {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
    padding: 24px 18px 27px !important;
    background: #f4f8f5 !important;
  }
  body > .support > div {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0 !important;
  }
  body > .support b {
    display: block;
    font-size: 21px !important;
    line-height: 1.45;
    white-space: normal;
    word-break: keep-all;
  }
  body > .support p {
    margin: 7px 0 6px;
    font-size: 13px;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  body > .support > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0 !important;
    padding: 13px 7px !important;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
  }

  /* 5개 하단 메뉴를 PC에서도 모바일앱처럼 동등한 너비로 배치 */
  body > .mobile-bottom {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    z-index: 100 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 470px !important;
    max-width: 100vw !important;
    min-height: 65px;
    padding: 7px 0 max(7px, env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    border-top: 1px solid #e6e6e6;
    background: #fff !important;
    box-shadow: 0 -2px 14px rgba(0,0,0,.04);
  }
  body > .mobile-bottom > a {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 1px 0;
    text-align: center;
    font-size: 23px !important;
    line-height: 1.15;
    text-decoration: none;
  }
  body > .mobile-bottom > a > small {
    display: block !important;
    margin-top: 4px;
    font-size: 10px !important;
    line-height: 1.2;
    color: #646c67;
    white-space: nowrap;
  }

  /* 메인 하단의 고객센터 카드도 2열 PC 그리드 대신 1열로 */
  .prime-service,
  .prime-story-inner,
  .checkout-grid,
  .detail,
  .my-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .prime-service { gap: 12px !important; padding-bottom: 28px !important; }
  .prime-service > div { min-width: 0; padding: 22px 18px !important; }
  .prime-service h2 { font-size: 21px !important; line-height: 1.4; word-break: keep-all; }
  .prime-service p { font-size: 13px !important; word-break: keep-all; }
  .prime-help-card div { display: flex; gap: 8px !important; flex-wrap: wrap !important; }
  .prime-help-card div a { font-size: 13px; padding: 11px 12px !important; }
  .prime-trust,
  .trust { grid-template-columns: minmax(0, 1fr) !important; gap: 11px !important; }
  .trust > div { min-width: 0; padding: 18px 20px; }
  .section-title { gap: 12px; align-items: flex-start; }
  .section-title > div { min-width: 0; }
  .section-title h2 { word-break: keep-all; overflow-wrap: break-word; }
  .section-title > a { flex: 0 0 auto; white-space: nowrap; font-size: 12px; }
  .category-section, .product-section { padding: 32px 0 !important; }
  .prime-category { padding-top: 30px !important; }
  .prime-product-section { padding-top: 30px !important; }
  .page-head { padding: 29px 0 16px; }
  .page-head h1 { font-size: 26px; }
  .detail { gap: 20px !important; padding: 24px 0 !important; }
  .detail-image { height: 390px !important; }
  .detail-info h1 { font-size: 25px !important; }
  .form-card, .summary, .seller-form, .auth, .cart-box, .my-grid { padding: 20px !important; }
  .notice-list a { grid-template-columns: 42px minmax(0,1fr) !important; gap: 8px; }
  .notice-list small { display: none; }
  body > footer { padding-bottom: 94px !important; }
  body > footer .wrap { width: calc(100% - 36px) !important; }
  body > footer .footer-grid { gap: 22px; }
}
/* PC와 모바일 사이 화면(태블릿 포함)에서도 하단 메뉴가 사라지지 않게 처리 */
@media (min-width:641px) and (max-width:759px) {
  body { padding-bottom: 65px; }
  body > .mobile-bottom {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 65px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    z-index: 100;
  }
  body > .mobile-bottom > a { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 23px; }
  body > .mobile-bottom small { display: block; font-size: 10px; }
  .support { flex-wrap: wrap; padding: 24px 16px; }
  .support > div { width: 100%; min-width: 0; }
}

/* 2026-11-02: PC 상단 공식 로고 표시 (사용자 제공 원본 그대로 사용) */
.header-row .sjprime-official-logo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  text-decoration: none !important;
}
.header-row .sjprime-official-logo .sjprime-mark {
  width: 53px !important;
  height: 53px !important;
  max-width: none !important;
  flex: 0 0 53px !important;
  display: block !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #fff;
}
.header-row .sjprime-official-logo b {
  color: #208963 !important;
  display: block !important;
  font-size: 21px !important;
  font-weight: 900 !important;
  letter-spacing: -0.9px !important;
  white-space: nowrap !important;
  line-height: 1.15 !important;
}
@media (min-width:760px) {
  .header-row { height: 68px !important; }
  .header-row .sjprime-official-logo { margin-right: auto !important; }
  .header-row .sjprime-official-logo .sjprime-mark {
    width: 57px !important;
    height: 57px !important;
    flex-basis: 57px !important;
  }
  .header-row .sjprime-official-logo b { font-size: 22px !important; }
}
@media (max-width:759px) {
  .header-row .sjprime-official-logo .sjprime-mark {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
  }
  .header-row .sjprime-official-logo b { font-size: 19px !important; }
}
@media (max-width:360px) {
  .header-row .sjprime-official-logo { gap: 3px !important; }
  .header-row .sjprime-official-logo .sjprime-mark {
    width: 39px !important;
    height: 39px !important;
    flex-basis: 39px !important;
  }
  .header-row .sjprime-official-logo b { font-size: 18px !important; }
}
