/* battery-finder.css */
:root {
    --cw-max-width: 1000px;
    --cw-breakpoint-md: 800px;
    --cw-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --cw-text-color-primary: #212529;
    --cw-bg-primary: #fff;
    --cw-border-color: #dee2e6;
}
#battery-filter-container.final-design {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 2.5rem;
    max-width: var(--cw-max-width);
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    #battery-filter-container.final-design {
        padding: 2.5rem 3rem;
    }
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.filter-title {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    margin: 0;
    color: #1d3557;
    flex-grow: 1;
    font-weight: 700;
}
.filter-stats {
    font-size: 0.9em;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 0.4em 1em;
    border-radius: 50px;
    white-space: nowrap;
}
@media (max-width: 799px) {
    .filter-title { width: 100%; margin-bottom: 0.5rem; }
    .filter-stats { flex-grow: 1; text-align: center; }
}
.filter-reset {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 0.4em 1em;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.filter-reset:hover { background: #6c757d; color: #fff; }
.filter-section { border-top: 1px solid #e9ecef; padding-top: 1.5rem; margin-top: 1.5rem; }
.filter-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.filter-section .filter-section-title { display: block; font-size: 1rem; font-weight: 600; color: #007bff; margin-top: 0; margin-bottom: 1.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.preset-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.preset-btn { padding: 0.8em 0.5em; border: 1px solid #ced4da; background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; color: #495057; text-align: center; transition: all 0.2s ease-in-out; line-height: 1.4; }
.preset-btn span { font-size: 0.8em; color: #6c757d; display: block; transition: color 0.2s ease-in-out; }
.preset-btn:hover, .preset-btn:focus-visible { border-color: #80bdff; color: #0056b3; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1); }
.preset-btn.active { background-color: #007bff; color: #fff; border-color: #007bff; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 123, 255, 0.25); }
.preset-btn.active span { color: rgba(255,255,255,0.8); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.25rem 1.5rem; }
.filter-group label { display: block; font-weight: 500; color: #495057; margin-bottom: 0.5rem; font-size: 0.9rem; }
.input-range { display: flex; align-items: center; gap: 0.5em; }
.input-range span { color: #6c757d; }
#battery-filter-form select, #battery-filter-form input[type="number"] { width: 100%; padding: 0.75rem; border: 1px solid #ced4da; border-radius: 8px; font-size: 1rem; background-color: #f8f9fa; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -webkit-appearance: none; appearance: none; }
#battery-filter-form select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; padding-right: 2.5rem; }
#battery-filter-form input[type="number"]::-webkit-outer-spin-button, #battery-filter-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#battery-filter-form input[type="number"] { -moz-appearance: textfield; }
#battery-filter-form input:focus, #battery-filter-form select:focus { border-color: #80bdff; outline: 0; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); background-color: #fff; }
.filter-grid-checkboxes { display: flex; flex-direction: column; gap: 1rem; }
.filter-group-checkbox { display: flex; align-items: center; }
.filter-group-checkbox input[type="checkbox"] { margin-right: 0.75rem; width: 1.1em; height: 1.1em; accent-color: #007bff; }
.filter-group-checkbox label { margin-bottom: 0; font-weight: 500; color: #495057; font-size: 0.95rem; cursor: pointer; }
.filter-submit { text-align: center; margin-top: 2.5rem; border-top: 1px solid #e9ecef; padding-top: 2rem; }
#filter-submit-button { width: 100%; max-width: 320px; padding: 1rem; font-size: 1.1rem; font-weight: 700; color: #fff; background-color: #007bff; border: none; border-radius: 50px; cursor: pointer; transition: all 0.2s ease-in-out; box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2); }
#filter-submit-button:hover:not(:disabled) { background-color: #0069d9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3); }
#filter-submit-button:disabled { background-color: #6c757d; cursor: not-allowed; box-shadow: none; }
#cw-list-wrapper { position: relative; display: block; min-height: 300px; clear: both; }
.cw-initial-state, .cw-no-results, .cw-error { text-align: center; padding: 4rem 1rem; font-size: 1.1rem; color: #6c757d; min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.cw-initial-state { background-color: #f8f9fa; border-radius: 8px; }
.cw-loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.85); z-index: 10; transition: opacity 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.cw-state-active { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cw-spinner { width: 48px; height: 48px; border: 5px solid #f3f3f3; border-top: 5px solid #007bff; border-radius: 50%; animation: spinner-rotate 1s linear infinite; margin-bottom: 1.5rem; }
@keyframes spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.cw-loading-overlay p { font-weight: 500; margin: 0; font-size: 1.1rem; color: #6c757d; }
.cw-error button, .cw-no-results button { margin-top: 1.5rem; }
#cw-list-container { font-family: var(--cw-font-family); margin: 2em auto; max-width: var(--cw-max-width); padding: 0; position: relative; }
.cw-list-note { font-size: 0.85em; color: #6c757d; background-color: #f8f9fa; border: 1px solid #e9ecef; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.5em; text-align: center; }
.cw-sort-buttons-container { margin-bottom: 1.5em; text-align: center; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75em; }
.cw-btn { padding: 0.65em 1.3em; margin: 0; border: 1px solid #dee2e6; background-color: #fff; color: #495057; cursor: pointer; border-radius: 50rem; font-size: 0.875rem; font-weight: 500; transition: all 0.15s ease-in-out; }
.cw-btn:hover, .cw-btn:focus-visible { background-color: #f8f9fa; border-color: #ced4da; transform: translateY(-1px); }
.cw-btn.active { background-color: #007bff; color: white; border-color: #007bff; }
.cw-table-view { display: flex; flex-direction: column; border: 1px solid var(--cw-border-color); border-radius: 0.3rem; overflow: hidden; background-color: var(--cw-bg-primary); min-width: var(--cw-breakpoint-md); }
.cw-table-header, .cw-table-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--cw-border-color); }
.cw-table-row:last-child { border-bottom: none; }
.cw-table-row:hover { background-color: #f8f9fa; }
.cw-table-header { background-color: #f8f9fa; color: #6c757d; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cw-table-cell { padding: 0.9em 0.8em; display: flex; align-items: center; font-size: 0.9rem; color: var(--cw-text-color-primary); line-height: 1.5; }
.cw-cell-rank { flex: 0 0 65px; justify-content: center; font-weight: 700; font-size: 1.05rem; }
.cw-cell-rank span { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background-color: #f8f9fa; color: #495057; }
.cw-cell-rank.cw-rank-1 span { background-color: #ffd700; color: #3d2800; }
.cw-cell-rank.cw-rank-2 span { background-color: #c0c0c0; color: #3d3d3d; }
.cw-cell-rank.cw-rank-3 span { background-color: #cd7f32; color: #fff; }
.cw-cell-image { flex: 0 0 90px; justify-content: center; }
.cw-cell-image img { width: 70px; height: 70px; object-fit: contain; border-radius: 0.25rem; }
.cw-cell-title { flex: 1 1 32%; min-width: 200px; font-weight: 500; }
.cw-title-multiline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cw-cell-price { flex: 0 0 140px; justify-content: center; font-weight: 600; color: #c82333; flex-direction: column; align-items: flex-end; gap: 2px; }
.cw-cell-rating { flex: 0 0 95px; justify-content: center; font-weight: 600; color: #ffc107; }
.cw-cell-buy { flex: 0 0 125px; display: flex; flex-direction: column; gap: 0.45em; align-items: stretch; justify-content: center; }
.cw-buy-btn { padding: 0.55em 0.5em; border-radius: 0.2rem; text-decoration: none; color: white !important; font-size: 0.8rem; text-align: center; display: block; font-weight: 500; }
.cw-buy-btn:hover { opacity: 0.88; }
.cw-buy-btn.az { background: #ff9900; }
.cw-buy-btn.rk { background: #bf0000; }
.cw-buy-btn.yh { background: #004097; }
@media (prefers-reduced-motion: reduce) { .preset-btn, .cw-btn, .cw-buy-btn-detail { transition: none; } .preset-btn:hover, .cw-btn:hover { transform: none; } }
@media (max-width: 799px) {
    #cw-list-container { overflow-x: visible; }
    .cw-table-view { min-width: 0; border: none; background-color: transparent; gap: 1rem; }
    .cw-table-header { display: none; }
    .cw-table-row { position: relative; display: grid; grid-template-columns: 90px 1fr; grid-template-rows: auto 1fr auto; gap: 0 1rem; border: 1px solid var(--cw-border-color); background-color: var(--cw-bg-primary); border-radius: 8px; padding: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
    .cw-table-row:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.08); }
    .cw-table-cell { padding: 0; border-bottom: none; height: auto; display: flex; flex-direction: column; align-items: flex-start; }
    .cw-cell-rank { position: absolute; top: 0; left: 0; }
    .cw-cell-rank span { width: 36px; height: 36px; border-top-left-radius: 8px; border-bottom-right-radius: 8px; border-top-right-radius: 0; border-bottom-left-radius: 0; }
    .cw-cell-image { grid-column: 1 / 2; grid-row: 1 / 4; gap: 0.5rem; }
    .cw-cell-rating, .cw-cell-price { margin-top: auto; font-weight: bold; }
    .cw-cell-price { color: #c82333; font-size: 1rem; }
    .cw-timestamp { font-weight: normal; font-size: 0.75em; }
    .cw-cell-title { grid-column: 2 / 3; grid-row: 1 / 2; font-weight: bold; line-height: 1.5; }
    .cw-title-multiline { -webkit-line-clamp: 2; }
    .cw-cell-buy { grid-column: 2 / 3; grid-row: 3 / 4; margin-top: auto; padding-top: 0.5rem; width: 100%; flex-direction: row; gap: 0.5rem; }
    .cw-buy-btn { flex-grow: 1; }
    .detail-card-title { padding-left: 45px; min-height: auto; font-size: 1.2rem; }
    .cw-detail-card { padding: 1.5rem; }
}
#cw-details-container { margin-top: 3rem; display: flex; flex-direction: column; gap: 2rem; }
.cw-detail-card { position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--cw-bg-primary); border-radius: 12px; padding: 2rem; box-shadow: 0 8px 30px rgba(0,0,0,0.07); border: 1px solid #e9ecef; }
.detail-card-rank { position: absolute; top: -1px; left: -1px; width: 40px; height: 40px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; border-bottom-right-radius: 12px; padding: 0 5px 5px 0; }
.detail-card-rank span { font-size: 1.2rem; }
.detail-card-rank.cw-rank-1 { background-color: #ffd700; color: #3d2800; }
.detail-card-rank.cw-rank-2 { background-color: #c0c0c0; color: #3d3d3d; }
.detail-card-rank.cw-rank-3 { background-color: #cd7f32; color: #fff; }
.detail-card-title { margin: 0 0 1.5rem 0; padding-left: 50px; min-height: 3.2rem; font-size: 1.4rem; color: var(--cw-text-color-primary); display: flex; align-items: center; }
.detail-card-content { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .detail-card-content { flex-direction: row; } }
.detail-card-left { flex-shrink: 0; text-align: center; align-self: center; }
.detail-card-left a { display: block; }
.detail-card-left img { width: 180px; height: 180px; object-fit: contain; border-radius: 8px; }
.detail-card-right { flex-grow: 1; display: flex; flex-direction: column; }
.detail-card-excerpt { font-size: 0.95rem; line-height: 1.7; color: #495057; margin: 0 0 1rem 0; }
.detail-card-meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: baseline; margin-bottom: 1.5rem; padding: 1rem; background-color: #f8f9fa; border-radius: 8px; }
.detail-card-rating { font-size: 1.2rem; font-weight: 700; color: #ffc107; }
.detail-card-price { font-size: 1.1rem; font-weight: 500; color: #495057; }
.detail-card-price-value { font-size: 1.5rem; font-weight: 700; color: #c82333; margin-left: 0.5rem; }
.detail-card-specs-list { list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem; color: #495057; column-count: 1; }
@media (min-width: 500px) { .detail-card-specs-list { column-count: 2; } }
.detail-card-specs-list li { padding: 0.35rem 0; border-bottom: 1px solid #f1f3f5; }
.detail-card-buttons { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid #e9ecef; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cw-buy-btn-detail { flex-grow: 1; padding: 0.8rem 1.5rem; border-radius: 8px; text-decoration: none; color: white !important; font-size: 1rem; text-align: center; font-weight: 600; }
.cw-buy-btn-detail.az { background: #ff9900; }
.cw-buy-btn-detail.rk { background: #bf0000; }
.cw-buy-btn-detail.yh { background: #004097; }
.cw-timestamp, .detail-card-timestamp { display: block; font-size: 0.75em; color: #6c757d; font-weight: 400; line-height: 1.3; white-space: nowrap; }
.detail-card-timestamp { display: inline; margin-left: 0.5em; }
.cw-disclaimer { font-size: 0.8rem; color: #6c757d; margin: 0 auto 2.5rem; padding: 1.5rem; border: 1px solid #e9ecef; border-radius: 8px; max-width: var(--cw-max-width); background: #f8f9fa; display: none; }
.cw-disclaimer ul { margin: 0; padding-left: 1.2em; }
.cw-disclaimer li { margin-bottom: 0.5em; }
.cw-disclaimer li:last-child { margin-bottom: 0; }