/* search.css */

/* タブのスタイル */
.tabs {
    display: flex;
    width: 100%;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
}

.tab-button {
    position: relative;
    flex-grow: 1;
    padding: 10px 0;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: var(--font-size-body-text);
    color: var(--color-body-text-2);
    text-align: center;
}

.tab-button.active {
    color: #d1121d;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #d1121d;

    /* ズレを微調整する */
    transform: translateY(2px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* メインコンテンツのスタイル */
.search-page-main {
    max-width: 960px;
    margin: 0 auto;
}

/* 検索フォームのスタイル */
.search-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    /* オートコンプリートの基準位置 */
}

.site-search-input,
.manual-search-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--color-background-border);
    border-radius: 5px;
    font-size: var(--font-size-body-text);
    max-width: 500px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: var(--color-submit-button);
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.search-button {
    padding: 12px 25px;
    background-color: var(--color-submit-button);
    color: var(--color-body-text-dark);
    border: none;
    border-radius: 5px;
    font-size: var(--font-size-body-text);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-button:hover {
    background-color: var(--color-submit-button-hovar);
}

.search-button:active {
    transform: translateY(0);
}

/* --- オートコンプリートのスタイル --- */
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
    background-color: var(--color-white-emphasis);
}

/* 検索結果のスタイル */
.results-section,
.site-search-results-section,
.manual-search-results-section {
    background-color: var(--color-background);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.results-title {
    color: var(--color-body-text-2);
    font-size: var(--font-size-h5);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.results-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--color-background-border);
    transition: background-color 0.3s ease;
}

.results-list li:last-child {
    border-bottom: none;
}

.results-list li a {
    display: flex;
    flex-direction: column;
    color: var(--color-body-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.results-list li a:hover {
    color: var(--color-link-text);
    text-decoration: none;
}

.results-list li:hover {
    background-color: var(--color-white-emphasis);
}

.result-title {
    font-size: var(--font-size-h5);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-description {
    font-size: var(--font-size-body-text);
    color: #777;
    margin-top: 5px;
}

.result-url {
    font-size: var(--font-size-caption);
    color: var(--color-body-text-2);
    margin-top: 5px;
    word-break: break-all;
}

/* product名を少し小さく */
.result-product-name {
    font-size: var(--font-size-caption);
    color: var(--color-body-text-2);
    margin-top: 5px;
}

.result-title img {
    height: 20px;
    width: auto;
}

/* 検索結果の概要とページネーションのスタイル */
.results-summary {
    text-align: right;
    margin: 30px 0 10px;
    font-size: var(--font-size-caption);
    color: var(--color-body-text-2);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.pagination-controls button {
    padding: 12px 25px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: var(--font-size-body-text);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pagination-controls button:hover {
    background-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.pagination-controls button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-controls button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .result-title-h3 {
        font-weight: 400;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .search-form {
        height: auto;
        flex-direction: column;
    }

    .site-search-input,
    .manual-search-input {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .search-button {
        width: 100%;
    }

    .result-title img {
        height: 20px;
        width: auto;
    }
}

/* 検索に関する注意事項 */
.search-notice {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: var(--font-size-body-text);
    line-height: 1.6;
}

.search-notice a {
    color: #856404;
    text-decoration: underline;
    font-weight: bold;
}

.search-notice a:hover {
    color: #533f03;
}