/* Compare page */

.compare-wrapper {
    max-width: 640px;
    margin: 32px auto;
    padding: 0 20px;
    width: 100%;
}

/* html/body has overflow-x:hidden, which per spec forces overflow-y to
   compute as auto — that clips absolutely-positioned content (the
   dropdown) past the page's in-flow height. Reserve space while a
   dropdown is open so the page is tall enough not to clip it. */
.compare-wrapper.dropdown-open {
    padding-bottom: 420px;
}

.compare-slot {
    position: relative;
}

.compare-label {
    display: block;
    font-size: 0.75em;
    font-weight: 300;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.compare-search {
    position: relative;
}

.compare-input {
    width: 100%;
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    font-weight: 400;
    padding: 14px 40px 14px 18px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: white;
    color: #222;
    outline: none;
    transition: border-color 0.15s;
}

.compare-input:focus {
    border-color: #999;
}

.compare-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    color: #bbb;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
    display: none;
}

.compare-clear:hover { color: #666; }
.compare-clear.visible { display: block; }

.compare-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 20;
    display: none;
}

.compare-dropdown.open { display: block; }

.compare-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.compare-option:hover { background: #f7f7f7; }

.compare-option-logo {
    height: 22px;
    width: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.compare-option-name {
    font-size: 0.92em;
}

.compare-empty {
    padding: 14px 16px;
    color: #aaa;
    font-size: 0.85em;
}

/* Divider */
.compare-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px 0;
}

.compare-divider::before,
.compare-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

.compare-divider-label {
    font-size: 0.75em;
    font-weight: 600;
    color: #bbb;
    letter-spacing: 0.08em;
}

/* Result card */
.compare-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid #e8e8e8;
    border-top: 4px solid #ccc;
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.compare-card-logo {
    height: 44px;
    width: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

.compare-card-body {
    flex: 1;
    min-width: 140px;
}

.compare-card-name {
    font-size: 1.1em;
    font-weight: 400;
}

.compare-card-link {
    font-size: 0.75em;
    color: #888;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.compare-card-link:hover { color: #444; }

.compare-card-stats-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.compare-card-stats {
    display: flex;
    gap: 28px;
}

.stat-val.stat-higher { color: #1e8449; }
.stat-val.stat-lower { color: #c0392b; }

.compare-placeholder {
    text-align: center;
    color: #bbb;
    font-size: 0.85em;
    padding: 20px;
}

@media (max-width: 540px) {
    .compare-wrapper { margin-top: 16px; padding: 0 12px; }
    .compare-card { padding: 14px 16px; gap: 12px; }
    .compare-card-logo { height: 34px; width: 52px; }
    .compare-card-name { font-size: 0.95em; }
    .compare-card-stats { gap: 16px; width: 100%; justify-content: space-around; }
}
