/* =============================================================================
   CHATKIT BLOCKS CSS
   Shared styles for all reusable UI blocks.
   Responsive-first: all blocks adapt to container width.
   ============================================================================= */

/* --- Base Card Styles --- */
.chatkit-card {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    width: 100%;
    max-width: 100%; /* Never exceed container */
    margin-bottom: var(--spacing-2);
    box-sizing: border-box;
}

/* Remove bottom margin from last card in message blocks */
.message-blocks .chatkit-card:last-child {
    margin-bottom: 0;
}

/* Ensure all inputs/textareas respect container width */
.chatkit-card input,
.chatkit-card textarea,
.chatkit-card select {
    box-sizing: border-box;
    max-width: 100%;
}

/* Ensure images never overflow */
.chatkit-card img {
    max-width: 100%;
    height: auto;
}

/* --- Buttons --- */
.chatkit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast) var(--ease-default);
    cursor: pointer;
    border: none;
    font-size: 14px;
    padding: 8px 16px;
}

.btn-primary { 
    background-color: var(--text-primary); 
    color: var(--bg-surface); 
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary { 
    background-color: var(--bg-surface-hover); 
    color: var(--text-primary); 
}

.btn-outline { 
    border: 1px solid var(--border-subtle); 
    background: transparent; 
    color: var(--text-primary); 
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-default);
}

.btn-ghost { 
    background: transparent; 
    color: var(--text-secondary); 
}

.btn-ghost:hover { 
    background-color: var(--bg-surface-hover); 
    color: var(--text-primary); 
}

/* --- Typography Helpers --- */
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.font-medium { font-weight: var(--font-weight-medium); }
.font-bold { font-weight: var(--font-weight-bold); }
.text-muted { color: var(--text-secondary); }

/* =============================================================================
   BLOCK: Agent Message (Refactored to Card)
   ============================================================================= */
