/**
 * TextileWall Konfigurator V2 - Minimal CSS
 * Uses theme styles, only konfigurator-specific components here
 */

/* Container - limit width */
.tw-konfigurator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Stepper */
.tw-stepper { display: flex; justify-content: space-between; align-items: center; margin: 2rem 0; padding: 0; list-style: none; position: relative; }
.tw-stepper-step { flex: 1; text-align: center; position: relative; z-index: 1; }
.tw-stepper-line { flex: 0 0 20px; height: 2px; background: #e5e7eb; margin: 0 -10px; position: relative; top: -20px; }
.tw-stepper-circle { width: 40px; height: 40px; border-radius: 50%; background: white; border: 2px solid #e5e7eb; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.5rem; font-weight: 600; color: #9ca3af; transition: all 0.3s; }
.tw-stepper-label { font-size: 0.875rem; color: #6b7280; }
.tw-stepper-step.active .tw-stepper-circle { border-color: #000; background: #000; color: white; }
.tw-stepper-step.active .tw-stepper-label { color: #000; font-weight: 600; }
.tw-stepper-step.completed .tw-stepper-circle { border-color: #10b981; background: #10b981; color: white; }
.tw-stepper-step.completed .tw-stepper-circle::before { content: '✓'; }

/* Steps */
.tw-step { min-height: 400px; animation: fadeIn 0.3s; }
.tw-step-hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tw-step-title { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; }
.tw-step-description { color: #6b7280; margin-bottom: 2rem; }

/* Cards Grid - CRITICAL FIX */
.tw-cards-grid { 
    display: grid !important; 
    gap: 1.5rem; 
    margin-bottom: 2rem; 
}
.tw-cards-grid.cols-3 { 
    grid-template-columns: repeat(3, 1fr) !important;
}
.tw-cards-grid.cols-2 { 
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Selection Cards */
.tw-category-card, .tw-profile-card, .tw-mounting-card, .tw-fabric-card, .tw-graphic-card { 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 2rem; 
    cursor: pointer; 
    transition: all 0.2s; 
    background: white; 
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.tw-category-card:hover, .tw-profile-card:hover, .tw-mounting-card:hover, .tw-fabric-card:hover, .tw-graphic-card:hover {
    border-color: #000; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.tw-category-card.selected, .tw-profile-card.selected, .tw-mounting-card.selected, .tw-fabric-card.selected, .tw-graphic-card.selected {
    border-color: #000; 
    background: #f9fafb;
}
.tw-category-card.selected::after, .tw-profile-card.selected::after, .tw-mounting-card.selected::after, .tw-fabric-card.selected::after, .tw-graphic-card.selected::after {
    content: '✓'; 
    position: absolute; 
    top: 1rem; 
    right: 1rem; 
    width: 24px; 
    height: 24px;
    background: #000; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px;
}

/* Clickable cards */
.tw-clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}
.tw-clickable-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.tw-clickable-card:active {
    transform: translateY(0);
}

.tw-card-icon { font-size: 2rem; margin-bottom: 1rem; opacity: 0.8; text-align: center; }
.tw-card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; text-align: center; }
.tw-card-description { color: #6b7280; font-size: 0.875rem; text-align: center; }
.tw-profile-badge { position: absolute; top: 1rem; left: 1rem; background: #10b981; color: white; padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.tw-profile-price { font-size: 1.125rem; font-weight: 700; margin-top: 1rem; text-align: center; }

/* Forms */
.tw-form-group { margin-bottom: 1.5rem; max-width: 600px; }
.tw-form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.tw-form-input { width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 1rem; box-sizing: border-box; }
.tw-form-input:focus { outline: none; border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }
.tw-form-help { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
.tw-form-error { color: #ef4444; font-size: 0.875rem; margin-top: 0.25rem; }
.tw-dimensions-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1rem; 
    max-width: 600px;
}

/* Price */
.tw-price-summary { 
    background: #f9fafb; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 1.5rem; 
    margin: 2rem 0;
    max-width: 600px;
}
.tw-price-row { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.tw-price-row.total { font-size: 1.5rem; font-weight: 700; padding-top: 0.75rem; border-top: 2px solid #e5e7eb; margin-top: 0.75rem; }
.tw-discount-badge { display: inline-block; background: #10b981; color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin-left: 0.5rem; }

/* Graphic & Cropper */
#tw-graphic-preview { margin: 2rem 0; text-align: center; }
#tw-graphic-preview img { max-width: 100%; height: auto; border-radius: 8px; }
.tw-cropper-container { margin: 2rem 0; max-width: 800px; }
.tw-cropper-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* Summary */
.tw-summary-grid { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.tw-summary-section { background: #f9fafb; border-radius: 8px; padding: 1.5rem; }
.tw-summary-section h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.tw-summary-item { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.tw-summary-item-label { color: #6b7280; }
.tw-summary-item-value { font-weight: 600; }
.tw-summary-graphic { text-align: center; padding: 1rem; }
.tw-summary-graphic img { max-width: 300px; height: auto; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* Summary Actions */
.tw-summary-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tw-summary-actions .tw-btn {
    flex: 1 1 auto;
    min-width: 200px;
}

/* Buttons - matching theme styles */
.tw-step-actions { 
    display: flex; 
    gap: 1rem; 
    margin-top: 2rem; 
    justify-content: flex-end; 
    flex-wrap: wrap; 
}

.tw-btn, 
.tw-btn.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md, 0.75rem) var(--space-xl, 2rem);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium, 600);
    text-decoration: none;
    border-radius: var(--border-radius, 4px);
    transition: var(--transition, all 0.2s);
    border: none;
    cursor: pointer;
    line-height: 1;
    gap: var(--space-sm, 0.5rem);
}

.tw-btn-primary,
.tw-btn.btn-primary {
    background-color: var(--secondary, #000);
    color: white;
    border: none;
}

.tw-btn-primary:hover,
.tw-btn.btn-primary:hover {
    background-color: var(--secondary-dark, #333);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.1));
}

.tw-btn-secondary,
.tw-btn.btn-outline {
    background-color: transparent;
    color: var(--text-primary, #000);
    border: 2px solid var(--border, #d1d5db);
}

.tw-btn-secondary:hover,
.tw-btn.btn-outline:hover {
    background-color: var(--gray-50, #f9fafb);
    border-color: var(--secondary, #000);
}

.tw-btn-select {
    width: 100%;
    margin-top: 1rem;
}

.tw-btn-upload,
.tw-btn-gallery {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.tw-btn-large { 
    padding: var(--space-lg, 1rem) var(--space-2xl, 3rem); 
    font-size: 1.125rem; 
}

.tw-btn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    pointer-events: none;
}

/* Notifications */
.tw-notification { 
    position: fixed; 
    top: 2rem; 
    right: 2rem; 
    background: white; 
    border-radius: 8px; 
    padding: 1rem 1.5rem; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    z-index: 9999; 
    min-width: 300px; 
    animation: slideIn 0.3s; 
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.tw-notification-success { border-left: 4px solid #10b981; }
.tw-notification-error { border-left: 4px solid #ef4444; }
.tw-notification-info { border-left: 4px solid #3b82f6; }

/* Responsive */
@media (max-width: 1024px) {
    .tw-cards-grid.cols-3 { 
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tw-stepper-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .tw-konfigurator-container {
        padding: 1rem 0.5rem;
    }
    
    .tw-stepper { 
        overflow-x: auto; 
        padding-bottom: 1rem;
        margin: 1rem -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .tw-stepper-step { 
        min-width: 60px;
        flex-shrink: 0;
    }
    
    .tw-stepper-line {
        flex: 0 0 10px;
    }
    
    .tw-stepper-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .tw-stepper-label { 
        font-size: 0.625rem;
    }
    
    .tw-cards-grid.cols-3,
    .tw-cards-grid.cols-2 { 
        grid-template-columns: 1fr;
    }
    
    .tw-dimensions-grid { 
        grid-template-columns: 1fr; 
    }
    
    .tw-step-actions { 
        flex-direction: column; 
    }
    
    .tw-btn { 
        width: 100%; 
    }
    
    .tw-category-card, 
    .tw-profile-card, 
    .tw-mounting-card, 
    .tw-fabric-card {
        min-height: 150px;
        padding: 1.5rem;
    }
}

.tw-stepper::before { content: ''; position: absolute; top: 20px; left: 0; right: 0; height: 2px; background: #e5e7eb; z-index: -1; }
.tw-stepper-item { flex: 1; text-align: center; position: relative; }
.tw-stepper-circle { width: 40px; height: 40px; border-radius: 50%; background: white; border: 2px solid #e5e7eb; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.5rem; font-weight: 600; color: #9ca3af; transition: all 0.3s; }
.tw-stepper-label { font-size: 0.875rem; color: #6b7280; }
.tw-stepper-item.active .tw-stepper-circle { border-color: #000; background: #000; color: white; }
.tw-stepper-item.active .tw-stepper-label { color: #000; font-weight: 600; }
.tw-stepper-item.completed .tw-stepper-circle { border-color: #10b981; background: #10b981; color: white; }
.tw-stepper-item.completed .tw-stepper-circle::before { content: '✓'; }

/* Steps */
.tw-step { min-height: 400px; animation: fadeIn 0.3s; }
.tw-step-hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tw-step-title { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; }
.tw-step-description { color: #6b7280; margin-bottom: 2rem; }

/* Cards Grid */
.tw-cards-grid { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.tw-cards-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tw-cards-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Selection Cards */
.tw-category-card, .tw-profile-card, .tw-mounting-card, .tw-fabric-card {
    border: 2px solid #e5e7eb; border-radius: 8px; padding: 2rem; cursor: pointer; 
    transition: all 0.2s; background: white; position: relative;
}
.tw-category-card:hover, .tw-profile-card:hover, .tw-mounting-card:hover, .tw-fabric-card:hover {
    border-color: #000; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.tw-category-card.selected, .tw-profile-card.selected, .tw-mounting-card.selected, .tw-fabric-card.selected {
    border-color: #000; background: #f9fafb;
}
.tw-category-card.selected::after, .tw-profile-card.selected::after, .tw-mounting-card.selected::after, .tw-fabric-card.selected::after {
    content: '✓'; position: absolute; top: 1rem; right: 1rem; width: 24px; height: 24px;
    background: #000; color: white; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; font-size: 14px;
}

.tw-card-icon { font-size: 2rem; margin-bottom: 1rem; opacity: 0.8; }
.tw-card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.tw-card-description { color: #6b7280; font-size: 0.875rem; }
.tw-profile-badge { position: absolute; top: 1rem; left: 1rem; background: #10b981; color: white; padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.tw-profile-price { font-size: 1.125rem; font-weight: 700; margin-top: 1rem; }

/* Forms */
.tw-form-group { margin-bottom: 1.5rem; }
.tw-form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.tw-form-input { width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 1rem; }
.tw-form-input:focus { outline: none; border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }
.tw-form-help { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
.tw-form-error { color: #ef4444; font-size: 0.875rem; margin-top: 0.25rem; }
.tw-dimensions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Price */
.tw-price-summary { background: #f9fafb; border: 2px solid #e5e7eb; border-radius: 8px; padding: 1.5rem; margin: 2rem 0; }
.tw-price-row { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.tw-price-row.total { font-size: 1.5rem; font-weight: 700; padding-top: 0.75rem; border-top: 2px solid #e5e7eb; margin-top: 0.75rem; }
.tw-discount-badge { display: inline-block; background: #10b981; color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin-left: 0.5rem; }

/* Graphic & Cropper */
#tw-graphic-preview { margin: 2rem 0; text-align: center; }
#tw-graphic-preview img { max-width: 100%; height: auto; border-radius: 8px; }
.tw-cropper-container { margin: 2rem 0; max-width: 100%; }
.tw-cropper-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

/* Summary */
.tw-summary-grid { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.tw-summary-section { background: #f9fafb; border-radius: 8px; padding: 1.5rem; }
.tw-summary-section h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.tw-summary-item { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.tw-summary-item-label { color: #6b7280; }
.tw-summary-item-value { font-weight: 600; }
.tw-summary-graphic { text-align: center; padding: 1rem; }
.tw-summary-graphic img { max-width: 300px; height: auto; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* Notifications */
.tw-notification { position: fixed; top: 2rem; right: 2rem; background: white; border-radius: 8px; padding: 1rem 1.5rem; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9999; min-width: 300px; animation: slideIn 0.3s; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.tw-notification-success { border-left: 4px solid #10b981; }
.tw-notification-error { border-left: 4px solid #ef4444; }
.tw-notification-info { border-left: 4px solid #3b82f6; }

/* Responsive */
@media (max-width: 768px) {
    .tw-stepper { overflow-x: auto; padding-bottom: 1rem; }
    .tw-stepper-item { min-width: 80px; }
    .tw-stepper-label { font-size: 0.75rem; }
    .tw-dimensions-grid { grid-template-columns: 1fr; }
    .tw-step-actions { flex-direction: column; }
    .tw-btn { width: 100%; }
}

/* Gallery Modal */
.tw-gallery-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.tw-gallery-modal-container {
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tw-gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    background: white;
}

.tw-gallery-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.tw-gallery-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tw-gallery-modal-close:hover {
    background: #f3f4f6;
    color: #000;
}

.tw-gallery-modal-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tw-gallery-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .tw-gallery-modal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .tw-gallery-modal-header {
        padding: 1rem;
    }
    
    .tw-gallery-modal-header h2 {
        font-size: 1.25rem;
    }
}
