/* Request a Quote: free-form rows. Palette and type follow the quote form
   (navy #183a4b, gold #f6be00, Montserrat, square #B7B8BA inputs). */
.tvqfi,
body.yith-request-a-quote-page #yith-ywrq-table-list {
    --tvqfi-h: 38px;
}

.tvqfi {
    flex: 1 1 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 28px 0 8px;
    padding: 24px;
    background: #f7f9fa;
    border: 1px solid #dde4e7;
    border-top: 4px solid #f6be00;
    font-family: 'Montserrat', sans-serif;
}

/* The theme styles bare h3s; this needs the extra specificity to win. */
body .tvqfi .tvqfi__title {
    margin: 0 0 6px;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #183a4b;
    text-transform: none;
}

.tvqfi__lead {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    color: #4f5f68;
}

.tvqfi__head,
.tvqfi__row {
    display: grid;
    grid-template-columns: minmax(0, 2.8fr) minmax(0, 1fr) 112px 38px;
    gap: 10px;
    align-items: center;
}

.tvqfi__head {
    padding: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #183a4b;
}

.tvqfi__row { margin: 0 0 10px; }

.tvqfi__cell { display: block; margin: 0; }

.tvqfi input[type="text"] {
    width: 100%;
    height: var(--tvqfi-h);
    box-sizing: border-box;
    margin: 0;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: calc(var(--tvqfi-h) - 2px);
    color: #666;
    box-shadow: none;
    transition: border-color .15s;
}

/* Neutral focus (no blue or gold ring), shared by every field in the rows. */
.tvqfi input[type="text"]:focus,
.tvqfi__stepper input[type="number"]:focus {
    outline: none;
    border-color: #999;
    box-shadow: none;
}

/* Quantity control: one look for both the product list and these rows: same
   size, font and grey +/- buttons with no blue (not even on hover). No loader on
   a quantity change in either place. */
.tvqfi__stepper,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    width: 104px;
    height: var(--tvqfi-h);
    margin: 0;
}

