/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet (768px - 1199px) */
@media (max-width: 1199px) {
    .companies-grid {
        grid-template-columns: 1fr;
        gap: 80px 30px;
        max-width: 450px;
    }
    
    .company-card {
        width: 100%;
        margin-top: 20px;
    }
    
    .company-tag {
        width: 298.874px;
        height: 36.775px;
        font-size: 17.512px;
        line-height: 36.775px;
    }
    
    /* .points-grid {
        grid-template-columns: 1fr;
        padding: 20px 15px 0 25px;
    }
     */
    .main-navigation ul {
        gap: 15px;
    }
    
    .main-navigation a {
        font-size: 14px;
    }
    
}

/* Tablet Portrait and Below (max-width: 991px) */
@media (max-width: 991px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .hero-item {
        min-height: 180px;
    }
    
    .problems-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 13px;
    }
    
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 10px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Top Bar - main.cssで管理 */
    
    /* Header - main.cssで管理 */
    
    /* サイドバーを非表示 */
    .company-intro-sidebar {
        display: none !important;
    }
    
    /* PC用今すぐCHECKインジケーターを非表示 */
    .check-indicator-pc {
        display: none !important;
    }
    
    /* Hero Section - 高さ縮小 */
    .hero-section {
        height: 400px;
        max-height: 400px;
    }
    
    .hero-content {
        height: 400px !important;
        max-height: 400px;
    }
    
    /* Hero Section */
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .hero-item {
        min-height: 150px;
    }
    

    
    
    /* Problems Section */
    .problems-title-wrapper {
        gap: 15px;
    }
    
    .alert-message {
        flex-direction: column;
        padding: 20px 15px;
        gap: 15px;
    }
    
    .alert-icon {
        width: 60px;
    }
    
    .alert-title {
        font-size: 20px;
    }
    
    .problems-grid {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .problem-item {
        padding: 20px 15px;
    }
    
    .problem-number {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .problem-title {
        font-size: 16px;
    }
    
    .problem-description {
        font-size: 13px;
    }
    
    .advice-box {
        width: calc(100% - 20px);
        height: auto;
        min-height: 120px;
        padding: 50px 15px 20px;
        margin: 0 10px 115px;
        box-shadow: 3px 3px 0 0 #000;
        overflow: visible;
    }
    
    .advice-icons {
        top: 0;
        left: 0;
        gap: 0;
    }
    
    .advice-icon-corner {
        width: 50px;
        margin-top: -28px;
        margin-left: -18px;
    }
    
    .advice-icon-main {
        width: 82px;
        height: auto;
        margin-left: -3px;
        margin-top: -12px;
    }
    
    .advice-arrow {
        bottom: -85px;
        width: 168px;
        height: 51px;
    }
    
    .advice-text {
        color: #000;
        font-family: "Hiragino Maru Gothic ProN", "Noto Sans JP", "Hiragino Sans", sans-serif;
        font-size: 12px;
        font-style: normal;
        font-weight: 400;
        line-height: 1.6;
        text-align: center;
    }

    /* 比較セクションの吹き出し下余白を縮める */
    .comparison-section {
        margin-bottom: 20px;
    }

    .comparison-advice {
        margin-bottom: 15px;
    }
    
    /* Comparison Section */
    .section-title-main {
        font-size: 4.8vw;
    }
    
    .section-title-sub {
        font-size: 6.4vw;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .section-title-sub .char-with-dot::before {
        width: 7px;
        height: 7px;
        top: -3px;
    }

    /* 行間詰め・余白削除 */
    .comparison-intro {
        gap: 0;
    }

    .intro-line {
        margin: 0;
    }

    .intro-line-2 {
        margin-top: 5px;
    }

    .intro-line-3 {
        margin-top: 10px;
    }

    .hake-icon {
        margin-right: 3px;
    }
    
    .comparison-table-wrapper {
        overflow-x: scroll;
    }
    
    .comparison-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .comparison-table thead th {
        padding: 8px;
        font-size: 13px;
    }
    
    .comparison-table tbody td {
        padding: 12px 8px;
    }
    
    .merit-cell li,
    .demerit-cell li {
        margin-bottom: 8px;
        font-size: 12px;
    }
    
    .comparison-note {
        font-size: 10px;
        margin-bottom: 20px;
        white-space: nowrap;
    }
    
    
    
    /* 強みセクション - 1カラム表示 */
    .strengths-grid {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .strength-card,
    .strengths-grid .strength-card:nth-child(n+4) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* 施工実績セクション - 1カラム表示 */
    .results-grid {
        flex-direction: column !important;
        gap: 15px;
        padding: 0 15px;
    }
    
    .result-card {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* 会社名セクション - スマホ用左寄せ＋大きめ文字 */
    .company-name-section {
        text-align: left !important;
        width: auto !important;
        padding: 15px !important;
        display: inline-block !important;
        margin-left: 0 !important;
    }

    /* 黄色アンダーラインをタイトルの下端に重ねて表示 */
    .company-name-underline {
        bottom: 20px !important;
        height: 12px !important;
        z-index: 1 !important;
    }

    /* タイトル文字を大きめに設定＋アンダーラインの前面に表示 */
    .company-name-large {
        font-size: 28px !important;
        text-align: left !important;
        display: inline-block !important;
        position: relative !important;
        z-index: 2 !important;
        padding-bottom: 4px !important;
    }

    /* ニッカホーム用 - スマホ用スタイル */
    .company-name-section-nikka {
        text-align: left !important;
        width: auto !important;
        padding: 15px !important;
        display: inline-block !important;
        margin-left: 0 !important;
    }

    /* ニッカホーム用 - PC用のアンダーラインspanをスマホでは非表示 */
    .company-name-section-nikka .company-name-underline {
        display: none !important;
    }

    .company-name-section-nikka .company-name-large {
        font-size: 26px !important;
        white-space: normal !important;
        line-height: 1.8 !important;
        display: block !important;
    }

    /* ニッカホーム用 - 各行を縦並びにしてアンダーライン追加 */
    .nikka-line {
        display: block !important;
        position: relative !important;
        padding-bottom: 0px !important;
    }

    .nikka-line::after {
        content: '' !important;
        position: absolute !important;
        bottom: 4px !important;
        left: 0 !important;
        width: 100% !important;
        height: 12px !important;
        background: #FFF500 !important;
        z-index: -1 !important;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .top-bar-text {
        font-size: 11px;
    }
    
    .site-title-en {
        font-size: 18px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .header-title .number {
        font-size: 28px;
    }
    
    /* Hero Section */
    .hero-grid {
        gap: 5px;
    }
   
    .red-bar-top,
    .red-bar-bottom {
        height: 4px;
    }
    
   

    /* 比較セクション - 480px以下 */
    .intro-line {
        gap: 3px;
    }

    .text-small-work {
        font-size: 18px;
        padding: 0 3px;
    }

    .text-easy-request {
        font-size: 12px;
    }

    .text-local {
        gap: 1px;
    }

    .text-local .char-bg {
        font-size: 18px;
        padding: 0 4px;
    }

    .question-mark {
        font-size: 18px;
    }

    .hake-icon {
        height: 30px;
    }

    .text-rich-experience {
        font-size: 16px;
    }

    .text-major {
        font-size: 18px;
        padding: 0 3px;
    }

    .comparison-header {
        margin-bottom: 15px;
    }
    
    .section-title-main {
        font-size: 20px;
    }
    
    .section-title-sub {
        font-size: 28px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .section-title-sub .char-with-dot::before {
        width: 7px;
        height: 7px;
        top: -3px;
    }
    
    /* .points-section - main.cssで管理 */
    
    .point-title {
        font-size: 15px;
        text-align: center;
    }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .recommended-companies .section-header {
        margin-bottom: 8px;
    }
    
    .recommended-companies .section-title-jp {
        font-size: 15px;
        padding: 4px 6px;
        margin-bottom: 5px;
    }
    
    .recommended-companies .section-title-en {
        font-size: 13px !important;
        white-space: nowrap;
    }
    
    .companies-grid {
        gap: 10px;
        padding: 12px 0 18px;
    }
    
    .company-wrapper {
        flex: 0 0 calc(100vw - 70px);
        width: calc(100vw - 70px);
        max-width: calc(100vw - 70px);
        min-width: calc(100vw - 70px);
    }
    
    .company-wrapper:first-child {
        margin-left: 12px;
    }
    
    .company-wrapper:last-child {
        margin-right: 12px;
    }

    /* 比較セクション - 360px以下 */
    .intro-line {
        gap: 2px;
    }

    .text-small-work {
        font-size: 16px;
        padding: 1px 3px;
    }

    .text-easy-request {
        font-size: 11px;
    }

    .text-local .char-bg {
        font-size: 16px;
        padding: 1px 3px;
    }

    .question-mark {
        font-size: 16px;
    }

    .hake-icon {
        height: 25px;
    }

    .text-rich-experience {
        font-size: 14px;
    }

    .text-major {
        font-size: 20px;
        padding: 1px 4px;
    }

    .comparison-header {
        margin-bottom: 10px;
    }

    .section-title-main {
        font-size: 18px;
    }

    .section-title-sub {
        font-size: 24px;
    }

    .comparison-note {
        font-size: 9px;
    }
}

/* Print Styles */
@media print {
    .hamburger-btn,
    .mobile-menu,
    .company-buttons {
        display: none !important;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    a {
        text-decoration: underline;
    }
}
