/*
 * Nasekarty Product Designer - Unified Configurator Styles
 * Single source of truth for all configurator UI components
 * Modern design system with consistent spacing, colors, and styling
 */

/* ===== DESIGN SYSTEM VARIABLES ===== */
:root {
    /* Colors - Modern & Consistent */
    --npd-color-primary: #3b82f6;
    --npd-color-primary-dark: #2563eb;
    --npd-color-success: #10b981;
    --npd-color-success-dark: #059669;
    --npd-color-warning: #f59e0b;
    --npd-color-danger: #dc2626;

    /* Neutral Colors */
    --npd-color-white: #ffffff;
    --npd-color-gray-50: #f8fafc;
    --npd-color-gray-100: #f1f5f9;
    --npd-color-gray-200: #e2e8f0;
    --npd-color-gray-300: #cbd5e1;
    --npd-color-gray-400: #94a3b8;
    --npd-color-gray-500: #64748b;
    --npd-color-gray-600: #475569;
    --npd-color-gray-700: #334155;
    --npd-color-gray-800: #1e293b;
    --npd-color-gray-900: #0f172a;

    /* Spacing */
    --npd-spacing-xs: 4px;   /* 4px */
    --npd-spacing-sm: 8px;    /* 8px */
    --npd-spacing-md: 16px;      /* 16px */
    --npd-spacing-lg: 24px;    /* 24px */
    --npd-spacing-xl: 32px;      /* 32px */
    --npd-spacing-2xl: 48px;     /* 48px */

    /* Border Radius - Consistent System */
    --npd-radius-sm: 4px;
    --npd-radius-md: 8px;
    --npd-radius-lg: 12px;
    --npd-radius-xl: 16px;
    --npd-radius-full: 50%;

    /* Shadows */
    --npd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --npd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --npd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --npd-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --npd-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --npd-font-size-sm: 14px;
    --npd-font-size-base: 16px;
    --npd-font-size-lg: 18px;
    --npd-font-size-xl: 20px;
    --npd-font-size-2xl: 24px;
    --npd-font-size-3xl: 30px;
}

/* ===== MAIN CONFIGURATOR CONTAINER ===== */
/* Targeted CSS reset - neutralise common theme overrides without
   breaking CSS custom-property inheritance (all:initial would do that). */
.npd-configurator-wrapper {
    /* Layout */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 1200px;
    width: 100%;
    min-height: 600px;
    padding: 0;
    margin: 24px auto;
    overflow: hidden;

    /* Typography - hardcoded, no inheritance from theme */
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: normal;
    word-spacing: normal;
    text-align: left;
    text-transform: none;
    text-decoration: none;
    text-indent: 0;
    white-space: normal;
    color: #1e293b;

    /* Visual - hardcoded */
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    outline: none;
    list-style: none;

    /* Prevent theme transforms / filters leaking in */
    transform: none;
    filter: none;
    opacity: 1;
    visibility: visible;
}

.npd-configurator-wrapper *,
.npd-configurator-wrapper *::before,
.npd-configurator-wrapper *::after {
    box-sizing: border-box;
}

/* Element-level reset - hardcoded production values, no inherit */
.npd-configurator-wrapper button,
.npd-configurator-wrapper input,
.npd-configurator-wrapper select,
.npd-configurator-wrapper textarea {
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    color: #1e293b;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    vertical-align: middle;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}

/* Restore native appearance for checkbox and radio inputs */
.npd-configurator-wrapper input[type="checkbox"],
.npd-configurator-wrapper input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
    border: initial;
    background: initial;
}

/* Prevent theme hover/focus styles from leaking into configurator buttons.
   Specificity (0,2,1) matches .elementor-kit-1006 button:hover and wins by
   source order.  Component-level rules (.npd-mobile-label:hover etc.) at
   (0,3,0) still override this reset. */
.npd-configurator-wrapper button:hover,
.npd-configurator-wrapper button:focus,
.npd-configurator-wrapper button:active {
    background: none;
    color: #1e293b;
    border: none;
    outline: none;
    box-shadow: none;
    text-shadow: none;
}
.npd-configurator-wrapper button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.npd-configurator-wrapper a,
.npd-configurator-wrapper a:hover,
.npd-configurator-wrapper a:focus,
.npd-configurator-wrapper a:active,
.npd-configurator-wrapper a:visited {
    color: #1e293b;
    text-decoration: none;
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
}

.npd-configurator-wrapper svg {
    display: inline-block;
    vertical-align: middle;
}

.npd-configurator-wrapper h1,
.npd-configurator-wrapper h2,
.npd-configurator-wrapper h3,
.npd-configurator-wrapper h4,
.npd-configurator-wrapper h5,
.npd-configurator-wrapper h6 {
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    margin: 0;
    padding: 0;
    letter-spacing: normal;
    text-transform: none;
}

.npd-configurator-wrapper p {
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #334155;
    margin: 0;
    padding: 0;
}

