/* --- Cool, Stylish & Readable Theme --- */

/* --- Variables --- */
:root {
    --bg-color: #FFFFFF;
    --text-color: #212529;
    --primary-color: #1A2E4A;
    --secondary-color: #007BFF;
    --accent-color: #6f42c1;
    --promo-bg-color: #f3f0ff; /* Light purple for promo */
    --gold-color: #d4af37;
    --card-bg-color: #ffffff;
    --header-bg-color: #ffffff;
    --border-color: #dee2e6;
    --light-blue-bg: #eaf6ff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.1);
    --success-color: #28a745; /* Green for base cashback */
}

/* --- Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.service-article .provider-logo {
    max-width: 100%;
}

/* --- Layout Containers --- */
.container, .container-full {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 1.5%;
}
.container-full { display: flex; gap: 40px; }
.main-content { flex: 3.5; }
.sidebar { flex: 0.8; }

/* --- Header --- */
header {
    background: var(--header-bg-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
.logo .logo-plus {
    color: var(--secondary-color);
    font-weight: 800;
}
.header-right {
    display: flex;
    align-items: center;
}
nav ul { padding: 0; list-style: none; margin: 0; }
nav ul li { display: inline-block; position: relative; margin: 0 15px; }
nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    transition: color 0.3s;
    padding: 10px 0;
}
nav a:hover { color: var(--secondary-color); }

/* --- Dropdown Menu --- */
nav ul li .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg-color);
    box-shadow: var(--shadow);
    border-radius: 8px;
    padding: 10px 0;
    list-style: none;
    min-width: 220px;
    z-index: 1021;
}

/* 右端のドロップダウンメニューがはみ出さないように調整 */
nav ul li:nth-last-child(-n+2) .dropdown-menu {
    left: auto;
    right: 0;
}

nav ul li:hover .dropdown-menu {
    display: block;
}
.dropdown-menu li {
    display: block;
    margin: 0;
}
.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
}
.dropdown-menu li a:hover {
    background-color: var(--light-blue-bg);
}

/* Dropdown Indicator */
.has-dropdown > a {
    position: relative;
}
.has-dropdown > a::after {
    content: '\25BC'; /* Downward arrow */
    font-size: 0.7em;
    margin-left: 6px;
    vertical-align: middle;
    display: inline-block;
    transition: transform 0.3s ease;
}
nav ul li:hover > a::after {
    transform: rotate(180deg);
}

.mobile-nav-toggle {
    display: none;
}

/* モバイルメニューを閉じるボタン（PCでは非表示） */
.mobile-nav-close-btn {
    display: none;
}

/* --- Page & Section Headers --- */
.page-header h1 { font-size: 2.0rem; }
.ranking-section h2, .comparison-section h2, .section h2, .article-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: left;
    margin-bottom: 40px;
}

/* Homepage Section Title */
.main-content > .section > h1 {
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: left;
    margin-bottom: 40px;
}

/* --- Hero Header (Soft Blue) --- */
.page-header-hero {
    background-color: var(--light-blue-bg);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 40px;
    border: 1px solid #d0eaff;
    position: relative;
    z-index: 1;
}
.page-header-hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: inline-block;
}
.page-header-hero p {
    font-size: 1.05rem;
    color: #495057;
    max-width: 700px;
    margin: 0;
}

/* --- Article Body --- */
.article-body {
    background: var(--card-bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.article-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.article-body p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}
.article-body ul, .article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.article-body li {
    margin-bottom: 0.5rem;
}
.article-body a {
    color: var(--secondary-color);
    text-decoration: underline;
}
.article-body a:hover {
    text-decoration: none;
}
.article-body blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6c757d;
}


/* --- Promo Section --- */
.promo-section {
    background: var(--promo-bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 40px;
    text-align: center;
}
.promo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}
.promo-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
}
.promo-logo {
    flex-shrink: 0;
}
.promo-description h4 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.promo-description p {
    margin-bottom: 1rem;
}
.promo-cta {
    margin-top: 1rem;
}