.block-agent-message {
    padding: var(--spacing-3) var(--spacing-4);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* =============================================================================
   BLOCK: Product Card (With Carousel)
   ============================================================================= */
.block-product-card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.block-product-card .header {
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.block-product-card .header-main {
    flex: 1;
}

.block-product-card .header-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.block-product-card .product-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-brand-primary, #000);
    color: #fff;
}

.block-product-card .stock-indicator {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.block-product-card .stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-success, #10b981);
}

.block-product-card .stock-indicator.out .stock-dot { background-color: var(--color-danger, #ef4444); }
.block-product-card .stock-indicator.low .stock-dot { background-color: var(--color-warning, #f59e0b); }

.block-product-card h3 {
    font-size: 15px;
    font-weight: var(--font-weight-bold);
    margin: 0;
    line-height: 1.3;
}

.block-product-card .price {
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
}

.block-product-card .carousel-container {
    width: 100%;
    aspect-ratio: 16/10; /* More horizontal, less tall in narrow containers */
    max-height: 220px; /* Cap height to prevent oversized images */
    background-color: var(--bg-surface-subtle);
    position: relative;
    overflow: hidden;
}

.block-product-card .carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.block-product-card .carousel-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.block-product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.block-product-card .carousel-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 99px;
}

.block-product-card .carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.2s;
}

.block-product-card .carousel-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

.block-product-card .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #333;
}

.block-product-card .carousel-container:hover .carousel-btn {
    opacity: 1;
}

.block-product-card .carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.block-product-card .carousel-btn.prev { left: 12px; }
.block-product-card .carousel-btn.next { right: 12px; }

.block-product-card .compatibility-row {
    padding: 8px 16px;
    background: color-mix(in srgb, var(--color-success, #10b981) 10%, transparent);
    color: var(--color-success-dark, #047857);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.block-product-card .actions-footer {
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    background: var(--bg-surface);
    flex-wrap: wrap;
}

.block-product-card .actions-footer .action-btn {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: 12px;
    padding: 8px 10px;
}

/* =============================================================================
   BLOCK: Specs (Markdown)
   ============================================================================= */
.block-specs-markdown {
    padding: var(--spacing-3);
    font-size: 13px;
}
.block-specs-markdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}
.block-specs-markdown li { display: flex; gap: var(--spacing-2); }
.block-specs-markdown .bullet { color: var(--text-tertiary); }
.block-specs-markdown strong { color: var(--text-primary); font-weight: var(--font-weight-medium); }

/* =============================================================================
   BLOCK: Added to Cart
   ============================================================================= */
.block-added-to-cart {
    padding: var(--spacing-4);
    text-align: center;
}
.block-added-to-cart .icon-circle {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-3);
}
.block-added-to-cart h3 {
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    margin: 0 0 4px 0;
}
.block-added-to-cart p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-4);
}

/* =============================================================================
   BLOCK: Stock Status
   ============================================================================= */
.block-stock-status {
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-2);
}
.block-stock-status.low {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.block-stock-status.in-stock {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.block-stock-status.out {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =============================================================================
   BLOCK: Quick Actions
   ============================================================================= */
.block-actions {
    display: flex;
    gap: var(--spacing-2);
    flex-wrap: wrap;
    margin-top: var(--spacing-2);
    width: 100%;
}
.block-actions .action-btn { flex: 1; white-space: nowrap; }

/* =============================================================================
   BLOCK: Comparison
   ============================================================================= */
.block-comparison {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}
.block-comparison::-webkit-scrollbar { display: none; }
.block-comparison .col {
    flex: 1 0 auto; /* Don't shrink below min-width */
    padding: var(--spacing-3);
    text-align: center;
    min-width: 120px; /* Smaller min for narrow containers */
    max-width: 180px; /* Cap width so columns don't get too wide */
    border-right: 1px solid var(--border-subtle);
}
.block-comparison .col:last-child { border-right: none; }
.block-comparison .title {
    font-weight: var(--font-weight-bold);
    font-size: 13px;
    margin-bottom: 4px;
    word-wrap: break-word;
}
.block-comparison .price {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.block-comparison .feature-chip {
    font-size: 11px;
    background: var(--bg-surface-subtle);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: inline-block;
}

/* =============================================================================
   BLOCK: Bundle Offer
   ============================================================================= */
.block-bundle {
    padding: var(--spacing-4);
    background-color: var(--bg-surface);
    /* Removed invalid token --color-discovery */
}
.block-bundle-header { 
    margin-bottom: var(--spacing-3);
    padding: 0;
}
/* Removed .block-bundle-badge as it relied on invalid tokens and caused layout issues */

.block-bundle h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}
.block-bundle-items {
    display: flex;
    gap: var(--spacing-3);
    align-items: center;
    flex-wrap: wrap; /* Wrap on very narrow screens */
    margin-bottom: var(--spacing-3);
}
.block-bundle-img-group {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}
.block-bundle-img-main {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}
.block-bundle-plus {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--bg-surface);
    border-radius: 50%;
    padding: 2px;
    border: 1px solid var(--border-subtle);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.block-bundle-plus svg { width: 10px; height: 10px; }
.block-bundle-img-acc {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}
.block-bundle-details { 
    flex: 1; 
    min-width: 0; /* Allow text truncation */
}
.block-bundle-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}
.block-bundle-pricing {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}
.block-bundle-price-new {
    font-weight: bold;
    font-size: 14px;
    color: var(--text-primary);
}
.block-bundle-price-old {
    text-decoration: line-through;
    color: var(--text-tertiary);
    font-size: 12px;
}
.block-bundle-btn {
    width: 100%;
    margin-top: var(--spacing-2);
}

/* =============================================================================
   BLOCK: Recommendations / Upsell
   ============================================================================= */
.block-recommendations { padding: var(--spacing-4); }
.block-rec-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}
.block-rec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.block-rec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-surface-subtle);
    border-radius: 8px;
}
.block-rec-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.block-rec-info { 
    flex: 1; 
    min-width: 0; /* Allow text truncation */
}
.block-rec-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block-rec-price {
    font-size: 12px;
    color: var(--text-secondary);
}

