/* UI-only overlay for the existing PakCosmetics Web Forms checkout.
   No gateway, validation, order, session or database changes in this stylesheet. */
.pak-checkout-mobile .pak-hazmat-badge {
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    margin-top: .35rem;
    padding: 2px 6px;
    border: 1px solid #e7b8bd;
    border-radius: 3px;
    background: #fff2f3;
    color: #842029;
    font-size: max(12px, .75rem);
    font-weight: 600;
    line-height: 1.5;
    white-space: normal;
}
.pak-checkout-mobile .pak-account-prompt {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #c8d3b9;
    background: #f5f8f0;
}
.pak-checkout-mobile .pak-account-prompt strong { color: #252525; font-size: 1rem; }
.pak-checkout-mobile .pak-account-prompt p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: .75rem 0 0;
}
.pak-checkout-mobile .pak-account-prompt p > span { flex: 1 1 12rem; }
.pak-checkout-mobile .pak-account-prompt a:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .65rem 1.25rem;
    border: 1px solid #435f15;
    background: #435f15;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}
.pak-checkout-mobile .pak-account-prompt a:hover { background: #334910; }
.pak-checkout-mobile .pak-billing-shortcut,
.pak-checkout-mobile .pak-address-default-note {
    margin-top: 1rem;
    padding: .75rem;
    border: 1px solid #ddd;
    background: #fafafa;
}
.pak-checkout-mobile .pak-billing-shortcut p { margin: 0 0 .5rem; }
.pak-checkout-mobile .pak-billing-shortcut button {
    min-height: 44px;
    padding: .5rem .75rem;
    border: 1px solid #435f15;
    background: #fff;
    color: #334910;
    font: inherit;
    line-height: 1.5;
    text-decoration: underline;
    cursor: pointer;
}
.pak-checkout-mobile,
.pak-checkout-mobile-modal {
    --pak-gap: 1rem;
    --pak-half-gap: .5rem;
    --pak-card-gap: 1.5rem;
    --pak-text: 1rem;
    --pak-small: .875rem;
    --pak-heading: 1.25rem;
    --pak-ink: #252525;
    --pak-muted: #555;
    --pak-line: #b7b7b7;
    --pak-surface: #fff;
    --pak-focus: #222;
    --pak-accent: #426218;
    --pak-accent-hover: #344e12;
    color: var(--pak-ink);
}
.pak-checkout-mobile *,
.pak-checkout-mobile-modal * { box-sizing: border-box; }
.pak-checkout-mobile .pak-checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-rows: min-content 1fr;
    gap: var(--pak-card-gap);
    align-items: start;
    margin: 0;
}
.pak-checkout-mobile .pak-checkout-grid > .pak-checkout-column {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
    margin-top: 0 !important;
}
.pak-checkout-mobile .pak-checkout-address { grid-column: 1; grid-row: 1 / span 2; }
.pak-checkout-mobile .pak-checkout-basket { grid-column: 2; grid-row: 1; }
.pak-checkout-mobile .pak-checkout-payment { grid-column: 2; grid-row: 2; }
.pak-checkout-mobile .card-body,
.pak-checkout-mobile-modal .modal-body { padding: var(--pak-card-gap); }
.pak-checkout-mobile .card,
.pak-checkout-mobile-modal .modal-dialog { min-width: 0; }
.pak-checkout-mobile h2,
.pak-checkout-mobile h3 { font-size: var(--pak-heading); line-height: 1.4; }
.pak-checkout-mobile a:not(.btn),
.pak-checkout-mobile .custom-color { color: var(--pak-accent) !important; }
.pak-checkout-mobile a:hover { color: var(--pak-accent-hover); }
.pak-checkout-mobile .btn:not(.btn-outline-secondary),
.pak-checkout-mobile-modal .btn:not(.btn-outline-secondary) {
    background-color: var(--pak-accent);
    border-color: var(--pak-accent);
    color: #fff;
}
.pak-checkout-mobile .btn:not(.btn-outline-secondary):hover,
.pak-checkout-mobile-modal .btn:not(.btn-outline-secondary):hover { background-color: var(--pak-accent-hover); }
.pak-checkout-mobile .btn-outline-secondary,
.pak-checkout-mobile-modal .btn-outline-secondary {
    color: var(--pak-ink);
    background-color: #f5f5f5;
    border: 1px solid var(--pak-line) !important;
}
.pak-checkout-mobile label,
.pak-checkout-mobile-modal label {
    line-height: 1.5;
    font-size: var(--pak-small);
    text-transform: none !important;
    white-space: normal;
    overflow-wrap: anywhere;
}
.pak-checkout-mobile .form-control,
.pak-checkout-mobile-modal .form-control {
    /* Beat the theme's fixed height and Bootstrap's more-specific select rule.
       Reserve room for the full line box, including larger mobile text. */
    box-sizing: border-box !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 52px;
    padding: .625rem .75rem !important;
    font-size: max(16px, var(--pak-text)) !important;
    line-height: 1.5 !important;
    color: var(--pak-ink);
    background-color: var(--pak-surface);
    border-color: var(--pak-line);
}
.pak-checkout-mobile select.form-control:not([multiple]):not([size]),
.pak-checkout-mobile-modal select.form-control:not([multiple]):not([size]) {
    /* Still a native select/picker, not a replacement JS dropdown. Zero vertical
       padding avoids iOS native text clipping; height grows with the text size. */
    height: calc(1.5em + 1.25rem + 4px) !important;
    padding: 0 2.5rem 0 .75rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 12px 8px !important;
}
.pak-checkout-mobile .select-wrapper::before,
.pak-checkout-mobile .select-wrapper::after,
.pak-checkout-mobile .select-wrapper-sm::before,
.pak-checkout-mobile .select-wrapper-sm::after,
.pak-checkout-mobile-modal .select-wrapper::before,
.pak-checkout-mobile-modal .select-wrapper::after { display: none !important; }
.pak-checkout-mobile .form-group,
.pak-checkout-mobile-modal .form-group { margin-bottom: var(--pak-gap); }
.pak-checkout-mobile button,
.pak-checkout-mobile .btn,
.pak-checkout-mobile input[type=submit],
.pak-checkout-mobile-modal button,
.pak-checkout-mobile-modal .btn { min-height: 48px; white-space: normal; line-height: 1.5; }
.pak-checkout-mobile [id$="Paymentbtn"] { width: 100%; font-size: var(--pak-text); }
.pak-checkout-mobile .row > *,
.pak-checkout-mobile-modal .row > * { min-width: 0; }
.pak-checkout-mobile .pak-field-wide,
.pak-checkout-mobile-modal .pak-field-wide { flex: 0 0 100%; max-width: 100%; }
.pak-checkout-mobile .pak-disclosure {
    display: block;
    margin-block: var(--pak-half-gap) var(--pak-gap);
    border-block: 1px solid var(--pak-line);
    color: var(--pak-ink);
}
.pak-checkout-mobile .pak-disclosure > summary {
    display: list-item;
    min-height: 48px;
    padding: .75rem var(--pak-half-gap);
    font-size: var(--pak-small);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    list-style: disclosure-closed inside;
}
.pak-checkout-mobile .pak-disclosure[open] > summary { list-style-type: disclosure-open; }
.pak-checkout-mobile .pak-disclosure-content { padding: var(--pak-gap) 0; }
.pak-checkout-mobile .pak-disclosure .row { margin-inline: 0; }
.pak-checkout-mobile .pak-disclosure .row > * { padding-inline: 0; }
.pak-checkout-mobile .pak-disclosure input,
.pak-checkout-mobile .pak-disclosure textarea { scroll-margin-top: var(--pak-gap); }
.pak-checkout-mobile input[type=checkbox],
.pak-checkout-mobile input[type=radio],
.pak-checkout-mobile-modal input[type=checkbox] {
    display: inline-block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 20px;
    height: 20px;
    margin-right: var(--pak-half-gap);
    vertical-align: middle;
    flex-shrink: 0;
}
.pak-checkout-mobile input[type=checkbox] + label,
.pak-checkout-mobile input[type=radio] + label {
    display: inline-block;
    min-height: 44px;
    padding-block: .75rem;
    max-width: calc(100% - 2rem);
    vertical-align: middle;
    margin-bottom: 0;
    padding-left: 0 !important;
}
.pak-checkout-mobile input[type=checkbox] + label::before,
.pak-checkout-mobile input[type=checkbox] + label::after,
.pak-checkout-mobile input[type=radio] + label::before,
.pak-checkout-mobile input[type=radio] + label::after { display: none !important; }
.pak-checkout-mobile [id$="DDShippingType"],
.pak-checkout-mobile [id$="payment_option_rl"] { width: 100%; table-layout: fixed; }
.pak-checkout-mobile [id$="DDShippingType"] td,
.pak-checkout-mobile [id$="payment_option_rl"] td { padding-block: var(--pak-half-gap); }
.pak-checkout-mobile [id$="payment_option_rl"] img {
    /* Override theme-wide image sizing without stretching the artwork. */
    display: inline-block;
    width: auto !important;
    height: auto !important;
    max-width: min(220px, 100%) !important;
    max-height: 44px !important;
    object-fit: contain !important;
    object-position: left center;
    vertical-align: middle;
}
.pak-checkout-mobile [id$="payment_option_rl"] img[src*="paypal"] {
    max-width: min(120px, 100%) !important;
    max-height: 32px !important;
}
.pak-checkout-mobile .input-group { min-width: 0; }
.pak-checkout-mobile .input-group > label { flex-basis: 100%; }
.pak-checkout-mobile .input-group > .row { width: 100%; margin-inline: 0; }
.pak-checkout-mobile .input-group > .row > :first-child { padding-left: 0; }
.pak-checkout-mobile .input-group > .row > :last-child { padding-right: 0; }
.pak-checkout-mobile .input-group > .form-control { flex: 1 1 8rem; width: 1%; }
.pak-checkout-mobile .input-group > .form-control:not(:last-child) { border-right: 1px solid var(--pak-line) !important; }
.pak-checkout-mobile .input-group-append { margin-left: var(--pak-half-gap); }
.pak-checkout-mobile .input-group .btn { padding-inline: .75rem; font-size: var(--pak-small); }
.pak-checkout-mobile .form-flex { gap: var(--pak-half-gap); }
.pak-checkout-mobile .form-flex > .form-group { flex: 1; min-width: 0; }
.pak-checkout-mobile [id$="instructions_tb"] { min-height: 104px; height: auto; resize: vertical; }
.pak-checkout-mobile [data-billing-fields][hidden] { display: none !important; }
.pak-checkout-mobile [data-address-preview] { white-space: pre-line; overflow-wrap: anywhere; }
.pak-checkout-mobile .cart-table-prd-name,
.pak-checkout-mobile .alert { overflow-wrap: anywhere; }
.pak-checkout-mobile .cart-table-prd-name h2 { font-size: var(--pak-small); line-height: 1.5; }
.pak-checkout-mobile .card-total-sm { padding-block: var(--pak-half-gap); min-height: 0; }
.pak-checkout-mobile .card-total-sm .float-right {
    float: none !important;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--pak-half-gap);
    text-align: left;
}
.pak-checkout-mobile :focus-visible,
.pak-checkout-mobile-modal :focus-visible { outline: 2px solid var(--pak-focus); outline-offset: 3px; }
.pak-checkout-mobile .pak-input-hint { color: var(--pak-muted); font-size: var(--pak-small); line-height: 1.5; }
@media (max-width: 991px) {
    .pak-checkout-mobile .pak-checkout-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .pak-checkout-mobile .pak-checkout-grid > .pak-checkout-column { grid-column: 1; grid-row: auto; }
    .pak-checkout-mobile .pak-checkout-grid > .pak-checkout-address { order: 0; }
    .pak-checkout-mobile .pak-checkout-grid > .pak-checkout-basket { order: 1; }
    .pak-checkout-mobile .pak-checkout-grid > .pak-checkout-payment { order: 2; }
}
/* The theme draws its own tick box in label:before; show only the native
   checkbox so customers never see two boxes for one setting. */
