/* リセット＆基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
}

/* ヘッダー */
.site-header {
    width: 100%;
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem;
}

@media (min-width: 768px) {
    .header-content {
        height: 5rem;
    }
}

.header-logo-wrapper {
    flex-shrink: 0;
}

.header-logo-link {
    display: block;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: opacity 0.2s;
}

.header-logo-link:hover {
    opacity: 0.8;
}

.header-logo-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px #E63946, 0 0 0 4px rgba(230, 57, 70, 0.2);
}

.header-logo-image {
    height: 2rem;
    width: auto;
    display: block;
}

@media (min-width: 768px) {
    .header-logo-image {
        height: 2.5rem;
    }
}

/* アプリ全体のラッパー */
.app-wrapper {
    min-height: 100vh;
    background-color: #f3f4f6;
}

/* 中央固定コンテンツ（モバイル: 100%, PC: 480px固定） */
.app-container {
    width: 100%;
    background-color: #f9fafb;
    min-height: 100vh;
}

@media (min-width: 768px) {
    .app-wrapper {
        background-color: #f3f4f6;
    }
    
    .app-container {
        max-width: 480px;
        margin: 0 auto;
        background-color: white;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* KVエリア - 1200×630比率の画像 */
.kv-area {
    position: relative;
    width: 100%;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background-color: #E63946;
}

.kv-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kv-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.kv-title {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.4;
}

/* 検索ウィジェットラッパー */
.search-widget-wrapper {
    background-color: #f9fafb;
    padding-bottom: 1.5rem;
}

/* 検索ウィジェット */
.search-widget {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    padding: 1rem;
    margin: -2rem 1rem 0;
    position: relative;
    z-index: 10;
}

.search-section {
    margin-bottom: 0.625rem;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
}

.icon {
    width: 1rem;
    height: 1rem;
    color: #E63946;
    flex-shrink: 0;
}

#areaSelect {
    /* --- 追加・修正した最強設定 --- */
    display: block;          /* インラインではなくブロック要素として扱う */
    width: 100% !important;  /* 親要素の幅100%を強制 */
    min-width: 100%;         /* 検証モードでの縮みを物理的に防ぐ */
    max-width: 100%;
    /* -------------------------- */

    height: 48px;
    padding: 0 1rem;
    font-size: 16px;
    color: #374151;
    background-color: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    box-sizing: border-box;
    
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

/* フォーカス時やIE向けは変更なしなのでそのままでOKです */
#areaSelect:focus {
    outline: none;
    border-color: #E63946;
}

#areaSelect::-ms-expand {
    display: none;
}

.date-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    position: relative;
}

.date-btn {
    padding: 0.625rem 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
}

.date-btn:hover {
    border-color: #E63946;
    color: #E63946;
}

.date-btn.active {
    border-color: #E63946;
    background: white;
    color: #E63946;
}

.search-btn {
    width: 100%;
    background: #6b7280;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #4b5563;
}

/* カレンダーポップアップ */
.calendar-popup {
    display: none;
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 100;
    margin-top: 0.5rem;
    width: calc(100% - 2rem);
    max-width: 320px;
    left: 50%;
    transform: translateX(-50%);
}

.calendar-popup.show {
    display: block;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.calendar-nav {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
}

.calendar-nav:hover {
    background: #FEF2F2;
}

.calendar-nav.hidden {
    visibility: hidden;
}

.calendar-nav svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
}

.calendar-title {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.166rem;
    margin-bottom: 0.25rem;
}

.weekday {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.05rem;
    font-weight: 500;
    width: 2.3rem;
    line-height: 2.3rem;
}

.weekday.sun {
    color: #dc2626;
}

.weekday.sat {
    color: #2563eb;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.05rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 2.3rem;
    line-height: 2.3rem;
    margin: 0.05rem;
}

.calendar-day:hover:not(.disabled):not(.empty) {
    background: #FEF2F2;
    color: #E63946;
}

.calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.selected {
    background: #E63946 !important;
    color: white !important;
    font-weight: 500;
}

.calendar-day.selected:hover {
    background: #D62839 !important;
}

.calendar-day.sunday {
    color: #dc2626;
}

.calendar-day.saturday {
    color: #2563eb;
}

.calendar-day.today {
    font-weight: 500;
    background: #FEF2F2;
    color: #E63946;
}

/* スティッキー検索バー */
.sticky-search-bar {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.625rem 1rem;
    z-index: 1000;
    transition: top 0.3s ease;
}