.block-upsell {
    padding: 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-info) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-info) 20%, transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2);
}
.block-upsell-content {
    display: flex;
    gap: 12px;
    align-items: center;
}
.block-upsell-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.block-upsell-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* =============================================================================
   BLOCK: Image Gallery
   ============================================================================= */
.block-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.block-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-surface-subtle);
}
.block-gallery-item.span-2 {
    grid-column: span 2;
    aspect-ratio: 16/9;
}
.block-gallery-item:not(.span-2) {
    aspect-ratio: 1/1;
}
.block-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.block-gallery-item:hover .block-gallery-img { transform: scale(1.05); }

/* =============================================================================
   BLOCK: Cart Summary
   ============================================================================= */
.block-cart-summary {
    padding: var(--spacing-4);
}
.block-cart-header {
    display: flex;
    justify-content: space-between;
    font-weight: var(--font-weight-bold);
    font-size: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}
.block-cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.block-cart-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.block-cart-thumb {
    width: 40px;
    height: 40px;
    background: var(--bg-surface-subtle);
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}
.block-cart-details {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}
.block-cart-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block-cart-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.block-cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.block-cart-summary .chatkit-button {
    margin-top: 0;
    margin-bottom: 0;
}

/* =============================================================================
   BLOCK: Lead Gen / Handoff
   ============================================================================= */
.block-lead-gen {
    padding: var(--spacing-4);
}
.block-lead-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.block-lead-title {
    font-weight: 600;
    font-size: 16px;
}
.block-lead-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}
.block-lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.block-lead-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-surface-subtle);
    color: var(--text-primary);
}
.block-lead-input:focus {
    outline: 2px solid var(--color-brand-accent);
    border-color: transparent;
}

/* =============================================================================
   BLOCK: File List (Datasheets)
   ============================================================================= */
.block-file-list {
    padding: var(--spacing-4);
}
.block-file-title {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}
.block-file-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.block-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s;
}
.block-file-item:hover {
    background-color: var(--bg-surface-subtle);
}
.block-file-icon {
    color: var(--color-danger);
    flex-shrink: 0;
}
.block-file-info { 
    flex: 1; 
    min-width: 0;
}
.block-file-name { 
    font-size: 13px; 
    font-weight: 500; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block-file-size { font-size: 11px; color: var(--text-secondary); }

/* =============================================================================
   BLOCK: Compatibility / Objection Handler
   ============================================================================= */
.block-compatibility {
    padding: var(--spacing-3);
    background: color-mix(in srgb, var(--color-info) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-info) 20%, transparent);
    border-radius: var(--radius-lg);
    display: flex;
    gap: var(--spacing-3);
    align-items: flex-start; /* Align to top for better text flow */
}
.block-comp-icon {
    background: var(--bg-surface);
    padding: 6px;
    border-radius: 50%;
    color: var(--color-info);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-top: 1px; /* Slight top offset for better alignment with text */
}
.block-comp-icon svg {
    width: 14px;
    height: 14px;
}
.block-comp-content { 
    flex: 1; 
    min-width: 0; /* Allow text wrapping */
}
.block-comp-title {
    font-weight: 600;
    color: var(--color-info);
    font-size: 13px;
    margin-bottom: 4px; /* Increased spacing between title and text */
    line-height: 1.3;
}
.block-comp-text {
    font-size: 12px;
    line-height: 1.5; /* Increased line height for better readability */
    color: var(--text-secondary);
    word-wrap: break-word;
}

/* =============================================================================
   BLOCK: FAQ
   ============================================================================= */
