/* Online Support chat widget — palette matches piggy_cards theme
   (accent #fecf58 / #F0B319, dark #121212, bg #F5F5F5) */

#piggy-chat {
    position: fixed;
    right: 20px;
    bottom: 90px; /* keep clear of the bottom cookie-consent bar */
    z-index: 10500;
    font-size: 14px;
}

.piggy-chat-launcher {
    background: #fecf58;
    color: #121212;
    border: none;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    float: right;
}

.piggy-chat-launcher:hover {
    background: #F0B319;
}

.piggy-chat-panel {
    position: absolute;
    right: 0;
    bottom: 52px;
    width: 340px;
    height: 440px;
    min-width: 300px;
    min-height: 320px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.piggy-chat-resize {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 2;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0 40%, transparent 40%);
}

.piggy-chat-header {
    background: #121212;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.piggy-chat-header strong {
    color: #fecf58;
}

.piggy-chat-header small {
    display: block;
    color: #838391;
    font-size: 11px;
}

.piggy-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.piggy-chat-close:hover {
    color: #fecf58;
}

.piggy-chat-messages {
    padding: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: #F5F5F5;
}

.piggy-chat-msg {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
    clear: both;
}

.piggy-chat-msg-user {
    background: #fecf58;
    color: #121212;
    float: right;
}

.piggy-chat-msg-bot {
    background: #fff;
    color: #333;
    border: 1px solid #e5e5e5;
    float: left;
}

.piggy-chat-msg-bot a {
    color: #c8900a;
    text-decoration: underline;
}

.piggy-chat-typing {
    color: #999;
    font-style: italic;
}

.piggy-chat-quick {
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.piggy-chat-quick-toggle {
    display: block;
    width: 100%;
    background: #fff;
    border: none;
    color: #888;
    font-size: 12px;
    text-align: left;
    padding: 5px 12px;
    cursor: pointer;
}

.piggy-chat-quick-toggle:hover {
    color: #121212;
}

.piggy-chat-quick-list {
    padding: 0 10px 6px;
}

.piggy-chat-quick-btn {
    background: #fff;
    border: 1px solid #F0B319;
    color: #a87708;
    border-radius: 12px;
    font-size: 12px;
    padding: 3px 10px;
    margin: 2px 2px 2px 0;
    cursor: pointer;
}

.piggy-chat-quick-btn:hover {
    background: #fff6dd;
    color: #121212;
}

.piggy-chat-inputbar {
    display: flex;
    border-top: 1px solid #eee;
    margin: 0;
    flex-shrink: 0;
}

.piggy-chat-input {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
}

.piggy-chat-send {
    background: #fecf58;
    color: #121212;
    font-weight: bold;
    border: none;
    padding: 0 16px;
    cursor: pointer;
}

.piggy-chat-send:hover {
    background: #F0B319;
}

.piggy-chat-fallback {
    padding: 10px;
    border-top: 1px solid #eee;
    margin: 0;
    flex-shrink: 0;
}

.piggy-chat-fallback-intro {
    font-size: 12px;
    color: #666;
    margin: 0 0 6px;
}

.piggy-chat-fallback-email,
.piggy-chat-fallback-message {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 6px;
}

.piggy-chat-fallback-send {
    background: #fecf58;
    color: #121212;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
}

.piggy-chat-fallback-send:hover {
    background: #F0B319;
}

@media (max-width: 480px) {
    #piggy-chat {
        bottom: 100px;
    }

    .piggy-chat-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 150px;
        width: auto !important;
        height: 60vh !important;
    }

    .piggy-chat-resize {
        display: none;
    }
}