.sticky-search-bar.show {
    top: 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        top: -100px;
    }
    to {
        top: 0;
    }
}

.sticky-search-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-conditions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sticky-condition-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.sticky-condition-item:first-child {
    flex-shrink: 0;
}

.sticky-condition-item:first-child span {
    white-space: nowrap;
}

.sticky-condition-item:last-child {
    flex: 1;
    min-width: 0;
}

.sticky-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: #6b7280;
    flex-shrink: 0;
}

.sticky-condition-item span {
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-divider {
    width: 1px;
    height: 0.75rem;
    background-color: #d1d5db;
    flex-shrink: 0;
}

.sticky-edit-btn {
    padding: 0.375rem 0.75rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.sticky-edit-btn:hover {
    background: #4b5563;
}

/* 検索結果数 */
.search-result-info {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
}

.search-result-info p {
    font-size: 0.875rem;
    color: #6b7280;
}

.search-result-info .highlight {
    color: #E63946;
}

/* プラン一覧コンテナ */
.plans-container {
    background-color: #f9fafb;
    padding-bottom: 1.5rem;
}

.plans-list {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 0 1rem;
}

/* プランカード */
.plan-card {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

.plan-card:hover {
    background-color: #f9fafb;
}

.plan-card:last-child {
    border-bottom: none;
}

/* カードヘッダー（画像 + 基本情報） */
.plan-header {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.plan-image-wrapper {
    flex-shrink: 0;
}

.plan-image {
    width: 5rem;
    height: 5rem;
    border-radius: 0.375rem;
    object-fit: cover;
    display: block;
}

.plan-info-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.plan-top-info {
    flex: 1;
}

.plan-area {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.625rem;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.plan-area svg {
    width: 0.625rem;
    height: 0.625rem;
    flex-shrink: 0;
    fill: #6E6E6E;
}

.plan-title {
    font-size: 0.875rem;
    color: #111827;
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.25rem;
}

.plan-facility {
    font-size: 0.6875rem;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1rem;
}

.plan-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.plan-price-original {
    color: #9ca3af;
    font-size: 0.625rem;
    text-decoration: line-through;
}

.plan-price {
    color: #E63946;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.75rem;
}

.plan-price-suffix {
    color: #9ca3af;
    font-size: 0.625rem;
}

.plan-discount {
    display: inline-block;
    background: #E63946;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    margin-left: auto;
}

/* 在���カレンダー */
.availability-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
    margin-bottom: 0.5rem;
}

.availability-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0;
    border-radius: 0.25rem;
    border: 1px solid;
}

.availability-slot.sat {
    background-color: #eff6ff;
    border-color: #bfdbfe;
}

.availability-slot.sun {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.availability-slot:not(.sat):not(.sun) {
    background-color: white;
    border-color: #e5e7eb;
}

.slot-day {
    font-size: 0.5625rem;
    line-height: 1;
    margin-bottom: 0.125rem;
    font-weight: 400;
}

.slot-day.sat {
    color: #2563eb;
}

.slot-day.sun {
    color: #dc2626;
}

.slot-day:not(.sat):not(.sun) {
    color: #111827;
}

.slot-date {
    font-size: 0.5625rem;
    line-height: 1;
    margin-bottom: 0.125rem;
    font-weight: 400;
}

.slot-date.sat {
    color: #2563eb;
}

.slot-date.sun {
    color: #dc2626;
}

.slot-date:not(.sat):not(.sun) {
    color: #111827;
}

.slot-status {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1;
}

.slot-mail-icon {
    width: 0.75rem;
    height: 0.75rem;
    color: #374151;
}

/* カレンダー説明 */
.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.5625rem;
    color: #6b7280;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.legend-mail-icon {
    width: 0.625rem;
    height: 0.625rem;
}

/* 予約ボタン */
.reserve-btn {
    width: 100%;
    background: #E63946;
    color: white;
    padding: 0.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.reserve-btn:hover {
    background: #D62839;
}

/* プランアクション（aタグ内の擬似ボタン） */
.plan-action {
    width: 100%;
    background: #E63946;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-align: center;
}

.plan-action-text {
    font-size: 0.875rem;
    color: white;
}

.plan-card:hover .plan-action {
    background: #D62839;
}

/* フッター */
.footer {
    background: #f9fafb;
    color: #6b7280;
    text-align: center;
    padding: 1.5rem 1rem;
}

.footer p {
    font-size: 0.75rem;
}