/**
 * Frontend Styles for Codezora WhatsApp Order & Commerce
 *
 * @package CodezoraWhatsAppOrder
 */

/* ── Order & Share Buttons ──────────────────────────── */
.czwo-button-container,
.czwo-loop-button-container,
.czwo-cart-button-container {
    margin: 12px 0;
    display: block;
}

.czwo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.28);
    box-sizing: border-box;
    vertical-align: middle;
}

.czwo-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.38);
    text-decoration: none !important;
}

.czwo-btn:active {
    transform: translateY(0);
}

.czwo-btn-text-wrap {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.czwo-btn-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.czwo-btn-sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

.czwo-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: inline-block;
}

/* Loop button style */
.czwo-btn-loop {
    width: 100%;
    margin-top: 8px;
    font-size: 13.5px;
    padding: 10px 14px !important;
}

/* Mobile-only visibility */
.czwo-mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .czwo-mobile-only {
        display: block !important;
    }
}

/* ── Button Animations ──────────────────────────────── */
.czwo-anim-pulse {
    animation: czwoBtnPulse 2.2s infinite;
}

@keyframes czwoBtnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.czwo-anim-bounce {
    animation: czwoBtnBounce 2.5s infinite;
}

@keyframes czwoBtnBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-2px); }
}

.czwo-anim-glow {
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.6) !important;
}

/* ── Sticky Mobile Bar ──────────────────────────────── */
.czwo-sticky-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 12px 16px;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    z-index: 9998;
    display: none;
}

@media (max-width: 768px) {
    .czwo-sticky-mobile-bar {
        display: block;
    }
    .czwo-btn-sticky {
        width: 100%;
    }
}

/* ── Modal Overlay & Card ───────────────────────────── */
.czwo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: czwoFadeIn 0.25s ease-out;
    box-sizing: border-box;
}

@keyframes czwoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.czwo-modal-card {
    background: #ffffff;
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: czwoSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    font-family: inherit;
    color: #1e293b;
}

@keyframes czwoSlideUp {
    from { transform: translateY(30px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.czwo-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
    z-index: 2;
}

.czwo-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.08);
}

/* ── Modal Header ───────────────────────────────────── */
.czwo-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.czwo-header-icon-wrap {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.czwo-header-icon {
    fill: #ffffff;
}

.czwo-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: czwoPulse 2s infinite;
}

.czwo-header-text h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.czwo-header-desc {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: #64748b;
}

/* ── Product Summary Card inside Modal ──────────────── */
.czwo-product-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.czwo-card-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #ffffff;
}

.czwo-card-details {
    flex: 1;
    min-width: 0;
}

.czwo-card-name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.czwo-card-meta {
    font-size: 12px;
    color: #128C7E;
    font-weight: 600;
    margin-bottom: 3px;
}

.czwo-card-pricing {
    font-size: 13px;
    color: #334155;
}

.czwo-card-price-val {
    font-weight: 700;
    color: #0f172a;
}

.czwo-card-subtotal-wrap {
    color: #166534;
    margin-left: 4px;
}

/* ── Form Groups & Inputs ───────────────────────────── */
.czwo-form-group {
    margin-bottom: 14px;
}

.czwo-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
}

.czwo-req {
    color: #ef4444;
}

.czwo-input,
.czwo-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s;
    font-family: inherit;
    background: #ffffff;
}

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

.czwo-textarea {
    resize: vertical;
    min-height: 70px;
}

.czwo-field-hint {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}

/* ── Quantity Stepper ───────────────────────────────── */
.czwo-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.czwo-qty-btn {
    width: 36px;
    height: 38px;
    background: #f8fafc;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #334155;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.czwo-qty-btn:hover {
    background: #e2e8f0;
}

.czwo-qty-input {
    width: 50px !important;
    height: 38px;
    border: none !important;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    padding: 0 !important;
    -moz-appearance: textfield;
}

.czwo-qty-input::-webkit-outer-spin-button,
.czwo-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Multi-Agent Picker in Modal ────────────────────── */
.czwo-agents-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.czwo-agent-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.czwo-agent-option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.czwo-agent-option.czwo-agent-selected {
    border-color: #25D366;
    background: #f0fdf4;
}

.czwo-agent-info {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
    flex: 1;
}

.czwo-agent-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.czwo-agent-role {
    font-size: 11px;
    color: #64748b;
}

.czwo-agent-hours {
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
}

/* ── Alerts & Errors ────────────────────────────────── */
.czwo-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    font-weight: 500;
}

/* ── Modal Submit Button ────────────────────────────── */
.czwo-btn-submit {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 6px;
}

.czwo-btn-submit:hover {
    background: #20ba59;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.czwo-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.czwo-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: czwoSpin 0.7s linear infinite;
    display: inline-block;
}

@keyframes czwoSpin {
    to { transform: rotate(360deg); }
}

.czwo-modal-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 12px;
}

/* ── Floating WhatsApp Widget ───────────────────────── */
.czwo-floating-widget {
    position: fixed;
    bottom: 24px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.czwo-float-right {
    right: 24px;
    align-items: flex-end;
}

.czwo-float-left {
    left: 24px;
    align-items: flex-start;
}

.czwo-float-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: #ffffff !important;
    padding: 13px 20px;
    border-radius: 50px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.czwo-float-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
    color: #ffffff !important;
}

.czwo-float-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.czwo-float-online-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
}

/* Radar pulse animation for floating widget */
.czwo-float-anim-pulse .czwo-float-btn {
    animation: czwoFloatRadar 2.5s infinite;
}

@keyframes czwoFloatRadar {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Floating Prompt Speech Bubble */
.czwo-float-prompt {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    max-width: 250px;
    position: relative;
    border: 1px solid #e2e8f0;
    animation: czwoPromptPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes czwoPromptPop {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.czwo-prompt-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.czwo-prompt-badge {
    display: inline-block;
    background: #e6fcf5;
    color: #0ca678;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.czwo-prompt-text {
    margin: 0;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.4;
}

/* Multi-Agent Mini Popup */
.czwo-multi-agent-popup {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 14px;
    width: 280px;
    border: 1px solid #e2e8f0;
    animation: czwoPromptPop 0.25s ease-out;
}

.czwo-multi-popup-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.czwo-multi-sub {
    font-size: 11.5px;
    color: #64748b;
}

.czwo-multi-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.czwo-agent-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
}

.czwo-agent-item-link:hover {
    background: #f0fdf4;
    border-color: #25D366;
    transform: translateX(-2px);
}

.czwo-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e6fcf5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.czwo-agent-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.czwo-agent-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
}

.czwo-agent-dept {
    font-size: 11px;
    color: #64748b;
}

.czwo-agent-time {
    font-size: 10px;
    color: #0ca678;
    font-weight: 600;
}

@media (max-width: 480px) {
    .czwo-float-btn {
        padding: 13px;
        border-radius: 50%;
    }
    .czwo-float-label-text {
        display: none;
    }
}
