/* Segafredo adjustments for the Zwernemann withdrawal pages, loaded after the module's own withdrawal.css */

.withdrawal-guest-search-container {
    margin: initial;
    max-width: 600px;
}

/* Page title already shows the order number */
.withdrawal-view-container > .block > .block-title {
    display: none;
}

/* Name fieldset: labels above inputs, first and last name side by side on desktop */
.withdrawal-name-fieldset > .legend {
    display: block;
    float: none;
    width: 100%;
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.withdrawal-name-fieldset.fieldset > .field,
.withdrawal-name-fieldset.fieldset > .field:not(.choice) > .label,
.withdrawal-name-fieldset.fieldset > .field:not(.choice) > .control {
    float: none;
    width: auto;
    text-align: left;
}

.withdrawal-name-fieldset.fieldset > .field:not(.choice) > .label {
    display: block;
    padding: 0;
    margin: 0 0 5px;
}

.withdrawal-name-fieldset .input-text {
    width: 100%;
    max-width: none;
}

@media (min-width: 768px) {
    .withdrawal-name-fieldset {
        display: flex;
        flex-wrap: wrap;
        column-gap: 20px;
    }

    .withdrawal-name-fieldset > .legend,
    .withdrawal-name-fieldset > .withdrawal-name-note {
        flex: 0 0 100%;
    }

    .withdrawal-name-fieldset > .field {
        flex: 0 1 300px;
    }

    .actions-toolbar > .primary {
        float: right;
    }

    .actions-toolbar > .secondary {
        float: left;
    }

    .column:not(.sidebar-additional) form .actions-toolbar, .column:not(.sidebar-main) form .actions-toolbar {
        margin-left: 0;
    }
}

/* Item table: room for the "withdrawn" badge in the selection column */
.withdrawal-view-container .table-order-items .col-withdrawal-select {
    width: 80px;
    white-space: nowrap;
}

/* Item table: cards instead of columns on mobile */
@media (max-width: 767px) {
    .withdrawal-view-container .table-order-items thead {
        display: none;
    }

    .withdrawal-view-container .table-order-items,
    .withdrawal-view-container .table-order-items tbody,
    .withdrawal-view-container .table-order-items tr,
    .withdrawal-view-container .table-order-items td {
        display: block;
        width: 100%;
    }

    .withdrawal-view-container .table-order-items tr {
        position: relative;
        padding: 10px 0 10px 35px;
        border-bottom: 1px solid #e0e0e0;
    }

    .withdrawal-view-container .table-order-items td {
        padding: 3px 0;
        border: 0;
    }

    .withdrawal-view-container .table-order-items td[data-th]::before {
        content: attr(data-th) ": ";
        font-weight: 600;
    }

    .withdrawal-view-container .table-order-items td.name::before {
        content: none;
    }

    .withdrawal-view-container .table-order-items td.name {
        font-weight: 600;
    }

    .withdrawal-view-container .table-order-items td.col-withdrawal-select {
        position: absolute;
        top: 12px;
        left: 0;
        width: auto;
    }

    /* Withdrawn items have no checkbox: show the badge above the name instead of in the checkbox slot */
    .withdrawal-view-container .table-order-items tr.withdrawal-item-withdrawn {
        padding-left: 0;
    }

    .withdrawal-view-container .table-order-items tr.withdrawal-item-withdrawn td.col-withdrawal-select {
        position: static;
    }

    .withdrawal-view-container .withdrawal-qty-input {
        display: inline-block;
        width: 70px;
        margin-left: 5px;
    }

    .withdrawal-view-container .actions-toolbar .action.submit {
        width: 100%;
    }
}

/* Order history: the table uses a fixed layout, give the withdrawal column room for its button */
@media (min-width: 768px) {
    .orders-history .table-order-items .col.withdrawal {
        width: 150px;
    }
}

.orders-history .col.withdrawal .action.primary {
    padding: .4em 1em;
    white-space: nowrap;
    line-height: initial;
    height: unset;
}

.orders-history .col.withdrawal .action.primary:hover {
    color: #fff;
}

/* Success page */
.withdrawal-success-container .actions-toolbar {
    flex-wrap: wrap;
    gap: 15px;
}

.withdrawal-success-container .actions-toolbar .secondary {
    margin-left: 0 !important;
}

/* Order view: action bar with reorder, print and withdrawal */
.order-actions-toolbar .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.order-actions-toolbar .actions .action {
    float: none;
    margin: 0;
}

.order-actions-toolbar .actions .action.primary {
    box-sizing: border-box;
    width: auto;
    height: 44px;
    margin-left: auto;
    padding: 12px 30px;
}

@media (max-width: 767px) {
    .order-actions-toolbar .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-actions-toolbar .actions .action.order,
    .order-actions-toolbar .actions .action.print,
    .order-actions-toolbar .actions .action.primary {
        justify-content: center;
        width: 100%;
        max-width: none;
        margin-left: 0;
        text-align: center;
    }

    .order-actions-toolbar .actions .action.primary {
        order: -1;
    }
}