/* --- Ranking Item --- */
.rank-item {
    display: flex;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 30px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.rank-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.rank-badge-container { font-size: 1.8rem; color: var(--gold-color); }
.rank-content h3 { font-size: 1.5rem; }
.cta-button {
    display: inline-block;
    background: var(--secondary-color);
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}
.cta-button:hover { background: var(--primary-color); transform: translateY(-2px); }

/* --- Comparison & Spec Tables --- */
.plan-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.plan-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg-color);
    color: var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}
.plan-btn:hover {
    background: var(--light-blue-bg);
    border-color: var(--secondary-color);
}
.plan-btn.active {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.comparison-table, .spec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.comparison-table th, .comparison-table td,
.spec-table th, .spec-table td {
    padding: 15px;
    text-align: left;
    vertical-align: middle;
    border: 1px solid var(--border-color);
}
.comparison-table thead {
    background: var(--primary-color);
    color: #fff;
    font-size: 1.05rem;
}
.comparison-table th, .comparison-table td {
    text-align: center;
}
.spec-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    width: 30%;
}
.comparison-table td strong {
    color: var(--secondary-color);
    font-size: 1.2em;
}
.base-cashback {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-color);
    margin-top: 4px;
}
.service-note {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}
.cashback-amount {
    color: var(--accent-color);
    font-weight: 600;
}
.cta-button-small {
    background: var(--secondary-color);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.cta-button-small:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Link Button for Table */
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--secondary-color);
    color: #fff !important;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.link-button:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}
.link-button i {
    font-size: 1.2rem;
}

/* --- Breakdown Row --- */
.breakdown-toggle {
    cursor: pointer;
    margin-left: 8px;
    color: #adb5bd;
    transition: transform 0.3s ease;
}
.breakdown-toggle.open {
    transform: rotate(180deg);
    color: var(--secondary-color);
}
.breakdown-row td {
    padding: 0;
}
.breakdown-content {
    background: #f8f9fa;
    padding: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}
.breakdown-row.show .breakdown-content {
    max-height: 500px;
    padding: 20px;
    transition: max-height 0.4s ease-in, padding 0.4s ease-in;
}
.breakdown-list {
    display: flex;
    justify-content: space-around;
    text-align: left;
}
.breakdown-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.breakdown-list h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.breakdown-list li {
    font-size: 0.9rem;
    margin-bottom: 5px;
}
.monthly-detail-list {
    list-style-type: disc !important;
    margin: 5px 0 5px 20px !important;
    padding: 0 !important;
    font-size: 0.85rem;
    color: #6c757d;
}
.breakdown-list .cashback {
    color: var(--success-color);
}
.breakdown-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}


/* --- Article Grid (for HOME.html) --- */
.article-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.article {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden; /* コンテナからはみ出した部分を隠す */
}
.article:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.article:hover img {
    transform: scale(1.05);
}
.article img {
    width: 100%; /* 幅をコンテナに合わせる */
    height: 200px; /* 高さを固定して統一感を出す */
    object-fit: cover; /* アスペクト比を維持しつつエリアを埋める */
    display: block; /* 不要な余白を削除 */
    transition: transform 0.4s ease; /* ホバーエフェクト用のトランジション */
}
.article-content { padding: 25px; }
.article h3 { font-size: 1.25rem; font-weight: 600; }
.article a { color: var(--secondary-color); font-weight: 600; }
.article a:hover { color: var(--primary-color); }

