/**
 * BL Catering System - Frontend Styles
 * WICHTIG: KEIN border-radius verwenden!
 * Farben: siehe Design/farben.md
 */

:root {
    --bl-primary: var(--e-global-color-primary, #8B1538);
    --bl-text: var(--e-global-color-text, #333);
    --bl-secondary: var(--e-global-color-4d429ad, #f5f5f5);
    --bl-border: var(--e-global-color-4326f11, #ddd);
}

/* Container - No outer restrictions for Elementor control */
.bl-catering-calculator {
    font-family: Arial, sans-serif;
    width: 100%;
    border: 2px solid var(--bl-border);
    padding: 30px;
}

.bl-calculator-form {
    position: relative;
}

/* Hidden */
.bl-hidden {
    display: none !important;
}

/* Form Steps */
.bl-form-step {
    animation: fadeIn 0.3s ease-in;
}

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

/* Typography */
.bl-step-title {
    color: var(--bl-primary);
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.bl-step-description {
    color: #666;
    font-size: 16px;
    margin: 0 0 30px 0;
}

/* Form Groups */
.bl-form-group {
    margin-bottom: 20px;
}

.bl-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bl-form-group-small {
    grid-column: span 1;
}

.bl-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--bl-text);
}

.bl-form-group input,
.bl-form-group select,
.bl-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--bl-border);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.bl-form-group input:focus,
.bl-form-group select:focus,
.bl-form-group textarea:focus {
    outline: none;
    border-color: var(--bl-primary);
}

.bl-hint {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Checkbox */
.bl-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
}

.bl-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

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

.bl-card {
    padding: 20px;
    border: 2px solid var(--bl-border);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.bl-card:hover {
    border-color: var(--bl-primary);
    background-color: #fff5f7;
}

.bl-card.selected {
    border-color: var(--bl-primary);
    background-color: var(--bl-primary);
    color: #fff;
}

.bl-card-icon {
    margin-bottom: 10px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bl-card-icon svg {
    width: 48px;
    height: 48px;
    color: var(--bl-primary);
}

.bl-card.selected .bl-card-icon svg {
    color: #fff;
}

.bl-card h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.bl-card p {
    font-size: 14px;
    margin: 0 0 10px 0;
    opacity: 0.9;
}

.bl-card.selected p {
    opacity: 1;
}

.bl-price-hint {
    display: block;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
}

.bl-card.selected .bl-price-hint {
    opacity: 1;
}

/* Result Box */
.bl-result-box {
    background: var(--bl-secondary);
    padding: 30px;
    margin-bottom: 30px;
    border-left: 4px solid var(--bl-primary);
}

.bl-result-box .bl-step-title {
    color: var(--bl-text);
}

.bl-logo-header {
    text-align: center;
    margin-bottom: 20px;
}

.bl-result-logo {
    max-width: 150px !important;
    height: auto;
    mix-blend-mode: multiply;
}

.bl-price-display {
    text-align: center;
    margin: 30px 0;
}

.bl-price-label {
    display: block;
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.bl-price-range {
    font-size: 36px;
    font-weight: 700;
    color: var(--bl-primary);
    margin: 10px 0;
}

.bl-price-note {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Recommendations */
.bl-recommendation {
    margin: 30px 0;
}

.bl-recommendation h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: var(--bl-text);
}

.bl-product-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bl-product-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bl-border);
}

.bl-product-list li:last-child {
    border-bottom: none;
}

.bl-note {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 20px;
}

/* Buttons - Horizontal Slide Animation */
.bl-btn {
    position: relative;
    display: inline-block;
    padding: 18px 50px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
}

.bl-btn span {
    position: relative;
    z-index: 2;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
}

.bl-btn::before {
    content: attr(data-hover-text);
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    font-weight: 600;
    z-index: 1;
}

.bl-btn:hover span {
    transform: translateX(500%);
}

.bl-btn:hover::before {
    left: 0;
}

/* Primary Button */
.bl-btn-primary {
    background: var(--bl-primary);
    color: #FFFFFF;
}

.bl-btn-primary::before {
    background: var(--bl-primary);
    filter: brightness(0.8);
    color: #FFFFFF;
}

.bl-btn-primary:hover {
    color: #FFFFFF;
}

/* Secondary Button (Outline Style) */
.bl-btn-secondary {
    background: transparent;
    border: 2px solid #999;
    color: #666;
    padding: 16px 48px;
}

.bl-btn-secondary::before {
    background: rgba(153, 153, 153, 0.1);
    color: #666;
}

.bl-btn-secondary:hover {
    border-color: #999;
    color: #666;
    background: rgba(153, 153, 153, 0.05);
}

.bl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Form Actions */
.bl-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.bl-form-actions .bl-btn-back {
    flex: 0 0 auto;
}

.bl-form-actions .bl-btn-next,
.bl-form-actions .bl-btn-submit {
    flex: 1;
}

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

.bl-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #28a745;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bl-success-icon svg {
    width: 48px;
    height: 48px;
}

.bl-success-message h2 {
    color: var(--bl-primary);
    margin: 0 0 15px 0;
}

.bl-success-message p {
    margin: 15px 0;
    line-height: 1.6;
}

.bl-next-steps {
    margin: 30px 0;
    text-align: left;
    background: var(--bl-secondary);
    padding: 20px;
}

.bl-next-steps h3 {
    margin: 0 0 15px 0;
    color: var(--bl-primary);
}

.bl-next-steps ol {
    margin: 0;
    padding-left: 20px;
}

.bl-next-steps li {
    margin: 8px 0;
}

/* Step Indicator */
.bl-step-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--bl-border);
}