/* ===== STEP NAVIGATION ===== */
.npd-configurator-wrapper .npd-step-nav{
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
    background: linear-gradient(to bottom, #fafbfc, #f8fafc);
    border-bottom: 1px solid #e2e8f0;
    gap: 0;
}

.npd-configurator-wrapper .npd-step{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.npd-configurator-wrapper .npd-step-circle{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.npd-configurator-wrapper .npd-step-number{
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.npd-configurator-wrapper .npd-step-checkmark{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    color: #ffffff;
    display: none;
}

.npd-configurator-wrapper .npd-step-label{
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    max-width: 120px;
    line-height: 1.3;
    white-space: nowrap;
}

/* Step Connector Lines */
.npd-configurator-wrapper .npd-step-connector{
    flex: 1;
    height: 3px;
    background: #cbd5e1;
    margin: 0 -8px;
    margin-bottom: 36px;
    max-width: 120px;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-top: 22px;
}

/* Active Step */
.npd-configurator-wrapper .npd-step.active .npd-step-circle{
    background: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transform: scale(1.05);
}

.npd-configurator-wrapper .npd-step.active .npd-step-label{
    color: #3b82f6;
    font-weight: 700;
}

/* Completed Step */
.npd-configurator-wrapper .npd-step.completed .npd-step-circle{
    background: #3b82f6;
}

.npd-configurator-wrapper .npd-step.completed .npd-step-number{
    display: none;
}

.npd-configurator-wrapper .npd-step.completed .npd-step-checkmark{
    display: block;
}

.npd-configurator-wrapper .npd-step.completed .npd-step-label{
    color: #334155;
}

/* Completed Connector */
.npd-configurator-wrapper .npd-step.completed + .npd-step-connector{
    background: #3b82f6;
}

/* Disabled/Future Step */
.npd-configurator-wrapper .npd-step.disabled .npd-step-circle{
    background: #cbd5e1;
    cursor: not-allowed;
}

.npd-configurator-wrapper .npd-step.disabled .npd-step-label{
    color: #94a3b8;
}

.npd-configurator-wrapper .npd-step.disabled{
    cursor: not-allowed;
    pointer-events: none;
}

/* Hover Effects */
.npd-configurator-wrapper .npd-step:not(.disabled):hover .npd-step-circle{
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== STEP CONTENT CONTAINER ===== */
.npd-configurator-wrapper .npd-steps-container{
    flex-grow: 1;
    position: relative;
}

.npd-configurator-wrapper .npd-step-content{
    display: none;
    padding: 32px;
    min-height: 500px;
    animation: fadeIn 0.3s ease-in-out;
}

.npd-configurator-wrapper .npd-step-content.active{
    display: block;
}


/* ===== STEP 1: DESIGN SELECTION ===== */
/* Step heading spacing */
.npd-configurator-wrapper .npd-step-content h2,
.npd-configurator-wrapper .npd-step-content .step-title,
.npd-configurator-wrapper .npd-step-content h1{
    margin: 0 0 40px 0;
    padding: 30px 0 20px 0;
    text-align: center;
}

.npd-configurator-wrapper .npd-designs-grid{
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 30px auto;
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    justify-content: center;
    align-items: stretch;
}


.npd-configurator-wrapper .npd-design-option,
.npd-configurator-wrapper .npd-design-card{
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px; /* Fixed minimum height for consistent card sizes */
}

.npd-configurator-wrapper .npd-design-option:hover,
.npd-configurator-wrapper .npd-design-card:hover{
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.npd-configurator-wrapper .npd-design-option.selected,
.npd-configurator-wrapper .npd-design-card.selected{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.npd-configurator-wrapper .npd-design-preview,
.npd-configurator-wrapper .npd-design-image{
    aspect-ratio: 3/4;
    background: #f1f5f9;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    display: block;
    overflow: hidden;
    position: relative;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.npd-configurator-wrapper .npd-design-preview img,
.npd-configurator-wrapper .npd-design-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 12px 12px 0 0;
}

.npd-configurator-wrapper .npd-design-image .npd-front-image{
    position: relative;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.npd-configurator-wrapper .npd-design-image .npd-featured-image{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    object-fit: cover;
}

/* Show featured image on hover over the product card */
.npd-configurator-wrapper .npd-design-card:hover .npd-design-image .npd-front-image,
.npd-configurator-wrapper .npd-design-option:hover .npd-design-image .npd-front-image{
    opacity: 0;
}

.npd-configurator-wrapper .npd-design-card:hover .npd-design-image .npd-featured-image,
.npd-configurator-wrapper .npd-design-option:hover .npd-design-image .npd-featured-image{
    opacity: 1;
}

/* Text area padding for design cards */
.npd-configurator-wrapper .npd-design-info{
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow info section to grow and push content to edges */
    justify-content: space-between;
}

.npd-configurator-wrapper .npd-design-title{
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.npd-configurator-wrapper .npd-design-description,
.npd-configurator-wrapper .npd-design-subtitle{
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 12px;
    min-height: 2.5em; /* Reserve space for 2 lines of text */
}

.npd-configurator-wrapper .npd-design-details{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin: 0;
}

.npd-configurator-wrapper .npd-design-count{
    color: #475569;
}

.npd-configurator-wrapper .npd-design-price,
.npd-configurator-wrapper .price{
    font-weight: 700;
    color: #00A86B !important;
    font-size: 20px;
    display: block;
    margin: 0;
}

/* ===== STEP 2: PACKAGE CUSTOMIZATION ===== */

/* Step 2 header spacing - consistent with Step 1 */
.npd-configurator-wrapper .npd-step-content[data-step="2"] h2{
    margin: 0 0 40px 0;
    padding: 30px 0 20px 0;
    text-align: center;
}

.npd-configurator-wrapper .npd-step-content[data-step="2"] p{
    margin: 0;
    text-align: center;
    color: #475569;
}

/* Main package customization container */
.npd-configurator-wrapper .npd-package-customization{
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Preview Section */
.npd-configurator-wrapper .preview-section{
    text-align: center;
}

/* Removed preview-section h3 styles since h3 was removed from HTML */

.npd-configurator-wrapper .npd-package-preview-container{
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: inline-block;
}

.npd-configurator-wrapper .package-preview-img{
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.npd-configurator-wrapper .package-text-overlay{
    position: absolute;
    color: #1e293b;
    font-weight: 600;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Default positioning - will be overridden by JavaScript */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: auto;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    /* Ensure text doesn't overflow the container */
    box-sizing: border-box;
}

/* Input Section */
.npd-configurator-wrapper .input-section{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.npd-configurator-wrapper .input-section label{
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.npd-configurator-wrapper .input-section .npd-input{
    font-size: 16px;
    padding: 12px 16px;
}

/* Font Selection Section */
.npd-configurator-wrapper .fonts-section{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.npd-configurator-wrapper .fonts-section label{
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.npd-configurator-wrapper .font-selection-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.npd-configurator-wrapper .font-option{
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
}

.npd-configurator-wrapper .font-option:hover{
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.npd-configurator-wrapper .font-option.selected,
.npd-configurator-wrapper .font-option.active{
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Individual font families - Google Fonts */
.npd-configurator-wrapper .font-option[data-font="Montserrat"]{ font-family: 'Montserrat', sans-serif; }
.npd-configurator-wrapper .font-option[data-font="Parisienne"]{ font-family: 'Parisienne', cursive; }
.npd-configurator-wrapper .font-option[data-font="Playfair Display"]{ font-family: 'Playfair Display', serif; }
.npd-configurator-wrapper .font-option[data-font="Mynerve"]{ font-family: 'Mynerve', cursive; }
.npd-configurator-wrapper .font-option[data-font="Roboto Condensed"]{ font-family: 'Roboto Condensed', sans-serif; }
.npd-configurator-wrapper .font-option[data-font="Story Script"]{ font-family: 'Story Script', cursive; }

/* Responsive design for package customization */
/* Note: Step 2 specific mobile layout is handled in the 800px media query below */
@media (max-width: 768px) {
    /* Font selection grid - applies to all contexts */
    .npd-configurator-wrapper .font-selection-grid{
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .npd-configurator-wrapper .font-option{
        padding: 16px 12px;
        font-size: 14px;
        min-height: 68px;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .npd-configurator-wrapper .npd-card-editor,
    .npd-configurator-wrapper .card-placeholder,
    .npd-configurator-wrapper .card-item{
        aspect-ratio: 2.5 / 3.5; /* Maintain playing card ratio */
        width: 100%;
        height: auto;
    }
}

/* ===== STEP 3: IMAGE UPLOAD ===== */
/* Step 3 title spacing */
.npd-configurator-wrapper .npd-step-content[data-step="3"] h2,
.npd-configurator-wrapper .npd-step-content[data-step="3"] .step-title{
    margin: 0 0 30px 0;
    text-align: center;
}

/* Instructions spacing */
.npd-configurator-wrapper .npd-step-content[data-step="3"] p,
.npd-configurator-wrapper .npd-step-content[data-step="3"] .instructions{
    margin: 30px 0;
    text-align: center;
    color: #475569;
}

.npd-configurator-wrapper .npd-upload-area,
.npd-configurator-wrapper .upload-box,
.npd-configurator-wrapper #bulk-upload-area{
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    background: #f8fafc;
    margin: 40px auto;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 600px;
    position: relative;
}

.npd-configurator-wrapper .npd-upload-area:hover,
.npd-configurator-wrapper .upload-box:hover,
.npd-configurator-wrapper #bulk-upload-area:hover{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.npd-configurator-wrapper .npd-upload-area.dragover,
.npd-configurator-wrapper .upload-box.dragover,
.npd-configurator-wrapper #bulk-upload-area.dragover{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.npd-configurator-wrapper .npd-upload-icon,
.npd-configurator-wrapper .upload-icon{
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 16px;
    display: block;
    text-align: center;
}

/* Skip button styling */
.npd-configurator-wrapper #skip-bulk-upload,
.npd-configurator-wrapper .skip-button{
    background: #e2e8f0;
    color: #334155;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.npd-configurator-wrapper #skip-bulk-upload:hover,
.npd-configurator-wrapper .skip-button:hover{
    background: #cbd5e1;
    transform: translateY(-1px);
}

.npd-configurator-wrapper .npd-uploaded-images{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.npd-configurator-wrapper .npd-uploaded-image{
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.npd-configurator-wrapper .npd-uploaded-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npd-configurator-wrapper .npd-image-remove{
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.npd-configurator-wrapper .npd-image-remove:hover{
    background: #b91c1c;
    transform: scale(1.1);
}

/* ===== STEP 4: CARD CONFIGURATION ===== */
.npd-configurator-wrapper .npd-cards-grid,
.npd-configurator-wrapper .card-grid,
.npd-configurator-wrapper #card-configurator-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Default: 2 columns for small screens */
    gap: 16px;
    margin-top: 24px;
    width: 100%;
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
    justify-items: stretch;
    justify-content: center;
    overflow: visible; /* Ensure container allows overflow */
}

/* Mobile: 1 column */
@media (max-width: 480px) {
    .npd-configurator-wrapper .npd-cards-grid,
    .npd-configurator-wrapper .card-grid,
    .npd-configurator-wrapper #card-configurator-grid{
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px;
    }
}

/* Small tablets: 2 columns */
@media (min-width: 481px) and (max-width: 768px) {
    .npd-configurator-wrapper .npd-cards-grid,
    .npd-configurator-wrapper .card-grid,
    .npd-configurator-wrapper #card-configurator-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 15px;
    }
}

/* Tablets: 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .npd-configurator-wrapper .npd-cards-grid,
    .npd-configurator-wrapper .card-grid,
    .npd-configurator-wrapper #card-configurator-grid{
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 15px;
        max-width: 100%;
    }
}

/* Desktop: 4 columns */
@media (min-width: 1025px) and (max-width: 1440px) {
    .npd-configurator-wrapper .npd-cards-grid,
    .npd-configurator-wrapper .card-grid,
    .npd-configurator-wrapper #card-configurator-grid{
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 20px;
        max-width: 100%;
    }
}

/* Large desktop: 5 columns */
@media (min-width: 1441px) {
    .npd-configurator-wrapper .npd-cards-grid,
    .npd-configurator-wrapper .card-grid,
    .npd-configurator-wrapper #card-configurator-grid{
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
        padding: 20px;
        max-width: 1800px;
    }
}

.npd-configurator-wrapper .npd-card-editor,
.npd-configurator-wrapper .card-placeholder{
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Dynamic sizing based on container width */
    min-width: 300px;
    width: 100%;
    min-height: 400px; /* 300px * 4/3 for aspect ratio */
}

.npd-configurator-wrapper .npd-card-editor:hover,
.npd-configurator-wrapper .card-placeholder:hover{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
}

.npd-configurator-wrapper .npd-card-preview{
    aspect-ratio: 3/4;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.npd-configurator-wrapper .npd-card-number{
    position: absolute;
    top: 8px;
    left: 8px;
    background: #3b82f6;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.npd-configurator-wrapper .npd-card-controls{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Upload placeholders styling */
.npd-configurator-wrapper .upload-placeholder,
.npd-configurator-wrapper .card-upload-icon{
    font-size: 24px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.npd-configurator-wrapper .upload-placeholder-text{
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.npd-configurator-wrapper .npd-input{
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: normal;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.npd-configurator-wrapper .npd-input:focus{
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

/* ===== BUTTONS ===== */
.npd-configurator-wrapper .npd-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: normal;
}

.npd-configurator-wrapper .npd-btn-primary{
    background: #3b82f6;
    color: #ffffff;
}

.npd-configurator-wrapper .npd-btn-primary:hover{
    background: #2563eb;
    transform: translateY(-1px);
}

.npd-configurator-wrapper .npd-btn-secondary{
    background: #e2e8f0;
    color: #334155;
}

.npd-configurator-wrapper .npd-btn-secondary:hover{
    background: #cbd5e1;
}

.npd-configurator-wrapper .npd-btn-success{
    background: #10b981;
    color: #ffffff;
}

.npd-configurator-wrapper .npd-btn-success:hover{
    background: #059669;
    transform: translateY(-1px);
}

/* ===== NAVIGATION BUTTONS ===== */
.npd-configurator-wrapper .npd-navigation-buttons,
.npd-configurator-wrapper .footer-navigation{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    position: relative;
}

/* Add to Cart button positioning */
.npd-configurator-wrapper #add-to-cart,
.npd-configurator-wrapper .add-to-cart-btn{
    background: #00A86B !important;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}

.npd-configurator-wrapper #add-to-cart:hover,
.npd-configurator-wrapper .add-to-cart-btn:hover{
    background: #008f5a !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 168, 107, 0.4);
}

/* Step indicator removed - using top navigation only */

/* Skip button styling */
.npd-configurator-wrapper #skip-bulk-upload{
    background-color: #e2e8f0;
    color: #334155;
    padding: 8px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
}

.npd-configurator-wrapper #skip-bulk-upload:hover{
    background-color: #cbd5e1;
}

/* ===== LOADING STATES ===== */
.npd-configurator-wrapper .npd-loading{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #64748b;
    font-size: 18px;
}

.npd-configurator-wrapper .npd-spinner{
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}


/* ===== RESPONSIVE DESIGN ===== */

/* Tablet & phones: 2x2 grid layout */
@media (max-width: 1024px) and (min-width: 501px) {
    .npd-configurator-wrapper .npd-step-nav{
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 16px 24px;
        padding: 24px;
        justify-items: center;
    }

    .npd-configurator-wrapper .npd-step{
        width: 100%;
        max-width: 200px;
        justify-self: center;
    }

    .npd-configurator-wrapper .npd-step-connector{
        display: none;
    }

    .npd-configurator-wrapper .npd-step-label{
        white-space: normal;
    }
}

/* Tablet content layout adjustments (768px and below) */
@media (max-width: 768px) {
    .npd-configurator-wrapper {
        margin: 8px auto;
        border-radius: 8px;
    }

    /* Mobile card grid - single column with proper card aspect ratio */
    .npd-configurator-wrapper .card-grid{
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 10px !important;
    }

    .npd-configurator-wrapper .card-item{
        width: 100% !important;
        aspect-ratio: 2.5 / 3.5; /* Default - dynamically overridden by JS */
        height: auto !important;
        border-radius: 8px !important;
        margin: 0 auto !important;
        min-height: unset !important;
        max-height: unset !important;
        max-width: 85vw !important;
    }

    .npd-configurator-wrapper .npd-step-content{
        padding: 24px;
    }


    .npd-configurator-wrapper .npd-package-options{
        grid-template-columns: 1fr;
    }

    .npd-configurator-wrapper .npd-cards-grid{
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .npd-configurator-wrapper .npd-navigation-buttons{
        flex-direction: column;
        gap: 8px;
    }
}

/* Small mobile: vertical step list layout */
@media (max-width: 500px) {
    .npd-configurator-wrapper .npd-step-nav{
        flex-direction: column;
        padding: 24px 8px;
        gap: 0;
        align-items: stretch;
    }

    .npd-configurator-wrapper .npd-step{
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        padding: 10px 8px;
    }

    .npd-configurator-wrapper .npd-step-circle{
        width: 40px;
        height: 40px;
        border-width: 2px;
        flex-shrink: 0;
    }

    .npd-configurator-wrapper .npd-step-number{
        font-size: 15px;
    }

    .npd-configurator-wrapper .npd-step-checkmark{
        width: 20px;
        height: 20px;
    }

    .npd-configurator-wrapper .npd-step-label{
        font-size: 14px;
        max-width: none;
        text-align: left;
        white-space: normal;
        flex: 1;
    }

    .npd-configurator-wrapper .npd-step-connector{
        display: none;
    }
}

@media (max-width: 480px) {
    .npd-configurator-wrapper .npd-step-content{
        padding: 16px;
    }

    .npd-configurator-wrapper .npd-upload-area{
        padding: 24px;
    }

    .npd-configurator-wrapper .npd-cards-grid{
        grid-template-columns: 1fr;
    }
}

/* Card wrapper - contains both card and buttons */
.npd-configurator-wrapper .card-wrapper{
    position: relative;
    padding: 20px; /* Padding to prevent control buttons from hiding card content */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    overflow: visible; /* Ensure buttons are always visible */
}

/* Card items generated by JavaScript */
.npd-configurator-wrapper .card-item{
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    aspect-ratio: 2.5 / 3.5; /* Default aspect ratio - dynamically overridden by JS based on template image */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100% !important;
    height: auto !important; /* Override any theme height constraints */
    overflow: hidden; /* Prevent images from bleeding outside card boundaries */
}

.npd-configurator-wrapper .card-item:hover{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
}

/* Desktop-specific card sizing - make cards bigger */
@media (min-width: 769px) {
    .npd-configurator-wrapper .card-item{
        min-width: 240px !important; /* Minimum card width on desktop */
        max-width: 300px !important; /* Maximum card width to keep reasonable size */
        height: auto !important; /* Ensure height is auto on desktop */
    }
}

@media (min-width: 1200px) {
    .npd-configurator-wrapper .card-item{
        min-width: 260px !important; /* Slightly bigger on large screens */
        max-width: 320px !important;
        height: auto !important; /* Ensure height is auto on desktop */
    }
}

/* Enhanced upload placeholder styling */
.npd-configurator-wrapper .upload-icon-placeholder{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 14px;
    transition: all 0.3s ease;
}

.npd-configurator-wrapper .upload-icon-placeholder:hover{
    transform: scale(1.02);
    color: #2563eb;
}

/* User image manipulation styles */
.npd-configurator-wrapper .user-image-layer{
    position: relative; /* Ensure proper stacking context */
    z-index: 2 !important; /* Always behind template, never elevate */
}

/* Active manipulation handled by border overlay */

.npd-configurator-wrapper .user-image-layer:hover .image-border-overlay{
    opacity: 1 !important;
    border-color: #3b82f6 !important;
}

.npd-configurator-wrapper .user-image-layer.active-manipulation .image-border-overlay{
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Border overlay that shows above template */
.npd-configurator-wrapper .image-border-overlay{
    transition: all 0.2s ease;
}

/* Ensure control buttons are always on top */
.npd-configurator-wrapper .card-item .delete-icon-button,
.npd-configurator-wrapper .card-item .resize-handle,
.npd-configurator-wrapper .card-item .rotate-handle{
    z-index: 30 !important; /* Highest priority for controls */
}

/* Control button improvements */
.npd-configurator-wrapper .delete-icon-button:hover{
    background: rgba(239, 68, 68, 1) !important;
    transform: scale(1.1);
}

.npd-configurator-wrapper .rotate-handle:hover{
    background: rgba(34, 197, 94, 1) !important;
    transform: scale(1.1);
}

.npd-configurator-wrapper .resize-handle:hover{
    background: #2563eb !important;
    transform: scale(1.2);
}

.npd-configurator-wrapper .upload-icon-placeholder svg{
    margin-bottom: 8px;
}

.npd-configurator-wrapper .card-name-label{
    display: none !important; /* Hidden as not needed */
    line-height: 1.2;
}

.npd-configurator-wrapper .card-number{
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    z-index: 10;
}

/* Control buttons - always visible and accessible */
.npd-configurator-wrapper .image-controls-layer .resize-handle,
.npd-configurator-wrapper .image-controls-layer .rotate-handle,
.npd-configurator-wrapper .image-controls-layer .delete-icon-button{
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
}

/* Ensure controls are always on top */
.npd-configurator-wrapper .image-controls-layer{
    pointer-events: none;
    z-index: 10;
}

.npd-configurator-wrapper .image-controls-layer > *{
    pointer-events: auto;
}

/* Performance optimization for drag operations */
.npd-configurator-wrapper .user-image-layer.active-manipulation{
    transition: none !important;
}

.npd-configurator-wrapper .image-border-overlay{
    transition: opacity 0.2s ease;
}

/* Mobile touch optimization - minimal interference approach */
.npd-configurator-wrapper .resize-handle,
.npd-configurator-wrapper .rotate-handle,
.npd-configurator-wrapper .delete-icon-button{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Remove touch-action initially to test */
}

.npd-configurator-wrapper .user-image-layer{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Remove touch-action initially to test */
}

/* Prevent text selection and context menus during manipulation */
.npd-configurator-wrapper .user-image-layer.active-manipulation{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Gesture handling improvements */
.npd-configurator-wrapper .user-image-layer{
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

/* Smooth transitions for gestures */
.npd-configurator-wrapper .user-image-layer.active-manipulation{
    transition: none; /* Disable transitions during active manipulation */
}

/* Enhanced border feedback for gestures */
.npd-configurator-wrapper .image-border-overlay{
    transition: border-color 0.2s ease, opacity 0.2s ease;
    border-style: dashed;
    border-width: 2px;
}

/* Visual feedback for different gesture types */
.npd-configurator-wrapper .user-image-layer.active-manipulation .image-border-overlay{
    opacity: 1;
}

/* Gesture instruction overlay (appears on first touch) */
.npd-configurator-wrapper .gesture-help{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
    white-space: nowrap;
}

.npd-configurator-wrapper .user-image-layer:hover .gesture-help{
    opacity: 1;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .npd-configurator-wrapper .user-image-layer{
        min-width: 44px; /* iOS minimum touch target */
        min-height: 44px;
    }
}

/* Prevent text selection during gestures */
.npd-configurator-wrapper .card-item.gesture-active{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Force touch-action none on gesture elements */
.npd-configurator-wrapper .user-image-layer{
    touch-action: none !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure control buttons are always clickable on all devices */
.npd-configurator-wrapper .delete-icon-button,
.npd-configurator-wrapper .resize-handle,
.npd-configurator-wrapper .rotate-handle{
    pointer-events: auto !important;
    z-index: 25 !important;
    position: absolute !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    transition: transform 0.2s ease, background-color 0.2s ease !important;
}

.npd-configurator-wrapper .delete-icon-button:hover{
    transform: scale(1.1) !important;
    background: rgba(239, 68, 68, 1) !important;
}

.npd-configurator-wrapper .resize-handle:hover{
    transform: scale(1.1) !important;
    background: #2563eb !important;
}

/* Resize slider styles */
.npd-configurator-wrapper .resize-slider-container{
    padding: 8px 0;
}

.npd-configurator-wrapper .resize-slider{
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.npd-configurator-wrapper .resize-slider:hover{
    background: #d1d5db;
}

.npd-configurator-wrapper .resize-slider::-webkit-slider-thumb{
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.npd-configurator-wrapper .resize-slider::-webkit-slider-thumb:hover{
    background: #2563eb;
    transform: scale(1.1);
}

.npd-configurator-wrapper .resize-slider::-moz-range-thumb{
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.npd-configurator-wrapper .resize-slider::-moz-range-thumb:hover{
    background: #2563eb;
    transform: scale(1.1);
}

.npd-configurator-wrapper .rotate-handle:hover{
    transform: scale(1.1) !important;
    background: rgba(34, 197, 94, 1) !important;
}

/* Buttons are now positioned directly on card container */
.npd-configurator-wrapper .card-item{
    position: relative !important;
}

/* Prevent scrolling on card items during gestures */
.npd-configurator-wrapper .card-item{
    touch-action: none !important;
}

/* Ensure step container allows scrolling only when not touching images */
.npd-configurator-wrapper .npd-step-content[data-step="4"]{
    touch-action: pan-y;
    overflow: visible !important; /* Allow buttons to overflow */
}

/* Override any other touch-action rules */
.npd-configurator-wrapper .user-image-layer,
.npd-configurator-wrapper .card-item,
.npd-configurator-wrapper .image-controls-layer{
    touch-action: none !important;
}

/* ===== ENHANCED MOBILE TOUCH SUPPORT ===== */

/* Touch-specific improvements for mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Remove excessive rounded corners and container styling on mobile */
    .npd-configurator-wrapper {
        border-radius: 8px !important;
        margin: 10px auto !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        overflow: visible !important; /* Allow buttons to overflow */
    }

    .npd-configurator-wrapper .npd-steps-container{
        border-radius: 0 !important;
    }

    .npd-configurator-wrapper .npd-step-content{
        border-radius: 0 !important;
        padding: 15px !important;
        overflow: visible !important; /* Allow buttons to overflow */
    }

    /* Step 4 specific mobile adjustments */
    .npd-configurator-wrapper .npd-step-content[data-step="4"]{
        padding: 10px !important;
        overflow: visible !important; /* Allow buttons to overflow */
    }
    /* Larger touch targets for control buttons on mobile */
    .npd-configurator-wrapper .delete-icon-button,
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .rotate-handle{
        width: 36px !important;
        height: 36px !important;
        border-width: 3px !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
        z-index: 20 !important;
        pointer-events: auto !important;
    }

                                        /* Position buttons in corners for mobile */
    .npd-configurator-wrapper .delete-icon-button{
        top: 4px !important;
        right: 4px !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* Hide resize handle, rotate buttons, and resize slider on mobile - only show delete */
    .npd-configurator-wrapper .rotate-handle,
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .resize-slider-container{
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Larger upload areas for easier touch interaction */
    .npd-configurator-wrapper .upload-icon-placeholder{
        border-width: 3px !important;
        min-height: 120px !important;
        padding: 20px !important;
    }

    .npd-configurator-wrapper .upload-icon-placeholder svg{
        width: 48px !important;
        height: 48px !important;
    }

    /* Enhanced visual feedback for touch */
    .npd-configurator-wrapper .card-item:active{
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .npd-configurator-wrapper .delete-icon-button:active{
        transform: scale(1.3) !important;
        background: rgba(239, 68, 68, 1) !important;
    }

    .npd-configurator-wrapper .resize-handle:active{
        transform: scale(1.3) !important;
        background: #1d4ed8 !important;
    }

    .npd-configurator-wrapper .rotate-handle:active{
        transform: scale(1.3) !important;
        background: rgba(34, 197, 94, 1) !important;
    }

    /* Touch helper text animation */
    .npd-configurator-wrapper .touch-helper{
        animation: slideInOut 2s ease-in-out;
        font-weight: 600;
        letter-spacing: 0.5px;
    }


    /* Enhanced border overlay for touch feedback */
    .npd-configurator-wrapper .image-border-overlay{
        border-width: 4px !important;
        border-style: solid;
        border-radius: 8px !important;
        transition: all 0.3s ease;
    }

    /* Ensure control buttons are always clickable */
    .npd-configurator-wrapper .delete-icon-button,
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .rotate-handle{
        pointer-events: auto !important;
        z-index: 25 !important;
        position: absolute !important;
        cursor: pointer !important;
    }

        /* User image layer should allow dragging but not interfere with buttons */
    .npd-configurator-wrapper .user-image-layer{
        pointer-events: auto !important;
        z-index: 10 !important;
    }

    /* Better visual feedback during manipulation */
    .npd-configurator-wrapper .user-image-layer.active-manipulation{
        z-index: 12 !important;
    }

    .npd-configurator-wrapper .user-image-layer.active-manipulation .image-border-overlay{
        opacity: 1 !important;
        animation: mobilePulse 1.5s infinite;
    }


    /* Enhanced gesture help for mobile */
    .npd-configurator-wrapper .gesture-help{
        font-size: 12px !important;
        padding: 6px 10px !important;
        bottom: -30px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        border-radius: 6px !important;
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    /* Mobile-specific step navigation improvements */
    .npd-configurator-wrapper .npd-step{
        min-height: 44px;
        padding: 8px 16px !important;
    }

    .npd-configurator-wrapper .npd-step-number{
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 16px !important;
    }

                         /* Mobile card grid - single column layout with card aspect ratio */
    .npd-configurator-wrapper .card-grid{
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    /* Mobile card wrapper - extra padding to accommodate control buttons */
    .npd-configurator-wrapper .card-wrapper{
        padding: 25px 20px !important;
    }

    /* Improved card items for mobile - proper playing card proportions */
    .npd-configurator-wrapper .card-item{
        width: 100% !important;
        aspect-ratio: 2.5 / 3.5; /* Default - dynamically overridden by JS */
        height: auto !important;
        min-width: unset !important;
        min-height: unset !important;
        max-height: unset !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        margin: 0 auto !important;
        max-width: 90vw !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .npd-configurator-wrapper .card-grid{
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 5px !important;
    }

    /* Extra padding for smallest devices */
    .npd-configurator-wrapper .card-wrapper{
        padding: 25px 15px !important;
    }

    .npd-configurator-wrapper .card-item{
        width: 100% !important;
        aspect-ratio: 2.5 / 3.5; /* Default - dynamically overridden by JS */
        height: auto !important;
        min-width: unset !important;
        min-height: unset !important;
        max-height: unset !important;
        max-width: 95vw !important;
    }

    .npd-configurator-wrapper .delete-icon-button,
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .rotate-handle{
        width: 32px !important;
        height: 32px !important;
    }

                                    .npd-configurator-wrapper .delete-icon-button{
        top: 3px !important;
        right: 3px !important;
        width: 38px !important;
        height: 38px !important;
    }

    /* Hide resize and rotate buttons and resize slider on small mobile - only show delete */
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .rotate-handle,
    .npd-configurator-wrapper .resize-slider-container{
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Ensure all control buttons are always visible and clickable (desktop default) */
.npd-configurator-wrapper .delete-icon-button,
.npd-configurator-wrapper .resize-handle,
.npd-configurator-wrapper .rotate-handle{
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

/* Hide resize and rotate buttons and resize slider on touchscreen devices (more specific targeting) */
@media (pointer: coarse) and (hover: none) {
    .npd-configurator-wrapper .resize-handle,
    .npd-configurator-wrapper .rotate-handle,
    .npd-configurator-wrapper .resize-slider-container{
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Ensure interactive elements work on all touch devices */
@media (pointer: coarse) {
    .npd-configurator-wrapper .delete-icon-button,
    .npd-configurator-wrapper .upload-icon-placeholder,
    .npd-configurator-wrapper .individual-upload-input{
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    /* Visual feedback for touch interactions */
    .npd-configurator-wrapper .delete-icon-button.button-pressed{
        transform: scale(0.95) !important;
        opacity: 0.8 !important;
    }

    .npd-configurator-wrapper .upload-icon-placeholder:active{
        transform: scale(0.98) !important;
        background: rgba(59, 130, 246, 0.15) !important;
    }
}

/* Ensure proper layering for image manipulation */
.npd-configurator-wrapper .card-template-overlay{
    pointer-events: none !important; /* Always allow clicks to pass through to user image below */
    z-index: 3 !important; /* Template on top */
}

.npd-configurator-wrapper .user-image-layer{
    z-index: 1 !important; /* User image behind template */
    pointer-events: auto !important; /* Allow dragging of user image */
    cursor: move !important;
}

.npd-configurator-wrapper .image-border-overlay{
    z-index: 5 !important; /* Border shows on top during manipulation */
    pointer-events: none !important; /* Don't interfere with dragging */
}

/* ===== PERFORMANCE OPTIMIZATIONS STYLES ===== */

/* Lazy loading placeholder animation */
.npd-configurator-wrapper .lazy-placeholder{
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.npd-configurator-wrapper .lazy-loaded .lazy-placeholder{
    opacity: 0 !important;
}

/* Smooth image fade-in when lazy loaded */
.npd-configurator-wrapper .user-image-layer{
    transition: background-color 0.3s ease;
}

.npd-configurator-wrapper .user-image-layer.lazy-loaded{
    animation: fadeInImage 0.3s ease;
}


/* Upload progress indicator styles are now inline in JS for better portability */

/* Smooth transitions for drag/resize operations */
.npd-configurator-wrapper .user-image-layer.active-manipulation{
    transition: none !important;
}

.npd-configurator-wrapper .user-image-layer:not(.active-manipulation){
    transition: transform 0.1s ease-out;
}

/* Performance hint for browser - promote to GPU layer */
.npd-configurator-wrapper .user-image-layer,
.npd-configurator-wrapper .card-template-overlay{
    will-change: transform, opacity;
    transform: translateZ(0); /* Force GPU acceleration */
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .npd-configurator-wrapper .user-image-layer,
    .npd-configurator-wrapper .lazy-placeholder{
        animation: none !important;
        transition: none !important;
    }
}

/* ===== STEP 2: PREDEFINED TEXT OPTIONS & DELIVERY ===== */

/* Package Customization Layout */
.npd-configurator-wrapper .npd-package-customization{
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Ensure flexbox is set for ordering to work */
.npd-configurator-wrapper #step2 .npd-package-customization,
.npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-package-customization{
    display: flex;
    flex-direction: column;
}


/* Package Preview Section - Compact */
.npd-configurator-wrapper .npd-package-preview-section{
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

.npd-configurator-wrapper .npd-package-preview-container{
    position: relative;
    max-width: 320px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.npd-configurator-wrapper .package-preview-img{
    display: block;
    width: 100%;
    height: auto;
}

.npd-configurator-wrapper .package-text-overlay{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    pointer-events: none;
}

/* Text Options Section */
.npd-configurator-wrapper .npd-text-options-section{
    margin-bottom: 24px;
}

.npd-configurator-wrapper .npd-section-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.npd-configurator-wrapper .npd-section-header h3{
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.npd-configurator-wrapper .npd-section-badge{
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Text Options Grid - Default: Single column for mobile */
.npd-configurator-wrapper .npd-text-options-grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Mobile Preview - Hidden by default, shown in mobile media query */
.npd-configurator-wrapper .npd-mobile-preview-area{
    display: none;
}

/* Desktop Layout: 2 columns (preview left, buttons right) - Only on larger screens */
@media (min-width: 769px) {
    .npd-configurator-wrapper .npd-text-options-grid{
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        align-items: start;
    }

    /* Desktop Preview - Show on Desktop */
    .npd-configurator-wrapper .npd-mobile-preview-area{
        display: block;
        grid-column: 1;
    }

.npd-configurator-wrapper .npd-mobile-preview-image{
    width: 100%;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    min-height: 400px;
}

.npd-configurator-wrapper .npd-mobile-preview-image img{
    width: 70%;
    max-width: 70%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.npd-configurator-wrapper .npd-mobile-preview-image .npd-option-placeholder{
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    padding: 32px 24px;
    text-align: center;
    border-radius: 8px;
}

    /* Desktop Label Container - Right Side */
    .npd-configurator-wrapper .npd-mobile-label-container{
        display: block;
        grid-column: 2;
        width: 100%;
    }

    .npd-configurator-wrapper .npd-mobile-scroll-wrapper{
        display: block;
    }

    .npd-configurator-wrapper .npd-scroll-arrow{
        display: none;
    }

    .npd-configurator-wrapper .npd-mobile-scroll-dots{
        display: none;
    }

    .npd-configurator-wrapper .npd-mobile-label-switcher{
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
}


/* Default label styling - applies to both mobile and desktop */
.npd-configurator-wrapper .npd-mobile-label-heading{
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.npd-configurator-wrapper .npd-mobile-label{
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.npd-configurator-wrapper .npd-mobile-label:hover{
    background-color: #ffffff;
    color: #334155;
    border: 2px solid #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.npd-configurator-wrapper .npd-mobile-label:focus{
    background-color: #ffffff;
    color: #334155;
    border: 2px solid #94a3b8;
}

.npd-configurator-wrapper .npd-mobile-label:active{
    background: #f8fafc;
    color: #334155;
    border: 2px solid #94a3b8;
}

.npd-configurator-wrapper .npd-mobile-label.active{
    background: #3b82f6;
    color: #ffffff;
    border: 2px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    font-weight: 700;
}

.npd-configurator-wrapper .npd-mobile-label.active:hover,
.npd-configurator-wrapper .npd-mobile-label.active:focus{
    background: #3b82f6;
    color: #ffffff;
    border: 2px solid #3b82f6;
}

.npd-configurator-wrapper .npd-mobile-label.active:active{
    background: #2563eb;
    border: 2px solid #3b82f6;
}

/* Desktop styling for labels - Larger on desktop */
@media (min-width: 769px) {
    .npd-configurator-wrapper .npd-mobile-label-heading{
        font-size: 18px;
    }

    .npd-configurator-wrapper .npd-mobile-label{
        padding: 16px 20px;
        font-size: 16px;
        min-height: 56px;
    }
}

/* Hide desktop image cards on all screen sizes */
.npd-configurator-wrapper .npd-text-option-card.npd-predefined-option{
    display: none;
}

/* Custom Text & Delivery Row */
.npd-configurator-wrapper .npd-custom-delivery-row{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Hide stray <p> and <br> tags injected by WordPress wpautop() inside grid/flex containers */
.npd-configurator-wrapper .npd-custom-delivery-row > p,
.npd-configurator-wrapper .npd-package-customization > p,
.npd-configurator-wrapper .npd-configurator-layout > p,
.npd-configurator-wrapper .npd-text-options-grid > p,
.npd-configurator-wrapper .npd-text-options-section > p,
.npd-configurator-wrapper .npd-step-content > p,
.npd-configurator-wrapper .npd-section-header > p,
.npd-configurator-wrapper .npd-delivery-main > p,
.npd-configurator-wrapper .npd-custom-card-footer > p,
.npd-configurator-wrapper .npd-custom-card-header > p,
.npd-configurator-wrapper .npd-express-option > p,
.npd-configurator-wrapper .footer-navigation > p {
    display: none;
}

/* Hide <br> tags injected by wpautop() - they break flex layouts by becoming flex items */
.npd-configurator-wrapper br {
    display: none;
}

/* CRITICAL: Mobile layout override - must be after base definition */
/* This applies to ALL screens 800px and below (481-800px range) */
@media screen and (max-width: 800px) {
    /* Force mobile layout for step 2 - CRITICAL for 481-800px range */
    /* Using multiple selectors for maximum specificity */
    .npd-configurator-wrapper #step2 .npd-package-customization,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-package-customization,
    .npd-configurator-wrapper div#step2.npd-step-content .npd-package-customization,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-package-customization,
    .npd-configurator-wrapper div#step2.npd-step-content.active .npd-package-customization{
        display: flex !important;
        flex-direction: column !important;
        max-width: 100% !important;
        gap: 24px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Make delivery row transparent for flexbox ordering */
    /* CRITICAL: display: contents makes children direct flex children */
    .npd-configurator-wrapper #step2 .npd-custom-delivery-row,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-custom-delivery-row,
    .npd-configurator-wrapper div#step2.npd-step-content .npd-custom-delivery-row,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-custom-delivery-row,
    .npd-configurator-wrapper div#step2.npd-step-content.active .npd-custom-delivery-row,
    .npd-configurator-wrapper .npd-package-customization > .npd-custom-delivery-row{
        display: contents !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Set ordering - these become direct children of .npd-package-customization */
    .npd-configurator-wrapper #step2 .npd-text-options-section,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-text-options-section,
    .npd-configurator-wrapper div#step2.npd-step-content .npd-text-options-section,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-text-options-section{
        order: 1 !important;
        margin-bottom: 0 !important;
    }

    .npd-configurator-wrapper #step2 .npd-custom-text-card,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-custom-text-card,
    .npd-configurator-wrapper div#step2.npd-step-content .npd-custom-text-card,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-custom-text-card,
    .npd-configurator-wrapper .npd-package-customization > .npd-custom-text-card{
        order: 2 !important;
        margin-bottom: 0 !important;
    }

    .npd-configurator-wrapper #step2 .npd-delivery-panel,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-delivery-panel,
    .npd-configurator-wrapper div#step2.npd-step-content .npd-delivery-panel,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-delivery-panel,
    .npd-configurator-wrapper .npd-package-customization > .npd-delivery-panel{
        order: 4 !important;
        margin-bottom: 0 !important;
    }
}



/* Text Option Card */
.npd-configurator-wrapper .npd-text-option-card{
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 180px;
}

/* Custom Text Card - Premium Elegant Design */
.npd-configurator-wrapper .npd-custom-text-card{
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

/* Subtle background accent */
.npd-configurator-wrapper .npd-custom-text-card::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #3b82f6 100%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.npd-configurator-wrapper .npd-custom-text-card:hover::before{
    opacity: 1;
    animation: shimmer 2s infinite;
}


.npd-configurator-wrapper .npd-custom-text-card:hover{
    border-color: #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
    transform: translateY(-3px);
}

.npd-configurator-wrapper .npd-custom-text-card.selected{
    border-color: #3b82f6;
    background: linear-gradient(135deg, #fafbff 0%, #f0f6ff 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 10px 30px rgba(59, 130, 246, 0.12);
}

.npd-configurator-wrapper .npd-custom-text-card.selected::before{
    opacity: 1;
}

.npd-configurator-wrapper .npd-custom-card-header{
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    flex: 1;
}

.npd-configurator-wrapper .npd-custom-icon-wrapper{
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
    position: relative;
    align-self: center;
    margin: 0;
    padding: 0;
}

/* Icon glow effect on hover */
.npd-configurator-wrapper .npd-custom-icon-wrapper::after{
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 22px;
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: opacity 0.3s ease;
}

.npd-configurator-wrapper .npd-custom-text-card:hover .npd-custom-icon-wrapper{
    transform: scale(1.05);
}

.npd-configurator-wrapper .npd-custom-text-card:hover .npd-custom-icon-wrapper::after{
    opacity: 0.6;
}

.npd-configurator-wrapper .npd-custom-icon-wrapper svg{
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.npd-configurator-wrapper .npd-custom-text-info{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    align-self: center;
    margin: 0;
    padding: 0;
}

.npd-configurator-wrapper .npd-custom-text-info h4{
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: left;
}

.npd-configurator-wrapper .npd-custom-text-info p{
    font-size: 15px;
    color: #475569;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    text-align: left;
}

/* Explicit classes to override any inherited center alignment */
.npd-configurator-wrapper .npd-custom-title{
    text-align: left !important;
}

.npd-configurator-wrapper .npd-custom-description{
    text-align: left !important;
}

/* Premium tag - HIDDEN */
.npd-configurator-wrapper .npd-premium-tag{
    display: none !important;
}

.npd-configurator-wrapper .npd-custom-card-footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.02) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.npd-configurator-wrapper .npd-custom-price{
    font-size: 22px;
    font-weight: 700;
    color: #3b82f6;
    letter-spacing: -0.02em;
    line-height: 1;
}

.npd-configurator-wrapper .npd-custom-check{
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.npd-configurator-wrapper .npd-custom-check svg{
    width: 20px;
    height: 20px;
}

.npd-configurator-wrapper .npd-custom-text-card.selected .npd-custom-check{
    display: flex;
    animation: checkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


.npd-configurator-wrapper .npd-text-option-card:hover{
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.npd-configurator-wrapper .npd-text-option-card.selected{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Predefined Option with Image */
.npd-configurator-wrapper .npd-text-option-card.npd-predefined-option{
    padding: 0;
    overflow: hidden;
    min-height: 300px;
}

.npd-configurator-wrapper .npd-text-option-card.npd-predefined-option .npd-option-image{
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
}

.npd-configurator-wrapper .npd-option-placeholder{
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    font-size: 18px;
    font-weight: 600;
    padding: 32px;
    text-align: center;
}

/* Premium Badge - More Subtle */
.npd-configurator-wrapper .npd-premium-badge{
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.npd-configurator-wrapper .npd-badge-icon{
    font-size: 12px;
}

/* Option Content */
.npd-configurator-wrapper .npd-option-content{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.npd-configurator-wrapper .npd-option-icon{
    margin-bottom: 4px;
}

.npd-configurator-wrapper .npd-custom-text-option .npd-option-icon svg{
    width: 36px;
    height: 36px;
}

.npd-configurator-wrapper .npd-option-title{
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.npd-configurator-wrapper .npd-option-description{
    font-size: 13px;
    color: #475569;
    margin: 0;
}

.npd-configurator-wrapper .npd-option-price{
    font-size: 15px;
    font-weight: 700;
    color: #3b82f6;
    margin: 6px 0 0 0;
}

/* Check Mark - HIDDEN BY DEFAULT */
.npd-configurator-wrapper .npd-option-check{
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 10;
}

.npd-configurator-wrapper .npd-option-check svg{
    width: 16px;
    height: 16px;
}

/* Only show checkmark when card is selected */
.npd-configurator-wrapper .npd-text-option-card.selected .npd-option-check{
    display: flex;
}

/* Custom Text Configurator Container */
.npd-configurator-wrapper .npd-custom-text-configurator{
    margin-top: 24px;
}

.npd-configurator-wrapper .npd-configurator-layout{
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 32px;
    align-items: start;
}

/* Custom Text Input Section - More Compact */
.npd-configurator-wrapper .npd-custom-text-input-section{
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

.npd-configurator-wrapper .npd-input{
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
}

.npd-configurator-wrapper .font-selection-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.npd-configurator-wrapper .font-option{
    padding: 18px 12px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
}

.npd-configurator-wrapper .font-option:hover{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.npd-configurator-wrapper .font-option.selected{
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
}

/* Delivery Panel - Redesigned */
.npd-configurator-wrapper .npd-delivery-panel{
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    height: fit-content;
    overflow: hidden;
    margin-bottom: 0;
}

.npd-configurator-wrapper .npd-delivery-header-new{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.npd-configurator-wrapper .npd-delivery-header-new svg{
    width: 22px;
    height: 22px;
    color: #3b82f6;
}

.npd-configurator-wrapper .npd-delivery-header-new h4{
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.npd-configurator-wrapper .npd-delivery-main{
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.npd-configurator-wrapper .npd-delivery-estimate{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    border: 1px solid #86efac;
}

.npd-configurator-wrapper .npd-delivery-label{
    font-weight: 600;
    color: #334155;
    font-size: 15px;
}

.npd-configurator-wrapper .npd-delivery-value{
    font-weight: 800;
    color: #15803d;
    font-size: 20px;
    letter-spacing: -0.025em;
}

/* Delivery Warning */
.npd-configurator-wrapper .npd-delivery-warning{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
}

.npd-configurator-wrapper .npd-delivery-warning svg{
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.npd-configurator-wrapper .npd-delivery-warning strong{
    font-weight: 800;
}

/* Express Delivery Option - Redesigned */
.npd-configurator-wrapper .npd-express-option{
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.npd-configurator-wrapper .npd-express-option:has(.npd-express-checkbox:checked){
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.npd-configurator-wrapper .npd-express-label-wrapper{
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin: 0;
}

.npd-configurator-wrapper .npd-express-checkbox{
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.npd-configurator-wrapper .npd-express-content{
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.npd-configurator-wrapper .npd-express-icon{
    font-size: 24px;
    line-height: 1;
}

.npd-configurator-wrapper .npd-express-info{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.npd-configurator-wrapper .npd-express-title{
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
}

.npd-configurator-wrapper .npd-express-subtitle{
    font-size: 13px;
    color: #475569;
}

.npd-configurator-wrapper .npd-express-price-text{
    color: #3b82f6;
    font-weight: 700;
}

/* Mobile Responsive Styles */
@media (max-width: 968px) {
    .npd-configurator-wrapper .npd-configurator-layout{
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ========================================
   MOBILE LAYOUT: 481px - 800px (Tablets & Small Screens)
   This ensures step 2 displays correctly on all mobile/tablet sizes
   ======================================== */
@media (max-width: 800px) {
    /* Text options grid - single column */
    .npd-configurator-wrapper .npd-text-options-grid{
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* ========================================
       MOBILE PREVIEW AREA - Show on 481-800px range
       This was missing and caused the preview to be hidden
       ======================================== */
    .npd-configurator-wrapper .npd-mobile-preview-area{
        display: block !important;
        grid-column: 1;
        margin-bottom: 24px;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        border: none;
    }

    .npd-configurator-wrapper .npd-mobile-preview-image{
        width: 100%;
        position: relative;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        min-height: auto;
    }

    .npd-configurator-wrapper .npd-mobile-preview-image img{
        width: 70%;
        max-width: 70%;
        height: auto;
        object-fit: contain;
        display: block;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    /* Mobile Label Container - Full width below preview */
    .npd-configurator-wrapper .npd-mobile-label-container{
        display: block !important;
        grid-column: 1;
        margin-bottom: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Show wrapper but hide scroll arrows */
    .npd-configurator-wrapper .npd-mobile-scroll-wrapper{
        display: block !important;
    }

    .npd-configurator-wrapper .npd-scroll-arrow{
        display: none !important;
    }

    .npd-configurator-wrapper .npd-mobile-scroll-dots{
        display: none !important;
    }

    .npd-configurator-wrapper .npd-mobile-label-heading{
        font-size: 16px;
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .npd-configurator-wrapper .npd-mobile-label-switcher{
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .npd-configurator-wrapper .npd-mobile-label{
        width: 100%;
        padding: 14px 18px;
        background: #ffffff;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: #334155;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
    }

    .npd-configurator-wrapper .npd-mobile-label.active{
        background: #3b82f6;
        color: #ffffff;
        border-color: #3b82f6;
    }

    /* Hide the desktop predefined option cards on mobile */
    .npd-configurator-wrapper .npd-text-option-card.npd-predefined-option{
        display: none !important;
    }

    /* Custom delivery row - use display: contents for flexbox ordering */
    /* Multiple selectors for maximum specificity - including .active class */
    .npd-configurator-wrapper #step2 .npd-custom-delivery-row,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-custom-delivery-row,
    .npd-configurator-wrapper #step2.npd-step-content .npd-custom-delivery-row,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-custom-delivery-row,
    .npd-configurator-wrapper div#step2.npd-step-content.active .npd-custom-delivery-row,
    .npd-configurator-wrapper .npd-package-customization > .npd-custom-delivery-row{
        display: contents !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Flexbox ordering for mobile layout */
    .npd-configurator-wrapper #step2 .npd-text-options-section,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-text-options-section,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-text-options-section{
        order: 1 !important;
        margin-bottom: 0 !important;
    }

    .npd-configurator-wrapper #step2 .npd-custom-text-card,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-custom-text-card,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-custom-text-card,
    .npd-configurator-wrapper .npd-package-customization > .npd-custom-text-card{
        order: 2 !important;
        margin-bottom: 0 !important;
    }

    .npd-configurator-wrapper #step2 .npd-custom-text-configurator,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-custom-text-configurator{
        order: 3 !important;
    }

    .npd-configurator-wrapper #step2 .npd-delivery-panel,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-delivery-panel,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-delivery-panel,
    .npd-configurator-wrapper .npd-package-customization > .npd-delivery-panel{
        padding: 0 !important;
        order: 4 !important;
        margin-bottom: 0 !important;
    }

    /* Package customization container */
    .npd-configurator-wrapper #step2 .npd-package-customization,
    .npd-configurator-wrapper .npd-step-content[data-step="2"] .npd-package-customization,
    .npd-configurator-wrapper #step2.npd-step-content.active .npd-package-customization,
    .npd-configurator-wrapper div#step2.npd-step-content.active .npd-package-customization{
        max-width: 100% !important;
        gap: 24px !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Step 2 content padding */
    .npd-configurator-wrapper #step2,
    .npd-configurator-wrapper .npd-step-content[data-step="2"]{
        padding: 24px 16px !important;
    }

    /* Delivery panel styling */
    .npd-configurator-wrapper .npd-delivery-header-new{
        padding: 16px 20px;
    }

    .npd-configurator-wrapper .npd-delivery-body{
        padding: 16px 20px;
    }

    /* Font selection grid */
    .npd-configurator-wrapper .font-selection-grid{
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Preview section */
    .npd-configurator-wrapper .npd-package-preview-section{
        padding: 16px;
    }

    .npd-configurator-wrapper .npd-package-preview-container{
        max-width: 100%;
    }

    /* Text option cards */
    .npd-configurator-wrapper .npd-text-option-card.npd-predefined-option{
        min-height: 250px;
    }

    .npd-configurator-wrapper .npd-text-option-card.npd-predefined-option .npd-option-image{
        min-height: 250px;
    }

    /* Custom text input section */
    .npd-configurator-wrapper .npd-custom-text-input-section{
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .npd-configurator-wrapper .npd-text-option-card{
        min-height: auto;
    }

    .npd-configurator-wrapper .npd-text-option-card.npd-custom-text-option{
        min-height: 140px;
    }

    .npd-configurator-wrapper .npd-text-option-card.npd-predefined-option{
        min-height: 200px;
    }

    .npd-configurator-wrapper .npd-text-option-card.npd-predefined-option .npd-option-image{
        min-height: 200px;
    }

    .npd-configurator-wrapper .npd-option-title{
        font-size: 15px;
    }

    .npd-configurator-wrapper .font-selection-grid{
        grid-template-columns: 1fr;
    }

    .npd-configurator-wrapper .npd-option-placeholder{
        height: 200px;
        font-size: 16px;
    }

    .npd-configurator-wrapper .npd-delivery-time{
        flex-wrap: wrap;
    }

    .npd-configurator-wrapper .npd-checkbox-text{
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Custom text card mobile adjustments */
    .npd-configurator-wrapper .npd-custom-text-card{
        padding: 0;
    }

    .npd-configurator-wrapper .npd-custom-card-header{
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 20px;
        gap: 16px;
    }

    .npd-configurator-wrapper .npd-custom-card-footer{
        padding: 16px 20px;
    }

    .npd-configurator-wrapper .npd-custom-icon-wrapper{
        width: 52px;
        height: 52px;
        flex-shrink: 0;
        align-self: center;
        margin: 0;
        padding: 0;
    }

    .npd-configurator-wrapper .npd-custom-icon-wrapper svg{
        width: 24px;
        height: 24px;
    }

    .npd-configurator-wrapper .npd-custom-text-info{
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-self: center;
        margin: 0;
        padding: 0;
    }

    .npd-configurator-wrapper .npd-custom-text-info h4{
        font-size: 18px;
        margin: 0 0 4px 0;
        line-height: 1.2;
    }

    .npd-configurator-wrapper .npd-custom-text-info p{
        font-size: 14px;
        margin: 0;
        line-height: 1.3;
    }

    .npd-configurator-wrapper .npd-custom-price{
        font-size: 20px;
    }

    /* Mobile: Single column layout - preview on top, buttons below */
    .npd-configurator-wrapper .npd-text-options-grid{
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Mobile Preview Area - Show on Mobile */
    .npd-configurator-wrapper .npd-mobile-preview-area{
        display: block !important;
        grid-column: 1;
        margin-bottom: 24px;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        border: none;
    }

    .npd-configurator-wrapper .npd-mobile-preview-image{
        width: 100%;
        position: relative;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        min-height: auto;
    }

    .npd-configurator-wrapper .npd-mobile-preview-image img{
        width: 70%;
        max-width: 70%;
        height: auto;
        object-fit: contain;
        display: block;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .npd-configurator-wrapper .npd-mobile-preview-image .npd-option-placeholder{
        width: 100%;
        min-height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        color: #475569;
        font-size: 16px;
        font-weight: 600;
        padding: 32px 24px;
        text-align: center;
    }

    /* Mobile Label Container - Full width below preview */
    .npd-configurator-wrapper .npd-mobile-label-container{
        display: block !important;
        grid-column: 1;
        margin-bottom: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Show wrapper but hide scroll arrows and indicators */
    .npd-configurator-wrapper .npd-mobile-scroll-wrapper{
        display: block !important;
    }

    .npd-configurator-wrapper .npd-scroll-arrow{
        display: none !important;
    }

    .npd-configurator-wrapper .npd-mobile-scroll-dots{
        display: none !important;
    }

    .npd-configurator-wrapper .npd-mobile-label-heading{
        font-size: 16px;
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 16px;
        padding: 0;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    /* Mobile Label Switcher - Flexible Wrapping (horizontal) */
    .npd-configurator-wrapper .npd-mobile-label-switcher{
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .npd-configurator-wrapper .npd-mobile-label{
        flex: 1 1 auto;
        min-width: 140px;
        max-width: 100%;
        padding: 14px 18px;
        background: #ffffff;
        border: 2px solid #cbd5e1;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: #334155;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        white-space: normal;
        word-wrap: break-word;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        text-align: center;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.4;
    }

    .npd-configurator-wrapper .npd-mobile-label:hover{
        background-color: #ffffff;
        color: #334155;
        border: 2px solid #94a3b8;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .npd-configurator-wrapper .npd-mobile-label:focus{
        background-color: #ffffff;
        color: #334155;
        border: 2px solid #94a3b8;
    }

    .npd-configurator-wrapper .npd-mobile-label:active{
        background: #f8fafc;
        color: #334155;
        border: 2px solid #94a3b8;
    }

    .npd-configurator-wrapper .npd-mobile-label.active{
        background: #3b82f6;
        color: #ffffff;
        border: 2px solid #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
        font-weight: 700;
    }

    .npd-configurator-wrapper .npd-mobile-label.active:hover,
    .npd-configurator-wrapper .npd-mobile-label.active:focus{
        background: #3b82f6;
        color: #ffffff;
        border: 2px solid #3b82f6;
    }

    .npd-configurator-wrapper .npd-mobile-label.active:active{
        background: #2563eb;
        border: 2px solid #3b82f6;
    }

    /* Desktop predefined option cards already hidden globally */
}

/* ===== MODAL STYLES ===== */
.npd-configurator-wrapper .npd-modal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.npd-configurator-wrapper .npd-modal-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.npd-configurator-wrapper .npd-modal-content{
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
}

.npd-configurator-wrapper .npd-modal-header{
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.npd-configurator-wrapper .npd-modal-title{
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.npd-configurator-wrapper .npd-modal-body{
    padding: 24px;
}

.npd-configurator-wrapper .npd-modal-body p{
    margin: 0;
    color: #334155;
    line-height: 1.6;
    font-size: 16px;
}

.npd-configurator-wrapper .npd-modal-footer{
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
}

.npd-configurator-wrapper .npd-modal-footer .npd-btn-secondary,
.npd-configurator-wrapper .npd-modal-footer .npd-btn-primary{
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.npd-configurator-wrapper .npd-modal-footer .npd-btn-secondary{
    background: #e2e8f0;
    color: #334155;
}

.npd-configurator-wrapper .npd-modal-footer .npd-btn-secondary:hover{
    background: #cbd5e1;
}

.npd-configurator-wrapper .npd-modal-footer .npd-btn-primary{
    background: #3b82f6;
    color: #ffffff;
}

.npd-configurator-wrapper .npd-modal-footer .npd-btn-primary:hover{
    background: #2563eb;
    transform: translateY(-1px);
}

/* ===== LEGACY STYLES (merged from theme style.css) ===== */
.npd-configurator-wrapper .configurator-container{
	background-color: #ffffff;
	border-radius: 16px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
	width: 100%;
	max-width: 1000px;
	display: flex;
	flex-direction: column;
	min-height: 600px;
	overflow: hidden;
	margin: 0 auto;
}

.npd-configurator-wrapper .configurator-content{
	flex-grow: 1;
	padding: 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

body.has-configurator {
	font-family: 'Inter', sans-serif;
}

.has-configurator .npd-configurator-wrapper {
	margin: 16px auto;
}

.npd-configurator-wrapper .card-design, .npd-configurator-wrapper .npd-design-card{
	position: relative;
	width: 320px;
	height: auto;
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
	background: #ffffff;
	display: flex;
	flex-direction: column;
	transform-style: preserve-3d;
	perspective: 1000px;
}

.npd-configurator-wrapper .card-design:hover{
	transform: translateY(-10px) scale(1.03);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.npd-configurator-wrapper .card-design img{
	position: relative;
	width: 320px;
	height: 320px;
	backface-visibility: hidden;
	transition: transform 0.6s;
	border-radius: 16px 16px 0 0;
	object-fit: contain;
	display: block;
}

.npd-configurator-wrapper .card-front{
	transform: rotateY(0deg);
}

.npd-configurator-wrapper .card-back{
	transform: rotateY(180deg);
}

.npd-configurator-wrapper .card-design.flipped .card-front{
	transform: rotateY(-180deg);
}

.npd-configurator-wrapper .card-design.flipped .card-back{
	transform: rotateY(0deg);
}

.npd-configurator-wrapper .upload-box{
	border: 3px dashed #cbd5e1;
	background-color: #f8fafc;
	border-radius: 12px;
	padding: 40px;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.npd-configurator-wrapper .upload-box:hover{
	background-color: #eff6ff;
	border-color: #93c5fd;
}

.npd-configurator-wrapper .card-grid{
	display: grid;
	width: 100%;
	margin-top: 20px;
}

.npd-configurator-wrapper .card-item{
	position: relative;
	width: 100%;
	height: auto;
	aspect-ratio: 2.5 / 3.5;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	background-color: #f8fafc;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.npd-configurator-wrapper .card-printing-area{
	position: relative;
	width: calc(100% - 16px);
	height: calc(100% - 16px);
	margin: 8px;
	border: 1px dashed #ccc;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}

.npd-configurator-wrapper .card-image-content{
	position: absolute;
	width: 100%;
	height: 100%;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	cursor: grab;
	transition: border 0.1s ease-in-out;
}

.npd-configurator-wrapper .card-image-content.active-drag{
	border: 2px solid #3b82f6;
}

.npd-configurator-wrapper .image-overlay-controls{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.4);
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.npd-configurator-wrapper .card-item:hover .image-overlay-controls{
	opacity: 1;
	pointer-events: auto;
}

.npd-configurator-wrapper .image-overlay-controls .control-button{
	background-color: rgba(0, 0, 0, 0.7);
	color: #ffffff;
	border-radius: 50%;
	padding: 8px;
	margin: 4px;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	justify-content: center;
	align-items: center;
	pointer-events: auto;
}

.npd-configurator-wrapper .image-overlay-controls .control-button:hover{
	background-color: rgba(0, 0, 0, 0.9);
}

.npd-configurator-wrapper .resize-handle{
	position: absolute;
	width: 16px;
	height: 16px;
	background-color: #3b82f6;
	border: 1px solid #ffffff;
	border-radius: 4px;
	cursor: nwse-resize;
	bottom: -8px;
	right: -8px;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: auto;
}

.npd-configurator-wrapper .card-item:hover .resize-handle{
	opacity: 1;
}

.npd-configurator-wrapper .upload-icon-placeholder{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	cursor: pointer;
	transition: color 0.2s;
}

.npd-configurator-wrapper .upload-icon-placeholder:hover{
	color: #64748b;
}

.npd-configurator-wrapper .footer-navigation{
	border-top: 1px solid #e2e8f0;
	padding: 20px 32px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: #f8fafc;
	border-bottom-left-radius: 16px;
	border-bottom-right-radius: 16px;
}

.npd-configurator-wrapper .font-option{
	padding: 18px 12px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-size: 14px;
	font-weight: 500;
	min-height: 72px;
	min-width: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1.4;
	white-space: normal;
	background: #ffffff;
	color: #334155;
}

.npd-configurator-wrapper .font-option:hover{
	background: #f8fafc;
	border-color: #cbd5e1;
	transform: translateY(-1px);
}

.npd-configurator-wrapper .font-option.selected,
.npd-configurator-wrapper .font-option.active{
	background: rgba(59, 130, 246, 0.1);
	border-color: #3b82f6;
	color: #3b82f6;
	font-weight: 600;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.npd-configurator-wrapper .hidden{
	display: none !important;
}

.npd-configurator-wrapper .current-step{
	display: flex !important;
}

@media (max-width: 991px) {
	.npd-configurator-wrapper .card-design, .npd-configurator-wrapper .npd-design-card{
		width: 280px;
		height: auto;
	}

	.npd-configurator-wrapper .card-design img{
		width: 280px;
		height: 280px;
	}
}

@media (max-width: 767px) {
	.npd-configurator-wrapper .configurator-container{
		margin: 10px;
		border-radius: 12px;
	}

	.npd-configurator-wrapper .configurator-content{
		padding: 20px;
	}

	.npd-configurator-wrapper .card-design, .npd-configurator-wrapper .npd-design-card{
		width: 240px;
		height: auto;
	}

	.npd-configurator-wrapper .card-item{
		width: 100%;
		height: auto;
	}
}

@media (max-width: 575px) {
	.npd-configurator-wrapper .configurator-container{
		margin: 5px;
		border-radius: 8px;
	}

	.npd-configurator-wrapper .configurator-content{
		padding: 15px;
	}

	.npd-configurator-wrapper .card-design, .npd-configurator-wrapper .npd-design-card{
		width: 100%;
		max-width: 300px;
		height: auto;
	}

	.npd-configurator-wrapper .card-design img{
		width: 100%;
		height: 300px;
		max-width: 300px;
	}

	.npd-configurator-wrapper .card-item{
		width: 100%;
		height: auto;
	}
}

/* ===== KEYFRAMES (Moved to root) ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
}

@keyframes mobilePulse {
    0%, 100% {
        opacity: 0.7;
        border-width: 4px;
    }
    50% {
        opacity: 1;
        border-width: 6px;
    }
}

@keyframes fadeInImage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