.tvqfi__stepper input[type="number"],
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity input.qty {
    flex: 1 1 auto;
    width: 40px;
    min-width: 0;
    height: var(--tvqfi-h);
    margin: 0;
    padding: 0 2px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: calc(var(--tvqfi-h) - 2px);
    text-align: center;
    color: #666;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* YITH blocks the quantity box with an overlay + spinner while it saves the new
   quantity in the background. No loader on a quantity change: hide it (the save
   itself is unchanged; Update/Clear List keep their own overlay). */
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity > .blockUI {
    display: none !important;
}

/* style.css pins the list's quantity field to 32x28 / 13px with !important; follow the
   shared control height instead so the list and the rows stay identical. */
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity input.qty {
    width: 40px !important;
    height: var(--tvqfi-h) !important;
    min-height: var(--tvqfi-h) !important;
    font-size: 14px !important;
}

.tvqfi__stepper input[type="number"]::-webkit-outer-spin-button,
.tvqfi__stepper input[type="number"]::-webkit-inner-spin-button,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity input.qty::-webkit-outer-spin-button,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tvqfi__step,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity .minus,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity .plus {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px !important;
    height: var(--tvqfi-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #f2f2f2 !important;
    border: 1px solid #ddd !important;
    border-radius: 3px;
    font-family: Roboto, sans-serif;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1;
    color: #333 !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background .15s;
}

.tvqfi__step:hover,
.tvqfi__step:focus-visible,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity .minus:hover,
body.yith-request-a-quote-page #yith-ywrq-table-list .product-quantity .quantity .plus:hover {
    background: #e4e4e4 !important;
    color: #333 !important;
}

.tvqfi__remove {
    width: var(--tvqfi-h);
    height: var(--tvqfi-h);
    padding: 0;
    background: #183a4b;
    border: 1px solid #183a4b;
    border-radius: 3px;
    font-family: Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.tvqfi__remove:hover,
.tvqfi__remove:focus-visible {
    background: #f6be00;
    border-color: #f6be00;
    color: #183a4b;
}

.tvqfi__add {
    margin-top: 6px;
    padding: 11px 18px;
    background: #183a4b;
    border: 0;
    border-radius: 3px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.tvqfi__add:hover:not(:disabled),
.tvqfi__add:focus-visible { background: #f6be00; color: #183a4b; }

.tvqfi__add:disabled { opacity: .5; cursor: not-allowed; }

.tvqfi__add span { font-size: 15px; margin-right: 4px; }

/* Layout: the quote page puts the list and the form side by side. Keep this
   section under the list, in the list's column. */
body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* The form spans four rows; without an explicit stretchy last row the
       extra height it adds is shared out between the list and this section,
       leaving a gap between them. */
    grid-template-rows: auto auto auto 1fr;
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
    align-content: start;
}

body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > .ywraq-before-form,
body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > form#yith-ywraq-form,
body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > .tvqfi {
    grid-column: 1;
}

/* YITH leaves 30px under the Clear/Update List buttons; with this section right
   below, that plus the section's own margin read as a big gap. */
body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > form#yith-ywraq-form .update-list-wrapper {
    margin-bottom: 0;
}

body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > .tvqfi {
    margin-top: 16px;
}

body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > .yith-ywraq-mail-form-wrapper {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin-left: 0 !important;
}

@media (max-width: 900px) {
    body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) {
        grid-template-columns: minmax(0, 1fr);
    }
    body.yith-request-a-quote-page .ywraq-form-table-wrapper:has(.tvqfi) > .yith-ywraq-mail-form-wrapper {
        grid-column: 1;
        grid-row: auto;
        margin-top: 24px;
    }
}

@media (max-width: 640px) {
    .tvqfi { padding: 18px 14px; }
    .tvqfi__head { display: none; }
    .tvqfi__row {
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 8px;
        padding: 12px;
        background: #fff;
        border: 1px solid #dde4e7;
    }
    .tvqfi__cell--name, .tvqfi__cell--sku, .tvqfi__cell--qty { grid-column: 1; }
    .tvqfi__remove { grid-column: 2; grid-row: 1; }
    .tvqfi__cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        color: #183a4b;
    }
    .tvqfi__cell--qty .tvqfi__stepper { max-width: 104px; }
}

/* Clear List and Update List: style.css gives Update List a 20px top margin and
   a shorter height, so the two buttons sat at different heights. Same height,
   centred on one line. */
body.yith-request-a-quote-page .update-list-wrapper {
    align-items: center;
}

body.yith-request-a-quote-page .update-list-wrapper .after-table-right,
body.yith-request-a-quote-page .update-list-wrapper .after-table-right .button {
    margin-top: 0;
    margin-bottom: 0;
}

body.yith-request-a-quote-page .update-list-wrapper .ywraq_clean_list,
body.yith-request-a-quote-page .update-list-wrapper input[name="update_raq"] {
    box-sizing: border-box;
    height: 40px;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 12px;
    line-height: 40px;
}

/* ── Quote detail page (/request-quote/?quote=ID&preview=1) ─────────────────
   Same palette and card look as the rest of the quote pages. */
body.yith-request-a-quote-page .ywraq-view-quote-wrapper {
    --tvq-line: #dde4e7;
    font-family: Roboto, sans-serif;
    color: #1c2b33;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper > header {
    margin: 6px 0 12px;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper > header h2 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #183a4b;
}

/* The wrapper is a wrapping flex row: header and cards take the full width, the
   request date and status share one line, "Continue shopping" is ordered last. */
body.yith-request-a-quote-page .ywraq-view-quote-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 28px;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper > header,
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > table.order_details,
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > .tvqfi-view,
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > .ywraq-additional-information,
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > .ywraq-admin-message {
    flex: 0 0 100%;
    box-sizing: border-box;
}

