/* === VARIABILE (compatibile cu Blocksy) === */
:root {
    --fcwa-green:   #25D366;
    --fcwa-dark:    #128C7E;
    --fcwa-white:   #ffffff;
    --fcwa-shadow:  0 4px 20px rgba(0,0,0,0.2);
    --fcwa-radius:  50px;
    --fcwa-z:       9999;
}

/* === BUTON FLOTANT === */
#fcwa-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--fcwa-z);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--fcwa-green);
    color: var(--fcwa-white);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: var(--fcwa-radius);
    box-shadow: var(--fcwa-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

#fcwa-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
    color: var(--fcwa-white);
    text-decoration: none;
}

#fcwa-button.fcwa-left {
    right: auto;
    left: 20px;
}

/* === ICON SVG / imagine personalizată === */
#fcwa-button svg,
#fcwa-button .fcwa-btn-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#fcwa-button svg {
    fill: white;
}

#fcwa-button .fcwa-btn-icon {
    object-fit: contain;
}

/* === GREETING POPUP === */
#fcwa-greeting {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: var(--fcwa-z);
    width: 300px;
    background: var(--fcwa-white);
    border-radius: 12px;
    box-shadow: var(--fcwa-shadow);
    overflow: hidden;
    transition: opacity .3s ease, transform .3s ease;
}

#fcwa-greeting.fcwa-greeting-in {
    animation: fcwa-slide-in .3s ease forwards;
}

#fcwa-greeting.fcwa-greeting--small  { width: 260px; }
#fcwa-greeting.fcwa-greeting--large  { width: 360px; }

/* === GREETING HEADER === */
.fcwa-greeting-header {
    background: var(--fcwa-dark);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.fcwa-greeting-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fcwa-agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fcwa-agent-info {
    flex: 1;
    min-width: 0;
}

.fcwa-greeting-header .fcwa-agent-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fcwa-status-badge {
    font-size: 11px;
    opacity: .85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fcwa-status-badge::before {
    content: '●';
    color: #4caf50;
}

.fcwa-status-badge.offline::before {
    color: #9e9e9e;
}

/* === GREETING BODY === */
.fcwa-greeting-body {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.fcwa-greeting-text {
    flex: 1;
}

/* === SHARE ICON (în interiorul greeting body) === */
.fcwa-share-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #888;
    text-decoration: none !important;
    padding: 4px;
    border-radius: 4px;
    transition: color .2s, background .2s;
    margin-top: 1px;
    background: #f0f0f0;
}

.fcwa-share-icon:hover {
    color: var(--fcwa-green);
    background: #e0f5e9;
    text-decoration: none !important;
}

.fcwa-share-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* style2 bubble text — același layout flex */
.fcwa-bubble-text {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.fcwa-bubble-text span {
    flex: 1;
}

/* === GREETING CLOSE === */
#fcwa-greeting-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

#fcwa-greeting-close:hover {
    color: white;
}


/* === GREETING FOOTER CTA === */
.fcwa-greeting-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #f0f0f0;
}

.fcwa-greeting-cta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 10px 16px !important;
    background: var(--fcwa-green) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: background .2s !important;
    box-sizing: border-box !important;
}

.fcwa-greeting-cta:hover,
.fcwa-greeting-cta:focus {
    background: var(--fcwa-dark) !important;
    color: white !important;
    text-decoration: none !important;
}

.fcwa-greeting-cta svg {
    width: 18px;
    height: 18px;
    fill: white;
    flex-shrink: 0;
}

/* === GREETING STYLE 2 === */
.fcwa-greeting--style2 {
    padding: 16px;
}

.fcwa-greeting-close-2 {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

.fcwa-greeting-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding-right: 20px;
}

.fcwa-bubble-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fcwa-bubble-content {
    background: #f0f2f5;
    border-radius: 0 8px 8px 8px;
    padding: 10px 12px;
    flex: 1;
}

.fcwa-bubble-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--fcwa-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fcwa-bubble-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* === OPT-IN === */
#fcwa-opt-in {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: var(--fcwa-z);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--fcwa-shadow);
    width: 280px;
}

#fcwa-opt-in.fcwa-opt-in--left {
    right: auto;
    left: 20px;
}

.fcwa-opt-in-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    cursor: pointer;
    line-height: 1.4;
    color: #333;
}

.fcwa-opt-in-checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

#fcwa-opt-in-accept {
    background: var(--fcwa-green);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    transition: background .2s;
}

#fcwa-opt-in-accept:hover {
    background: var(--fcwa-dark);
}

.fcwa-opt-in-error {
    font-size: 12px;
    color: #c0392b;
    margin: 0 0 10px;
    padding: 6px 10px;
    background: #fdf0ef;
    border-left: 3px solid #c0392b;
    border-radius: 3px;
}

/* === BUTON PE PAGINA PRODUS (WooCommerce) === */
/* !important pe proprietăți vizuale pentru a preveni override-ul din tema WoodMart */
.fcwa-product-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: var(--fcwa-green) !important;
    color: white !important;
    text-decoration: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 10px !important;
    transition: background .2s !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    width: auto !important;
}

.fcwa-product-btn:hover,
.fcwa-product-btn:focus,
.fcwa-product-btn:active {
    background: var(--fcwa-dark) !important;
    color: white !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.fcwa-product-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    flex-shrink: 0;
}

.fcwa-product-btn-wrap {
    display: block;
    margin-top: 10px;
}

.fcwa-product-btn-wrap--before {
    margin-bottom: 30px;
    margin-top: 0;
}

.fcwa-product-btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

/* === ASCUNS === */
.fcwa-hidden {
    display: none !important;
}

/* === ANIMAȚII === */
@keyframes fcwa-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fcwa-anim-bounce {
    animation: fcwa-bounce .6s ease;
}

@keyframes fcwa-bounce {
    0%,100% { transform: scale(1); }
    30%      { transform: scale(1.15); }
    60%      { transform: scale(0.95); }
}

.fcwa-anim-fade {
    animation: fcwa-fade .5s ease;
}

@keyframes fcwa-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fcwa-anim-slide {
    animation: fcwa-slide .5s ease;
}

@keyframes fcwa-slide {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === MODAL POSITION (greeting) === */
.fcwa-greeting--modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    width: 400px;
    max-width: 90vw;
}

/* === GREETING LEFT SIDE === */
#fcwa-button.fcwa-left ~ #fcwa-greeting,
.fcwa-greeting-left {
    right: auto;
    left: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #fcwa-button.fcwa-hide-mobile    { display: none !important; }
    #fcwa-greeting.fcwa-hide-mobile  { display: none !important; }

    #fcwa-button .fcwa-btn-text {
        display: none;
    }

    #fcwa-button {
        padding: 14px;
        border-radius: 50%;
    }

    #fcwa-greeting {
        right: 10px;
        left: 10px;
        width: auto;
    }

    #fcwa-opt-in {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (min-width: 769px) {
    #fcwa-button.fcwa-hide-desktop   { display: none !important; }
    #fcwa-greeting.fcwa-hide-desktop { display: none !important; }
}
