/**
 * Kivor Social Order & Checkout - Frontend Styles
 *
 * Public-facing styles for buttons, chat widget, checkout,
 * and inline messaging components.
 *
 * @package Kivor_Social_Order_Checkout
 * @since   1.0.0
 */

/* ==========================================================================
   1. Single Product Button
   ========================================================================== */

.kivor-soc-single-product-btn-wrap {
    margin: 15px 0;
}

.kivor-soc-single-product-btn-wrap.kivor-soc-beside {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    margin-top: 0;
}

.kivor-soc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    line-height: 1.4;
}

.kivor-soc-btn:hover {
    opacity: 0.9;
}

.kivor-soc-btn:active {
    transform: scale(0.98);
}

.kivor-soc-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Size: Small */
.kivor-soc-btn--small {
    padding: 8px 16px;
    font-size: 13px;
}

.kivor-soc-btn--small svg {
    width: 16px;
    height: 16px;
}

/* Size: Large */
.kivor-soc-btn--large {
    padding: 16px 32px;
    font-size: 17px;
}

.kivor-soc-btn--large svg {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   2. Checkout Button
   ========================================================================== */

.kivor-soc-checkout-btn-wrap {
    margin: 20px 0;
    text-align: center;
}

.kivor-soc-checkout-btn {
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.kivor-soc-checkout-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ==========================================================================
   3. Chat Widget
   ========================================================================== */

.kivor-soc-chat-widget {
    position: fixed;
    z-index: 99999;
    bottom: 24px;
}

.kivor-soc-chat-widget[data-position="bottom-right"] {
    right: 24px;
}

.kivor-soc-chat-widget[data-position="bottom-left"] {
    left: 24px;
}

/* FAB (Floating Action Button) */
.kivor-soc-chat-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kivor-soc-chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.kivor-soc-chat-fab svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* Tooltip */
.kivor-soc-chat-tooltip {
    position: absolute;
    bottom: 70px;
    background: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.kivor-soc-chat-widget[data-position="bottom-right"] .kivor-soc-chat-tooltip {
    right: 0;
}

.kivor-soc-chat-widget[data-position="bottom-left"] .kivor-soc-chat-tooltip {
    left: 0;
}

.kivor-soc-chat-widget:hover .kivor-soc-chat-tooltip {
    opacity: 1;
}

/* Popup Container */
.kivor-soc-chat-popup {
    position: absolute;
    bottom: 72px;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.kivor-soc-chat-popup.kivor-soc-chat-popup--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.kivor-soc-chat-widget[data-position="bottom-right"] .kivor-soc-chat-popup {
    right: 0;
}

.kivor-soc-chat-widget[data-position="bottom-left"] .kivor-soc-chat-popup {
    left: 0;
}

/* Popup Header */
.kivor-soc-chat-popup-header {
    background: #25D366;
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.kivor-soc-chat-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* Departments List */
.kivor-soc-chat-popup-departments {
    padding: 8px;
}

.kivor-soc-chat-dept {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: background 0.2s;
}

.kivor-soc-chat-dept:nth-child(4n+1) .kivor-soc-dept-icon {
    background: #25D366;
}

.kivor-soc-chat-dept:nth-child(4n+2) .kivor-soc-dept-icon {
    background: #1F9D57;
}

.kivor-soc-chat-dept:nth-child(4n+3) .kivor-soc-dept-icon {
    background: #0EA5A8;
}

.kivor-soc-chat-dept:nth-child(4n+4) .kivor-soc-dept-icon {
    background: #3B82F6;
}

.kivor-soc-chat-dept:hover {
    background: #f5f5f5;
}

.kivor-soc-dept-icon {
    width: 40px;
    height: 40px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kivor-soc-dept-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.kivor-soc-dept-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.kivor-soc-dept-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.kivor-soc-dept-label {
    font-weight: 500;
    font-size: 14px;
}

/* ==========================================================================
   4. Inline Success Message (No-Order Mode)
   ========================================================================== */

.kivor-soc-success-msg {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
    text-align: center;
}

.kivor-soc-success-msg a {
    color: #155724;
    font-weight: 600;
}

/* ==========================================================================
   5. Responsive
   ========================================================================== */

@media (max-width: 600px) {

    .kivor-soc-chat-popup {
        width: calc(100vw - 48px);
    }

    .kivor-soc-checkout-btn {
        max-width: 100%;
    }
}
