/* ============================================
   또치네 쿠팡 핫딜 - 모바일 스타일시트
   ✅ 전면 수정: 공백 최소화
============================================ */

/* ============================================
   ✅ 모바일 햄버거 메뉴 (우측 작게)
============================================ */
@media (max-width: 991px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 12px;
    left: auto;
    width: 160px;
    background: white;
    padding: 8px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 10px;
    z-index: 1000;
  }

  .navbar-nav {
    text-align: left;
  }

  .navbar-nav .nav-item {
    border-bottom: none;
  }

  .navbar .nav-link {
    color: #1e293b !important;
    padding: 10px 16px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    display: block;
  }

  .navbar .nav-link:hover,
  .navbar .nav-link.active {
    color: #6366f1 !important;
    background: #f8fafc;
  }
}

/* ============================================
   태블릿 (768px 이하)
============================================ */
@media (max-width: 768px) {
  body {
    padding-top: 48px;
  }

  .navbar {
    height: 48px;
  }

  .navbar-brand {
    font-size: 0.95rem;
  }

  /* ✅ Hero 공백 최소화 */
  .hero {
    padding: 52px 0 8px !important;
  }

  .hero h1 {
    font-size: 1.1rem !important;
    margin-bottom: 2px !important;
  }

  .hero p {
    font-size: 0.78rem !important;
    margin-bottom: 0 !important;
  }

  .hero-icon {
    font-size: 1.4rem !important;
    margin-bottom: 2px !important;
  }

  /* ✅ 컨테이너 마진 최소화 */
  .container.my-4,
  .container.my-3 {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
  }

  /* 핫 배너 */
  .hot-banner {
    padding: 14px 10px;
    margin-top: 6px;
    margin-bottom: 8px;
    border-radius: 12px;
  }

  .hot-banner h1 {
    font-size: 1rem !important;
  }

  .hot-banner p {
    font-size: 0.75rem;
  }

  /* 통계 그리드 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 10px 8px;
  }

  .stat-card i {
    font-size: 1.1rem;
    margin-bottom: 2px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  /* 탭 네비게이션 */
  .nav-pills .nav-link {
    padding: 5px 10px;
    font-size: 0.75rem;
    margin: 2px;
  }

  /* 상품 카드 */
  .product-card img,
  .product-image,
  .product-img-wrap img {
    height: 120px;
  }

  .product-card .card-body {
    padding: 8px;
  }

  .product-card .product-name {
    font-size: 0.8rem;
  }

  .product-card .product-price {
    font-size: 0.95rem;
  }

  .lowest-tag {
    font-size: 0.6rem;
    padding: 2px 5px;
  }

  /* ✅ 모바일 2열 그리드 */
  .row .col-6,
  .row .col-md-4,
  .row .col-lg-3,
  .row .col-lg-4 {
    width: 50% !important;
    flex: 0 0 50% !important;
  }

  /* ✅ 딜 섹션 - 카테고리 간 간격 추가 */
  .deal-section {
    padding: 8px;
    margin-bottom: 12px;
  }

  .deal-section h2 {
    font-size: 0.9rem;
    margin-bottom: 6px;
    padding-bottom: 4px;
  }

  .deal-product {
    padding: 6px;
    margin-bottom: 4px;
  }

  .deal-product img {
    width: 50px;
    height: 50px;
    margin-right: 8px;
  }

  .deal-product-name {
    font-size: 0.8rem;
  }

  .deal-product-price {
    font-size: 0.9rem;
  }

  /* 랭킹 */
  .ranking-table {
    padding: 6px;
  }

  .ranking-row {
    padding: 6px;
    margin-bottom: 3px;
  }

  .ranking-product-img {
    width: 45px;
    height: 45px;
    margin-right: 8px;
  }

  .ranking-product-name {
    font-size: 0.8rem;
  }

  .rank-num {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    margin-right: 6px;
  }

  /* 가이드 카드 */
  .guide-card {
    padding: 8px;
  }

  .guide-card-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .guide-card-title {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  /* ✅ 설명 자연스럽게 ... 처리 */
  .guide-card-desc {
    font-size: 0.68rem;
    height: auto;
    max-height: 2.6em;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #64748b;
  }

  /* 가이드 상세 컴팩트 */
  .guide-section-compact {
    padding: 8px 10px;
    margin-bottom: 5px;
  }

  .guide-section-compact h2 {
    font-size: 0.85rem;
    margin-bottom: 4px;
    padding-bottom: 3px;
  }

  .guide-section-compact p {
    font-size: 0.8rem;
  }

  .tip-box-compact {
    padding: 8px;
    margin-bottom: 5px;
  }

  .tip-box-compact h3 {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .tip-item-compact {
    font-size: 0.78rem;
    padding: 2px 0;
  }

  .sidebar-compact {
    padding: 8px;
    margin-bottom: 5px;
  }

  .sidebar-compact h4 {
    font-size: 0.8rem;
    margin-bottom: 5px;
  }

  .toc-link {
    font-size: 0.75rem;
    padding: 3px 0;
  }

  /* 미니 상품 카드 */
  .mini-product-card {
    padding: 6px;
  }

  .mini-product-card img {
    height: 60px;
    margin-bottom: 4px;
  }

  .mini-product-name {
    font-size: 0.68rem;
  }

  .mini-product-price {
    font-size: 0.78rem;
  }

  /* 관련 가이드 */
  .related-guides {
    padding: 8px;
    margin-bottom: 6px;
  }

  .guide-section-title {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  .guide-btn {
    font-size: 0.68rem;
    padding: 4px 6px;
  }

  /* 광고 */
  .ad-box {
    padding: 6px;
    min-height: 50px;
    margin-bottom: 6px !important;
  }

  /* 푸터 */
  .footer {
    padding: 8px 0;
    font-size: 0.7rem;
  }

  /* 컨테이너 */
  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* 그리드 간격 */
  .row.g-3, .row.g-4 {
    --bs-gutter-x: 6px;
    --bs-gutter-y: 6px;
  }

  .row.g-2 {
    --bs-gutter-x: 4px;
    --bs-gutter-y: 4px;
  }
}

/* ============================================
   모바일 (576px 이하)
============================================ */
@media (max-width: 576px) {
  body {
    padding-top: 46px;
  }

  .navbar {
    height: 46px;
  }

  .navbar-brand {
    font-size: 0.88rem !important;
  }

  .navbar-brand i {
    display: none;
  }

  /* ✅ Hero 공백 더 줄임 */
  .hero {
    padding: 50px 0 6px !important;
  }

  .hero h1 {
    font-size: 1rem !important;
  }

  .hero p {
    font-size: 0.72rem !important;
  }

  .hero-icon {
    font-size: 1.2rem !important;
  }

  /* 핫 배너 */
  .hot-banner {
    padding: 10px 8px;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .hot-banner h1 {
    font-size: 0.92rem !important;
  }

  .hot-banner p {
    font-size: 0.7rem;
  }

  /* 통계 */
  .stats-grid {
    gap: 5px;
  }

  .stat-card {
    padding: 8px 6px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  /* 상품 카드 */
  .product-card img,
  .product-image,
  .product-img-wrap img {
    height: 100px;
  }

  .product-card .card-body {
    padding: 6px;
  }

  .product-card .product-name {
    font-size: 0.75rem;
    height: 2.2em;
  }

  .product-card .product-price {
    font-size: 0.88rem;
  }

  /* 딜 상품 */
  .deal-section {
    padding: 6px;
    margin-bottom: 10px;
  }

  .deal-section h2 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    padding-bottom: 3px;
  }

  .deal-product {
    padding: 5px;
    margin-bottom: 3px;
  }

  .deal-product img {
    width: 45px;
    height: 45px;
    margin-right: 6px;
  }

  .deal-product-name {
    font-size: 0.75rem;
  }

  .deal-product-price {
    font-size: 0.85rem;
  }

  .deal-discount-badge {
    padding: 2px 4px;
    font-size: 0.58rem;
  }

  /* 랭킹 */
  .ranking-table {
    padding: 5px;
  }

  .ranking-row {
    padding: 5px;
    margin-bottom: 2px;
  }

  .ranking-product-img {
    width: 40px;
    height: 40px;
    margin-right: 6px;
  }

  .ranking-product-name {
    font-size: 0.75rem;
  }

  .rank-num {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    margin-right: 5px;
  }

  /* 가이드 상세 */
  .guide-section-compact {
    padding: 6px 8px;
    margin-bottom: 4px;
  }

  .guide-section-compact h2 {
    font-size: 0.8rem;
  }

  .guide-section-compact p {
    font-size: 0.75rem;
  }

  .tip-box-compact {
    padding: 6px;
    margin-bottom: 4px;
  }

  .tip-item-compact {
    font-size: 0.72rem;
  }

  /* 미니 상품 */
  .mini-product-card img {
    height: 55px;
  }

  .mini-product-name {
    font-size: 0.65rem;
  }

  .mini-product-price {
    font-size: 0.72rem;
  }

  /* 버튼 */
  .btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .btn-sm {
    font-size: 0.7rem;
    padding: 3px 6px;
  }

  /* 컨테이너 */
  .container {
    padding-left: 6px;
    padding-right: 6px;
  }

  /* 광고 */
  .ad-box {
    padding: 4px;
    min-height: 40px;
  }

  /* 푸터 */
  .footer {
    padding: 6px 0;
    font-size: 0.65rem;
  }
}

/* ============================================
   작은 모바일 (480px 이하)
============================================ */
@media (max-width: 480px) {
  .navbar-brand {
    font-size: 0.82rem !important;
  }

  .hero {
    padding: 48px 0 5px !important;
  }

  .hero h1 {
    font-size: 0.95rem !important;
  }

  .hero p {
    font-size: 0.68rem !important;
  }

  .hot-banner {
    padding: 8px 6px;
  }

  .hot-banner h1 {
    font-size: 0.85rem !important;
  }

  .stat-value {
    font-size: 1.05rem;
  }

  .product-card img,
  .product-image,
  .product-img-wrap img {
    height: 90px;
  }

  .product-card .product-name {
    font-size: 0.7rem;
  }

  .product-card .product-price {
    font-size: 0.82rem;
  }

  .deal-product img {
    width: 40px;
    height: 40px;
  }

  .ranking-product-img {
    width: 36px;
    height: 36px;
  }

  .badge-rocket,
  .badge-discount,
  .badge-lowest {
    font-size: 0.52rem;
    padding: 1px 3px;
  }
}

/* ============================================
   매우 작은 모바일 (360px 이하)
============================================ */
@media (max-width: 360px) {
  .navbar-brand {
    font-size: 0.78rem !important;
  }

  .hero {
    padding: 46px 0 4px !important;
  }

  .hero h1 {
    font-size: 0.88rem !important;
  }

  .hot-banner {
    padding: 6px 5px;
  }

  .stat-value {
    font-size: 0.95rem;
  }

  .product-card img {
    height: 80px;
  }

  .product-card .product-name {
    font-size: 0.65rem;
  }

  .product-card .product-price {
    font-size: 0.78rem;
  }

  .deal-product img {
    width: 35px;
    height: 35px;
  }

  .guide-card-desc {
    display: none;
  }
}

/* ============================================
   가로 모드
============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 46px 0 4px !important;
  }

  .hero h1 {
    font-size: 0.9rem !important;
  }
}
