/* energi-tco.css — RankWatt plugin styles */

/* ── Model Detail Page ──────────────────────────────────────────────────────── */

.etco-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Breadcrumb */
.etco-breadcrumb {
    font-size: 0.82em;
    color: #888;
    margin: 1em 0 1.5em;
}
.etco-breadcrumb a { color: #555; text-decoration: none; }
.etco-breadcrumb a:hover { text-decoration: underline; }

/* Hero */
.etco-model-hero { margin-bottom: 1.5em; }
.etco-model-category-tag {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 600;
    color: #fff;
    background: #3a7bd5;
    border-radius: 3px;
    padding: 0.2em 0.6em;
    margin: 0 0 0.5em;
    letter-spacing: 0.02em;
}
.etco-model-brand {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 0.2em;
    font-weight: 500;
}
.etco-model-title {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 0.5em;
    line-height: 1.3;
}
.etco-grade-badge {
    display: inline-block;
    padding: 0.3em 0.8em;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
    color: #fff;
    margin-right: 0.5em;
}
.etco-grade-badge.etco-grade-1 { background: #1a8a2e; color: #fff; }
.etco-grade-badge.etco-grade-2 { background: #5aab2e; color: #fff; }
.etco-grade-badge.etco-grade-3 { background: #f5a623; color: #fff; }
.etco-grade-badge.etco-grade-4 { background: #e07020; color: #fff; }
.etco-grade-badge.etco-grade-5 { background: #d0021b; color: #fff; }

/* Key stats cards */
.etco-key-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75em;
    margin: 1.5em 0;
}
.etco-stat-card {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1em;
    text-align: center;
}
.etco-stat-card.etco-stat-primary {
    background: #eef7ff;
    border-color: #b3d7f5;
}
.etco-stat-label {
    font-size: 0.78em;
    color: #666;
    margin-bottom: 0.3em;
}
.etco-stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a1a;
}
.etco-stat-sub {
    font-size: 0.72em;
    color: #999;
    margin-top: 0.2em;
}

/* Context section */
.etco-context-section {
    margin: 1.5em 0;
    padding: 1.2em 1.5em;
    background: #f0f7ff;
    border-left: 4px solid #3a7bd5;
    border-radius: 0 6px 6px 0;
}
.etco-context-section h2 {
    font-size: 1.05em;
    margin: 0 0 0.6em;
    color: #1a1a1a;
}
.etco-context-section p {
    font-size: 0.9em;
    color: #444;
    line-height: 1.7;
    margin: 0 0 0.6em;
}
.etco-context-section p:last-child { margin-bottom: 0; }

/* Specs table */
.etco-specs-section { margin: 2em 0; }
.etco-specs-section h2 { margin-bottom: 0.75em; font-size: 1.1em; }
.etco-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.etco-specs-table th,
.etco-specs-table td {
    padding: 0.65em 0.9em;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}
.etco-specs-table th {
    background: #f5f5f5;
    font-weight: 600;
    width: 40%;
}

/* Coupang CTA */
.etco-coupang-cta { margin: 2em 0; text-align: center; }

/* Data source */
.etco-data-source {
    margin: 2.5em 0 1em;
    padding: 1em 1.2em;
    background: #f9f9f9;
    border-left: 3px solid #ccc;
    font-size: 0.83em;
    color: #666;
}
.etco-data-source h3 {
    font-size: 0.95em;
    margin: 0 0 0.5em;
    color: #444;
}
.etco-data-source ul {
    margin: 0 0 0.5em;
    padding-left: 1.2em;
}
.etco-data-source li { margin-bottom: 0.25em; }
.etco-data-source-note { margin: 0; color: #999; }
.etco-data-source a { color: #555; }

/* ── Guide Page ─────────────────────────────────────────────────────────────── */

.etco-guide-header { margin-bottom: 1.5em; }
.etco-guide-title { font-size: 1.8em; font-weight: 700; margin: 0 0 0.4em; }
.etco-guide-meta { font-size: 0.85em; color: #888; }
.etco-guide-thumbnail { margin-bottom: 1.5em; }
.etco-guide-thumbnail img { width: 100%; height: auto; border-radius: 6px; }
.etco-guide-content { line-height: 1.75; }

/* ── Comparison Table ──────────────────────────────────────────────────────── */

.etco-comparison-table-wrap {
    overflow-x: auto;
    margin: 1.5em 0;
}

.etco-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.etco-comparison-table th,
.etco-comparison-table td {
    padding: 0.6em 0.8em;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.etco-comparison-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    white-space: nowrap;
}

.etco-comparison-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Energy grade badges */
.etco-grade { font-weight: 700; text-align: center; }
.etco-grade-1 { color: #1a8a2e; }
.etco-grade-2 { color: #5aab2e; }
.etco-grade-3 { color: #f5a623; }
.etco-grade-4 { color: #e07020; }
.etco-grade-5 { color: #d0021b; }

/* ── Buy Button ────────────────────────────────────────────────────────────── */

.etco-buy-btn {
    display: inline-block;
    padding: 0.4em 0.8em;
    background: #e8320a;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.etco-buy-btn:hover {
    background: #c0280a;
    color: #fff;
    text-decoration: none;
}

.etco-buy-btn--large {
    padding: 0.7em 1.4em;
    font-size: 1em;
    margin-top: 1em;
}

/* ── Rate Table ────────────────────────────────────────────────────────────── */

.etco-rate-table-wrap {
    margin: 1em 0;
    border: 1px solid #dde;
    border-radius: 6px;
    overflow: hidden;
}
.etco-rate-table-wrap summary {
    padding: 0.7em 1em;
    background: #f0f4ff;
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    color: #334;
    list-style: none;
}
.etco-rate-table-wrap summary::-webkit-details-marker { display: none; }
.etco-rate-table-wrap[open] summary {
    border-bottom: 1px solid #dde;
}
.etco-rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}
.etco-rate-table th,
.etco-rate-table td {
    padding: 0.5em 0.9em;
    border-bottom: 1px solid #eef;
    text-align: left;
}
.etco-rate-table thead th {
    background: #f8f9ff;
    font-weight: 600;
    color: #555;
}
.etco-rate-table tr.etco-rate-highlight td {
    background: #fff8f0;
    color: #b34000;
}
.etco-rate-note {
    font-size: 0.78em;
    color: #888;
    padding: 0.5em 1em;
    margin: 0;
}

/* ── TCO Calculator ────────────────────────────────────────────────────────── */

.etco-tco-calculator {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5em;
    margin: 1.5em 0;
    width: 100%;
    box-sizing: border-box;
}

.etco-calc-title {
    margin: 0 0 1em;
    font-size: 1.1em;
}

.etco-calc-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1em;
}

.etco-calc-inputs label {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    font-size: 0.85em;
    font-weight: 600;
}

.etco-calc-inputs input[type="number"] {
    width: 90px;
    padding: 0.3em 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.etco-calc-results {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1em;
    margin-bottom: 0.75em;
}

.etco-result-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4em 0;
    border-bottom: 1px dotted #eee;
}

.etco-result-item:last-child { border-bottom: none; }

.etco-result-label { font-size: 0.9em; color: #555; }

.etco-result-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── Affiliate Disclosure ──────────────────────────────────────────────────── */

.etco-affiliate-disclosure {
    font-size: 0.78em;
    color: #888;
    margin-top: 0.5em;
}

/* ── No data ───────────────────────────────────────────────────────────────── */

.etco-no-data {
    color: #888;
    font-style: italic;
}

/* ── Calc note ─────────────────────────────────────────────────────────────── */

.etco-calc-note {
    font-size: 0.78em;
    color: #888;
    margin-top: 0.5em;
}

/* ── Disclosure (hero area) ────────────────────────────────────────────────── */

.etco-disclosure-hero {
    font-size: 0.72em;
    color: #aaa;
    margin: 0.4em 0 0;
}

/* ── AdSense slots ─────────────────────────────────────────────────────────── */

.etco-ad-slot {
    margin: 1.5em 0;
    text-align: center;
    overflow: hidden;
}

/* Header ad: hidden on mobile to protect Core Web Vitals / CLS */
@media (max-width: 767px) {
    .etco-ad-header { display: none; }
}

/* in-content: keep visual separation from surrounding text */
.etco-ad-in-content {
    clear: both;
    padding: 0.5em 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Interactive Compare Tool ───────────────────────────────────────────── */

.etco-compare-tool {
    margin: 1.5em 0;
    background: #fff;
    border: 1px solid #dde3f0;
    border-radius: 12px;
    padding: 1.75em 1.5em;
    box-shadow: 0 2px 16px rgba(58,123,213,0.07);
}

.etco-compare-tool-desc {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 1.4em;
    text-align: center;
}

/* ── Two-panel selector row ──────────────────────────────────────────────── */

.etco-compare-selectors {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.etco-compare-panel {
    flex: 1;
    min-width: 0;
    background: #f5f8ff;
    border: 2px solid #d0ddf5;
    border-radius: 10px;
    padding: 1.1em 1.1em 1em;
    transition: border-color 0.18s;
}

.etco-compare-panel:focus-within {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 3px rgba(58,123,213,0.1);
}

.etco-compare-panel-label {
    font-size: 0.78em;
    font-weight: 700;
    color: #3a7bd5;
    letter-spacing: 0.02em;
    margin-bottom: 0.65em;
    text-transform: uppercase;
}

/* search wrapper — dropdown positions relative to this */
.etco-search-wrap {
    position: relative;
}

.etco-model-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6em 2em 0.6em 0.85em;
    border: 1.5px solid #c8d5ed;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aab' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat right 0.65em center;
    background-size: 14px;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
}

.etco-model-search:focus {
    outline: none;
    border-color: #3a7bd5;
    box-shadow: 0 0 0 3px rgba(58,123,213,0.12);
    background-color: #fff;
}

.etco-model-search::placeholder { color: #b0b8cc; }

/* dropdown */
.etco-model-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #3a7bd5;
    border-radius: 8px;
    list-style: none;
    margin: 0;
    padding: 0.3em 0;
    z-index: 300;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 8px 28px rgba(58,123,213,0.18);
}

.etco-model-dropdown li {
    padding: 0.52em 0.9em;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1.45;
    border-bottom: 1px solid #f0f4ff;
}

.etco-model-dropdown li:last-child { border-bottom: none; }
.etco-model-dropdown li:hover { background: #eef4ff; }

.etco-dropdown-empty {
    color: #aaa;
    font-style: italic;
    cursor: default !important;
}

.etco-dd-brand { font-weight: 700; color: #1a3870; }

.etco-dd-grade {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 700;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    margin-left: 0.3em;
    vertical-align: middle;
}

.etco-dd-grade.etco-grade-1 { background: #e6f7ec; color: #1a8a2e; }
.etco-dd-grade.etco-grade-2 { background: #eef8e6; color: #4a9a20; }
.etco-dd-grade.etco-grade-3 { background: #fef8e6; color: #b08000; }
.etco-dd-grade.etco-grade-4 { background: #fef0e6; color: #b04800; }
.etco-dd-grade.etco-grade-5 { background: #fde8eb; color: #b0021b; }

/* selected state */
.etco-selected-model {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.58em 0.85em;
    background: #fff;
    border: 1.5px solid #3a7bd5;
    border-radius: 6px;
    font-size: 0.86em;
}

.etco-selected-name {
    flex: 1;
    font-weight: 600;
    color: #1a3870;
    word-break: break-word;
    line-height: 1.4;
}

.etco-clear-btn {
    background: #f0f4ff;
    border: none;
    cursor: pointer;
    color: #7a90b8;
    font-size: 0.85em;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    line-height: 1.6em;
    text-align: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.etco-clear-btn:hover { background: #fde8eb; color: #d0021b; }

/* VS badge */
.etco-compare-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2em;
    flex-shrink: 0;
    padding-top: 2.8em; /* vertically align with input */
}

.etco-compare-vs span {
    display: block;
    background: linear-gradient(135deg, #3a7bd5 0%, #5b9cf0 100%);
    color: #fff;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.42em 0.65em;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(58,123,213,0.35);
}

/* ── Compare result table ─────────────────────────────────────────────────── */

.etco-compare-result { margin-top: 2em; }

.etco-compare-result-header {
    font-size: 0.82em;
    font-weight: 700;
    color: #3a7bd5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #3a7bd5;
}

.etco-compare-table-wrap { overflow-x: auto; }

.etco-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

.etco-compare-table th,
.etco-compare-table td {
    padding: 0.65em 0.85em;
    border: 1px solid #e4e8f0;
    text-align: left;
    vertical-align: middle;
}

.etco-compare-table thead th {
    background: #3a7bd5;
    color: #fff;
    font-weight: 600;
    font-size: 0.84em;
    line-height: 1.4;
    word-break: break-word;
}

.etco-compare-table thead th.etco-spec-label-th {
    background: #2d65b8;
    color: rgba(255,255,255,0.7);
    font-size: 0.78em;
    font-weight: 500;
    width: 26%;
    white-space: nowrap;
}

.etco-compare-table tbody tr:nth-child(even) td { background: #fafbff; }
.etco-compare-table tbody tr:hover td { background: #f0f5ff !important; }

.etco-spec-label {
    font-weight: 600;
    color: #555;
    font-size: 0.84em;
    background: #f5f7fc !important;
    white-space: nowrap;
    width: 26%;
}

.etco-compare-val { color: #222; }

.etco-compare-val.etco-better {
    background: #edfbf1 !important;
    color: #1a7a2a;
    font-weight: 700;
}

.etco-compare-loading {
    color: #aaa;
    font-style: italic;
    text-align: center;
    padding: 2em;
    font-size: 0.9em;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .etco-compare-tool { padding: 1.25em 1em; }
    .etco-compare-selectors { flex-direction: column; gap: 0.75em; }
    .etco-compare-vs { width: auto; padding-top: 0; }
}
