/* ==========================================================================
   Process Stack Widget - CSS
   Sticky Stacking Cards Effect
   ========================================================================== */

/* CSS Variables */
:root {
    --ps-bg: #ffffff;
    --ps-card-bg-from: #fafafa;
    --ps-card-bg-to: #f4f4f4;
    --ps-card-border: #eeeeee;
    --ps-text-primary: #3d3d3d;
    --ps-text-secondary: #595959;
    --ps-text-muted: #6d6d6d;
    --ps-accent: #659bff;
}

/* ==========================================================================
   Section
   ========================================================================== */
.ps-section {
    background-color: var(--ps-bg);
    padding: 80px 20px;
}

.ps-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */
.ps-header {
    text-align: left;
    margin-bottom: 48px;
    max-width: 600px;
}

.ps-header .faq-tag {
    margin-bottom: 20px;
}

.ps-title {
    color: var(--ps-text-primary);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Cards Wrapper
   ========================================================================== */
.ps-cards-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Card Container - Sticky Behavior
   ========================================================================== */
.ps-card-container {
    position: sticky;
    top: var(--card-top, 100px);
    z-index: calc(10 + var(--card-index, 0));
    margin-bottom: 24px;
}

/* Last card doesn't need margin */
.ps-card-container:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Card Styling
   ========================================================================== */
.ps-card {
    position: relative;
    background: linear-gradient(314deg, var(--ps-card-bg-from) 0%, var(--ps-card-bg-to) 100%);
    border: 1px solid var(--ps-card-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.08),
        inset 0 3px 2px rgba(255, 255, 255, 1),
        inset 3px 0 2px rgba(255, 255, 255, 1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ps-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 3px 2px rgba(255, 255, 255, 1),
        inset 3px 0 2px rgba(255, 255, 255, 1);
}

/* ==========================================================================
   Step Badge
   ========================================================================== */
.ps-step-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background-color: #eeeeee;
    color: var(--ps-text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: 40px;
    z-index: 99999;
}

/* ==========================================================================
   Card Content
   ========================================================================== */
.ps-card-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ==========================================================================
   Icon
   ========================================================================== */
.ps-icon-wrap {
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ps-accent);
    border-radius: 40px;
    color: #ffffff;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.ps-icon-wrap i,
.ps-icon-wrap svg {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

.ps-card:hover .ps-icon-wrap {
    transform: scale(1.05);
}

/* ==========================================================================
   Content Row - Text & Image Side by Side
   ========================================================================== */
.ps-content-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 32px;
}

.ps-text-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-step-title {
    color: var(--ps-text-secondary);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.ps-step-desc {
    color: var(--ps-text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    max-width: 400px;
}

/* ==========================================================================
   Step Image
   ========================================================================== */
.ps-step-image {
    flex-shrink: 0;
    width: 240px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ps-step-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ps-card:hover .ps-step-image img {
    transform: scale(1.03);
}

/* ==========================================================================
   CTA Button
   ========================================================================== */
.ps-cta-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .ps-card-content {
        flex-direction: column;
    }

    .ps-content-row {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .ps-step-image {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .ps-section {
        padding: 60px 16px;
    }
    
    .ps-header {
        margin-bottom: 32px;
    }
    
    .ps-card {
        padding: 24px;
    }
    
    .ps-step-badge {
        top: 16px;
        right: 16px;
        padding: 4px 12px;
        font-size: 12px;
    }
    
    .ps-icon-wrap {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }
    
    .ps-icon-wrap i,
    .ps-icon-wrap svg {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
    
    .ps-step-title {
        font-size: 18px;
    }
    
    .ps-step-desc {
        font-size: 14px;
    }
    
    .ps-card-container {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .ps-title {
        font-size: 24px;
    }
    
    .ps-tag {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .ps-card {
        padding: 20px;
    }
    
    .ps-card-content {
        gap: 16px;
    }
    
    .ps-step-title {
        font-size: 16px;
    }
    
    .ps-step-desc {
        font-size: 13px;
    }
}

/* ==========================================================================
   Disable Sticky on Mobile (Optional)
   ========================================================================== */
@media (max-width: 640px) {
    .ps-card-container {
        position: relative;
        top: auto !important;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .ps-card,
    .ps-icon-wrap,
    .ps-step-image img {
        transition: none;
    }

    .ps-card:hover .ps-step-image img {
        transform: none;
    }
}

/* ==========================================================================
   Elementor Editor
   ========================================================================== */
.elementor-editor-active .ps-card-container {
    position: relative;
    top: auto !important;
}

/* ==========================================================================
   Dark Theme Variant
   ========================================================================== */
.ps-section[data-theme="dark"] {
    --ps-bg: #0f0f0f;
    --ps-card-bg-from: #1a1a1a;
    --ps-card-bg-to: #1f1f1f;
    --ps-card-border: #2a2a2a;
    --ps-text-primary: #f5f5f5;
    --ps-text-secondary: #e0e0e0;
    --ps-text-muted: #a0a0a0;
}

.ps-section[data-theme="dark"] .ps-tag {
    background-color: #1a1a1a;
    border-color: #333333;
}

.ps-section[data-theme="dark"] .ps-step-badge {
    background-color: #2a2a2a;
}

.ps-section[data-theme="dark"] .ps-card {
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Scale Animation on Scroll (Applied via JS)
   ========================================================================== */
.ps-card-container.ps-scaled .ps-card {
    transform: scale(0.96);
    opacity: 0.7;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .ps-section {
        padding: 20px 0;
    }
    
    .ps-card-container {
        position: relative !important;
        top: auto !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}