.block-faq {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.block-faq-header {
    padding: 12px 16px;
    background-color: var(--bg-surface-subtle);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.block-faq-item {
    border-bottom: 1px solid var(--border-subtle);
}
.block-faq-item:last-child { border-bottom: none; }
.block-faq-question {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.block-faq-question:hover { background-color: var(--bg-surface-subtle); }
.block-faq-answer {
    padding: 0 16px 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: none; /* Hidden by default, toggle via JS if needed or inline style */
}
/* Simple CSS-only toggle logic for prototype: details/summary structure is better for accessibility, 
   but sticking to div structure to match block renderer logic. 
   For this CSS file, we'll assume open state class or inline style handling. */
.block-faq-item.open .block-faq-answer { display: block; }

/* =============================================================================
   BLOCK: Video (YouTube / Embed)
   ============================================================================= */
.block-video {
    overflow: hidden;
}
.block-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background-color: var(--bg-surface-subtle);
}
.block-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.block-video-caption {
    padding: var(--spacing-2) var(--spacing-3);
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--bg-surface-subtle);
    border-top: 1px solid var(--border-subtle);
}

/* =============================================================================
   BLOCK: Map / Location
   ============================================================================= */
.block-map {
    overflow: hidden;
}
.block-map-container {
    position: relative;
    width: 100%;
    padding-bottom: 40%; /* Shorter aspect ratio for maps */
    height: 0;
    min-height: 120px;
    background-color: var(--bg-surface-subtle);
}
.block-map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.block-map-details {
    padding: var(--spacing-3) var(--spacing-4);
}
.block-map-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.block-map-address {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.block-map-hours {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* =============================================================================
   BLOCK: Ticket / Support Form
   ============================================================================= */
.block-ticket {
    padding: var(--spacing-4);
}
.block-ticket-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}
.block-ticket-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.block-ticket-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-surface-subtle);
    color: var(--text-primary);
    font-family: inherit;
}
.block-ticket-input:focus {
    outline: 2px solid var(--color-brand-accent);
    border-color: transparent;
}
.block-ticket-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.block-ticket-actions .chatkit-button {
    flex: 1 1 auto;
    min-width: 100px;
}
/* =============================================================================
   BLOCK: Code Snippet
   ============================================================================= */
.block-code {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #333;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    overflow: hidden; /* Contain the scrollable pre */
}
.block-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #252526;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 8px;
}
.block-code-lang {
    font-size: 11px;
    color: #9cdcfe;
    text-transform: uppercase;
    font-weight: 500;
}
.block-code-copy {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.block-code-copy:hover {
    background-color: #333;
}
.block-code pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 12px;
    line-height: 1.5;
    max-height: 200px; /* Cap height for long snippets */
    -webkit-overflow-scrolling: touch;
}
.block-code code {
    white-space: pre;
    word-break: normal;
}

/* =============================================================================
   RESPONSIVE: Container Query Fallback (Width-based adjustments)
   These kick in when blocks are in narrow containers like chat widgets
   Minimum supported width: 320px (iPhone SE, smallest common mobile)
   ============================================================================= */