.bl-step-dot {
    width: 12px;
    height: 12px;
    background: #ddd;
    cursor: pointer;
    transition: background 0.3s;
}

.bl-step-dot.active {
    background: var(--bl-primary);
}

/* Loading Overlay */
.bl-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bl-spinner-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bl-spinner-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.bl-spinner-track {
    fill: none;
    stroke: rgba(139, 21, 56, 0.1);
    stroke-width: 3;
}

.bl-spinner-progress {
    fill: none;
    stroke: var(--bl-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 282.7;
    stroke-dashoffset: 282.7;
    animation: fillCircle 2s ease-out forwards;
}

@keyframes fillCircle {
    0% {
        stroke-dashoffset: 282.7;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.bl-spinner-logo {
    position: relative;
    z-index: 2;
    max-width: 150px !important;
    height: auto;
    mix-blend-mode: multiply;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

.bl-loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--bl-text);
    font-weight: 600;
}

/* Error Messages */
.bl-error-message {
    padding: 15px;
    margin: 15px 0;
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .bl-catering-calculator {
        padding: 20px;
    }

    .bl-step-title {
        font-size: 24px;
    }

    .bl-option-cards {
        grid-template-columns: 1fr;
    }

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

    .bl-form-actions {
        flex-direction: column;
    }

    .bl-form-actions .bl-btn-back,
    .bl-form-actions .bl-btn-next,
    .bl-form-actions .bl-btn-submit {
        width: 100%;
    }

    .bl-btn {
        padding: 16px 40px;
        font-size: 14px;
        letter-spacing: 1.5px;
    }

    .bl-btn-secondary {
        padding: 14px 38px;
    }

    .bl-price-range {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .bl-catering-calculator {
        padding: 15px;
    }

    .bl-step-title {
        font-size: 20px;
    }

    .bl-card-icon svg {
        width: 36px;
        height: 36px;
    }

    .bl-card h3 {
        font-size: 16px;
    }

    .bl-success-icon {
        width: 60px;
        height: 60px;
    }

    .bl-success-icon svg {
        width: 36px;
        height: 36px;
    }

    .bl-btn {
        padding: 14px 30px;
        font-size: 13px;
        letter-spacing: 1px;
    }

    .bl-btn-secondary {
        padding: 12px 28px;
    }
}

/* Product Selection - Accordion Style */
.bl-product-category {
    margin-bottom: 15px;
    border: 2px solid var(--bl-border);
    overflow: hidden;
}

.bl-product-category-header {
    background: var(--bl-primary);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.bl-product-category-header:hover {
    background: #6d1029;
}

.bl-product-category-header h3 {
    color: white;
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}

.bl-accordion-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: white;
}

.bl-product-category.active .bl-accordion-icon {
    transform: rotate(180deg);
}

.bl-product-category-header {
    cursor: pointer;
    user-select: none;
}

.bl-product-items-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.bl-product-category.active .bl-product-items-wrapper {
    max-height: 600px;
    overflow-y: auto;
    transition: max-height 0.6s ease-in;
}

.bl-product-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #fafafa;
}

@media (min-width: 768px) {
    .bl-product-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bl-product-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bl-product-item {
    display: block;
    border: 1px solid var(--bl-border);
    background: white;
    transition: all 0.3s;
}

.bl-product-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bl-product-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.bl-product-info {
    padding: 10px;
}

.bl-product-info strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--bl-primary);
}

.bl-product-info p {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bl-product-price {
    display: none;
}

.bl-product-quantity {
    padding: 0 10px 10px 10px;
}

.bl-qty-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--bl-border);
    text-align: center;
    font-size: 14px;
}

