/* WP Portal Map – Frontend Styles */

/* ── Reset & Base ── */
.wpm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Buttons ── */
.wpm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
.wpm-btn:active { transform: scale(0.97); }
.wpm-btn-primary {
    background: #2563eb;
    color: #fff;
}
.wpm-btn-primary:hover { background: #1d4ed8; color: #fff; }
.wpm-btn-secondary {
    background: #6b7280;
    color: #fff;
}
.wpm-btn-secondary:hover { background: #4b5563; color: #fff; }
.wpm-btn-outline {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}
.wpm-btn-outline:hover { background: #2563eb; color: #fff; }
.wpm-btn-lg { padding: 14px 28px; font-size: 16px; }

/* ── Inputs ── */
.wpm-input,
.wpm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.wpm-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.wpm-input:focus,
.wpm-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
textarea.wpm-input { resize: vertical; min-height: 120px; }

/* ── Badges ── */
.wpm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.wpm-badge-featured { background: #f59e0b; color: #fff; }
.wpm-badge-new      { background: #10b981; color: #fff; }

/* ════════════════════════════════════════
   MAP PORTAL LAYOUT
   height はショートコード/ウィジェットのインラインスタイルで注入。
   Leaflet は親要素に実寸 height が必要なため position:absolute で解決。
════════════════════════════════════════ */
.wpm-portal-wrapper {
    display: flex;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    /* インラインスタイルで height が設定される。フォールバック: */
    min-height: 500px;
    /* overflow:hidden は border-radius 用だが z-index 対策で visible に変更 */
    overflow: visible;
}
/* border-radius を子要素でクリップ */
.wpm-portal-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* Search Panel */
.wpm-search-panel {
    width: 320px;
    min-width: 280px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    border-radius: 10px 0 0 10px;
    overflow: hidden;
    transition: width 0.3s, min-width 0.3s;
    z-index: 10;
    position: relative;
}
.wpm-search-panel.collapsed {
    width: 0;
    min-width: 0;
}
.wpm-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
.wpm-search-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.wpm-panel-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
    line-height: 1;
}
.wpm-search-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.wpm-search-results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px 16px;
    min-height: 0; /* flex overflow scroll に必要 */
}
.wpm-search-results .wpm-store-card {
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.wpm-search-results .wpm-card-image {
    height: 100px;
}

/* Map Container: 残りの幅を全て占有し、map div の position 基準になる */
.wpm-map-container {
    flex: 1;
    position: relative;
    min-height: 0; /* flex アイテムの縮小を許可 */
    min-width: 0;
    border-radius: 0 10px 10px 0;
    overflow: hidden;
}

/* ☰ 検索ボタン（モバイル用） */
.wpm-panel-open {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: none;
}
.wpm-panel-open:hover { background: #f9fafb; }

/* ★ 修正ポイント: position:absolute で親コンテナを完全に塗りつぶす
   height:100% は flex の暗黙高さを参照できないため、absolute+inset で解決 */
#wpm-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* ── LEAFLET TOOLTIP ── */
.wpm-leaflet-tooltip {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 10px 14px;
    pointer-events: none;
    min-width: 180px;
    max-width: 260px;
}
.wpm-leaflet-tooltip::before {
    border-top-color: #e5e7eb !important;
}

/* ── MAP POPUP ── */
.wpm-popup {
    min-width: 220px;
    max-width: 280px;
}
.wpm-popup-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    display: block;
}
.wpm-popup-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111827;
}
.wpm-popup-pr {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 6px;
}
.wpm-popup-address,
.wpm-popup-phone {
    font-size: 12px;
    color: #374151;
    margin: 0 0 4px;
}
.wpm-popup-cats {
    margin: 6px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.wpm-popup-link {
    display: block;
    margin-top: 8px;
    text-align: center;
    background: #2563eb;
    color: #fff;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.wpm-popup-link:hover { background: #1d4ed8; color: #fff; }
.wpm-popup-badges { margin-bottom: 6px; }

/* ── STORE LIST ── */
.wpm-store-list-wrapper {
    padding: 20px 0;
}
.wpm-filter-bar {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.wpm-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.wpm-no-results {
    grid-column: 1/-1;
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-size: 16px;
}

/* ── STORE CARD ── */
.wpm-store-card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}
.wpm-store-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.wpm-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.wpm-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}
.wpm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}
.wpm-store-card:hover .wpm-card-image img { transform: scale(1.04); }
.wpm-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 14px;
}
.wpm-card-image .wpm-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}
.wpm-card-body {
    padding: 14px 16px;
}
.wpm-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111827;
}
.wpm-card-pr {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wpm-card-address,
.wpm-card-phone {
    font-size: 12px;
    color: #4b5563;
    margin: 0 0 4px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}
.wpm-icon { flex-shrink: 0; }
.wpm-card-cats {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.wpm-cat-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}
.wpm-tag {
    display: inline-block;
    color: #2563eb;
    font-size: 12px;
    text-decoration: none;
    margin-right: 4px;
}
.wpm-tag:hover { text-decoration: underline; }

/* ── PAGINATION ── */
.wpm-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.wpm-pagination a,
.wpm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    text-decoration: none;
    color: #374151;
    background: #fff;
}
.wpm-pagination a:hover { background: #f3f4f6; }
.wpm-pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ════════════════════════════════════════
   SINGLE STORE PAGE
════════════════════════════════════════ */
.wpm-single-store { --accent: #2563eb; }

/* Hero */
.wpm-hero {
    position: relative;
    height: 420px;
    overflow: hidden;
    background: #1e293b;
}
.wpm-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.75;
}
.wpm-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    padding: 32px;
}
.wpm-hero-info { color: #fff; }
.wpm-store-title {
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 800;
    margin: 8px 0 6px;
    color: inherit;
    line-height: 1.2;
}
.wpm-store-pr {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 8px;
}
.wpm-hero-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Header without image */
.wpm-store-header-text {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    padding: 40px 0;
    color: #fff;
}
.wpm-store-header-text .wpm-store-title { color: #fff; margin: 8px 0 0; }
.wpm-store-header-text .wpm-store-pr    { color: rgba(255,255,255,0.85); }

/* Breadcrumb */
.wpm-breadcrumb {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
    font-size: 13px;
    color: #6b7280;
}
.wpm-breadcrumb a { color: #4b5563; text-decoration: none; }
.wpm-breadcrumb a:hover { text-decoration: underline; }
.wpm-breadcrumb span { margin: 0 6px; }

/* Layout */
.wpm-store-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 48px;
    align-items: start;
}
.wpm-store-sidebar { position: sticky; top: 20px; }

/* Sections */
.wpm-section { margin-bottom: 36px; }
.wpm-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 16px;
}

/* Info Table */
.wpm-info-table {
    width: 100%;
    border-collapse: collapse;
}
.wpm-info-table th,
.wpm-info-table td {
    padding: 10px 14px;
    vertical-align: top;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.wpm-info-table th {
    width: 130px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    white-space: nowrap;
}
.wpm-info-table td { color: #111827; }
.wpm-zip { color: #6b7280; font-size: 12px; }
.wpm-tel { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 16px; }
.wpm-tel:hover { text-decoration: underline; }
.wpm-external { font-size: 11px; opacity: 0.7; }

/* Intro / Details / Access */
.wpm-intro-text,
.wpm-details-text,
.wpm-access-text {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Business Hours */
.wpm-hours-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.wpm-hours-cell {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 4px;
}
.wpm-hours-cell.today {
    background: #eff6ff;
    border-color: var(--accent);
}
.wpm-hours-cell.closed {
    background: #fef2f2;
    border-color: #fecaca;
}
.wpm-hours-day {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #374151;
}
.wpm-hours-cell.today .wpm-hours-day { color: var(--accent); }
.wpm-hours-time { font-size: 11px; color: #6b7280; line-height: 1.4; }
.wpm-closed { font-size: 11px; color: #ef4444; font-weight: 600; }
.wpm-holiday-note { margin-top: 10px; font-size: 13px; color: #6b7280; }

/* Price Table */
.wpm-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.wpm-price-table th {
    background: #f3f4f6;
    padding: 10px 14px;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}
.wpm-price-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.wpm-price-table tr:hover td { background: #f9fafb; }
.wpm-price-name   { font-weight: 600; }
.wpm-price-amount { color: #dc2626; font-weight: 700; white-space: nowrap; }
.wpm-price-desc   { color: #6b7280; font-size: 13px; }

/* Course Cards */
.wpm-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.wpm-course-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}
.wpm-course-name     { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: #111827; }
.wpm-course-duration { font-size: 13px; color: #6b7280; margin: 0 0 4px; }
.wpm-course-price    { font-size: 18px; font-weight: 800; color: #dc2626; margin: 4px 0 8px; }
.wpm-course-desc     { font-size: 13px; color: #6b7280; margin: 0; }

/* Gallery */
.wpm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.wpm-gallery-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}
.wpm-gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.2s;
}
.wpm-gallery-thumb:hover::after { background: rgba(0,0,0,0.15); }
.wpm-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.wpm-gallery-thumb:hover .wpm-gallery-img { transform: scale(1.05); }

/* Lightbox */
.wpm-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.wpm-lightbox.active { display: flex; }
.wpm-lb-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
#wpm-lb-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
.wpm-lb-close,
.wpm-lb-prev,
.wpm-lb-next {
    position: fixed;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.wpm-lb-close:hover,
.wpm-lb-prev:hover,
.wpm-lb-next:hover { background: rgba(255,255,255,0.3); }
.wpm-lb-close { top: 16px; right: 16px; font-size: 22px; }
.wpm-lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.wpm-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.wpm-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

/* Store Map */
.wpm-store-map {
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Contact Form */
.wpm-contact-form { max-width: 640px; }
.wpm-form-row { margin-bottom: 16px; }
.wpm-form-row label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.wpm-required { color: #ef4444; }
.wpm-form-submit { margin-top: 8px; }
.wpm-contact-msg {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}
.wpm-contact-msg.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}
.wpm-contact-msg.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}
.wpm-contact-msg.loading { display: block; color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb; }

/* Sidebar */
.wpm-sidebar-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.wpm-sidebar-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 10px;
}
.wpm-sidebar-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 12px;
}
.wpm-phone-icon { font-size: 22px; }
.wpm-sidebar-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 8px;
    cursor: pointer;
    border: none;
}

/* Today Hours Badge */
.wpm-today-hours { display: flex; align-items: center; gap: 8px; }
.wpm-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.wpm-status-badge.open   { background: #d1fae5; color: #065f46; }
.wpm-status-badge.closed { background: #fee2e2; color: #991b1b; }
.wpm-today-time { font-size: 14px; color: #374151; font-weight: 600; }

/* SNS Links */
.wpm-sns-links { display: flex; flex-direction: column; gap: 8px; }
.wpm-sns-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    color: #374151;
    transition: background 0.15s;
}
.wpm-sns-link:hover { background: #f3f4f6; }
.wpm-sns-instagram { border-left: 3px solid #E1306C; }
.wpm-sns-twitter   { border-left: 3px solid #000; }
.wpm-sns-facebook  { border-left: 3px solid #1877F2; }
.wpm-sns-line      { border-left: 3px solid #00B900; }
.wpm-sns-youtube   { border-left: 3px solid #FF0000; }
.wpm-sns-icon { font-size: 16px; }

/* Archive */
.wpm-archive-hero {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    padding: 48px 0;
    color: #fff;
}
.wpm-archive-title { font-size: 28px; font-weight: 800; margin: 0 0 8px; color: #fff; }
.wpm-archive-desc  { font-size: 16px; opacity: 0.85; margin: 0; }
.wpm-archive-wrapper { padding-bottom: 48px; }

/* Search widget */
.wpm-search-form-widget {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}
.wpm-search-form-inner {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: end;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
    .wpm-store-layout {
        grid-template-columns: 1fr;
    }
    .wpm-store-sidebar {
        position: static;
        order: -1;
    }
    .wpm-hours-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .wpm-filter-bar {
        grid-template-columns: 1fr 1fr;
    }
    .wpm-filter-bar .wpm-input { grid-column: 1/-1; }
    .wpm-filter-bar .wpm-btn  { grid-column: 1/-1; }
}

@media (max-width: 768px) {
    /* ══════════════════════════════════════════════
       モバイル: 地図(上) → 検索パネル(下) に並び替え
       検索パネルは常時表示（折り畳み不要）
    ══════════════════════════════════════════════ */

    /* ラッパー: 縦積み・高さ自動 */
    .wpm-portal-wrapper {
        flex-direction: column;
        border-radius: 8px;
        height: auto !important;
        min-height: 0 !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    }

    /* 地図を先に (order:1) */
    .wpm-map-container {
        order: 1;
        border-radius: 8px 8px 0 0;
        min-height: 320px;
        height: 320px;
    }
    #wpm-map {
        position: relative !important;
        height: 320px !important;
        inset: auto !important;
    }

    /* 検索パネルを後に (order:2)、常時表示 */
    .wpm-search-panel {
        order: 2;
        width: 100% !important;
        min-width: 100% !important;
        max-height: none !important;        /* 折り畳みを解除 */
        overflow: visible !important;       /* スクロール不要 */
        border-right: none;
        border-top: 2px solid #2563eb;
        border-radius: 0 0 8px 8px;
        position: relative;
        background: #fff;
        display: flex;
        flex-direction: column;
    }

    /* 折り畳みボタンはモバイルでは非表示 */
    .wpm-panel-toggle { display: none !important; }

    /* ☰検索 ボタンも不要 */
    .wpm-panel-open { display: none !important; }

    /* ヘッダーをよりコンパクトに */
    .wpm-search-header {
        padding: 10px 14px;
        background: #eff6ff;
    }
    .wpm-search-header h3 {
        font-size: 14px;
        color: #1d4ed8;
    }

    /* 検索ボディを2カラムグリッドに（セレクトを横並び） */
    .wpm-search-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px 14px;
    }
    /* キーワード入力は全幅 */
    .wpm-search-body .wpm-input {
        grid-column: 1 / -1;
    }
    /* 検索ボタンは全幅 */
    #wpm-search-btn {
        grid-column: 1 / -1;
        padding: 10px;
    }
    #wpm-reset-btn {
        grid-column: 1 / -1;
    }

    /* 検索結果リスト: スクロール可能領域 */
    .wpm-search-results {
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wpm-hero { height: 280px; }
    .wpm-hero-overlay { padding: 20px; }

    .wpm-hours-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .wpm-lb-prev { left: 8px; }
    .wpm-lb-next { right: 8px; }

    .wpm-course-grid {
        grid-template-columns: 1fr;
    }

    .wpm-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .wpm-store-grid {
        grid-template-columns: 1fr;
    }
    .wpm-hours-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .wpm-filter-bar {
        grid-template-columns: 1fr;
    }
    .wpm-info-table th {
        width: 90px;
        font-size: 12px;
    }
    .wpm-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
