:root {
    --wc-wizard-primary: #6366f1;
    --wc-wizard-primary-hover: #4f46e5;
    --wc-wizard-bg: #f3f4f6;
    --wc-wizard-card-bg: #ffffff;
    --wc-wizard-text: #1f2937;
    --wc-wizard-text-light: #6b7280;
    --wc-wizard-border: #e5e7eb;

    /* Dimensions Defaults */
    --wc-wizard-radius: 12px;
    --wc-wizard-card-radius: 12px;
    --wc-wizard-container-padding: 32px;
    --wc-wizard-card-padding: 20px;
    --wc-wizard-grid-gap: 20px;

    /* Typography Defaults */
    --wc-wizard-font-size-base: 16px;
    --wc-wizard-font-size-header: 24px;
    --wc-wizard-font-size-step: 14px;
    --wc-wizard-font-size-card-title: 18px;
    --wc-wizard-font-size-price: 18px;

    --wc-wizard-font-size-price: 18px;

    /* [NEW] Font Weights Defaults */
    --wc-wizard-font-weight-header: 700;
    --wc-wizard-font-weight-price: 700;
    --wc-wizard-font-weight-body: 400;

    /* Tooltip Defaults */
    --wc-wizard-tooltip-font-size: 12px;
    --wc-wizard-tooltip-padding: 12px;
    --wc-wizard-tooltip-radius: 8px;
    --wc-wizard-tooltip-width: 280px;

    --wc-wizard-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.wc-wizard-container {
    font-family: var(--wc-wizard-font-family, 'Inter', system-ui, -apple-system, sans-serif);
    font-size: var(--wc-wizard-font-size-base);
    background: var(--wc-wizard-card-bg);
    width: 100%;
    max-width: var(--wc-wizard-max-width, 900px);
    margin: 30px auto 30px;
    border-radius: var(--wc-wizard-radius, 12px);
    box-shadow: var(--wc-wizard-shadow);
    overflow: visible;
    /* Changed to visible to allow tooltips to overflow panels */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.wc-wizard-container * {
    box-sizing: border-box;
}

/* Header & Progress */
.wc-wizard-header {
    padding: var(--wc-wizard-container-padding);
    border-bottom: 1px solid var(--wc-wizard-border);
    background: #fff;
    border-top-left-radius: var(--wc-wizard-radius);
    border-top-right-radius: var(--wc-wizard-radius);
}

.wc-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    position: relative;
}

/* Per-step connection line instead of single bar */
.wc-step-indicator {
    position: relative;
    z-index: 1;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1;
    /* Distribute space evenly */
}

/* Line connecting to the next step */
.wc-step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    /* Vertically center based on circle size */
    top: calc(var(--wc-wizard-progress-circle-size, 32px) / 2);
    /* Correct for line thickness to be truly centered */
    transform: translateY(-50%);

    /* Start after circle */
    left: calc(50% + var(--wc-wizard-progress-circle-size, 32px) / 2 + 10px);
    width: calc(100% - var(--wc-wizard-progress-circle-size, 32px) - 20px);

    /* End before next circle */
    height: var(--wc-wizard-progress-line-height, 3px);
    background: var(--wc-wizard-progress-line-color, #e5e7eb);
    z-index: 0;
    /* Changed from -1 to 0 to be visible but controlled */
}

.wc-step-indicator.completed::after {
    background: #10b981;
    /* Optional: color the line for completed steps? User didn't ask, but safe to leave gray or make primary */
    /* Let's keep it gray or border color for now to match user expectation of "line between" */
    background: var(--wc-wizard-progress-line-color, #e5e7eb);
}

/* Wait, if the line is BEHIND steps, we need to make sure the circle hides it?
   The circle has background set by variable or specific color.
   The line z-index -1 puts it behind the container.
   But the container has transparent background now.
   So we need line z-index: -1 relative to .wc-step-indicator?
   If .wc-step-indicator is z-index: 1, then ::after -1 puts it behind text?
   Let's keep ::after z-index: -1 and ensure .wc-step-circle has a background color to cover it.
*/

.wc-step-circle {
    width: var(--wc-wizard-progress-circle-size, 32px);
    height: var(--wc-wizard-progress-circle-size, 32px);
    border-radius: 50%;
    background: var(--wc-wizard-bg);
    border: 2px solid var(--wc-wizard-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--wc-wizard-font-weight-header, 600);
    font-size: var(--wc-wizard-progress-circle-font-size, 14px);
    color: var(--wc-wizard-text-light);
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    /* Ensure circle stays on top of the line */
}

.wc-step-indicator.active .wc-step-circle {
    background: var(--wc-wizard-primary);
    border-color: var(--wc-wizard-primary);
    color: white;
}

.wc-step-indicator.completed .wc-step-circle {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.wc-step-label {
    font-size: var(--wc-wizard-font-size-step);
    color: var(--wc-wizard-text-light);
    font-weight: 500;
}

.wc-step-indicator.active .wc-step-label {
    color: var(--wc-wizard-primary);
    font-weight: 700;
}

/* Content Area */
.wc-wizard-content {
    padding: var(--wc-wizard-container-padding);
    flex: 1;
    overflow: visible !important;
    position: relative;
    z-index: 5;
}

.wc-step-panel {
    display: none;
    animation: var(--wc-wizard-animation-name, wcWizardFadeIn) var(--wc-wizard-animation-duration, 0.4s) ease;
    position: relative;
    z-index: 10;
    overflow: visible !important;
    transform-style: preserve-3d;
    /* Prevent clipping during animation */
}

.wc-step-panel.active {
    display: block;
}

@keyframes wcWizardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcWizardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcWizardZoomIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wc-step-panel h2 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: var(--wc-wizard-font-size-header);
    color: var(--wc-wizard-text);
}

.wc-step-description {
    font-size: var(--wc-wizard-font-size-description, 0.95rem);
    color: var(--wc-wizard-color-description, var(--wc-wizard-text-light));
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Cards Layout - Flexbox for Centering */
.wc-options-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Default fallback */
    gap: var(--wc-wizard-grid-gap);
    overflow: visible !important;
}

/* Alignment Overrides */
.wc-align-left .wc-options-grid {
    justify-content: flex-start;
}

.wc-align-center .wc-options-grid {
    justify-content: center;
}

.wc-align-right .wc-options-grid {
    justify-content: flex-end;
}

.wc-option-card {
    /* Default flex behavior */
    flex: 0 1 250px;
    border: 2px solid var(--wc-wizard-border);
    border-radius: var(--wc-wizard-card-radius);
    padding: var(--wc-wizard-card-padding);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    min-height: 100%;
    /* Ensure equal height in flex row */
    overflow: visible !important;
}

/* Specific Sizes */
.wc-card-size-small .wc-options-grid .wc-option-card {
    width: calc((100% - 60px) / 4);
    /* 4 cols, 3 gaps */
    flex: 0 0 auto;
}

.wc-card-size-medium .wc-options-grid .wc-option-card {
    width: calc((100% - 40px) / 3);
    /* 3 cols, 2 gaps */
    flex: 0 0 auto;
}

.wc-card-size-large .wc-options-grid .wc-option-card {
    width: calc((100% - 20px) / 2);
    /* 2 cols, 1 gap */
    flex: 0 0 auto;
}

.wc-option-card:hover,
.wc-option-card.wc-tooltip-active {
    border-color: var(--wc-wizard-primary);
    transform: translateY(-2px);
    box-shadow: var(--wc-wizard-shadow);
    z-index: 1000;
    /* Ensure it stays above other cards */
}

.wc-option-card-description {
    width: 100%;
    margin-bottom: 25px;
}

/* Structured Description Items */
.wc-option-card .wc-description-items {
    list-style: none !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
}

.wc-option-card .wc-description-item {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: var(--wc-wizard-font-size-desc-item, 14px);
    color: var(--wc-wizard-color-desc-item-text, #1f2937);
    line-height: 1.4 !important;
    text-align: left !important;
    justify-content: flex-start !important;
}

.wc-desc-item-icon-container {
    width: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    min-width: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-desc-item-icon-img {
    width: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    height: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

.wc-desc-item-icon {
    width: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    height: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--wc-wizard-color-desc-item-icon, #6366f1);
    flex-shrink: 0 !important;
    font-size: var(--wc-wizard-desc-item-icon-size, 26px) !important;
    line-height: 1 !important;
}

.wc-desc-item-content {
    flex: 1 !important;
    min-width: 0 !important;
    text-align: left !important;
    line-height: 1.4 !important;
}

.wc-desc-tooltip-text-trigger {
    text-decoration: none !important;
    cursor: help;
    display: inline-block !important;
    /* Positioning context for tooltip */
    position: relative !important;
    background: none !important;
    color: inherit !important;
}

/* Tooltip positioning relative to trigger text */
.wc-desc-tooltip-text-trigger .wc-tooltip {
    bottom: calc(100% + 12px) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.wc-desc-tooltip-text-trigger .wc-tooltip::after {
    top: 100% !important;
    bottom: auto !important;
    border-top-color: rgba(31, 41, 55, 0.95) !important;
    border-bottom-color: transparent !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Hide old tooltip button if it still exists in DOM */
.wc-desc-tooltip-trigger {
    display: none !important;
}

.wc-option-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0;
}

.wc-checkbox-circle {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--wc-wizard-border);
    background: white;
    transition: all 0.2s;
}

/* Base style for divider (overridden by inline CSS) */
.wc-option-divider {
    display: none;
    width: 100%;
    border: none;
    margin: 15px 0;
}

.wc-option-card.selected .wc-checkbox-circle {
    background: var(--wc-wizard-primary);
    border-color: var(--wc-wizard-primary);
}

.wc-option-card.selected .wc-checkbox-circle::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

.wc-option-card.wc-option-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-option-title {
    font-weight: var(--wc-wizard-font-weight-header, 700);
    margin-bottom: 8px;
    font-size: var(--wc-wizard-font-size-card-title);
    color: var(--wc-wizard-text);
    position: relative;
    width: 100%;
}

.wc-option-short-desc {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    margin: 5px 0 10px 0;
    font-style: italic;
}

.wc-option-desc {
    font-size: var(--wc-wizard-font-size-base);
    font-weight: var(--wc-wizard-font-weight-body, 400);
    color: var(--wc-wizard-text-light);
    margin-bottom: 16px;
    line-height: 1.4;
    text-align: left;
    max-height: 120px;
    height: auto !important;
    flex: none !important;
    overflow-y: auto;
    padding-right: 8px;
    width: 100%;
    white-space: pre-line;
}

/* Expanded Description Mode */
.wc-desc-expand .wc-option-desc {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
}

.wc-option-price {
    background: #f9fafb;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: var(--wc-wizard-font-weight-price, 700);
    color: var(--wc-wizard-primary);
    font-size: var(--wc-wizard-font-size-price);
    margin-top: auto;
    width: fit-content;
}

/* Tooltips */
.wc-tooltip-trigger {
    display: inline-flex;
    position: absolute;
    top: 15px;
    left: 15px;
    width: 20px;
    height: 20px;
    background: var(--wc-wizard-primary);
    color: white;
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

.wc-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.95);
    color: white;
    background: rgba(31, 41, 55, 0.95);
    color: white;
    padding: var(--wc-wizard-tooltip-padding);
    border-radius: var(--wc-wizard-tooltip-radius);
    font-size: var(--wc-wizard-tooltip-font-size);
    line-height: 1.5;
    max-width: var(--wc-wizard-tooltip-width);
    width: var(--wc-wizard-tooltip-width);
    /* Force width to ensure overflow */
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: left;
    white-space: pre-line;
}

.wc-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(31, 41, 55, 0.95);
}

.wc-tooltip.active {
    opacity: 1;
    pointer-events: auto;
}

/* Bottom positioning (default) */
.wc-tooltip-bottom .wc-tooltip,
.wc-tooltip {
    /* Default fallback */
    top: calc(100% + 12px);
    bottom: auto;
}

.wc-tooltip-bottom .wc-tooltip::after,
.wc-tooltip::after {
    /* Default fallback */
    bottom: 100%;
    top: auto;
    border-bottom-color: rgba(31, 41, 55, 0.95);
    border-top-color: transparent;
}

/* Top positioning */
.wc-tooltip-top .wc-tooltip {
    bottom: calc(100% + 12px);
    top: auto;
}

.wc-tooltip-top .wc-tooltip::after {
    top: 100%;
    bottom: auto;
    border-top-color: rgba(31, 41, 55, 0.95);
    border-bottom-color: transparent;
}

.wc-tooltip strong {
    font-weight: 700;
    color: var(--wc-wizard-tooltip-bold, #fbbf24);
}

.wc-tooltip em {
    font-style: italic;
    color: var(--wc-wizard-tooltip-italic, #cbd5e1);
}


.wc-wizard-footer {
    padding: var(--wc-wizard-container-padding);
    border-top: 1px solid var(--wc-wizard-border);
    background: #fff;
    border-bottom-left-radius: var(--wc-wizard-radius);
    border-bottom-right-radius: var(--wc-wizard-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.wc-discount-info {
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    text-align: center;
    width: 100%;
    order: -1;
    margin-bottom: 5px;
}

.wc-btn {
    padding: var(--wc-wizard-btn-padding-y, 12px) var(--wc-wizard-btn-padding-x, 24px);
    border-radius: var(--wc-wizard-btn-radius, 8px);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: var(--wc-wizard-btn-font-size, 16px);
}

.wc-btn-secondary {
    background: var(--wc-wizard-btn-secondary-bg, white);
    border: 1px solid var(--wc-wizard-btn-secondary-border, #e5e7eb);
    color: var(--wc-wizard-btn-secondary-text, #1f2937);
}

.wc-btn-primary {
    background: var(--wc-wizard-primary);
    color: white;
}

.wc-btn-primary:hover {
    background: var(--wc-wizard-primary-hover);
}

.woocommerce-page a.button:hover::after {
    content: none !important;
    opacity: 0 !important;
    margin-left: 0 !important;
}

/* Sidebar Layout Styles (App-style) */
@media (min-width: 1025px) {
    .wc-layout-sidebar {
        flex-direction: row !important;
        align-items: stretch !important;
        background: #fff;
        max-width: 1200px !important;
        /* Wider for sidebar layout */
    }

    .wc-layout-sidebar .wc-wizard-header {
        width: 280px;
        /* Slightly narrower sidebar */
        flex: 0 0 280px;
        border-bottom: none;
        border-right: 1px solid var(--wc-wizard-border);
        background: #f8fafc;
        padding: 40px 25px;
        position: sticky;
        top: 0;
        height: auto;
        /* Manual rounding for corners */
        border-top-left-radius: var(--wc-wizard-radius, 12px);
        border-bottom-left-radius: var(--wc-wizard-radius, 12px);
        border-top-right-radius: 0;
    }

    .wc-layout-sidebar .wc-progress-bar {
        flex-direction: column;
        justify-content: flex-start;
        gap: 25px;
        height: 100%;
        margin: 0;
    }

    .wc-layout-sidebar .wc-step-indicator {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        text-align: left;
        flex: none;
        padding: 0;
        width: 100%;
    }

    .wc-layout-sidebar .wc-step-label {
        font-size: 0.95rem;
        font-weight: 500;
        margin-top: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wc-layout-sidebar .wc-step-indicator::after {
        display: none !important;
    }

    /* Vertical line for sidebar */
    .wc-layout-sidebar .wc-step-indicator:not(:last-child)::before {
        content: '';
        position: absolute;
        left: calc(var(--wc-wizard-progress-circle-size, 32px) / 2);
        top: calc(var(--wc-wizard-progress-circle-size, 32px) + 5px);
        bottom: -20px;
        width: var(--wc-wizard-progress-line-height, 3px);
        background: var(--wc-wizard-progress-line-color, #e5e7eb);
        z-index: 1;
        transform: translateX(-50%);
    }

    .wc-layout-sidebar .wc-step-indicator.completed:not(:last-child)::before,
    .wc-layout-sidebar .wc-step-indicator.active:not(:last-child)::before {
        background: var(--wc-wizard-primary);
    }

    .wc-layout-sidebar .wc-step-indicator.completed:not(:last-child)::before {
        background: var(--wc-wizard-completed, #10b981);
    }

    .wc-layout-sidebar .wc-wizard-main-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        background: #fff;
        /* Manual rounding for right corners */
        border-top-right-radius: var(--wc-wizard-radius, 12px);
        border-bottom-right-radius: var(--wc-wizard-radius, 12px);
        overflow: visible;
    }

    .wc-layout-sidebar .wc-wizard-content {
        flex: 1;
        padding: 40px;
        overflow: visible !important;
        /* allow tooltips to overflow panels */
        border-top-right-radius: var(--wc-wizard-radius, 12px);
    }

    .wc-layout-sidebar .wc-wizard-footer {
        margin-top: auto;
        border-top: 1px solid var(--wc-wizard-border);
        padding: 25px 40px;
        border-bottom-right-radius: var(--wc-wizard-radius, 12px);
        border-bottom-left-radius: 0;
        /* Sidebar is on the left */
    }
}

/* Responsive - Tablets and below */
@media (max-width: 1024px) {
    .wc-wizard-container {
        margin: 20px auto;
    }

    .wc-step-label {
        font-size: 0.75rem;
    }

    .wc-step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .wc-card-size-small .wc-options-grid .wc-option-card,
    .wc-card-size-medium .wc-options-grid .wc-option-card,
    .wc-card-size-large .wc-options-grid .wc-option-card {
        width: 100%;
        flex: 0 0 100%;
    }

    /* Mobile Layout Override: 2 Columns if enabled - Higher specificity */
    .wc-wizard-container.wc-mobile-two-col.wc-card-size-small .wc-options-grid .wc-option-card,
    .wc-wizard-container.wc-mobile-two-col.wc-card-size-medium .wc-options-grid .wc-option-card,
    .wc-wizard-container.wc-mobile-two-col.wc-card-size-large .wc-options-grid .wc-option-card {
        width: calc(50% - 10px) !important;
        flex: 0 0 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
    }

    .wc-wizard-container.wc-mobile-two-col .wc-option-card img {
        width: 50px;
        height: 50px;
    }

    .wc-wizard-footer {
        flex-direction: column;
    }

    .wc-nav-buttons,
    .wc-btn {
        width: 100%;
    }

    .wc-btn-skip {
        order: -1;
    }
}

@media (max-width: 480px) {
    .wc-step-label {
        display: none;
    }

    .wc-step-indicator:not(:last-child)::after {
        top: 13px;
        /* Adjust for smaller circle 26px/2 */
    }

    .wc-step-circle {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
}