/* Floating Contact */
.floating-contact {
    position: fixed;
    right: 24px;
    top: 60%;
    transform: translateY(-60%);
    z-index: 9999;
}

/* レスポンシブ対応 */


.floating-contact-container {
    position: relative;
}

.floating-contact-btn {
    width: 56px;
    height: 56px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.floating-contact-btn:hover {
    background: #1D4ED8;
    transform: scale(1.1);
}

.floating-contact-btn i {
    transition: transform 0.3s ease;
}

.floating-contact-btn.active i {
    transform: rotate(45deg);
}

.floating-contact-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0);
    transform-origin: bottom right;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    border: 1px solid #E5E7EB;
    z-index: 10000;
}

.floating-contact-panel.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.floating-contact-panel.show {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .floating-contact {
        right: 12px !important;
        top: auto !important;
        bottom: 20px !important;
        left: auto !important;
        transform: none !important;
    }

    .floating-contact-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .floating-contact-panel {
        position: fixed;
        right: 12px;
        left: auto;
        bottom: 76px;
        width: min(300px, calc(100vw - 24px));
        min-height: 0;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        background: white;
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
        transform: scale(0);
        transform-origin: bottom right;
        transition: all 0.3s ease;
        opacity: 0;
        pointer-events: none;
        border: 1px solid #E5E7EB;
        z-index: 10000;
    }

    .floating-contact-panel.active,
    .floating-contact-panel.show {
        transform: scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    /* スマホでは電話番号横並びがはみ出さないよう調整 */
    .floating-contact-panel .contact-option.phone-btn {
        min-width: 0 !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        align-items: center !important;
        justify-content: space-between !important;
        overflow: hidden;
    }

    .floating-contact-panel .contact-option.phone-btn > div:first-child {
        flex: 0 1 auto;
        min-width: 0;
    }

    .floating-contact-panel .contact-option.phone-btn > div:last-child {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        flex-shrink: 1 !important;
        align-items: flex-end !important;
        justify-content: center !important;
    }

    .floating-contact-panel .contact-option.phone-btn > div:last-child > div {
        white-space: normal !important;
        max-width: 100%;
        line-height: 1.25;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .floating-contact {
        right: 10px !important;
        top: auto !important;
        bottom: 16px !important;
        left: auto !important;
        transform: none !important;
    }

    .floating-contact-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .floating-contact-panel {
        right: 10px;
        bottom: 68px;
        width: min(280px, calc(100vw - 20px));
    }
}

.contact-panel-header {
    background: #2563EB;
    color: white;
    padding: 8px 16px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.contact-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.contact-panel-header p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.contact-panel-content {
    padding: 16px;
}

.contact-option {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}

.contact-option:hover {
    background: #F3F4F6;
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-option i {
    font-size: 20px;
}

.wechat-btn {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.wechat-btn:hover {
    background: #059669;
    border-color: #059669;
}

/* 一時非表示：再表示する場合はこのルールを削除またはコメントアウト */
.floating-contact-panel .contact-option.wechat-btn,
.floating-contact-panel .wechat-btn {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

.email-btn {
    background: #F9FAFB;
    color: #1F2937;
}

.working-hours {
    padding: 12px;
    border-top: 1px solid #E5E7EB;
    text-align: center;
}

.working-hours-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 4px;
}

.working-hours-time {
    font-size: 0.875rem;
    color: #1F2937;
    font-weight: 500;
}

.qr-code-panel {
    position: relative;
    padding: 24px;
}

.close-qr-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #F3F4F6;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-qr-btn:hover {
    background: #E5E7EB;
}

.qr-code-container {
    margin-bottom: 16px;
}

.qr-code-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.qr-code-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    color: #1F2937;
}

.qr-code-subtitle {
    font-size: 0.875rem;
    text-align: center;
    color: #6B7280;
    margin-bottom: 16px;
}

.phone-contact {
    background: #EBF8FF;
    border-radius: 10px;
    padding: 10px;
}

.phone-title {
    font-weight: 600;
    color: #1E40AF;
    font-size: 0.8rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.phone-number {
    color: #2563EB;
    font-weight: 700;
    font-size: 0.9rem;
}


/* Floating panel close button */
.contact-panel-header {
    position: relative;
    padding-right: 44px;
}

.floating-contact-close {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 28px;
    height: 28px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.floating-contact-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .floating-contact-panel {
        width: min(280px, calc(100vw - 24px));
        max-height: min(420px, calc(100vh - 112px));
    }

    .contact-panel-content {
        padding: 12px;
    }

    .contact-option {
        padding: 10px 12px !important;
        gap: 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .floating-contact-panel {
        width: min(260px, calc(100vw - 20px));
        max-height: min(380px, calc(100vh - 96px));
    }
}
