/* API データ表示のスタイル（仮） */

/* デバッグ情報のスタイル */
.debug-info {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.debug-info pre {
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
}

.error {
    margin: 20px 0;
    padding: 15px;
    background: #fff3f3;
    border: 1px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
}

/* 検索フォーム */
.search-form-container {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 100px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs input {
    width: 100px;
}

.range-inputs span {
    color: #666;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-search-form .search-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.search-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover:not(:disabled) {
    background-color: #45a049;
}

.search-button:disabled,
.search-button.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.reset-button {
    background: #6c757d;
    color: white;
}

.reset-button:hover {
    background: #5a6268;
}

/* 検索結果情報 */
.search-results-info {
    margin: 0 auto;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    text-align: center;
	width: 50%;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #007bff;
    background: white;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .prev,
.pagination .next {
    padding: 8px 15px;
}

.sort-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.sort-options select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.sort-options select:focus {
    outline: none;
    border-color: #007bff;
}

.sort-options optgroup {
    font-weight: bold;
}

.sort-options option {
    padding: 4px;
}

.grade-name {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.color-option:hover {
    background-color: #f5f5f5;
}

.color-option input[type="checkbox"] {
    display: none;
}

.color-option input[type="checkbox"]:checked + .color-swatch {
    border: 2px solid #007bff;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
}

.color-name {
    font-size: 14px;
    color: #333;
} 

.main-content {
    display: flex;
}

.main-sub-search-form .search-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
	width: 200px;
	margin: 0 auto;
}

.main-content .sub-search-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover:not(:disabled) {
    background-color: #45a049;
}

.main-content .sub-search-button:disabled,
.main-content .sub-search-button.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.municipality-accordion {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.municipality-accordion.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.accordion-header {
    padding: 10px 15px;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
}

.accordion-header.disabled {
    cursor: not-allowed;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-content {
    display: none;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.accordion-content.active {
    display: block;
}

.municipality-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.municipality-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.municipality-checkboxes label:hover {
    background-color: #f5f5f5;
}

.municipality-checkboxes input[type="checkbox"] {
    margin: 0;
}

.designated-city {
    grid-column: 1 / -1;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 1.1em;
}

.designated-city:first-child {
    margin-top: 0;
}

.stock-quantity {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}

.municipality-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border-radius: 4px;
}

.municipality-item:hover {
    background-color: #f5f5f5;
}

/* 地域グループのスタイル */
.section-header {
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 0.5em;
    padding: 0.5em;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.prefecture-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.25em 0;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.no-cars {
    text-align: center;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 8px;
}

@media screen and (max-width: 1024px) {
    .latest-cars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .latest-cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .latest-cars-grid {
        grid-template-columns: 1fr;
    }
}

.shop-list {
    margin-top: 150px;
}

.shop-detail {
    margin-top: 150px;
}

.car-detail {
    max-width: 1200px;
    margin: 100px auto;
    padding: 20px;
}

.car-basic-info {
    margin-bottom: 20px;
}

.car-basic-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.grade-name {
    font-size: 18px;
    color: #666;
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .search-form-container {
        padding: 15px;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .range-inputs {
        flex-direction: column;
    }

    .range-inputs input {
        width: 100%;
    }

    .range-inputs span {
        margin-top: 5px;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-group label {
        margin-bottom: 5px;
    }

    .main-search-form .search-buttons {
        flex-direction: column;
    }

    .main-search-form .search-buttons button {
        width: 100%;
        margin-top: 10px;
    }

    .reset-button {
        width: 100%;
    }

    .search-results-info {
        width: 100%;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination a,
    .pagination span {
        width: 100%;
    }

    .pagination .current {
        width: 100%;
    }

    .pagination .prev,
    .pagination .next {
        width: 100%;
    }

    .sort-container {
        flex-direction: column;
    }

    .sort-options select {
        width: 100%;
    }

    .sort-options select:focus {
        outline: none;
    }

    .sort-options optgroup {
        width: 100%;
    }

    .sort-options option {
        width: 100%;
    }

    .grade-name {
        width: 100%;
    }

    .checkbox-group {
        max-height: 150px;
    }

    .color-palette {
        max-height: 150px;
    }

    .color-option {
        width: 100%;
    }

    .color-option:hover {
        background-color: #f5f5f5;
    }

    .color-option input[type="checkbox"] {
        width: 100%;
    }

    .color-option input[type="checkbox"]:checked + .color-swatch {
        border: 2px solid #007bff;
    }

    .color-swatch {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 1px solid #ddd;
        display: inline-block;
    }

    .color-name {
        width: 100%;
    }

    .main-content {
        flex-direction: column;
    }

    .main-sub-search-form .search-buttons {
        width: 100%;
    }

    .main-content .sub-search-button {
        width: 100%;
    }

    .municipality-accordion {
        width: 100%;
    }

    .accordion-header {
        width: 100%;
    }

    .accordion-icon {
        width: 100%;
    }

    .accordion-content {
        width: 100%;
    }

    .accordion-content.active {
        width: 100%;
    }

    .municipality-checkboxes {
        width: 100%;
    }

    .municipality-checkboxes label {
        width: 100%;
    }

    .municipality-checkboxes input[type="checkbox"] {
        width: 100%;
    }

    .designated-city {
        width: 100%;
    }

    .stock-quantity {
        width: 100%;
    }

    .municipality-item {
        width: 100%;
    }

    .section-header {
        width: 100%;
    }

    .prefecture-checkboxes {
        width: 100%;
    }

    .checkbox-label {
        width: 100%;
    }

    .checkbox-label input[type="checkbox"] {
        width: 100%;
    }

    .latest-cars-section {
        padding: 20px;
    }

    .latest-cars-section h1 {
        font-size: 20px;
    }

    .latest-cars-section p {
        font-size: 14px;
    }

    .latest-cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-car-item {
        width: 100%;
    }

    .latest-car-image {
        width: 100%;
    }

    .latest-car-info {
        width: 100%;
    }

    .latest-car-name {
        width: 100%;
    }

    .latest-grade-name {
        width: 100%;
    }

    .latest-car-price {
        width: 100%;
    }

    .no-cars {
        width: 100%;
    }

    .car-type-search {
        padding: 20px;
    }

    .car-type-search h2 {
        font-size: 20px;
    }

    .car-type-search .total-count {
        font-size: 14px;
    }

    .car-type-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .car-type-item {
        width: 100%;
    }

    .car-type-item a {
        width: 100%;
    }

    .view-all {
        width: 100%;
    }

    .view-all a {
        width: 100%;
    }

    .shop-list {
        width: 100%;
    }

    .shop-detail {
        width: 100%;
    }
}
