/* 모바일 메인 페이지 전용 스타일 */
/* 767px 이하 화면에만 적용 */

@media only screen and (max-width: 767.98px) {
  
    /* ============================================
       햄버거 메뉴 카테고리 (펼쳐지는 메뉴)
       ============================================ */
    
    /* ============================================
       모바일 전체 화면 메뉴 오버레이
       ============================================ */
    
    .mobile-menu-overlay {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 99999 !important;
      overflow: hidden;
      display: none !important; /* 초기 상태: 숨김 */
      margin: 0 !important;
      padding: 0 !important;
      transform: none !important;
      will-change: auto !important;
    }
    
    /* sticky-top의 containing block 영향 제거 */
    .sticky-top .mobile-menu-overlay {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
    }
  
    .mobile-menu-overlay.show,
    .mobile-menu-overlay.collapsing {
      display: block !important;
    }
    
    /* 인라인 스타일이 있어도 show 클래스가 있으면 표시 */
    .mobile-menu-overlay.show[style*="display"] {
      display: block !important;
    }
  
    .mobile-menu-container {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      width: 85% !important;
      max-width: 400px !important;
      height: 100% !important;
      background-color: #fff !important;
      overflow-y: auto !important;
      box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
    }
  
    /* 상단 헤더 */
    .mobile-menu-header {
      background-color: #fff;
      position: sticky;
      top: 0;
      z-index: 10;
      border-bottom: 1px solid #eee;
    }
  
    /* 탭 버튼 */
    .mobile-menu-tabs {
      position: sticky;
      top: 0;
      background-color: #fff;
      z-index: 9;
    }
  
    .mobile-tab-btn {
      flex: 1;
      padding: 12px;
      border: none;
      background: none;
      font-size: 14px;
      font-weight: 500;
      color: #666;
      border-bottom: 2px solid transparent;
      cursor: pointer;
    }
  
    .mobile-tab-btn.active {
      color: #d60000;
      border-bottom-color: #d60000;
      font-weight: 600;
    }
  
    /* 탭 컨텐츠 */
    .mobile-tab-content {
      display: none;
    }
  
    .mobile-tab-content.active {
      display: block;
    }
  
    /* 카테고리 리스트 */
    .mobile-category-list {
      background-color: #fff;
    }
  
    .mobile-category-item {
      background-color: #fff;
    }
  
    .mobile-category-item .d-flex.justify-content-between {
      cursor: pointer;
    }
  
    .mobile-category-item .d-flex.justify-content-between:hover {
      background-color: #f8f9fa;
    }
  
    /* 서브카테고리 */
    .mobile-subcategory-list {
      background-color: #f8f9fa;
    }
  
    .mobile-subcategory-list .bg-light {
      background-color: #f8f9fa !important;
    }
  
    .mobile-subcategory-list .bg-light:hover {
      background-color: #e9ecef !important;
    }
  
    /* 데스크톱 카테고리 메뉴는 모바일에서 완전히 숨김 */
    #customCategoryMenu {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      height: 0 !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      pointer-events: none !important;
    }
  
    /* 데스크톱 메뉴 초기 상태 확인 - show 클래스가 있어도 숨김 */
    #customCategoryMenu.collapse,
    #customCategoryMenu.collapse.show,
    #customCategoryMenu.collapse:not(.show),
    #customCategoryMenu.show,
    #customCategoryMenu.collapsing {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      height: 0 !important;
      pointer-events: none !important;
    }
    
    /* 인라인 스타일이 있어도 숨김 */
    #customCategoryMenu[style*="display"] {
      display: none !important;
    }
  
    /* ============================================
       기본 레이아웃 조정
       ============================================ */
    
    /* 메인 컨텐츠 상단 여백 (sticky-top 높이만큼) */
    section {
      margin-top: 0 !important;
      padding-top: 0px !important; /* 상단 네비게이션 + 대 카테고리 높이 */
    }
  
    /* 컨테이너 패딩 조정 */
    .container {
      padding-left: 8px !important;
      padding-right: 8px !important;
    }
  
    /* 왼쪽 메뉴 숨기기 */
    .left-menu-col {
      display: none !important;
    }
  
    /* 세로 롤링 섹션 숨기기 */
    .vertical-banner {
      display: none !important;
    }
  
    /* 메인 슬라이더 높이 조정 */
    .main-swiper {
      height: 200px !important;
      margin-left: 0 !important;
      margin-bottom: 10px;
    }
  
    /* 첫 번째 줄 레이아웃 변경 */
    .row.flex-lg-nowrap {
      flex-wrap: wrap !important;
    }
  
    .row.flex-lg-nowrap > div {
      width: 100% !important;
      max-width: 100% !important;
    }
  
    /* ============================================
       섹션 제목 스타일
       ============================================ */
    
    .maintitle {
      font-size: 18px;
      font-weight: 700;
      color: #d60000;
      display: block;
      margin-bottom: 10px;
    }
  
    /* NEW ITEM, 카테고리별 TOP10 타이틀 가운데 정렬 */
    .row .col > div:first-child:not(.maintitle-bottom) {
      text-align: center !important;
    }
  
    .maintitle-bottom {
      font-size: 0;
      margin-bottom: 10px;
      text-align: center !important;
      line-height: 1.2;
      border-bottom: none !important;
      border-top: none !important;
    }
  
    .maintitle-bottom .maintitle {
      font-size: 18px !important;
      display: block !important;
      margin-right: 0 !important;
      margin-bottom: 0 !important;
    }
  
    /* MD 추천 타이틀 아래 구분선 추가 (NEW ITEM과 동일) */
    .row.gx-0[style*="background-color: #fff"] {
      border-top: 3px solid #F59538 !important;
      margin-top: 10px !important;
      padding-top: 10px !important;
    }
  
    /* ============================================
       제품 그리드 - 3열 레이아웃
       ============================================ */
    
    .item-box {
      width: 33.333% !important;
      padding: 5px !important;
      box-sizing: border-box;
    }
  
    .slide-content {
      flex-wrap: wrap;
      padding: 5px;
    }
  
    .slide-content .item-box {
      width: 33.333% !important;
    }
  
    /* NEW ITEM 슬라이드: 모바일에서 첫 번째 슬라이드만 표시 */
    .newitem .swiper-wrapper {
      display: flex !important;
      transform: none !important;
    }
  
    .newitem .swiper-slide:not(:first-child) {
      display: none !important;
    }
  
    .newitem .swiper-slide:first-child {
      width: 100% !important;
    }
  
    /* NEW ITEM 타이틀 아래 구분선 추가 */
    .newitem {
      border-top: 3px solid #F59538 !important; 
      margin-top: 10px !important;
      padding-top: 10px !important;
    }
  
    /* NEW ITEM 슬라이드: 카테고리 숨기기, 6개만 표시 (3칸씩 2줄) */
    .newitem .slide-content {
      display: flex !important;
      flex-wrap: wrap !important;
      width: 100% !important;
    }
  
    .newitem .slide-content .item-box {
      width: 33.333% !important;
      flex: 0 0 33.333% !important;
      max-width: 33.333% !important;
      box-sizing: border-box !important;
      border: none !important;
    }
  
    /* NEW ITEM 상품 구분선 제거 */
    .newitem .item-box.border-right,
    .newitem .item-box.border-bottom,
    .newitem .item-box.border-right-none,
    .newitem .item-box.border-bottom-none {
      border: none !important;
      border-right: none !important;
      border-bottom: none !important;
    }
  
    .newitem .slide-content .item-box:nth-child(n+7) {
      display: none !important;
    }
  
    /* 상품명은 표시, 카테고리는 숨김 (필요시 추가) */
  
    /* NEW ITEM 슬라이드 네비게이션 버튼 숨기기 */
    .newitem .swiper-button-prev,
    .newitem .swiper-button-next {
      display: none !important;
    }
  
    /* NEW ITEM 탭 숨기기 */
    #new-tabs {
      display: none !important;
    }
  
    /* 제품 카드 스타일 */
    .item-box .card-body {
      padding: 8px 4px !important;
    }
  
    .item-box .product-name {
      font-size: 13px !important;
      line-height: 1.3;
      margin-bottom: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      height: 32px;
    }
  
    .item-box img {
      width: 100% !important;
      height: auto !important;
      aspect-ratio: 1;
      object-fit: contain;
    }
  
    .item-box .card-img-top {
      padding: 5px;
      background-color: #fff;
    }
  
    /* 하트 버튼 크기 조정 */
    .heart-btn {
      width: 24px !important;
      height: 24px !important;
      font-size: 14px !important;
    }
  
    /* 가격 스타일 */
    .item-box span[style*="color:#008bcc"] {
      font-size: 13px !important;
    }
  
    /* ============================================
       MD 추천 섹션 모바일 스타일
       ============================================ */
    
    .row.gx-0[style*="background-color: #fff"] {
      display: flex;
      flex-wrap: wrap;
    }
  
    .md-item-col {
      width: 33.333% !important;
      max-width: 33.333% !important;
      flex: 0 0 33.333% !important;
      border-bottom: 1px solid #eee !important;
      border-right: 1px solid #eee !important;
      padding: 0 !important;
    }
  
    .md-item-col:nth-child(3n) {
      border-right: none !important;
    }
  
    .md-item-col .d-flex {
      flex-direction: column !important;
      align-items: center !important;
      padding: 10px 5px !important;
      text-align: center;
    }
  
    .md-item-col > div > div:first-child {
      width: 100% !important;
      display: flex;
      justify-content: center;
      margin-bottom: 8px;
    }
  
    .md-item-col img {
      width: 80px !important;
      height: 80px !important;
      margin: 0 auto;
    }
  
    .md-item-col .ms-2 {
      margin-left: 0 !important;
      width: 100%;
      padding: 0 !important;
    }
  
    .md-item-col .product-name {
      font-size: 12px !important;
      margin-bottom: 5px;
      text-align: center;
      line-height: 1.3;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      height: 32px;
    }
  
    .md-item-col .product-price2 {
      text-align: center !important;
      font-size: 14px !important;
    }
  
    .md-item-col del {
      display: none !important;
    }
  
    /* MD 추천 가격 영역: point와 selling_price 각각 한 줄씩, 가운데 정렬 */
    .md-item-col .ms-2 > div:last-child {
      flex-direction: column !important;
      align-items: center !important;
      width: 100% !important;
    }
  
    .md-item-col .ms-2 > div:last-child > div:first-child {
      width: 100% !important;
      margin-bottom: 5px !important;
      text-align: center !important;
    }
  
    .md-item-col .product-price2 {
      width: 100% !important;
      text-align: center !important;
      margin-top: 5px !important;
      display: block !important;
    }
  
    .md-item-col .heart-btn {
      position: absolute;
      top: 5px;
      right: 5px;
    }
  
    /* ============================================
       SUPER PRICE 슬라이더 모바일
       ============================================ */
    
    .superitem {
      padding: 0 5px;
    }
  
    .superitem .swiper-slide {
      padding: 5px;
      height: auto !important;
    }
  
    .superitem .box {
      height: 100% !important;
    }
  
    .superitem .card-img-top {
      height: 180px !important;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .superitem .card-img-top img {
      max-height: 160px !important;
      width: auto !important;
      max-width: 100%;
    }
  
    /* ============================================
       탭 스타일 모바일
       ============================================ */
    
    .main_tab {
      padding: 8px 5px;
      font-size: 13px;
    }
  
    .tab-item {
      font-size: 12px !important;
      padding: 4px 6px !important;
    }
  
    /* ============================================
       인기급상승 상품 모바일
       ============================================ */
    
   
  
    /* 인기급상승 상품 타이틀 하단 border 추가 */
    .row.mt-4.mb-4:has(.trending-item) .text-center .maintitle {
      border-bottom: 3px solid #F59538 !important;
      padding-bottom: 10px !important;
      display: inline-block;
      width: 100%;
    }
  
    /* 인기급상승 상품 3개씩 2줄로 배치 */
    .d-flex.flex-wrap .trending-item {
      width: 33.333% !important;
      max-width: 33.333% !important;
      flex: 0 0 33.333% !important;
      border-bottom: 1px solid #eee !important;
      border-right: 1px solid #eee !important;
      padding: 0 !important;
      box-sizing: border-box !important;
    }
  
    /* 3번째마다 오른쪽 border 제거 */
    .d-flex.flex-wrap .trending-item:nth-child(3n) {
      border-right: none !important;
    }
  
    /* 4번째부터는 아래 border 제거 (2줄만 표시) */
    .d-flex.flex-wrap .trending-item:nth-child(n+4) {
      border-bottom: none !important;
    }
  
    /* 6개 이상은 숨기기 */
    .d-flex.flex-wrap .trending-item:nth-child(n+7) {
      display: none !important;
    }
  
    .d-flex.flex-wrap .trending-item img {
      width: 80px !important;
      height: 80px !important;
      border-radius: 50%;
      margin: 0 auto;
      display: block;
    }
  
    /* 인기급상승 상품 카드 내부 스타일 */
    .d-flex.flex-wrap .trending-item .card-body {
      padding: 10px 5px !important;
    }
  
    .d-flex.flex-wrap .trending-item .product-name {
      font-size: 12px !important;
      line-height: 1.3;
      margin-bottom: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      height: 32px;
    }
  
    .d-flex.flex-wrap .trending-item span[style*="color:#008bcc"] {
      font-size: 13px !important;
    }
  
    /* ============================================
       프로모션 배너
       ============================================ */
    
    .row.mt-4 img {
      width: 100%;
      height: auto;
    }
  
    /* 세로 롤링 제품 박스 숨기기 */
    .product-box {
      display: none !important;
    }
  
    /* ============================================
       Swiper 버튼 크기 조정
       ============================================ */
    
    .swiper-button-prev,
    .swiper-button-next {
      width: 30px !important;
      height: 30px !important;
    }
  
    .swiper-button-prev::after,
    .swiper-button-next::after {
      font-size: 16px !important;
    }
  
    /* ============================================
       랭크 배지 크기 조정
       ============================================ */
    
    .rank-badge {
      font-size: 10px !important;
      padding: 2px 6px !important;
      top: 3px !important;
      left: 3px !important;
    }
  
    /* ============================================
       할인 배지
       ============================================ */
    
    .discount-arrow {
      display: none !important;
    }
  
    .discount-arrow span {
      font-size: 16px !important;
    }
  
    .discount-arrow span span {
      font-size: 10px !important;
    }
  
    /* ============================================
       카테고리별 TOP10 섹션 숨기기
       ============================================ */
    
    /* 카테고리별 TOP10 섹션 전체 숨기기 */
    .row.mt-4:has(#best-tabs),
    .row.mt-4:has(.bestitem) {
      display: none !important;
    }
  
    /* ============================================
       섹션 간격 조정
       ============================================ */
    
    .row.mt-4 {
      margin-top: 15px !important;
    }
  
  }
  
  