/**
 * Dedicated Mobile & Tablet Responsive Stylesheet (assets/css/mobile.css)
 * - 모바일 및 태블릿 환경에서 스플릿 비디오, 카탈로그, 섹션 2~8, 5대 서브페이지가 절대 깨지지 않도록 제어합니다.
 */

@media screen and (max-width: 1120px) {
  .carnest-app {
    flex-direction: column;
  }

  .video-panel {
    position: relative;
    top: 0;
    width: 100%;
    height: 46vh;
    min-height: 340px;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }

  .video-overlay {
    padding: 22px;
  }

  .rental-highlight-pills {
    display: none;
  }

  .content-panel {
    width: 100%;
    padding: 24px 18px 40px;
  }

  .wb-flex-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding-bottom: 14px;
  }

  .wb-card {
    flex: 0 0 260px;
    scroll-snap-align: center;
  }

  .directions-container {
    flex-direction: column;
  }
}

@media screen and (max-width: 991px) {
  .gr-card {
    flex-direction: column;
  }
  .gr-left {
    max-height: 240px;
  }
  .gr-right {
    padding: 26px 20px;
  }
  .gr-right h3 {
    font-size: 1.5rem;
    text-align: center;
  }

  .pc-footer {
    display: none;
  }
  .mobile-footer {
    display: flex;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --L-nav-width: 82%;
  }

  body.L-nav-open .L-nav-trigger {
    left: calc(82% - 48px);
  }

  .promo-banner {
    flex-direction: column;
    text-align: center;
    padding: 24px 18px;
  }
  .promo-text {
    max-width: 100%;
  }
  .promo-car-img {
    max-width: 85%;
  }

  .service-bg-text-vertical {
    left: 6px;
    font-size: 2rem;
    opacity: 0.35;
  }
  .section-container {
    padding-left: 36px;
    text-align: left;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .service-card {
    flex-direction: row;
    padding: 14px;
    gap: 14px;
  }
  .service-card .icon-box {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin-bottom: 0;
  }

  .wc-battle-field {
    flex-direction: column;
    gap: 16px;
  }
  .wc-vs-divider {
    margin: -8px auto;
  }

  .res-btn-group {
    grid-template-columns: 1fr;
  }
  .phone-number {
    font-size: 1.7rem;
  }

  .modal-card {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }
  .modal-visual-stage {
    padding: 22px 18px;
  }
  .modal-quote-panel {
    padding: 22px 18px;
  }
  .booking-form-grid {
    grid-template-columns: 1fr;
  }

  .L-main-title,
  .L-lineup-title,
  .L-system-title,
  .L-party-title,
  .T-main-title {
    font-size: 2.1rem;
  }
  .L-style-grid,
  .T-info-grid {
    grid-template-columns: 1fr;
  }

  /* 모바일 헤더 & 스크롤 일체형 최적화 */
  .header-inner {
    padding: 0 12px;
  }
  .header-left-cluster {
    gap: 8px;
    padding: 5px 12px 5px 6px;
  }
  .cockpit-menu-trigger {
    padding: 5px 8px;
  }
  .trigger-label {
    display: none;
  }
  .brand-sub-badge {
    display: none;
  }
  .brand-main-title {
    font-size: 1.1rem;
  }
  .header-hud-nav {
    display: none;
  }
  .header-hud-actions {
    gap: 6px;
  }
  .hud-action-capsule {
    padding: 4px 8px 4px 4px;
  }
  .capsule-icon-box {
    width: 28px;
    height: 28px;
    font-size: 11px;
    margin-right: 5px;
  }
  .capsule-sub {
    display: none;
  }
  .capsule-main {
    font-size: 11px;
  }
  .top-Capsule-container {
    display: none;
  }
  .header-bar.scrolled .header-left-cluster {
    left: 10px;
    top: 8px;
    transform: scale(0.85);
  }
  .hud-mode-selector {
    grid-template-columns: 1fr;
  }
  .hud-theme-grid {
    grid-template-columns: 1fr;
  }
  .hud-modal-card {
    max-height: 88vh;
    border-radius: 16px;
  }
  .hud-modal-header {
    padding: 16px 18px;
  }
  .hud-modal-body {
    padding: 18px 18px 24px;
  }

  /* 모바일 스마트 FAB & 엣지 패널 최적화 (푸터 가림 완전 방지 & 테마 8종 잘림 방지) */
  .smart-scroll-fab {
    right: 16px;
    bottom: 20px;
    width: 54px;
    height: 54px;
    z-index: 2450;
  }
  .smart-scroll-fab.above-footer {
    bottom: calc(126px + env(safe-area-inset-bottom, 0px));
  }
  .progress-ring-svg {
    width: 52px;
    height: 52px;
  }
  .edge-cockpit-sidebar {
    width: 68px;
    right: -68px;
    top: 110px;
  }
  .edge-cockpit-sidebar.open {
    right: 0;
  }
  .edge-hud-handle {
    width: 20px;
    height: 76px;
    left: -20px;
  }
  .edge-flyout-box {
    right: 72px;
    max-width: calc(100vw - 80px);
  }
  .flyout-theme-box {
    width: 310px;
    max-width: calc(100vw - 80px);
    padding: 12px 10px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .edge-palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .edge-color-orb {
    padding: 7px 8px;
    min-height: 44px;
    gap: 6px;
  }
  .orb-dot {
    width: 14px;
    height: 14px;
  }
  .orb-title {
    font-size: 11px;
  }
  .orb-sub {
    font-size: 8.5px;
  }
  .btn-wide-toggle {
    display: none;
  }
  .smart-media-remote {
    bottom: 0;
    left: 0;
    border-radius: 0;
    padding: 0;
  }
  .smart-media-remote .btn-remote-key {
    width: 36px;
    height: 36px;
    font-size: 12px;
    padding: 0;
  }
}

/* 모바일 & 태블릿 반응형: 스플래시, 게시판, 로그인, 커뮤니티 피드 */
@media screen and (max-width: 991px) {
  .feed-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 768px) {
  .splash-content-card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  .splash-brand-glow {
    font-size: 24px;
  }
  .splash-slogan {
    font-size: 12px;
  }
  .feed-card-grid {
    grid-template-columns: 1fr;
  }
  .feed-header-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .board-form-grid {
    grid-template-columns: 1fr;
  }
  .board-card-container {
    padding: 22px 16px;
  }
  .comment-input-row {
    flex-direction: column;
  }
  .comment-author-input {
    width: 100%;
  }
  .vip-stats-grid {
    grid-template-columns: 1fr;
  }
  .board-top-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .board-search-and-write {
    flex-direction: column;
    align-items: stretch;
  }
  .board-search-form {
    width: 100%;
  }
  .board-search-input {
    width: 100%;
  }
  .btn-board-write {
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .board-wide-wrapper {
    padding: 24px 14px 60px;
  }
  .board-wide-wrapper .board-table th,
  .board-wide-wrapper .board-table td {
    padding: 10px 8px;
    font-size: 11.5px;
  }
  .auth-tab-bar {
    flex-direction: column;
  }
  .btn-board-wide-toggle {
    display: none;
  }
}


/* =====================================================
   모바일 전용 24H 직통 플로팅 전화 & 상담 바 (요청 반영)
   ===================================================== */
.mobile-floating-cta-bar {
  display: none;
}

@media screen and (max-width: 991px) {
  /* 모바일 글씨 잘림 및 넘침 방지 타이포그래피 */
  body, p, h1, h2, h3, h4, span, div, a, li, button {
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }

  .content-panel {
    padding-bottom: 90px !important; /* 플로팅 바 가림 방지 여백 */
  }

  .promo-banner {
    flex-direction: column !important;
    text-align: left !important;
    padding: 22px 18px !important;
    gap: 14px !important;
  }
  .promo-title {
    font-size: clamp(1.3rem, 5.2vw, 1.75rem) !important;
    line-height: 1.35 !important;
  }
  .promo-desc {
    font-size: 12.5px !important;
    line-height: 1.58 !important;
    margin-bottom: 14px !important;
  }
  .promo-img-wrap {
    max-width: 170px !important;
    margin: 0 auto !important;
  }

  .hero-kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .hero-kpi-strip .kpi-item {
    border-right: none !important;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 6px !important;
  }
  .hero-cta-row {
    flex-direction: column !important;
  }
  .hero-cta-row .btn-promo {
    width: 100%;
    justify-content: center;
  }

  .tomba-system-badges-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .left-panel-luxury-hud {
    padding: 24px 16px 44px 16px !important;
  }
  .lp-hud-headline {
    font-size: 17px !important;
  }
  .lp-hud-subtext {
    font-size: 11px !important;
  }
  .lp-hud-actions {
    width: 100%;
  }
  .lp-hud-call-btn,
  .lp-hud-qq-btn {
    padding: 7px 12px !important;
    font-size: 11.5px !important;
  }

  .directions-container {
    grid-template-columns: 1fr !important;
  }
  .directions-container .map-box {
    border-right: none !important;
    border-bottom: 1px solid var(--border-glass);
    padding: 14px !important;
  }
  .map-photo-card img {
    height: 92px !important;
  }
  .directions-container .info-box {
    padding: 20px 16px !important;
  }
  .reg-area-grid {
    grid-template-columns: 1fr !important;
  }
  .regional-seo-card {
    padding: 22px 16px !important;
  }

  /* 모바일 플로팅 CTA 바 */
  .mobile-floating-cta-bar {
    display: block !important;
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    z-index: 2420;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }

  .m-cta-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 14, 24, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(212, 175, 55, 0.25);
  }

  .m-cta-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
    transition: all 0.2s ease;
  }

  .m-cta-sms {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
  }

  .m-cta-call {
    flex: 1;
    position: relative;
    padding: 10px 16px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8928 100%);
    color: #0b0d13;
    font-weight: 800;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.45);
    overflow: hidden;
  }

  .m-call-pulse-ring {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.45);
    animation: mPulse 2s infinite ease-out;
  }

  @keyframes mPulse {
    0% { transform: scale(0.8); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
  }

  .m-call-icon {
    font-size: 16px;
    color: #000;
    z-index: 2;
  }

  .m-call-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    z-index: 2;
  }

  .m-call-sub {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.7);
  }

  .m-call-num {
    font-size: 14.5px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #000;
  }

  /* 스마트 스크롤 탑 버튼 모바일 위치 (플로팅 바 위에 안 겹치게 배치) */
  .smart-scroll-fab {
    right: 14px !important;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .smart-scroll-fab.above-footer {
    bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 하단 푸터 슬라이드업 시 플로팅 바 살짝 위로 이동 */
  body.has-footer-revealed .mobile-floating-cta-bar {
    transform: translateY(-84px);
  }
}

@media screen and (max-width: 991px) {
  .gr-left {
    max-height: none !important;
    padding: 18px 18px 4px !important;
  }
  .gr-left img {
    max-height: 290px !important;
    border-radius: 14px !important;
    object-position: top center !important;
  }

  /* 모바일 타이틀·뱃지·버튼 글자 잘림 완벽 방지 (320px ~ 430px 대응) */
  .hero-top-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }
  .promo-badge,
  .hero-live-status {
    font-size: 11px !important;
    padding: 5px 10px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  .hero-h1-title {
    font-size: clamp(1.22rem, 5.2vw, 1.65rem) !important;
    line-height: 1.32 !important;
    letter-spacing: -0.4px !important;
  }
  .hero-h1-title small {
    font-size: clamp(0.84rem, 3.6vw, 1.02rem) !important;
    display: block !important;
    margin-top: 5px !important;
    line-height: 1.35 !important;
  }
  .media-live-badge {
    padding: 5px 10px !important;
    gap: 6px !important;
    max-width: 100% !important;
  }
  .media-counter {
    font-size: 10.5px !important;
  }
  .media-title-text {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .car-name {
    font-size: clamp(1.08rem, 4.5vw, 1.25rem) !important;
    line-height: 1.3 !important;
  }
  .step-guide-container {
    padding: 26px 18px !important;
  }
  .step-title,
  .estimate-title,
  .res-section .main-title,
  .service-section .main-title,
  .feed-title,
  .reg-title {
    font-size: clamp(1.2rem, 5vw, 1.52rem) !important;
    line-height: 1.34 !important;
    letter-spacing: -0.3px !important;
  }
  .step-card-title {
    font-size: 15px !important;
    line-height: 1.35 !important;
  }
  .map-photos-row {
    gap: 6px !important;
  }
  .map-photo-caption {
    font-size: 10.5px !important;
    padding: 5px 4px !important;
    letter-spacing: -0.3px !important;
  }
  .reg-link-pill {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
  .L-main-title,
  .L-lineup-title,
  .L-system-title,
  .L-party-title,
  .T-main-title {
    font-size: clamp(1.5rem, 6.2vw, 2rem) !important;
    line-height: 1.3 !important;
  }
}
