/* components.css: Reusable UI Elements */

/* Utilities */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-center {
    text-align: center;
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-12 {
    margin-top: var(--space-12);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: var(--font-sans);
    border: 1px solid transparent;
}

.btn-large {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--accent-green);
    color: #000;
    border: 1px solid var(--accent-green);
    font-weight: 600;
}

.btn-primary:hover {
    background: #1eba5a;
    border-color: #1eba5a;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: rgba(37, 211, 102, 0.3);
    color: var(--accent-green);
}

.btn-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(37, 211, 102, 0.2);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    color: var(--accent-green);
}

.link-animate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-green);
    font-weight: 500;
    transition: gap 0.2s;
}

.link-animate:hover {
    gap: 0.75rem;
}

.link-animate i {
    transition: transform 0.2s;
}

.link-animate:hover i {
    transform: translateX(4px);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge.purple,
.badge.green {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
    color: var(--accent-green);
}

/* Live indicator: explicit child elements to avoid ::after GPU compositor artifacts */
.pulse-dot {
    position: relative;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.pulse-dot .dot-core {
    position: absolute;
    inset: 0;
    background: var(--accent-green);
    border-radius: 50%;
}

.pulse-dot .dot-ring {
    position: absolute;
    inset: -2px;
    background: var(--accent-green);
    border-radius: 50%;
    opacity: 0.5;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    80% {
        transform: scale(2.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 460px;
    padding: 0;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    /* Own compositor layer — prevents modal-overlay's backdrop-filter
       from double-rendering the scale/slide-in transition on HTTP */
    will-change: transform;
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-modal:hover {
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: rgba(37, 211, 102, 0.03);
}

/* --- Pricing Page Components --- */
.plan-select-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.plan-select-card:hover {
    border-color: rgba(37, 211, 102, 0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.plan-select-card.selected {
    border-color: var(--accent-green);
    background: rgba(37, 211, 102, 0.05);
    box-shadow: var(--shadow-glow-strong);
}

.plan-select-check {
    position: static;
    color: var(--text-muted);
    flex-shrink: 0;
}

.plan-select-card.selected .plan-select-check {
    color: var(--accent-green);
}

/* Add-on cards */
.addon-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.addon-card.added {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.03);
}

.addon-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.addon-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.addon-price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    margin-top: auto;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.addon-price span {
    font-size: 0.85rem;
    font-weight: 400;
}

.addon-controls {
    margin-top: auto;
}

/* Quantity Stepper */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--bg-dark);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 999px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.qty-btn:hover:not(:disabled) {
    background: rgba(37, 211, 102, 0.15);
    color: var(--accent-green);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-value {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-green);
}

/* --- Integration Cards --- */
/* --- Automation Builder Info Banner --- */
.int-ab-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.int-ab-banner:hover { border-color: var(--accent-green); color: var(--text-secondary); }
.int-ab-banner strong { color: var(--text-secondary); font-weight: 600; }

/* --- Integration Cards --- */
.int-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.int-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 211, 102, 0.3);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.int-card-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.int-card:hover .int-card-logo {
    opacity: 1;
    filter: none;
}

.int-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    background: rgba(37, 211, 102, 0.1);
    border-radius: var(--radius-md);
}

.int-card-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.int-card-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.int-card-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.15rem;
}

.int-card-method-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.int-card:hover .int-card-method-dot { opacity: 1; }
.int-dot-api_key    { background: #25D366; }
.int-dot-oauth      { background: #4A9EF5; }
.int-dot-webhook    { background: #F5A623; }
.int-dot-bearer_token { background: #A78BFA; }

/* --- Integration Detail Modal --- */
.int-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.int-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.int-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-elevated);
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.int-modal-overlay.active .int-modal-card {
    transform: scale(1) translateY(0);
}

.int-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.int-modal-close:hover { color: white; background: rgba(255,255,255,0.06); }
.int-modal-close i, .int-modal-close svg { width: 20px; height: 20px; }

.int-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.int-modal-body::-webkit-scrollbar { width: 4px; }
.int-modal-body::-webkit-scrollbar-track { background: transparent; }
.int-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.int-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.int-modal-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.int-modal-icon-fallback {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    background: rgba(37, 211, 102, 0.1);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.int-modal-icon-fallback i, .int-modal-icon-fallback svg { width: 24px; height: 24px; }

.int-modal-header-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.int-modal-header-text .int-card-cat {
    font-size: 0.7rem;
}

.int-modal-section {
    margin-bottom: 1.25rem;
}

.int-modal-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.int-modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.int-modal-caps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.int-modal-caps li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.int-modal-caps li i,
.int-modal-caps li svg {
    width: 16px;
    height: 16px;
    color: var(--accent-green);
    flex-shrink: 0;
    margin-top: 2px;
}

.int-modal-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.int-badge-api_key      { background: rgba(37, 211, 102, 0.08); border: 1px solid rgba(37, 211, 102, 0.15); color: #25D366; }
.int-badge-oauth        { background: rgba(74, 158, 245, 0.08); border: 1px solid rgba(74, 158, 245, 0.15); color: #4A9EF5; }
.int-badge-webhook      { background: rgba(245, 166, 35, 0.08); border: 1px solid rgba(245, 166, 35, 0.15); color: #F5A623; }
.int-badge-bearer_token { background: rgba(167, 139, 250, 0.08); border: 1px solid rgba(167, 139, 250, 0.15); color: #A78BFA; }

.int-modal-steps {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.int-modal-steps li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.int-modal-steps li::marker {
    color: var(--accent-green);
    font-weight: 600;
}

.int-modal-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.int-modal-visit-btn {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
}

.int-modal-visit-btn i,
.int-modal-visit-btn svg { width: 16px; height: 16px; }

/* --- External Link Warning --- */
.int-modal-warning {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
    gap: 0.75rem;
}

.int-modal-warning-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 211, 102, 0.1);
    border-radius: 50%;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}
.int-modal-warning-icon i,
.int-modal-warning-icon svg { width: 28px; height: 28px; }

.int-modal-warning h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.int-modal-warning p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.int-modal-domain {
    color: var(--accent-green);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.int-modal-warning-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    width: 100%;
    max-width: 320px;
}

.int-modal-warning-actions .btn {
    flex: 1;
    justify-content: center;
}

/* --- Mobile: Full-screen modal --- */
@media (max-width: 600px) {
    .int-modal-overlay { padding: 0; align-items: flex-end; }
    .int-modal-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    .int-modal-body { padding: 1.25rem 1rem; }
    .int-modal-footer { padding: 0.75rem 1rem 1rem; }
    .int-ab-banner { font-size: 0.7rem; gap: 0.35rem; padding: 0.35rem 0.75rem; white-space: normal; text-align: center; line-height: 1.35; }
}

/* Integration Filter Tabs */
.int-filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
    justify-content: center;
}

.int-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.int-filter-btn:hover {
    border-color: rgba(37, 211, 102, 0.3);
    color: var(--text-primary);
}

.int-filter-btn.active {
    background: var(--accent-green);
    color: #000;
    border-color: var(--accent-green);
    font-weight: 600;
}

/* Integration Search */
.int-search-wrap {
    max-width: 400px;
    margin: 0 auto var(--space-6) auto;
    position: relative;
}

.int-search-wrap i,
.int-search-wrap svg.lucide {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.int-search-wrap input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.int-search-wrap input:focus {
    outline: none;
    border-color: var(--accent-green);
}

/* --- Use Cases Page --- */
.uc-category {
    margin-bottom: var(--space-12);
    padding-top: 80px;
    margin-top: -80px;
}

.uc-category-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-surface));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.uc-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.uc-category-card:hover {
    box-shadow: var(--shadow-glow);
    border-color: rgba(37, 211, 102, 0.2);
}

.uc-category-header {
    margin-bottom: var(--space-6);
}

.uc-category-header h2 {
    font-size: 1.75rem;
    margin-top: var(--space-3);
    margin-bottom: var(--space-3);
}

.uc-category-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 700px;
}

/* Flow Strip */
.uc-flow-strip {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(37, 211, 102, 0.15);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.uc-flow-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uc-flow-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--accent-green);
    color: #000;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.uc-flow-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.uc-flow-steps {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.uc-flow-step {
    background: var(--bg-dark);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tiles */
.uc-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.uc-tile {
    background: var(--bg-card);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.uc-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 211, 102, 0.2);
    box-shadow: 0 10px 30px -10px rgba(37, 211, 102, 0.15);
}

.uc-tile h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.uc-tile-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: var(--space-4);
    display: inline-block;
}

/* Use Cases Sidebar */
/* overflow-x:clip prevents horizontal scroll without breaking sticky positioning */
section:has(.uc-page-layout) {
    overflow: visible;
    overflow-x: clip;
}

.uc-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 992px) {
    .uc-page-layout {
        grid-template-columns: 240px 1fr;
    }
}

.uc-sidebar {
    display: none;
}

@media (min-width: 992px) {
    .uc-sidebar {
        display: block;
        position: sticky;
        top: 100px;
        height: fit-content;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

.uc-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.uc-sidebar a:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.uc-sidebar a.active {
    color: var(--accent-green);
    background: rgba(37, 211, 102, 0.08);
    border-left: 2px solid var(--accent-green);
}

/* --- Use Cases Mobile --- */
@media (max-width: 640px) {
    .uc-category {
        margin-bottom: var(--space-8);
        padding-top: 60px;
        margin-top: -60px;
    }

    .uc-category-card {
        padding: var(--space-5) var(--space-4);
        border-radius: var(--radius-xl);
        text-align: center;
    }

    .uc-category-header {
        margin-bottom: var(--space-4);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .uc-category-header h2 {
        font-size: 1.35rem;
        margin-top: var(--space-2);
        margin-bottom: var(--space-2);
        line-height: 1.3;
    }

    .uc-category-desc {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    /* Flow strip — clean vertical stack */
    .uc-flow-strip {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        text-align: left;
    }

    /* Trigger row — badge + label side by side, don't break badge */
    .uc-flow-trigger {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .uc-flow-badge {
        flex-shrink: 0;
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .uc-flow-label {
        font-size: 0.88rem;
        line-height: 1.3;
    }

    /* Hide the arrow between trigger and steps */
    .uc-flow-strip > svg,
    .uc-flow-strip > i {
        display: none;
    }

    /* Steps — vertical list */
    .uc-flow-steps {
        width: 100%;
        flex-direction: column;
        gap: 6px;
    }

    .uc-flow-step {
        white-space: normal;
        font-size: 0.82rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 6px 12px;
    }

    /* Add a subtle right chevron to each step */
    .uc-flow-step::after {
        content: '\203A';
        color: var(--text-muted);
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    /* Hide the inline chevron icons between steps */
    .uc-flow-steps > svg,
    .uc-flow-steps > i {
        display: none;
    }

    .uc-category-card > .btn {
        width: 100%;
        justify-content: center;
    }

    .uc-tiles-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .uc-tile {
        padding: var(--space-4);
        text-align: left;
    }

    .uc-tile h4 {
        font-size: 1rem;
    }
}

/* --- Cart Drawer --- */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    justify-content: flex-end;
}

.cart-drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cart-drawer {
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    /* Own compositor layer — prevents backdrop-filter on parent overlay
       from causing double-render of the slide transition on HTTP */
    will-change: transform;
}

.cart-drawer-overlay.active .cart-drawer {
    transform: translateX(0);
}

/* Mobile nav menu */
.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-4) var(--space-6);
    z-index: 99;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: var(--shadow-elevated);
}

.mobile-nav-menu.open {
    display: flex;
}

.mobile-nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    transition: color 0.2s;
}

.mobile-nav-menu a:hover {
    color: var(--accent-green);
}

.mobile-nav-menu .btn {
    margin-top: var(--space-2);
}

.mobile-nav-menu .btn-primary {
    color: #000;
}

/* Region select styling */
.region-switcher-compact select {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6577' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.region-switcher-compact select:focus {
    outline: none;
    border-color: var(--accent-green);
}

/* --- Slider Pricing --- */
.slider-row {
    margin-top: var(--space-3);
}

.slider-track {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--glass-border);
    outline: none;
    transition: background 0.2s;
    cursor: pointer;
}

.slider-track::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: grab;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.5);
    transition: box-shadow 0.2s;
}

.slider-track::-webkit-slider-thumb:hover {
    box-shadow: 0 0 14px rgba(37, 211, 102, 0.7);
}

.slider-track::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: grab;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.5);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.slider-plan-card .package-price {
    transition: all 0.2s ease;
}

/* --- Message Type Badges --- */
.msg-types-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-2);
}

.msg-type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(37, 211, 102, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(37, 211, 102, 0.15);
}

/* --- Micro Grid Tweak --- */
.micro-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}