/* Request date and status on one line, status as a badge. */
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > p:not(.tvqfi-view__actions) {
    flex: 0 0 auto;
    margin: 0 0 18px;
    font-size: 14px;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper .ywraq-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: #fff4d6;
    font-size: 13px;
    font-weight: 600;
    color: #183a4b;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.shop_table.order_details {
    width: 100%;
    margin: 0 0 24px;
    border: 1px solid var(--tvq-line);
    border-radius: 6px;
    padding: 0 !important;
    background: #fff !important;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details thead th {
    padding: 14px 18px;
    background: #f3f6f7;
    border: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #183a4b;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details tbody td {
    padding: 14px 18px;
    border: 0;
    border-top: 1px solid var(--tvq-line);
    vertical-align: middle;
    font-size: 15px;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details tbody img {
    width: 64px;
    height: auto;
    border: 1px solid var(--tvq-line);
    background: #fff;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details .product-quantity {
    font-weight: 600;
    color: #183a4b;
}

/* New requests show the products in the cards' own table instead of YITH's. */
body.yith-request-a-quote-page .ywraq-view-quote-wrapper.ywraq-status-ywraq-new > table.shop_table.order_details {
    display: none;
}

/* A request made only of free-form items has no products: no empty products bar. */
body.yith-request-a-quote-page .ywraq-view-quote-wrapper > table.order_details:not(:has(tbody tr)) {
    display: none;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details tfoot:empty,
body.yith-request-a-quote-page .ywraq-view-quote-wrapper table.order_details tfoot:not(:has(td, th)) {
    display: none;
}

.tvqfi-view__sku {
    margin-top: 2px;
    font-size: 13px;
    color: #4f5f68;
}

/* Cards: additional items and customer details share one look. */
.tvqfi-view,
body.yith-request-a-quote-page .ywraq-additional-information .ywraq-customer-information {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 24px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--tvq-line, #dde4e7);
    border-radius: 6px;
}

.tvqfi-view h3,
body.yith-request-a-quote-page .ywraq-customer-information header h3 {
    margin: 0 0 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #183a4b;
}

.tvqfi-view table.tvqfi-items {
    margin: 0;
    font-size: 15px;
    table-layout: fixed;
}

/* Same column widths in the products and additional-items tables. */
.tvqfi-view table.tvqfi-items th:nth-child(1) { width: 44px !important; }
.tvqfi-view table.tvqfi-items th:nth-child(3) { width: 22% !important; }
.tvqfi-view table.tvqfi-items th:nth-child(4) { width: 90px !important; }
.tvqfi-view table.tvqfi-items td { overflow-wrap: anywhere; }

body.yith-request-a-quote-page .ywraq-additional-information {
    display: block;
}

body.yith-request-a-quote-page .ywraq-customer-information .ywraq-view-quote__customer-info {
    margin: 0 0 8px;
    font-size: 15px;
}

/* The free-form rows now have their own card; hide YITH's inline copy (its
   label line, the table and the empty paragraphs it leaves behind). */
body.yith-request-a-quote-page .ywraq-customer-information p.ywraq-view-quote__customer-info:has(+ table.tvqfi-items),
body.yith-request-a-quote-page .ywraq-customer-information > table.tvqfi-items,
body.yith-request-a-quote-page .ywraq-customer-information p:empty {
    display: none;
}

body.yith-request-a-quote-page .ywraq-view-quote-wrapper > .tvqfi-view__actions {
    order: 99;
    flex: 0 0 100%;
    margin: 4px 0 24px;
}

.tvqfi-view__btn {
    display: inline-block;
    padding: 12px 22px;
    background: #183a4b;
    border-radius: 3px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none !important;
    color: #fff !important;
    transition: background .2s, color .2s;
}

.tvqfi-view__btn:hover,
.tvqfi-view__btn:focus-visible {
    background: #f6be00;
    color: #183a4b !important;
}

