/**
 * WC WA & Katalog — Floating Chat
 */

#wcwk-floating-wrap {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Floating Button ===== */
#wcwk-floating-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}

#wcwk-floating-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#wcwk-floating-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

#wcwk-floating-btn svg {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 2;
}

/* Pulse animation */
.wcwk-floating-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: inherit;
    background-color: currentColor;
    opacity: 0.4;
    animation: wcwk-pulse 2s infinite;
    z-index: 1;
}

@keyframes wcwk-pulse {
    0%   { transform: scale(1);    opacity: 0.5; }
    100% { transform: scale(1.6);  opacity: 0;   }
}

/* ===== Popup ===== */
#wcwk-floating-popup {
    position: fixed;
    width: 340px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(10px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#wcwk-floating-popup.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.wcwk-popup-header {
    background: linear-gradient(135deg, #128C7E, #25D366);
    color: #fff;
    padding: 18px 18px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.wcwk-popup-header-text h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.wcwk-popup-header-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
    color: #fff;
}

#wcwk-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

#wcwk-popup-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Form */
#wcwk-popup-form {
    padding: 18px;
    max-height: 60vh;
    overflow-y: auto;
}

.wcwk-form-row {
    margin-bottom: 14px;
}

.wcwk-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.wcwk-required {
    color: #e74c3c;
}

.wcwk-form-row input,
.wcwk-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: #333;
}

.wcwk-form-row input:focus,
.wcwk-form-row textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.wcwk-form-row textarea {
    resize: vertical;
    min-height: 70px;
}

.wcwk-form-row input.wcwk-error,
.wcwk-form-row textarea.wcwk-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

/* Submit button */
.wcwk-popup-submit {
    width: 100%;
    padding: 12px 16px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 4px;
}

.wcwk-popup-submit:hover {
    background: #1ebe5d;
}

.wcwk-popup-submit:active {
    transform: scale(0.98);
}

/* ===== Position variants for popup ===== */
.wcwk-pos-bottom-right #wcwk-floating-popup,
.wcwk-pos-top-right #wcwk-floating-popup {
    right: 20px;
}

.wcwk-pos-bottom-left #wcwk-floating-popup,
.wcwk-pos-top-left #wcwk-floating-popup {
    left: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    #wcwk-floating-btn {
        width: 54px;
        height: 54px;
    }

    #wcwk-floating-btn svg {
        width: 28px;
        height: 28px;
    }

    #wcwk-floating-popup {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
    }
}

/* ===== Scrollbar styling untuk form ===== */
#wcwk-popup-form::-webkit-scrollbar {
    width: 6px;
}

#wcwk-popup-form::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#wcwk-popup-form::-webkit-scrollbar-thumb:hover {
    background: #999;
}
