/* =========================================================
   Fitness Brot Bestellungen – Frontend Styles
   Dark theme · Accent: #3A8690
   ========================================================= */

/* ---- CSS Custom Properties (matching site theme) ---- */
.fbo-wrap {
    --fbo-accent:       #3a8690;
    --fbo-accent-dark:  #2e6b74;
    --fbo-accent-glow:  rgba(58, 134, 144, 0.15);
    --fbo-surface:      rgba(255, 255, 255, 0.04);
    --fbo-surface-alt:  rgba(255, 255, 255, 0.07);
    --fbo-border:       rgba(255, 255, 255, 0.09);
    --fbo-border-focus: rgba(58, 134, 144, 0.6);
    --fbo-text-head:    #f0eeeb;
    --fbo-text-body:    rgba(240, 238, 235, 0.65);
    --fbo-text-muted:   rgba(240, 238, 235, 0.38);
    --fbo-radius-card:  14px;
    --fbo-radius-input: 8px;
}

/* ---- Wrapper ---- */
.fbo-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ---- Heading overrides — white on dark ---- */
.fbo-wrap h2,
.fbo-wrap h3 {
    color: var(--fbo-text-head) !important;
    -webkit-text-fill-color: var(--fbo-text-head) !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* ---- Progress indicator ---- */
.fbo-progress {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding: 28px 0 20px;
}

.fbo-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.35;
    transition: opacity 0.3s;
}

.fbo-progress-step.fbo-step-active {
    opacity: 1;
}

.fbo-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--fbo-text-muted);
    font-weight: 700;
    font-size: 13px;
    font-family: 'Geist Mono', monospace, sans-serif;
    letter-spacing: 0.02em;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
    border: 1px solid var(--fbo-border);
}

.fbo-progress-step.fbo-step-active .fbo-step-number {
    background: var(--fbo-accent);
    color: #fff;
    border-color: var(--fbo-accent);
    box-shadow: 0 0 14px rgba(58, 134, 144, 0.4);
}

.fbo-step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fbo-text-body);
    letter-spacing: 0.01em;
}

.fbo-progress-step.fbo-step-active .fbo-step-label {
    color: var(--fbo-text-head);
}

.fbo-progress-divider {
    flex: 1;
    height: 1px;
    background: var(--fbo-border);
    margin: 0 16px;
}

/* ---- Step heading ---- */
.fbo-step > h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 0 20px !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid var(--fbo-border) !important;
    color: var(--fbo-text-head) !important;
    -webkit-text-fill-color: var(--fbo-text-head) !important;
    letter-spacing: -0.01em;
}

/* ---- Bread list ---- */
.fbo-bread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

/* ---- Bread card ---- */
.fbo-bread-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--fbo-surface);
    border: 1px solid var(--fbo-border);
    border-radius: var(--fbo-radius-card);
    padding: 16px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.fbo-bread-card:hover {
    border-color: rgba(58, 134, 144, 0.4);
    background: var(--fbo-surface-alt);
}

.fbo-bread-card.fbo-selected {
    border-color: var(--fbo-accent);
    background: rgba(58, 134, 144, 0.08);
    box-shadow: 0 0 0 1px rgba(58, 134, 144, 0.2);
}

/* ---- Bread image ---- */
.fbo-bread-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--fbo-border);
}

.fbo-bread-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}

.fbo-bread-no-image {
    font-size: 34px;
    line-height: 1;
}

/* ---- Bread info ---- */
.fbo-bread-info {
    flex: 1;
    min-width: 0;
}

.fbo-bread-info h3 {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 5px !important;
    line-height: 1.3 !important;
    color: var(--fbo-text-head) !important;
    -webkit-text-fill-color: var(--fbo-text-head) !important;
}

.fbo-bread-desc {
    font-size: 13px;
    color: var(--fbo-text-body);
    margin: 0 0 10px;
    line-height: 1.55;
}

/* ---- Nutrition toggle ---- */
.fbo-toggle-nutrition {
    background: none;
    border: none;
    color: var(--fbo-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.fbo-toggle-nutrition:hover {
    opacity: 1;
}

.fbo-nutrition-details {
    margin-top: 10px;
    padding: 0 12px;
    background: rgba(58, 134, 144, 0.07);
    border: 1px solid rgba(58, 134, 144, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--fbo-text-body);
    line-height: 1.65;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
}

.fbo-nutrition-details.fbo-visible {
    max-height: 500px;
    opacity: 1;
    padding: 12px;
}

.fbo-nutrition-details p {
    margin: 0 0 6px;
}

.fbo-nutrition-details p:last-child {
    margin-bottom: 0;
}

/* ---- Bread order controls (price + stepper) ---- */
.fbo-bread-order {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.fbo-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--fbo-accent);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ---- Quantity stepper ---- */
.fbo-qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--fbo-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.fbo-qty-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 38px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    color: var(--fbo-text-body);
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fbo-qty-btn:hover {
    background: var(--fbo-accent);
    color: #fff;
}

.fbo-qty-input {
    width: 44px;
    height: 38px;
    border: none;
    border-left: 1px solid var(--fbo-border);
    border-right: 1px solid var(--fbo-border);
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--fbo-text-head);
    background: transparent;
    -moz-appearance: textfield;
    outline: none;
}

.fbo-qty-input::-webkit-outer-spin-button,
.fbo-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Step 1 footer ---- */
.fbo-step1-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--fbo-border);
    gap: 16px;
    flex-wrap: wrap;
}

.fbo-total-display {
    font-size: 16px;
    font-weight: 500;
    color: var(--fbo-text-body);
}

