/* ============================================================
   TEPPICHBODEN-KONFIGURATOR — Mathan-Ritter (rot #e42025)
   Standalone-Page wie polster-konfigurator/termin/route/kontakt
   ============================================================ */

.teppichboden-modal * {
    box-sizing: border-box;
}

/* Modal Overlay */
.teppichboden-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow-y: auto;
}

.teppichboden-modal-dialog {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.teppichboden-modal-content {
    background: white;
    width: 100%;
    max-width: 1400px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: teppichbodenSlideIn 0.3s ease-out;
}

@keyframes teppichbodenSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.teppichboden-modal-header {
    background: #e42025;
    color: #fff;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.teppichboden-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
    font-weight: 600;
}

.teppichboden-close-btn {
    font-family: "Roboto", sans-serif;
    background: rgba(255, 255, 255, 0.2);
    border: solid 2px #fff;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 0;
    padding: 0;
    margin: 0;
}

.teppichboden-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* Body */
.teppichboden-modal-body {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 600px;
    max-height: 800px;
}

/* Form Section (Links) */
.teppichboden-form-section {
    width: 350px;
    background: #f8f9fa;
    padding: 30px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Info Section */
.teppichboden-info-section { margin-bottom: 30px; }
.teppichboden-info-section h2 { font-size: 20px; color: #2c3e50; margin-bottom: 15px; }

.teppichboden-info-step {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #e42025;
}

.teppichboden-info-step h4 { font-size: 14px; color: #2c3e50; margin-bottom: 8px; }
.teppichboden-info-step p  { font-size: 13px; line-height: 1.6; color: #666; }

.teppichboden-info-important {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #e42025;
}

.teppichboden-info-important h4 { font-size: 14px; color: #856404; margin-bottom: 10px; }
.teppichboden-info-important ul { list-style: none; padding: 0; }
.teppichboden-info-important li {
    font-size: 13px;
    color: #856404;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.teppichboden-info-important li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #e42025;
}

/* Progress Indicator */
.teppichboden-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
    margin-bottom: 30px;
}

.teppichboden-progress::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.teppichboden-progress-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.teppichboden-progress-circle {
    width: 36px;
    height: 36px;
    background: white;
    color: #999;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.teppichboden-progress-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Active Status */
.teppichboden-progress-item.active .teppichboden-progress-circle {
    background: #e42025;
    color: #fff;
    border-color: #e42025;
    box-shadow: 0 0 0 4px rgba(228, 32, 37, 0.2);
}

.teppichboden-progress-item.active .teppichboden-progress-label {
    color: #000;
    font-weight: 600;
}

/* Completed Status */
.teppichboden-progress-item.completed .teppichboden-progress-circle {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.teppichboden-progress-item.completed .teppichboden-progress-circle::after {
    content: '✓';
}

.teppichboden-progress-item.completed .teppichboden-progress-label { color: #28a745; }

/* Content Section (Rechts) */
.teppichboden-content-section {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    min-width: 0;
}

/* Steps */
.teppichboden-step { display: none; }

.teppichboden-step.active {
    display: block;
    animation: teppichbodenFadeIn 0.3s ease-out;
}

@keyframes teppichbodenFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.teppichboden-step h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.teppichboden-step-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Option Cards */
.teppichboden-option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.teppichboden-grid-3 { grid-template-columns: repeat(3, 1fr); }

.teppichboden-option-card {
    position: relative;
    cursor: pointer;
}

.teppichboden-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.teppichboden-option-content {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.teppichboden-option-card:hover .teppichboden-option-content {
    border-color: #e42025;
    background: #fffbf0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.teppichboden-option-card input:checked + .teppichboden-option-content {
    border-color: #e42025;
    background: #fffef0;
    box-shadow: 0 0 0 3px rgba(228, 32, 37, 0.2);
}

.teppichboden-option-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.teppichboden-option-content h4 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.teppichboden-option-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Form Groups */
.teppichboden-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.teppichboden-form-group {
    display: flex;
    flex-direction: column;
}

.teppichboden-form-group.full-width { grid-column: 1 / -1; }

.teppichboden-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.teppichboden-required { color: #dc3545; }

.teppichboden-form-group input,
.teppichboden-form-group textarea,
.teppichboden-form-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.teppichboden-form-group input:focus,
.teppichboden-form-group textarea:focus,
.teppichboden-form-group select:focus {
    outline: none;
    border-color: #e42025;
    box-shadow: 0 0 0 3px rgba(228, 32, 37, 0.1);
}

.teppichboden-form-group.error input,
.teppichboden-form-group.error textarea,
.teppichboden-form-group.error select {
    border-color: #dc3545;
}

.teppichboden-error-msg {
    display: none;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

.teppichboden-form-group.error .teppichboden-error-msg { display: block; }

/* Button Group */
.teppichboden-button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 40px;
}

.teppichboden-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.teppichboden-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.teppichboden-btn-primary {
    background: #e42025;
    color: #fff;
}

.teppichboden-btn-primary:hover:not(:disabled) {
    background: #8c1b1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.teppichboden-btn-secondary {
    background: #6c757d;
    color: white;
}

.teppichboden-btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

/* Success Step */
.teppichboden-success-message {
    text-align: center;
    padding: 40px 20px;
}

.teppichboden-success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 48px;
    color: white;
}

.teppichboden-success-message h3 {
    font-size: 32px;
    color: #28a745;
    margin-bottom: 15px;
}

.teppichboden-success-message p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
    .teppichboden-modal-body {
        flex-direction: column;
        height: auto;
        max-height: none;
        min-height: 0;
    }

    .teppichboden-form-section {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 20px;
    }

    .teppichboden-content-section { padding: 30px 20px; }

    .teppichboden-option-grid,
    .teppichboden-grid-3 { grid-template-columns: repeat(2, 1fr); }

    .teppichboden-form-grid { grid-template-columns: 1fr; }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    .teppichboden-modal-dialog { padding: 10px; }

    .teppichboden-modal-header { padding: 15px 20px; }
    .teppichboden-modal-header h2 { font-size: 20px; }

    .teppichboden-form-section,
    .teppichboden-content-section { padding: 16px; }

    .teppichboden-step h3 { font-size: 20px; }
    .teppichboden-step-description { font-size: 14px; margin-bottom: 18px; }

    .teppichboden-option-grid,
    .teppichboden-grid-3 { grid-template-columns: 1fr; gap: 12px; }

    .teppichboden-option-content { padding: 20px 16px; }

    .teppichboden-button-group {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 24px;
    }

    .teppichboden-btn { width: 100%; justify-content: center; }

    .teppichboden-progress-label { display: none; }

    .teppichboden-progress-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* Responsive — Small Mobile */
@media (max-width: 480px) {
    .teppichboden-modal-dialog { padding: 0; }

    .teppichboden-form-section,
    .teppichboden-content-section { padding: 12px; }

    .teppichboden-progress { padding: 0 4px; }
    .teppichboden-progress::before { left: 20px; right: 20px; }

    .teppichboden-progress-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .teppichboden-option-content { padding: 16px 12px; }
    .teppichboden-option-icon { font-size: 36px; margin-bottom: 8px; }
    .teppichboden-option-content h4 { font-size: 16px; }
}


/* ============================================================
   STANDALONE-MODUS — Konfigurator als Page (nicht Modal)
   Body trägt class="teppichboden-konfigurator-standalone"
   ============================================================ */

body.teppichboden-konfigurator-standalone {
    background: #eeeeee !important;
}

body.teppichboden-konfigurator-standalone .page-content {
    padding: 40px 0 60px !important;
    background: #eeeeee !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-modal,
body.teppichboden-konfigurator-standalone #teppichboden-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    overflow: visible !important;
    animation: none !important;
    z-index: auto !important;
    width: auto !important;
    height: auto !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-modal-dialog {
    min-height: auto !important;
    display: block !important;
    padding: 0 15px !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-modal-content {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    max-height: none !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: block !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-modal-header {
    display: none !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-modal-body {
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

body.teppichboden-konfigurator-standalone .teppichboden-form-section,
body.teppichboden-konfigurator-standalone .teppichboden-content-section {
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 1024px) {
    body.teppichboden-konfigurator-standalone .teppichboden-modal-body {
        flex-direction: column !important;
    }

    body.teppichboden-konfigurator-standalone .teppichboden-form-section,
    body.teppichboden-konfigurator-standalone .teppichboden-content-section {
        width: 100% !important;
        flex: none !important;
    }
}

@media (max-width: 768px) {
    body.teppichboden-konfigurator-standalone .page-content {
        padding: 20px 0 40px !important;
    }

    body.teppichboden-konfigurator-standalone .teppichboden-modal-dialog {
        padding: 0 8px !important;
    }
}