.pak-checkout-mobile-modal input[type=checkbox]+label:before,
.pak-checkout-mobile-modal input[type=checkbox]+label:after {
    content: none !important;
    display: none !important;
}
.pak-checkout-mobile-modal input[type=checkbox]+label {
    padding-left: 0;
    min-width: 0;
    margin: 0;
    line-height: inherit;
}
/* The saved-address editor's postcode search must fit a full postcode. */
.pak-checkout-mobile-modal .modal-dialog { max-width: min(800px, calc(100vw - 2rem)); }
.pak-checkout-mobile-modal .input-group[class*="col-md"] { flex: 1 1 0; max-width: none; }
.pak-checkout-mobile-modal [id$="address_lookup_tb"] { min-width: 9rem; }
.pak-checkout-mobile-modal [id$="address_doorno_lookup_tb"] { min-width: 7rem; }
/* The editor is one focused form: stack every field at any width instead of
   uneven Bootstrap column splits inside the narrow modal. */
.pak-checkout-mobile-modal .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
@media (max-width: 767px) {
    .pak-checkout-mobile,
    .pak-checkout-mobile-modal { --pak-card-gap: 1rem; }
    .pak-checkout-mobile .pak-checkout-address .row > [class*="col-"],
    .pak-checkout-mobile-modal .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .pak-checkout-mobile .container { padding-inline: var(--pak-gap); }
    .pak-checkout-mobile .input-group > .row { margin-inline: 0; }
    .pak-checkout-mobile .input-group > .row > * { padding-inline: 0; }
    .pak-checkout-mobile .pak-checkout-address .input-group-append,
    .pak-checkout-mobile-modal .input-group-append { width: 100%; margin-left: 0; }
    .pak-checkout-mobile .pak-checkout-address .input-group-append .btn,
    .pak-checkout-mobile-modal .input-group-append .btn { width: 100%; margin-top: var(--pak-half-gap); }
    .pak-checkout-mobile .pak-checkout-address .input-group > .form-control,
    .pak-checkout-mobile-modal .input-group > .form-control { flex-basis: 100%; width: 100%; }
    .pak-checkout-mobile .card-total-price { font-size: var(--pak-heading); }
    .pak-checkout-mobile-modal .modal-dialog { margin: var(--pak-half-gap); max-width: calc(100% - 1rem); }
}
@media (prefers-reduced-motion: reduce) {
    .pak-checkout-mobile *, .pak-checkout-mobile-modal * { scroll-behavior: auto !important; }
}
@media (max-width: 359px) {
    /* Reserve a full row for names/warnings when larger text leaves no
       usable item column beside quantity and price on a small phone. */
    .pak-checkout-mobile.pak-accordion .pak-cart-scroll .cart-table-prd {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .pak-checkout-mobile.pak-accordion .pak-cart-scroll .cart-table-prd-name {
        grid-column: 1 / -1;
    }
    .pak-checkout-mobile.pak-accordion .pak-cart-scroll .cart-table-prd-qty {
        grid-column: 1;
        max-width: 4rem;
    }
    .pak-checkout-mobile.pak-accordion .pak-cart-scroll .cart-table-prd-price {
        grid-column: 2;
    }
}