.fbo-total-amount {
    color: var(--fbo-accent);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

/* ---- Buttons ---- */
.fbo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.fbo-btn:active {
    transform: scale(0.97);
}

.fbo-btn-primary {
    background: var(--fbo-accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(58, 134, 144, 0.25);
}

.fbo-btn-primary:hover {
    background: var(--fbo-accent-dark);
    box-shadow: 0 4px 18px rgba(58, 134, 144, 0.35);
}

.fbo-btn-primary:disabled,
.fbo-btn-primary[disabled] {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fbo-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fbo-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--fbo-text-body);
    border: 1px solid var(--fbo-border);
}

.fbo-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fbo-text-head);
}

/* ---- Order summary (step 2) ---- */
.fbo-order-summary {
    background: rgba(58, 134, 144, 0.07);
    border: 1px solid rgba(58, 134, 144, 0.22);
    border-radius: var(--fbo-radius-card);
    padding: 20px;
    margin-bottom: 24px;
}

.fbo-order-summary h3 {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    margin: 0 0 14px !important;
    color: var(--fbo-accent) !important;
    -webkit-text-fill-color: var(--fbo-accent) !important;
}

.fbo-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fbo-summary-item:last-of-type {
    border-bottom: none;
}

.fbo-summary-item-name {
    flex: 1;
    color: var(--fbo-text-head);
}

.fbo-summary-item-qty {
    color: var(--fbo-text-muted);
    margin: 0 16px;
    font-size: 13px;
}

.fbo-summary-item-price {
    font-weight: 700;
    color: var(--fbo-accent);
    white-space: nowrap;
}

.fbo-summary-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(58, 134, 144, 0.3);
    text-align: right;
    font-size: 17px;
    font-weight: 700;
    color: var(--fbo-text-head);
    letter-spacing: -0.01em;
}

/* ---- Notice ---- */
.fbo-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fbo-next-week-notice {
    background: rgba(240, 180, 41, 0.08);
    border: 1px solid rgba(240, 180, 41, 0.3);
    color: rgba(240, 200, 80, 0.9);
}

/* ---- Form section separator ---- */
.fbo-form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fbo-text-muted);
    margin: 24px 0 16px;
}

/* ---- Form rows ---- */
.fbo-form-row {
    margin-bottom: 16px;
}

.fbo-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

.fbo-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fbo-text-body);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.fbo-required {
    color: var(--fbo-accent);
    margin-left: 1px;
}

.fbo-form-group input[type="text"],
.fbo-form-group input[type="email"],
.fbo-form-group input[type="tel"],
.fbo-form-group select {
    padding: 11px 14px;
    border: 1px solid var(--fbo-border);
    border-radius: var(--fbo-radius-input);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fbo-text-head);
    width: 100%;
    -webkit-appearance: none;
}

.fbo-form-group select option {
    background: #1a1a1a;
    color: #f0eeeb;
}

.fbo-form-group input::placeholder {
    color: var(--fbo-text-muted);
}

.fbo-form-group input:focus,
.fbo-form-group select:focus {
    outline: none;
    border-color: var(--fbo-accent);
    background: rgba(58, 134, 144, 0.06);
    box-shadow: 0 0 0 3px rgba(58, 134, 144, 0.12);
}

.fbo-form-group input.fbo-invalid,
.fbo-form-group select.fbo-invalid {
    border-color: rgba(220, 53, 69, 0.7);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ---- Checkbox ---- */
.fbo-checkbox-group {
    margin-top: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--fbo-border);
    border-radius: var(--fbo-radius-input);
}

.fbo-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.6;
    color: var(--fbo-text-body);
}

.fbo-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--fbo-accent);
    cursor: pointer;
}

#fbo-order-text-display {
    color: var(--fbo-text-body);
}

/* ---- Form error ---- */
.fbo-form-error {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: rgba(255, 120, 130, 0.95);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ---- Form actions ---- */
.fbo-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--fbo-border);
    flex-wrap: wrap;
}

/* ---- Confirmation screen ---- */
.fbo-confirmation {
    text-align: center;
    padding: 48px 20px;
}

.fbo-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--fbo-accent);
    color: #fff;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 32px rgba(58, 134, 144, 0.4);
}

.fbo-confirmation h2 {
    font-size: 26px !important;
    margin-bottom: 10px !important;
    letter-spacing: -0.02em;
}

.fbo-confirmation-text {
    font-size: 15px;
    color: var(--fbo-text-body);
    margin-bottom: 28px;
    line-height: 1.6;
}

.fbo-confirmation-summary {
    background: rgba(58, 134, 144, 0.07);
    border: 1px solid rgba(58, 134, 144, 0.2);
    border-radius: var(--fbo-radius-card);
    padding: 20px;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.9;
    color: var(--fbo-text-body);
}

/* ---- Global error ---- */
.fbo-global-error {
    padding: 20px;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.25);
    border-radius: var(--fbo-radius-card);
    color: rgba(255, 120, 130, 0.9);
    text-align: center;
}

/* ---- Loading state ---- */
.fbo-btn-loading {
    position: relative;
    pointer-events: none;
}

.fbo-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fbo-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes fbo-spin {
    to { transform: rotate(360deg); }
}

/* ---- Mobile responsive ---- */
@media (max-width: 600px) {
    .fbo-bread-card {
        flex-wrap: wrap;
    }

    .fbo-bread-order {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--fbo-border);
    }

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

    .fbo-step1-footer {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .fbo-progress-step .fbo-step-label {
        font-size: 13px;
    }
}
