/* ============================================
   中古スマホ最安値ナビ - Style Sheet
   WordPress SWELL風デザイン
   ============================================ */

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* === Base === */
:root {
    --c-primary: #0073aa;
    --c-primary-dark: #005f8d;
    --c-accent: #e53e3e;
    --c-accent-light: #fff5f5;
    --c-bg: #f0f2f5;
    --c-surface: #ffffff;
    --c-text: #333333;
    --c-text-light: #6b7280;
    --c-border: #e5e7eb;
    --c-gold: #f59e0b;
    --c-silver: #9ca3af;
    --c-bronze: #b45309;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
        "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.8;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-primary-dark); }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* === Header === */
.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2137 100%);
    color: #fff;
    padding: 20px 0;
    box-shadow: var(--shadow-lg);
}

.header-inner { display: flex; flex-direction: column; gap: 4px; }

.site-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-title a { color: #fff; }
.site-title a:hover { color: #e0e0e0; }

.site-title-sm { font-size: 1rem; font-weight: 700; }
.site-title-sm a { color: #fff; }

.site-tagline { font-size: 0.9rem; color: #94a3b8; }

.updated-at {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
}

/* === Shop Nav === */
.shop-nav {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 12px 0;
}

.shop-nav-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-nav-label { font-size: 0.85rem; color: var(--c-text-light); white-space: nowrap; }
.shop-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.shop-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--c-border);
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 0.85rem;
    color: var(--c-text);
    transition: all 0.2s;
}

.shop-badge:hover {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
    text-decoration: none;
}

.shop-badge:hover .shop-badge-domain { color: rgba(255,255,255,0.8); }

.shop-badge-name { font-weight: 600; line-height: 1.3; }
.shop-badge-domain { font-size: 0.7rem; color: var(--c-text-light); line-height: 1.3; }

/* === Breadcrumb === */
.breadcrumb { background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: 10px 0; }

.breadcrumb-list {
    list-style: none;
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--c-text-light);
}

.breadcrumb-list li::after { content: " >"; margin-left: 8px; }
.breadcrumb-list li:last-child::after { content: ""; }
.breadcrumb-list li:last-child { color: var(--c-text); font-weight: 500; }

/* === Main Layout === */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 60px;
}

.main-content { min-width: 0; }

/* === Sections === */
.section { margin-bottom: 32px; }

.section-header { margin-bottom: 16px; }

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--c-text);
    padding-left: 14px;
    border-left: 4px solid var(--c-primary);
}

.section-sub { font-size: 0.9rem; color: var(--c-text-light); margin-top: 4px; padding-left: 14px; }

/* === Category Grid === */
.category-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.category-chip {
    display: inline-flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-text);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.category-chip:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-1px);
}

.category-chip-price { font-size: 0.75rem; color: var(--c-accent); font-weight: 700; }

/* === Card === */
.card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
    background: #fafbfc;
}

.card-title { font-size: 1.05rem; font-weight: 700; }
.card-title a { color: var(--c-text); }
.card-title a:hover { color: var(--c-primary); }

.card-best-price { text-align: right; }

.best-price-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-light);
    display: block;
}

.best-price-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--c-accent);
}

/* === Ranking List === */
.ranking-list { padding: 0; }

.ranking-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.ranking-item:hover { background: #f9fafb; }
.ranking-item:last-child { border-bottom: none; }

.ranking-item--first { background: var(--c-accent-light); }
.ranking-item--first:hover { background: #fee2e2; }

.ranking-position { text-align: center; }

.ranking-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: var(--c-text-light);
}

.ranking-number--1 { background: var(--c-gold); }
.ranking-number--2 { background: var(--c-silver); }
.ranking-number--3 { background: var(--c-bronze); }

.ranking-shop { display: flex; flex-direction: column; }
.ranking-shop-name { font-weight: 600; font-size: 0.95rem; }
.ranking-shop-domain { font-size: 0.75rem; color: var(--c-text-light); }

.ranking-price { font-weight: 800; font-size: 1.05rem; color: var(--c-accent); white-space: nowrap; }

.ranking-condition {
    font-size: 0.8rem;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 12px;
    color: var(--c-text-light);
    white-space: nowrap;
}

.ranking-action { text-align: right; }

/* === Card Footer === */
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--c-border);
    background: #fafbfc;
    text-align: right;
}

.card-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--c-primary);
}

/* === Storage Tabs === */
.storage-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--c-border);
}

.storage-tab {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--c-text-light);
    transition: all 0.2s;
    font-family: var(--font);
}

.storage-tab:hover { color: var(--c-primary); }

.storage-tab--active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}

.storage-content { display: none; }
.storage-content--active { display: block; }

.storage-summary { margin-top: 32px; margin-bottom: 24px; }
.storage-summary .section-title { margin-bottom: 16px; }