.bl-loading-placeholder {
    text-align: center;
    padding: 40px;
    color: #666;
}

.bl-summary-item {
    margin-bottom: 20px;
}

.bl-summary-item h3 {
    color: var(--bl-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bl-summary-item h3 svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Datepicker Styling */
.bl-datepicker {
    position: relative;
    font-size: 18px;
    padding: 16px;
    cursor: pointer;
}

/* Chrome zeigt roten Rahmen bei leeren required date inputs - das deaktivieren */
.bl-datepicker:invalid,
.bl-form-group input[type="date"]:invalid {
    box-shadow: none; /* Firefox */
    outline: none;
}

/* Kalender-Icon komplett ausblenden - Feld ist überall klickbar durch showPicker() */
.bl-datepicker::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

/* Firefox */
.bl-datepicker::-moz-calendar-picker-indicator {
    display: none;
}

.bl-datepicker::-webkit-datetime-edit {
    padding: 4px;
}

.bl-datepicker::-webkit-datetime-edit-fields-wrapper {
    background: transparent;
}

.bl-datepicker::-webkit-datetime-edit-text {
    color: var(--bl-text);
    padding: 0 4px;
}

.bl-datepicker::-webkit-datetime-edit-month-field,
.bl-datepicker::-webkit-datetime-edit-day-field,
.bl-datepicker::-webkit-datetime-edit-year-field {
    color: var(--bl-primary);
    font-weight: 600;
}

/* Dark Theme */
.bl-catering-calculator[data-theme="dark"] {
    background: #1a1a1a;
    color: #fff;
}

.bl-catering-calculator[data-theme="dark"] .bl-form-group input,
.bl-catering-calculator[data-theme="dark"] .bl-form-group select,
.bl-catering-calculator[data-theme="dark"] .bl-form-group textarea {
    background: #2a2a2a;
    color: #fff;
    border-color: #444;
}

.bl-catering-calculator[data-theme="dark"] .bl-card {
    background: #2a2a2a;
    border-color: #444;
}

.bl-catering-calculator[data-theme="dark"] .bl-result-box {
    background: #2a2a2a;
}

/* Portion Size Selection Cards */
.bl-portion-size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.bl-portion-card {
    position: relative;
    border: 3px solid var(--bl-border);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    min-height: 180px;
}

.bl-portion-card:hover {
    border-color: var(--bl-primary);
    box-shadow: 0 4px 12px rgba(139, 21, 56, 0.15);
    transform: translateY(-2px);
}

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

.bl-portion-card:has(input[type="radio"]:checked) {
    background: var(--bl-primary);
    border-color: var(--bl-primary);
}

.bl-portion-card:has(input[type="radio"]:checked) strong,
.bl-portion-card:has(input[type="radio"]:checked) p {
    color: white;
}

.bl-portion-card:has(input[type="radio"]:checked)::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.bl-portion-card-content {
    position: relative;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bl-portion-icon {
    font-size: 48px;
    margin-bottom: 15px;
    line-height: 1;
}

.bl-portion-card strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--bl-text);
    transition: color 0.3s ease;
}

.bl-portion-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* Mobile responsiveness for portion cards */
@media (max-width: 768px) {
    .bl-portion-size-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
