/* ============================================================
   moi フロントエンドスタイル
   ============================================================ */

/* ---- テーマグローバルmarginリセット ---- */
.moi-section p,
.moi-section ul,
.moi-section ol,
.moi-section dl,
.moi-section table,
.moi-section form,
.moi-section h1,
.moi-section h2,
.moi-section h3,
.moi-section h4 {
    margin: 0;
}

/* ---- セクション共通 ---- */
.moi-section {
    margin: 40px 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
}
.moi-section-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-brand, #8B7C55);
    color: var(--c-brand, #8B7C55);
}
.moi-no-data {
    color: #888;
    font-size: 0.9em;
}

/* ---- 犬情報カード ---- */
.moi-dog-cards {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}
.moi-dog-card {
    border: 1px solid #e0ddd8;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.moi-dog-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.moi-dog-breed {
    font-size: 0.85em;
    color: #888;
    background: #f5f3ef;
    padding: 2px 8px;
    border-radius: 10px;
}
.moi-dog-sizes {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 6px;
}
.moi-dog-memo {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 8px;
}
.moi-dog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.moi-dog-actions form {
    margin: 0;
}

/* ---- ボタン ---- */
.moi-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--c-accent, #FFBE9B);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1;
}
.moi-btn:hover { opacity: 0.85; }
.moi-btn-ghost {
    background: transparent;
    color: var(--c-brand, #8B7C55);
    border: 1px solid var(--c-brand, #8B7C55);
}
.moi-btn-ghost:hover { background: #f5f3ef; }
.moi-btn-sm {
    padding: 5px 12px;
    font-size: 0.82em;
    background: #f5f3ef;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}
.moi-btn-sm:hover { background: #e8e4de; }
.moi-btn-danger {
    color: #c00;
    border-color: #c00;
}
.moi-btn-danger:hover { background: #fff0f0; }

/* ---- 犬情報フォーム ---- */
.moi-form {
    margin-top: 16px;
    padding: 20px;
    background: #f9f8f5;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
}
.moi-form-row {
    margin-bottom: 14px;
}
.moi-form-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
}
.moi-form-row input[type="text"],
.moi-form-row input[type="number"],
.moi-form-row select,
.moi-form-row textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}
.moi-form-sizes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.moi-form-sizes label {
    flex: 1;
    min-width: 90px;
}
.moi-form-sizes input {
    max-width: 100% !important;
}
.moi-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.moi-error { color: #c00; font-size: 0.88em; }

/* ---- メッセージ スレッド ---- */
.moi-chat-thread {
    height: 380px;
    overflow-y: auto;
    background: #f5f3ef;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}
.moi-bubble-wrap {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}
.moi-bubble-wrap.moi-bubble-member {
    align-items: flex-end;
}
.moi-bubble-wrap.moi-bubble-admin {
    align-items: flex-start;
}
.moi-bubble {
    display: inline-block;
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.92em;
    line-height: 1.6;
    word-break: break-word;
}
.moi-bubble-member .moi-bubble {
    background: var(--c-accent, #FFBE9B);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.moi-bubble-admin .moi-bubble {
    background: #fff;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
}
.moi-bubble-time {
    font-size: 0.75em;
    color: #aaa;
    margin-top: 4px;
}
.moi-chat-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.moi-chat-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.92em;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}
#moi-msg-status { font-size: 0.85em; }
.moi-file-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: #777;
}
.moi-bubble-img {
    margin-top: 8px;
}
.moi-bubble-img img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    display: block;
    cursor: zoom-in;
}

/* ---- ライトボックス ---- */
.moi-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.moi-lightbox.is-open {
    display: flex;
}
.moi-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
    cursor: default;
}
.moi-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

/* ---- マイページ クイックナビ ---- */
.moi-mypage-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}
.moi-mypage-nav .moi-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- 未読件数 ---- */
.moi-unread-count {
    color: #c00;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 4px;
}

/* ---- サイズヒント ---- */
.moi-size-hint-block {
    margin: 24px 0;
    background: #f9f8f5;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
}
.moi-size-hint-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    font-size: 1em;
    font-weight: bold;
    color: var(--c-brand, #8B7C55);
    cursor: pointer;
    user-select: none;
}
.moi-size-hint-summary::-webkit-details-marker { display: none; }
.moi-size-hint-summary::after {
    content: '＋';
    font-size: 1em;
    color: var(--c-brand, #8B7C55);
}
.moi-size-hint-block[open] .moi-size-hint-summary::after {
    content: '－';
}
.moi-size-hint-block[open] .moi-size-hint-summary {
    border-bottom: 1px solid #e0ddd8;
}
.moi-size-hint-block > :not(summary) {
    padding: 16px 20px;
}
.moi-hint-dogs {
    margin-bottom: 12px;
}
.moi-hint-dog {
    margin-bottom: 6px;
    font-size: 0.92em;
}
.moi-hint-result {
    font-weight: bold;
    color: var(--c-brand, #8B7C55);
}
.moi-hint-dog-sizes {
    font-size: 0.82em;
    color: #888;
    margin-top: 2px;
}
.moi-hint-note {
    font-size: 0.88em;
    color: #888;
    margin: 0 0 12px;
}
.moi-hint-note a { color: var(--c-brand, #8B7C55); }
.moi-hint-table-wrap {
    margin-top: 12px;
    font-size: 0.88em;
    color: #555;
}
.moi-hint-table-wrap summary {
    cursor: pointer;
    color: var(--c-brand, #8B7C55);
    font-size: 0.9em;
    margin-bottom: 8px;
}
.moi-size-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 400px;
}
.moi-size-table th,
.moi-size-table td {
    border: 1px solid #ddd;
    padding: 6px 10px;
    text-align: center;
}
.moi-size-table td {
    background-color: #fff;
}
.moi-size-table th {
    background: #f0ede8;
    font-weight: normal;
}

/* ---- 追随メッセージアイコン ---- */
.moi-float-msg {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--c-brand, #8B7C55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    text-decoration: none;
    transition: opacity 0.2s;
}
.moi-float-msg:hover { opacity: 0.85; }
.moi-float-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #c00;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ============================================================
   右下固定バナー＋モーダル（お問い合わせ／会員登録）
   ============================================================ */

/* 右下固定バナー */
#moi-contact-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}
#moi-contact-btn {
    display: block;
    background: transparent !important;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    opacity: 1;
}
#moi-contact-btn:hover { opacity: 1; }
#moi-contact-btn img {
    display: block;
    width: 104px;        /* 原寸368×484pxは大きすぎるため縮小 */
    max-width: 22vw;
    height: auto;
}
/* PC画像のみ表示 */
#moi-contact-btn .moi-banner-sp { display: none; }
@media screen and (max-width: 767px) {
    #moi-contact-banner { bottom: 16px; right: 16px; }
    #moi-contact-btn .moi-banner-pc { display: none; }
    #moi-contact-btn .moi-banner-sp { display: block; }
    #moi-contact-btn img { width: 84px; }
}

/* 未読バッジ */
#moi-contact-btn .moi-unread-count {
    position: absolute;
    top: -6px;
    right: -6px;
    display: inline-block;
    background: #c00;
    color: #fff;
    font-size: 0.78em;
    font-weight: bold;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.6;
}

/* モーダル */
#moi-contact-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
#moi-contact-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.moi-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.moi-modal-inner {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    padding: 56px 48px 60px;
    width: 560px;
    max-width: 92vw;
    max-height: 84vh;
    overflow-y: auto;
}
.moi-modal-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 38px;
    height: 38px;
    /* テーマの button{background:var(--c-accent)!important} 等を打ち消す */
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer;
    transition: opacity 0.25s ease;
}
/* hover で色（テーマの button:hover のピーチ背景）は付けない。opacityの薄まりのみ */
.moi-modal-close:hover {
    background: none !important;
    transform: none !important;
    opacity: 0.6;
}
/* グローバルメニュー（ドロワー）と同じ×：2pxの細線2本を45°で交差。白カード上のため色はブランド色 */
.moi-modal-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 2px;
    background: var(--c-brand);
    border-radius: 2px;
}
.moi-modal-close span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.moi-modal-close span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ===== Contact モーダル中身 ===== */
.moi-modal-contact { text-align: center; }
.moi-modal-title {
    font-family: var(--font-serif-en);
    color: var(--c-brand);
    font-size: 2.6rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin: 4px 0 18px;
}
.moi-modal-lead {
    color: var(--c-brand);
    font-size: 0.95rem;
    line-height: 1.9;
    letter-spacing: 0.04em;
    margin: 0 0 30px;
}
.moi-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 480px;
    margin: 0 auto;
}
.moi-modal-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    border-radius: 100px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.moi-modal-pill:hover { transform: translateY(-2px); opacity: 0.92; }
.moi-modal-pill::after {
    content: "";
    position: absolute;
    right: 26px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}
.moi-modal-pill--member { background: var(--c-accent); }       /* ピーチ #FFBE9B */
.moi-modal-pill--guest  { background: #DCCDA2; }               /* ベージュ */

@media screen and (max-width: 767px) {
    .moi-modal-inner { padding: 44px 24px 40px; border-radius: 18px; }
    .moi-modal-close { top: 16px; right: 16px; }
    .moi-modal-close span { width: 28px; }
    .moi-modal-title { font-size: 2.1rem; }
    .moi-modal-lead { font-size: 0.86rem; margin-bottom: 24px; }
    .moi-modal-pill { padding: 17px 24px; font-size: 0.9rem; }
}