/* === Button === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn--sm { padding: 5px 12px; font-size: 0.8rem; }

.btn--primary {
    background: var(--c-primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--c-primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn svg { flex-shrink: 0; }

/* === Price Table (model page) === */
.article { margin-bottom: 40px; }

.article-header { margin-bottom: 24px; }

.article-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--c-text);
}

.article-meta { font-size: 0.85rem; color: var(--c-text-light); margin-top: 6px; }

/* === Best Price Box === */
.best-price-box {
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 2px solid var(--c-gold);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 24px;
}

.best-price-box-inner {
    background: var(--c-surface);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
}

.best-price-box-label {
    font-size: 0.9rem;
    color: var(--c-text-light);
    margin-bottom: 4px;
}

.best-price-box-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--c-accent);
    line-height: 1.2;
}

.best-price-box-value .yen { font-size: 1rem; font-weight: 600; }

.best-price-box-shop {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 4px;
}

.best-price-box-domain { color: var(--c-text-light); font-weight: 400; }

.best-price-box-diff {
    font-size: 0.85rem;
    color: var(--c-text-light);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--c-border);
}

/* === Table === */
.table-responsive { overflow-x: auto; margin-bottom: 24px; }

.price-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.price-table thead { background: #1e3a5f; color: #fff; }

.price-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.price-table td { padding: 14px 16px; border-bottom: 1px solid var(--c-border); }

.tr-best { background: var(--c-accent-light); }
.tr-best .td-price { font-size: 1.15rem; }

.td-rank { text-align: center; width: 60px; }

.rank-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f3f4f6;
    color: var(--c-text-light);
}

.rank-badge--1 { background: #fef3c7; color: var(--c-bronze); }
.rank-badge--2 { background: #f3f4f6; color: #6b7280; }
.rank-badge--3 { background: #fef3c7; color: var(--c-bronze); }

.shop-info { display: flex; flex-direction: column; }
.shop-info-name { font-weight: 600; }
.shop-info-domain { font-size: 0.75rem; color: var(--c-text-light); }

.td-price { font-weight: 800; color: var(--c-accent); white-space: nowrap; font-size: 1.05rem; }

.condition-badge {
    font-size: 0.8rem;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 12px;
    color: var(--c-text-light);
}

.td-action { text-align: center; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--c-text-light);
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.no-data {
    color: var(--c-text-light);
    padding: 20px;
    text-align: center;
    font-style: italic;
}

/* === Related Models === */
.related-models { margin-top: 40px; }
.related-models .section-title { margin-bottom: 16px; }

/* === Sidebar === */
.sidebar { position: sticky; top: 20px; align-self: start; }

.sidebar-widget {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--c-primary);
}

.widget-list { list-style: none; }

.widget-list li { border-bottom: 1px solid #f3f4f6; }
.widget-list li:last-child { border-bottom: none; }

.widget-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    color: var(--c-text);
    transition: background 0.15s;
    border-radius: 4px;
}

.widget-list a:hover { background: #f9fafb; text-decoration: none; }

.widget-model { font-size: 0.9rem; font-weight: 500; }
.widget-price { font-size: 0.85rem; font-weight: 700; color: var(--c-accent); white-space: nowrap; }
.widget-text { font-size: 0.85rem; color: var(--c-text-light); line-height: 1.7; }

/* === Ad Slots === */
.ad-slot {
    text-align: center;
    padding: 16px 0;
}

.ad-header { background: #f8fafc; border-bottom: 1px solid var(--c-border); }
.ad-between { margin: 16px 0; }
.ad-footer { background: #f8fafc; border-top: 1px solid var(--c-border); }
.ad-article { margin: 24px 0; padding: 20px; background: #f8fafc; border-radius: var(--radius); }

/* === Footer === */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 32px 0;
    font-size: 0.85rem;
}

.footer-inner { text-align: center; }
.footer-site-name { font-weight: 700; font-size: 1rem; color: #e2e8f0; margin-bottom: 8px; }
.footer-note { margin: 4px 0; line-height: 1.6; }
.footer-links { margin-top: 16px; padding-top: 16px; border-top: 1px solid #334155; color: #64748b; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar { position: static; }
}

@media (max-width: 640px) {
    body { font-size: 14px; }

    .container { padding: 0 14px; }

    .site-title { font-size: 1.3rem; }

    .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    .ranking-item {
        grid-template-columns: 32px 1fr auto;
        gap: 8px;
        padding: 10px 14px;
    }

    .ranking-condition { display: none; }
    .ranking-action { display: none; }

    .ranking-price { font-size: 0.95rem; }

    .best-price-box-value { font-size: 1.8rem; }

    .price-table th,
    .price-table td { padding: 10px 8px; font-size: 0.85rem; }

    .th-condition, .td-condition { display: none; }

    .article-title { font-size: 1.25rem; }

    .category-chip { padding: 6px 12px; font-size: 0.85rem; }

    .shop-badges { gap: 4px; }
    .shop-badge { padding: 4px 10px; font-size: 0.8rem; }
}