/* --- Sidebar --- */
.sidebar-widget {
    background: var(--card-bg-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}
.sidebar-widget h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-widget ul li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: #343a40;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}
.sidebar-widget ul li a:hover, .sidebar-widget ul li a.active {
    background-color: var(--secondary-color);
    color: #fff;
    transform: translateX(5px);
}
.sidebar-widget ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* --- Footer --- */
footer {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: 40px;
}
.footer-nav {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}
.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.footer-nav a:hover {
    color: #fff;
}
.footer-social {
    margin-bottom: 1.5rem;
}
.social-link {
    display: inline-block;
    width: 44px;
    height: 44px;
    line-height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin: 0 8px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.social-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- Price Table for Service Details --- */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.price-table th,
.price-table td {
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    text-align: center;
    vertical-align: middle;
}

.price-table thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.price-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* --- Service Article --- */
.service-article {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.service-article:hover {
    box-shadow: var(--shadow-hover);
}

.service-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.service-header h2 {
    margin-bottom: 1rem;
}

.provider-logo {
    max-width: 400px;
    height: auto;
    margin-bottom: 1rem;
}

.page-header-hero img {
    max-width: 400px;
    margin-bottom: 1rem;
}

/* --- To Top Button --- */
.to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    line-height: 45px;
    border-radius: 50%;
    font-size: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-hover);
}
.to-top-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- Device Info Box --- */
.device-info-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    max-width: 800px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.device-info-box .device-image {
    flex: 0 0 150px;
}
.device-info-box .device-specs {
    flex: 1;
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    .container-full { flex-direction: column; }
    .promo-content { flex-direction: column; text-align: center; }
    .rank-item { flex-direction: column; }
    .rank-badge-container { flex-basis: auto; margin-bottom: 15px; text-align: left; }
    .logo a { font-size: 1.6rem; }
    .page-header-hero h1 { font-size: 2.2rem; }

    .mobile-nav-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1031;
        margin: 0;
        padding: 10px;
        width: 40px;
        height: 40px;
        position: relative;
    }

    .mobile-nav-toggle .icon-bar {
        display: block;
        width: 24px;
        height: 3px;
        background-color: var(--primary-color);
        border-radius: 1px;
        transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        position: absolute;
        left: 8px;
    }

    .mobile-nav-toggle .icon-bar:nth-child(1) {
        top: 10px;
    }

    .mobile-nav-toggle .icon-bar:nth-child(2) {
        top: 18px;
    }

    .mobile-nav-toggle .icon-bar:nth-child(3) {
        top: 26px;
    }

    .mobile-nav-active .mobile-nav-toggle .icon-bar:nth-child(1) {
        top: 18px;
        transform: rotate(45deg);
    }

    .mobile-nav-active .mobile-nav-toggle .icon-bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-active .mobile-nav-toggle .icon-bar:nth-child(3) {
        top: 18px;
        transform: rotate(-45deg);
    }

    .header-right {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: flex-start; /* flex-startにして上から表示 */
        align-items: center;
        z-index: 1030;
        padding-top: 80px; /* 上部に余白を入れてヘッダーと被らないように */
        padding-bottom: 20px; /* 下部にも余白 */
        overflow-y: auto; /* 縦に長い場合はスクロール可能にする */
    }

    .header-right.active {
        display: flex;
    }

    /* 新しく追加した閉じるボタンのスタイル */
    .mobile-nav-close-btn {
        display: block; /* スマホ画面では表示する */
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.8rem;
        color: var(--primary-color);
        cursor: pointer;
        z-index: 1032;
        padding: 10px;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .mobile-nav-close-btn:hover {
        transform: scale(1.1) rotate(90deg);
        color: var(--secondary-color);
    }

    body.mobile-nav-active {
        overflow: hidden;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    nav ul li {
        display: block;
        width: 80%;
        margin: 0 auto;
        text-align: center;
    }

    nav a {
        display: block;
        padding: 15px; /* 余白を調整（20px -> 15px） */
        font-size: 1.2rem; /* 文字サイズを調整（1.5rem -> 1.2rem） */
        border-bottom: 1px solid var(--border-color);
    }

    .has-dropdown > a::after {
        display: none; /* Hide dropdown arrow on mobile */
    }

    nav ul li .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        min-width: auto;
        padding: 0;
        background-color: transparent;
    }

    nav ul li:hover .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding: 10px 15px; /* 余白を調整（15px 20px -> 10px 15px） */
        font-size: 1.1rem; /* 文字サイズを調整（1.5rem -> 1.1rem） */
        color: #333;
        border-bottom: none;
    }

    .device-info-box {
        flex-direction: column;
    }
}