/* ──────────────────────────────────────────────────────────────────
   FrisbeeTeamOrder — Team-Bestellung Widget
   Modernes, klares Layout. Tritt im Buy-Widget-Slot der Variant-PDP auf.
   ────────────────────────────────────────────────────────────────── */

/* Im Team-Order-Modus bleiben Variant-Auswahl, Preis, Designer-Button sichtbar.
   Nur das Buy-Form (Mengenauswahl + moorl-Felder + Add-to-cart-Button) wird
   ausgeblendet — das moorl-File-Input bleibt im DOM und wird vom Designer-Plugin
   weiterhin befüllt. Wir lesen es beim Submit aus. */
.frisbee-team-order-mode form.product-detail-form,
.frisbee-team-order-mode form[data-add-to-cart="true"],
.frisbee-team-order-mode .product-detail-form-buy-container,
.frisbee-team-order-mode .product-detail-buy-quantity-container,
.frisbee-team-order-mode .product-detail-buy-button {
    display: none !important;
}

/* Aber: das Form muss im DOM bleiben, damit der Designer sein PDF
   ins moorl-File-Input legen kann. Daher position-absolute statt remove. */
.frisbee-team-order-mode form.product-detail-form,
.frisbee-team-order-mode form[data-add-to-cart="true"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    pointer-events: none !important;
    display: block !important; /* sonst wären die Inputs nicht erreichbar */
}

.fto {
    margin-top: 1.5rem;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    font-family: inherit;
}

.fto__header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.fto__title {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
}

.fto__lead {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Steps */
.fto-step {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.fto-step:last-of-type {
    border-bottom: 0;
}

.fto-step__num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.fto-step__body {
    flex: 1;
    min-width: 0;
}

.fto-step__title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #111;
    margin-bottom: 0.25rem;
}

.fto-step__desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

/* Design-CTA */
.fto-design-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.fto-design-status {
    color: #888;
    font-size: 0.875rem;
}

.fto-design-cta[data-fto-design-status="set"] .fto-design-status {
    color: #060;
    font-weight: 500;
}

.fto-design-cta[data-fto-design-status="set"] .fto-btn--primary::before {
    content: "✓ ";
}

/* Inputs */
.fto-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fto-input:focus {
    outline: none;
    border-color: #06c;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Player rows — als Cards, nicht als Tabelle */
.fto-players {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fto-player {
    display: grid;
    grid-template-columns: 32px 1fr 90px 1fr 32px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
}

.fto-player__num {
    color: #999;
    font-size: 0.85rem;
    text-align: center;
    user-select: none;
}

.fto-player input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 5px;
    background: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.fto-player input:hover {
    border-color: #ddd;
}

.fto-player input:focus {
    outline: none;
    border-color: #06c;
}

.fto-player__remove {
    background: transparent;
    border: 1px solid transparent;
    color: #aaa;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.15s;
}

.fto-player__remove:hover {
    border-color: #c00;
    background: rgba(204, 0, 0, 0.05);
    color: #c00;
}

/* Per-Row Color Override — als kompakter Inline-Toggle */
.fto-player__color-toggle {
    grid-column: 2 / -2;
    margin-top: 0.4rem;
    font-size: 0.8rem;
}

.fto-player__color-link {
    background: none;
    border: 0;
    color: #06c;
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.fto-player__color-link:hover {
    text-decoration-style: solid;
}

.fto-player__color-panel {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e0e8f4;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.fto-player__color-panel select {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 0.85rem;
    font-family: inherit;
}

.fto-player__color-panel-clear {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.fto-player__color-badge {
    color: #06c;
    font-size: 0.75rem;
    margin-left: 0.4rem;
    padding: 0.1rem 0.4rem;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 10px;
}

/* Action row */
.fto-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.fto-counter {
    margin-left: auto;
    color: #666;
    font-size: 0.9rem;
}

/* Buttons */
.fto-btn {
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
}

.fto-btn--primary {
    background: #06c;
    color: #fff;
    border-color: #06c;
}

.fto-btn--primary:hover {
    background: #0050a3;
    border-color: #0050a3;
}

.fto-btn--ghost {
    background: #fff;
    color: #444;
    border-color: #ddd;
}

.fto-btn--ghost:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.fto-btn--cta {
    background: #060;
    color: #fff;
    border-color: #060;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
}

.fto-btn--cta:hover:not(:disabled) {
    background: #048700;
    border-color: #048700;
}

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

/* Submit-Bereich */
.fto-submit {
    padding: 1.5rem;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.fto-feedback {
    margin: 0.75rem 0 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.fto-feedback--error {
    color: #c00;
}

.fto-feedback--success {
    color: #060;
}

/* Designer-Modal */
.fto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fto-modal {
    position: relative;
    width: min(95vw, 1100px);
    height: min(90vh, 800px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.fto-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
}

.fto-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cart-Offcanvas */
.fto-offcanvas-wrap {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.fto-offcanvas-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: auto;
}

.fto-offcanvas-overlay.is-open {
    background: rgba(0, 0, 0, 0.4);
}

.fto-offcanvas {
    position: absolute;
    top: 0;
    right: 0;
    width: min(440px, 95vw);
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    pointer-events: auto;
}

.fto-offcanvas.is-open {
    transform: translateX(0);
}

.fto-offcanvas-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #444;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 10;
}

.fto-offcanvas-body {
    padding: 1rem;
}

/* Mobile */
@media (max-width: 768px) {
    .fto-step {
        flex-direction: column;
        gap: 0.75rem;
    }

    .fto-player {
        grid-template-columns: 24px 1fr 70px 1fr 28px;
        gap: 0.35rem;
        font-size: 0.85rem;
    }
}