/* Very small mobile (320px - 360px) */
@media (max-width: 360px) {
    .chatkit-card {
        border-radius: var(--radius-sm); /* Keep rounded corners, just smaller */
    }
    
    .block-comparison .col {
        min-width: 80px; /* Smaller for very narrow screens */
        padding: var(--spacing-2);
        font-size: 11px;
    }
    
    .block-comparison .title {
        font-size: 11px;
    }
    
    .block-comparison .price {
        font-size: 11px;
    }
    
    .block-product-card .header {
        padding: var(--spacing-2);
        flex-direction: column;
        gap: 6px;
    }
    
    .block-product-card h3 {
        font-size: 13px;
    }
    
    .block-product-card .price {
        font-size: 13px;
    }
    
    .block-product-card .carousel-container {
        max-height: 160px;
    }
    
    .block-product-card .carousel-btn {
        width: 24px;
        height: 24px;
    }
    
    .block-bundle {
        padding: var(--spacing-2);
    }
    
    .block-bundle-header {
        margin-bottom: var(--spacing-2);
    }
    
    .block-bundle-items {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
        margin-bottom: var(--spacing-2);
    }
    
    .block-bundle-img-group,
    .block-bundle-img-acc {
        width: 36px;
        height: 36px;
    }
    
    .block-bundle-name {
        font-size: 11px;
    }
    
    .block-bundle-price-new {
        font-size: 12px;
    }
    
    .block-bundle-price-old {
        font-size: 10px;
    }
    
    .block-bundle-btn {
        margin-top: var(--spacing-1);
        font-size: 12px;
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .block-compatibility {
        padding: var(--spacing-2);
        gap: var(--spacing-2);
        flex-direction: column;
        align-items: flex-start;
    }
    
    .block-comp-icon {
        width: 20px;
        height: 20px;
        padding: 3px;
    }
    
    .block-comp-icon svg {
        width: 10px;
        height: 10px;
    }
    
    .block-comp-title {
        font-size: 12px; /* Slightly larger for readability */
        margin-bottom: 3px;
    }
    
    .block-comp-text {
        font-size: 11px; /* Slightly larger for readability */
        line-height: 1.5;
    }
}

/* Small mobile (361px - 400px) */
@media (max-width: 400px) {
    .chatkit-card {
        border-radius: var(--radius-md); /* Keep rounded corners */
    }
    
    .block-product-card .header {
        padding: var(--spacing-2) var(--spacing-3);
        flex-direction: column;
        gap: 8px;
    }
    
    .block-product-card .price {
        font-size: 14px;
    }
    
    .block-product-card h3 {
        font-size: 14px;
    }
    
    .block-product-card .carousel-container {
        max-height: 180px;
    }
    
    .block-product-card .carousel-btn {
        width: 28px;
        height: 28px;
    }
    
    .block-bundle {
        padding: var(--spacing-3);
    }
    
    .block-bundle-header {
        margin-bottom: var(--spacing-2);
    }
    
    .block-bundle h3 {
        font-size: 14px; /* Smaller title on mobile */
    }
    
    .block-bundle-items {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2); /* Reduce gap on mobile */
        margin-bottom: var(--spacing-2);
    }
    
    .block-bundle-img-group,
    .block-bundle-img-acc {
        width: 40px; /* Smaller images on mobile */
        height: 40px;
    }
    
    .block-bundle-name {
        font-size: 12px; /* Smaller text on mobile */
    }
    
    .block-bundle-price-new {
        font-size: 13px; /* Smaller price on mobile */
    }
    
    .block-bundle-price-old {
        font-size: 11px; /* Smaller old price on mobile */
    }
    
    .block-bundle-btn {
        margin-top: var(--spacing-2);
        font-size: 13px;
    }
    
    .block-comparison .col {
        min-width: 90px; /* Smaller for narrow screens */
        padding: var(--spacing-2);
    }
    
    .block-faq-question {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .block-faq-answer {
        padding: 0 12px 10px 12px;
        font-size: 12px;
    }
    
    .block-ticket {
        padding: var(--spacing-3);
    }
    
    .block-lead-gen {
        padding: var(--spacing-3);
    }
    
    .block-cart-summary {
        padding: var(--spacing-3);
    }
    
    .block-recommendations {
        padding: var(--spacing-3);
    }
    
    .block-compatibility {
        padding: var(--spacing-2);
        gap: var(--spacing-2);
        flex-direction: column; /* Stack on very small screens */
        align-items: flex-start;
    }
    
    .block-comp-icon {
        width: 24px;
        height: 24px;
        padding: 4px;
    }
    
    .block-comp-icon svg {
        width: 12px;
        height: 12px;
    }
    
    .block-comp-title {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .block-comp-text {
        font-size: 11px;
        line-height: 1.5;
    }
}
