/* ==========================================================================
   巴洛克音響 (ANSBACH ACOUSTIC) 響應式裝置最佳化樣式
   支援手機 (Mobile)、平板 (Tablet)、高解析度螢幕
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* 1024px 視口導航間距適度調整，維持視覺置中且防重疊 */
  .nav-links {
    gap: 24px;
  }

  .nav-actions {
    gap: 12px;
  }

  /* 1024px 視口企業識別適配（防擠壓中央導航與預約按鈕） */
  .navbar .brand-logo {
    gap: 0;
  }

  .navbar .brand-logo-img {
    height: 52px;
    margin-right: -5px;
  }

  .navbar .brand-logo-text {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav {
    display: flex;
  }

  section[id], footer[id], [id] {
    scroll-margin-top: 80px;
  }

  .navbar-container {
    height: 72px;
  }

  /* 頂部 Header 企業識別手機最佳化 (<=768px) */
  .navbar .brand-logo {
    flex: initial;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .navbar .nav-actions {
    flex: initial;
  }

  .navbar .brand-logo-img {
    height: 40px;
    margin-right: -4px;
  }

  .navbar .brand-logo-text {
    font-size: 1.25rem;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
  }

  #nav-toggle-btn {
    display: inline-flex !important;
  }
  
  .nav-links {
    display: none; /* 由漢堡選單展開 */
  }
  
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(20px);
    padding: 30px 24px;
    border-bottom: 1px solid var(--gold-border);
    gap: 20px;
  }
  
  /* ==================== Hero 品牌首頁影音橫幅 (M4-03 手機 9:16 首屏滿版最佳化) ==================== */
  .hero-section {
    position: relative;
    width: 100%;
    /* 使用 100dvh 確保按鈕在首屏完整可見，不被底部導覽列遮擋，無須下滑 */
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    /* 頂部固定避開 Navbar (72px)，底部避開固定 Bottom Nav (58px + safe-area) */
    padding-top: 72px;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-left: 0;
    padding-right: 0;
    background: #0a0c10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  .hero-banner-container {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0; /* 關鍵：防 flex 子項目被預設 min-height: auto 撐開造成溢出 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-banner-wrapper {
    position: relative;
    flex: 1;
    min-height: 0; /* 高度自動填滿上方剩餘空間 */
    height: 100%;
    max-height: 100%;
    aspect-ratio: 9 / 16; /* 嚴格維持原生 9:16 直式比例 */
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: #0a0c10;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-banner-video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 9:16 零裁切、不變形、完整呈現器材、壁爐與 Franco Serblin Logo */
    display: block;
    background: #0a0c10;
  }

  /* 手機版隱藏桌面浮動 dock，防止遮擋畫面與字幕 */
  .hero-action-dock {
    display: none !important;
  }

  /* M4-04 手機版原聲音量開關：左上角緊湊佈局，不遮擋右上角 Franco Serblin Logo 與結尾字幕 */
  .hero-sound-toggle {
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    gap: 6px;
    font-size: 0.76rem;
    min-height: 34px;
    background: rgba(10, 12, 16, 0.82);
    z-index: 25;
  }

  .hero-sound-toggle .sound-icon-box {
    width: 16px;
    height: 16px;
  }

  .hero-sound-toggle .sound-icon {
    width: 16px;
    height: 16px;
  }

  .hero-sound-toggle .sound-label {
    font-size: 0.76rem;
  }

  /* 手機版專屬主要行動入口：置於畫面下方、底部導覽列上方，首屏 100% 完整可見 */
  .hero-mobile-cta-strip {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 絕不被擠壓 */
    width: 100%;
    padding: 8px 16px 10px;
    background: #0a0c10;
    border-top: 1px solid rgba(197, 168, 128, 0.18);
    box-sizing: border-box;
    z-index: 20;
  }

  .btn-mobile-cta {
    width: 100%;
    max-width: 360px;
    min-height: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    padding: 0 16px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 4px 16px rgba(197, 168, 128, 0.35);
  }

  .hero-trust-strip {
    padding: 14px 0;
  }

  .hero-trust-strip .hero-trust-bar {
    gap: 8px 12px;
    justify-content: center;
  }

  .hero-trust-strip .trust-val {
    font-size: 1.25rem;
  }

  .hero-trust-strip .trust-lbl {
    font-size: 0.76rem;
  }

  .trust-sep {
    display: none;
  }

  .hero-trust-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
  }
  
  .section-padding {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 2rem;
  }

  .warranty-service-card {
    padding: 32px 18px;
  }

  .warranty-notice-box {
    padding: 24px 20px;
    margin: 24px 0 20px;
  }

  .warranty-notice-title {
    font-size: 1.18rem;
  }

  .warranty-notice-list {
    padding-left: 20px;
    gap: 12px;
  }

  .warranty-notice-list li {
    font-size: 1rem;
    line-height: 1.85;
    color: #e2e8f0;
  }

  #warranty-section .section-desc {
    font-size: 1.18rem;
    line-height: 1.85;
    color: #ffffff;
    font-weight: 500;
  }

  .modal-brand-title {
    font-size: 1.45rem;
    font-weight: 800;
  }

  /* 頁尾手機單欄無溢出適配 (M16 補正) */
  .footer-grid-three {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* 最新消息手機字級約 16px，自然換行零溢出 (M16 補正) */
  .news-desc {
    font-size: 1rem !important; /* 16px */
    line-height: 1.7 !important;
    padding: 0 8px;
    max-width: 100%;
  }

  .desktop-only-br {
    display: none !important;
  }

  .footer-col-title {
    font-size: 1.25rem;
  }

  .footer-slogan {
    font-size: 1.05rem;
  }

  .footer-desc,
  .footer-info-list {
    font-size: 0.98rem;
  }

  .footer-sub-list {
    padding-left: 24px;
    font-size: 0.94rem;
    gap: 5px;
  }

  .footer-phone-link {
    font-size: 1.1rem;
  }

  .warranty-section-desc-old {
    font-size: 1.12rem;
    line-height: 1.8;
  }

  .warranty-contact-box {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .modal-dialog {
    padding: 24px 18px;
  }

  .container {
    padding: 0 16px;
  }

  /* 手機版格點自適應（防止 360px~430px 溢出） */
  .brands-grid {
    grid-template-columns: 1fr;
  }

  /* 關於巴洛克手機/平板適配 (M16 手機版同步適度放大) */
  .about-card {
    padding: 40px 22px;
  }

  .about-title {
    font-size: 1.85rem;
    margin: 14px 0 22px;
  }

  .about-body {
    gap: 16px;
    margin-bottom: 28px;
  }

  .about-body p {
    font-size: 1.12rem;
    color: #e2e8f0;
    line-height: 1.85;
    text-align: left;
  }

  .about-signoff {
    font-size: 1.15rem;
    padding-top: 20px;
  }

  /* VIP 電子報簡約訂閱列垂直排列 (保持緊湊) */
  .newsletter-strip {
    padding: 20px 0;
  }

  .newsletter-strip-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: left;
  }

  .newsletter-strip-form {
    min-width: 100%;
    max-width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .newsletter-strip-form .btn {
    width: 100%;
  }

  /* 頁尾手機版緊湊間距 */
  footer {
    padding: 50px 0 30px !important;
  }

  /* 品牌精選 BRANDS 手機版適配 (M3-02 9:16 單張直式輪播) */
  .brand-showcase-section {
    padding: 36px 0 calc(96px + env(safe-area-inset-bottom, 0px));
    scroll-margin-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .brand-section-header {
    margin-bottom: 22px;
  }

  .header-divider-line {
    width: 36px;
  }

  .heading-zh {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
  }

  .heading-en {
    font-size: 1rem;
    letter-spacing: 0.2em;
  }

  /* 手機版隱藏桌面切換箭頭，改由底部 ‹ 01 / 08 › 控制 */
  .brand-arrow-btn {
    display: none !important;
  }

  .brand-showcase-stage {
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* 手機版單張 9:16 精品卡片容器 */
  .brand-mobile-single-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .brand-mobile-single-wrapper .brand-vertical-card {
    width: 100%;
    max-width: 280px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  }

  .brand-card-img-wrap {
    height: 48%;
    padding: 12px;
  }

  .brand-card-info-wrap {
    height: 52%;
    padding: 14px 12px 12px;
  }

  .brand-card-title {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .brand-card-features-list {
    gap: 3px;
    margin-bottom: 8px;
  }

  .brand-feature-item {
    padding: 4px 2px;
  }

  .feature-icon-box {
    width: 16px;
    height: 16px;
  }

  .feature-svg-icon {
    width: 14px;
    height: 14px;
  }

  .feature-text {
    font-size: 0.78rem;
  }

  .brand-card-action-wrap {
    position: relative;
    z-index: 2;
  }

  .brand-explore-btn {
    height: 38px;
    font-size: 0.85rem;
    position: relative;
    z-index: 5;
    touch-action: manipulation;
  }

  .brand-explore-placeholder {
    height: 38px;
  }

  /* 手機版底部頁碼切換：顯示 ‹ 01 / 08 › */
  .brand-pagination-desktop {
    display: none !important;
  }

  .brand-pagination-container {
    margin-top: 18px;
    position: relative;
    z-index: 10;
  }

  .brand-pagination-mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 20px;
  }

  .mobile-chevron-btn {
    background: transparent;
    border: none;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .mobile-chevron-btn:active {
    transform: scale(0.88);
  }

  .pagination-number {
    font-size: 0.88rem;
    min-width: 68px;
    text-align: center;
    user-select: none;
  }
}

@media (max-width: 360px) {
  /* 360px 極限緊湊屏 Header 尺寸防溢出 */
  .navbar .brand-logo {
    gap: 0;
  }

  .navbar .brand-logo-img {
    height: 35px;
    margin-right: -3px;
  }
  .navbar .brand-logo-text {
    font-size: 1.12rem;
    letter-spacing: 0.02em;
  }
  .header-divider-line {
    width: 24px;
  }
  .heading-zh {
    font-size: 1.25rem;
  }
  .heading-en {
    font-size: 0.95rem;
  }
  .brand-showcase-section {
    padding: 28px 0 calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .brand-mobile-single-wrapper .brand-vertical-card {
    max-width: 260px;
  }
  .brand-card-title {
    font-size: 1.15rem;
  }
  .feature-text {
    font-size: 0.74rem;
  }
}
