#gfd-ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

#gfd-ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2e7d32;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#gfd-ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Screen Transitions */
#gfd-ai-welcome-screen, #gfd-ai-main-chat {
    width: 90%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Welcome Screen */
#gfd-ai-welcome-screen {
    padding: 40px 20px;
    text-align: center;
    justify-content: center;
}

.welcome-header h3 { color: #2e7d32; font-size: 24px; margin-bottom: 5px; }
.welcome-actions { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }

.welcome-btn {
    padding: 15px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.welcome-btn.secondary { background: #f0f0f0; color: #333; border: 1px solid #ddd; }

/* Capabilities Grid */
.gfd-capabilities {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 0 5px;
}

.cap-item {
    text-align: center;
    font-size: 0.8em;
    color: #444;
    width: 23%;
}

.cap-icon {
    display: block;
    font-size: 1.4em;
    margin-bottom: 5px;
    background: #f9f9f9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    margin: 0 auto 5px auto;
}

/* Quick Prompts */
.gfd-quick-prompts {
    background: #fff8f0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85em;
    border-left: 3px solid #ff9900;
}

.gfd-quick-prompts p {
    margin: 0 0 5px 0;
    font-weight: bold;
    color: #d35400;
}

.gfd-quick-prompts ul {
    margin: 0;
    padding-left: 15px;
    color: #555;
    font-style: italic;
    text-align: justify;
}

.gfd-quick-prompts li {
    margin-bottom: 3px;
}

/* Chat Window Header */
#gfd-ai-chat-header{
    background: #2e7d32;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#gfd-ai-chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f9f9f9; }
.bot-msg { background: #eee; padding: 10px; border-radius: 8px; margin-bottom: 10px; align-self: flex-start; max-width: 85%; }
.user-msg { background: #e8f5e9; color: #2e7d32; padding: 10px; border-radius: 8px; margin-bottom: 10px; align-self: flex-end; max-width: 85%; margin-left: auto; }

#gfd-ai-chat-input-area { padding: 10px; display: flex; gap: 5px; border-top: 1px solid #eee; }
#gfd-ai-user-input { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 8px 15px; }
#gfd-ai-send-btn { background: #2e7d32; color: white; border: none; border-radius: 20px; padding: 0 15px; cursor: pointer; }


.close-corner, .close-btn { background: none; border: none; color: #888; font-size: 20px; cursor: pointer; }
#gfd-ai-chat-header .close-btn { color: white; }

/* GFD Chatbot Checkout Button */
.gfd-checkout-btn {
    display: block;
    background-color: #d63638; /* Your brand red */
    color: #ffffff !important;
    padding: 14px 20px;
    text-align: center;
    border-radius: 10px;
    margin: 15px auto;
    width: 90%; /* Center it nicely in the chat bubble */
    text-decoration: none !important;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Shimmer Effect Animation */
.gfd-checkout-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.7s;
    animation: gfdShimmer 3s infinite;
}

@keyframes gfdShimmer {
    0% { left: -60%; }
    20% { left: 120%; }
    100% { left: 120%; }
}

/* Hover & Active States */
.gfd-checkout-btn:hover {
    background-color: #b52d2f;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(214, 54, 56, 0.4);
    color: #ffffff !important;
}

.gfd-checkout-btn:active {
    transform: translateY(-1px);
}

/* Icon spacing */
.gfd-checkout-btn::before {
    content: '🛒';
    margin-right: 10px;
    font-size: 18px;
    vertical-align: middle;
}

/* Product Card Container */
.gfd-product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    margin: 5px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Header with Flower Name */
.gfd-product-card h5 {
    margin: 0 0 8px 0;
    color: #d63638; /* Signature Red */
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Header with Flower Name */
.gfd-product-card p {
    margin: 0px !important;
}

/* Price and Delivery Details */
.gfd-product-info {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}

.gfd-product-info b {
    color: #333;
}

/* The Action Button */
.gfd-add-to-cart-btn {
    display: block;
    width: 100%;
    background: #d63638;
    color: #fff !important;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
}

.gfd-add-to-cart-btn:hover {
    background: #b52b2d;
}

/* Badge for Slot/Date */
.gfd-badge {
    display: inline-block;
    background: #fff0f0;
    color: #d63638;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 5px;
}

/* GFD Cart Button */
.gfd-cart-btn {
    display: block;
    background-color: #d63638; /* Brand Red */
    color: #ffffff !important;
    padding: 14px 20px;
    text-align: center;
    border-radius: 10px;
    margin: 15px auto;
    width: 90%;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Shimmer Animation */
.gfd-cart-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    animation: gfdShimmer 3s infinite;
}

/* Keyframes (Ensure this exists once in your CSS) */
@keyframes gfdShimmer {
    0% { left: -60%; }
    20% { left: 120%; }
    100% { left: 120%; }
}

/* Hover State */
.gfd-cart-btn:hover {
    background-color: #b52d2f;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(214, 54, 56, 0.4);
    color: #ffffff !important;
}

/* Mobile Responsiveness */
@media only screen and (max-width: 480px) {
    .gfd-cart-btn {
        width: 100%;
        font-size: 15px;
    }
}

/* --- Tracking Card Container --- */
.gfd-tracking-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background: #ffffff;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-family: inherit;
}

/* --- Header Layout (Flexbox) --- */
.gfd-tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* CRITICAL: Allows the comment to break to the next line */
    margin-bottom: 15px;
}

/* Order ID */
.gfd-order-id {
    font-weight: 700;
    color: #333;
    font-size: 15px;
}

/* --- Status Badge Styling --- */
.gfd-status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Status Colors (Based on {status_slug}) */
.gfd-status-badge.completed, 
.gfd-status-badge.packinginprogress,
.gfd-status-badge.dispatched {
    background: #e8f5e9;
    color: #2e7d32; /* Green */
}
.gfd-status-badge.processing,
.gfd-status-badge.packed {
    background: #fff3e0;
    color: #ef6c00; /* Orange */
}
.gfd-status-badge.cancelled,
.gfd-status-badge.failed {
    background: #ffebee;
    color: #c62828; /* Red */
}
.gfd-status-badge.on-hold,
.gfd-status-badge.pending {
    background: #e3f2fd;
    color: #1565c0; /* Blue */
}

/* --- New Status Comment Field --- */
.gfd-status-comment {
    flex-basis: 100%;       /* Force it to take full width */
    margin-top: 12px;       /* Space between badge and comment */
    font-size: 13px;
    color: #555;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #d63638; /* Brand accent line */
    line-height: 1.4;
}

/* --- Progress Bar (If included in HTML) --- */
.gfd-progress-container {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0 5px 0;
}
.gfd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d63638, #ff6b6b);
    border-radius: 3px;
    transition: width 1s ease-in-out;
}
.gfd-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-bottom: 10px;
}

/* --- Driver Section --- */
.gfd-driver-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    font-size: 13px;
}
.gfd-track-link {
    display: inline-block;
    margin-top: 5px;
    color: #d63638;
    text-decoration: none;
    font-weight: bold;
}
.gfd-track-link:hover {
    text-decoration: underline;
}

.gfd-typing .dot { animation: gfd-blink 1.4s infinite both; }
.gfd-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.gfd-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes gfd-blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* --- HISTORY PANEL STYLES --- */
#gfd-ai-history-panel {
    position: absolute; /* Sits on top of other screens */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 20; /* Higher than welcome screen */
    display: none; /* Hidden by default */
    flex-direction: column;
}

.history-header {
    background: #25D366; /* WhatsApp Green or your Brand Color */
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.history-header h3 {
    margin: 0;
    font-size: 16px;
    flex-grow: 1;
    text-align: center;
    color: white;
}

#gfd-history-back {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
}

.history-list-wrapper {
    flex-grow: 1;
    overflow-y: auto; /* Scrollable list */
    padding: 10px;
    background: #f9f9f9;
}

#gfd-session-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual History Item Card */
.history-item {
    background: #fff;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.history-item:hover {
    border-color: #25D366;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.history-item strong {
    display: block;
    color: #333;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.history-item p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if text is too long */
}