/* =====================================================================
 * "We Talk TPE" FAB + Request a Sample
 *
 * A simple pulsing red chat-icon circle on the middle-right edge.
 * On hover the two action pills slide out smoothly to the left.
 * Clean, no clutter.
 *
 * 1. FAB (pulsing circle + hover-reveal actions)
 * 2. Inline CTA section (product page footer)
 * 3. Modal form styling
 * 4. Responsive
 * ===================================================================== */


/* -----------------------------------------------------------------
 * 1. FAB — Pulsing circle, middle-right
 * ----------------------------------------------------------------- */

/* Wrapper — fixed to right edge, vertically centred */
.fab-wrap {
    position: fixed;
    top: 50%;
    right: 20px;
    z-index: 1040;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* --- Main trigger: red circle with chat icon --- */
.fab-trigger {
    position: relative;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    order: 3;
    /* keeps trigger at the bottom of the flex column */
}

.fab-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(231, 76, 60, 0.6);
}

/* Pulsing ring around the circle */
.fab-trigger::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(231, 76, 60, 0.5);
    animation: fabPulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fabPulse {

    0%,
    100% {
        opacity: 0;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}


/* --- Action pills — hidden by default, appear on hover --- */
.fab-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    /* Start invisible + shifted right */
    opacity: 0;
    transform: translateX(20px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.3s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease;
}

.fab-action i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* "Request a Sample" — warm orange */
.fab-sample {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    order: 2;
}

.fab-sample:hover {
    box-shadow: 0 6px 22px rgba(211, 84, 0, 0.5);
    color: #fff;
}

/* "Talk to an Expert" — teal */
.fab-expert {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    order: 1;
}

.fab-expert:hover {
    box-shadow: 0 6px 22px rgba(22, 160, 133, 0.5);
    color: #fff;
}

/* ---- Reveal on hover (desktop) or touch-open (mobile) ---- */
.fab-wrap:hover .fab-action,
.fab-wrap.fab-touch-open .fab-action {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

/* Stagger the two actions */
.fab-wrap:hover .fab-sample,
.fab-wrap.fab-touch-open .fab-sample {
    transition-delay: 0.05s;
}

.fab-wrap:hover .fab-expert,
.fab-wrap.fab-touch-open .fab-expert {
    transition-delay: 0.12s;
}

/* Stop pulsing when actions are visible */
.fab-wrap:hover .fab-trigger::after,
.fab-wrap.fab-touch-open .fab-trigger::after {
    animation: none;
    opacity: 0;
}

/* Rotate icon slightly when hovered/open for a subtle touch */
.fab-wrap:hover .fab-trigger i,
.fab-wrap.fab-touch-open .fab-trigger i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}


/* -----------------------------------------------------------------
 * 2. Inline CTA section (product page footer band)
 * ----------------------------------------------------------------- */

.sample-cta-section {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 60%, #e67e22 100%);
    position: relative;
    overflow: hidden;
}

.sample-cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* Slow-drifting wave across the bottom of the CTA band */
.sample-cta-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 60px;
    background-repeat: repeat-x;
    background-size: 50% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C200,55 400,5 600,30 C800,55 1000,5 1200,30 L1200,60 L0,60 Z' fill='rgba(255,255,255,0.08)'/%3E%3Cpath d='M0,38 C150,52 350,18 600,38 C850,58 1050,12 1200,38 L1200,60 L0,60 Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
    animation: ctaWaveDrift 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.sample-cta-section .btn-request-sample {
    background: #fff;
    color: #c0392b;
    font-weight: 700;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1.05rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sample-cta-section .btn-request-sample:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.sample-cta-section .btn-request-sample i {
    margin-right: 8px;
}


/* -----------------------------------------------------------------
 * 3. Modal Styling
 * ----------------------------------------------------------------- */

#requestSampleModal .modal-content {
    background: #1a252f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

#requestSampleModal .modal-header {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border-bottom: none;
    padding: 24px 28px;
}

#requestSampleModal .modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
}

#requestSampleModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

#requestSampleModal .modal-header .btn-close:hover {
    opacity: 1;
}

#requestSampleModal .modal-body {
    padding: 28px;
    background: #2c3e50;
}

#requestSampleModal .modal-footer {
    background: #243342;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 28px;
}

/* Form controls */
#requestSampleModal .form-label {
    color: #ecf0f1;
    font-weight: 600;
    font-size: 0.9rem;
}

#requestSampleModal .form-control,
#requestSampleModal .form-select {
    background: #34495e;
    border: 1px solid #4a5f7a;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#requestSampleModal .form-control:focus,
#requestSampleModal .form-select:focus {
    background: #3b5268;
    border-color: #e74c3c;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.2);
    color: #ecf0f1;
}

#requestSampleModal .form-control::placeholder {
    color: #8899a6;
}

/* Submit button */
#requestSampleModal .btn-submit-sample {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 12px 36px;
    border-radius: 50px;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#requestSampleModal .btn-submit-sample:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

#requestSampleModal .btn-submit-sample:disabled {
    opacity: 0.65;
    transform: none;
}

/* Divider */
.sample-form-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 12px 0 16px;
}

/* Helper text */
.sample-form-helper {
    color: #8899a6;
    font-size: 0.82rem;
    margin-top: 4px;
}

/* Validation */
#requestSampleModal .invalid-feedback {
    color: #e74c3c;
    font-size: 0.85rem;
}


/* -----------------------------------------------------------------
 * 4. Responsive
 * ----------------------------------------------------------------- */

@media (max-width: 576px) {
    .fab-wrap {
        right: 14px;
    }

    .fab-trigger {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }

    .fab-action {
        padding: 10px 16px;
        font-size: 0.82rem;
    }

    #requestSampleModal .modal-body {
        padding: 20px;
    }
}