/* ============================================================
   PurplePrince OneStepCheckout
   ============================================================ */

/* ----------------------------------------------------------
   Page title
   ---------------------------------------------------------- */
.pp-checkout-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #eee;
    letter-spacing: -0.3px;
}

/* ----------------------------------------------------------
   Layout: main left, sidebar right
   ---------------------------------------------------------- */
.checkout-index-index .columns .column.main {
    width: 100%;
}

.checkout-index-index .checkout-container {
    display: flex;
    align-items: flex-start;
}

.checkout-index-index .opc-wrapper {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    float: none !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

.checkout-index-index .opc-sidebar {
    flex: 0 0 360px;
    width: 360px !important;
    float: none !important;
    margin: 0 !important;
    position: sticky;
    top: 20px;
}

@media (max-width: 1024px) {
    .checkout-index-index .checkout-container {
        flex-direction: column;
    }
    .checkout-index-index .opc-sidebar {
        width: 100% !important;
        position: static;
    }
}

/* ----------------------------------------------------------
   Hide breadcrumb, duplicate shipping info, Next button
   ---------------------------------------------------------- */
.checkout-index-index .opc-progress-bar {
    display: none !important;
}

.checkout-index-index .opc-wrapper .opc-block-shipping-information {
    display: none !important;
}

#shipping-method-buttons-container {
    display: none !important;
}

/* ----------------------------------------------------------
   Force all steps visible
   ---------------------------------------------------------- */
.checkout-index-index #checkout .opc > li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ----------------------------------------------------------
   Step cards
   ---------------------------------------------------------- */
.checkout-index-index #checkout .opc {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkout-index-index #checkout .opc > li {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   Hide New Address button
   ---------------------------------------------------------- */
.checkout-shipping-address .action-show-popup {
    display: none !important;
}

#opc-new-shipping-address {
    display: none !important;
}

/* ----------------------------------------------------------
   Section titles
   ---------------------------------------------------------- */
.checkout-index-index .opc-wrapper .step-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 14px;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

/* ----------------------------------------------------------
   Search box
   ---------------------------------------------------------- */
.searchForAddress {
    margin-bottom: 18px;
}

.searchForAddress p {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin: 0 0 6px;
}

.searchForAddress input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s;
    background: #fafafa;
}

.searchForAddress input:focus {
    border-color: #1a1a1a;
    background: #fff;
    outline: none;
}

/* ----------------------------------------------------------
   Address cards
   NOTE: no !important on display so jQuery show/hide works
   ---------------------------------------------------------- */
.checkout-shipping-address .shipping-address-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    font-size: 0;
}

.checkout-shipping-address .shipping-address-item {
    position: relative;
    flex: 0 0 calc(50% - 5px);
    min-width: 200px;
    padding: 16px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow: hidden;
    width: auto;
    margin: 0;
}

@media (max-width: 640px) {
    .checkout-shipping-address .shipping-address-item {
        flex: 0 0 100%;
    }
}

.checkout-shipping-address .shipping-address-item:hover {
    border-color: #aaa;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.checkout-shipping-address .shipping-address-item.selected-item {
    border-color: #1a1a1a;
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.checkout-shipping-address .shipping-address-item.selected-item::after {
    content: '\2713';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-shipping-address .shipping-address-item::before {
    display: none !important;
}

/* Address card inner elements */
.pp-addr-company {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.pp-addr-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.pp-addr-street,
.pp-addr-city,
.pp-addr-country {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.pp-addr-phone {
    margin-top: 6px;
    font-size: 13px;
}

.pp-addr-phone a {
    color: #1565c0;
    text-decoration: none;
}

.pp-addr-phone a:hover {
    text-decoration: underline;
}

/* Actions row */
.pp-addr-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* Ship Here */
.checkout-shipping-address .action-select-shipping-item {
    display: inline-block;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    float: none;
    margin: 0;
}

.checkout-shipping-address .action-select-shipping-item:hover {
    background: #333;
}

.checkout-shipping-address .selected-item .action-select-shipping-item {
    display: none;
}

/* Edit */
.checkout-shipping-address .edit-address-link {
    display: inline-block;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    float: none;
    margin: 0;
    text-decoration: none;
}

.checkout-shipping-address .edit-address-link:hover {
    border-color: #999;
    background: #f5f5f5;
}

/* ----------------------------------------------------------
   Shipping methods — styled as cards like addresses
   ---------------------------------------------------------- */
.checkout-shipping-method {
    margin-top: 14px;
}

/* Hide the table layout and render rows as cards */
.table-checkout-shipping-method {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-checkout-shipping-method thead {
    display: none;
}

.table-checkout-shipping-method tbody {
    display: contents;
}

.table-checkout-shipping-method tbody tr {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 calc(50% - 5px);
    min-width: 200px;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    position: relative;
}

@media (max-width: 640px) {
    .table-checkout-shipping-method tbody tr {
        flex: 0 0 100%;
    }
}

.table-checkout-shipping-method tbody tr:hover {
    border-color: #aaa;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.table-checkout-shipping-method tbody tr._active,
.table-checkout-shipping-method tbody tr:has(input:checked) {
    border-color: #1a1a1a;
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Selected checkmark on active row */
.table-checkout-shipping-method tbody tr._active::after,
.table-checkout-shipping-method tbody tr:has(input:checked)::after {
    content: '\2713';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-checkout-shipping-method tbody td {
    display: block;
    padding: 0;
    border: none !important;
    font-size: 13px;
    color: #333;
}

/* Hide the radio visually — the whole card is clickable */
.table-checkout-shipping-method tbody td:first-child {
    display: none;
}

/* Carrier title */
.table-checkout-shipping-method tbody td.col-carrier {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 600;
}

/* Method name */
.table-checkout-shipping-method tbody td.col-method {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    flex: 1;
}

/* Price */
.table-checkout-shipping-method tbody td.col-price {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    white-space: nowrap;
    margin-left: auto;
}

/* Error rows */
.table-checkout-shipping-method tbody .row-error {
    flex: 0 0 100%;
    border: none;
    padding: 0 4px;
    box-shadow: none;
}

.table-checkout-shipping-method tbody .row-error td {
    font-size: 12px;
    color: #c62828;
}

.table-checkout-shipping-method tbody .row-error:hover {
    border-color: transparent;
    box-shadow: none;
}

.table-checkout-shipping-method tbody .row-error::after {
    display: none;
}

/* ----------------------------------------------------------
   Payment
   ---------------------------------------------------------- */
.checkout-payment-method .step-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

/* Payment methods list */
.checkout-payment-method .payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Each payment method card */
.checkout-payment-method .payment-method {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 0;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s, background .2s;
    background: #fff;
}

.checkout-payment-method .payment-method:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.checkout-payment-method .payment-method._active {
    border-color: #1a1a1a;
    background: #f5f8fc;
    box-shadow: 0 3px 12px rgba(0,0,0,.10);
}

/* Title row — large click target */
.checkout-payment-method .payment-method-title {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    cursor: pointer;
    background: transparent;
    border: none !important;
    margin: 0;
    position: relative;
    min-height: 60px;
}

/* Hide radio — whole card is clickable */
.checkout-payment-method .payment-method-title input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin: 0;
    padding: 0;
}

.checkout-payment-method .payment-method:hover .payment-method-title input[type="radio"] {
    border-color: #999;
}

.checkout-payment-method .payment-method._active .payment-method-title input[type="radio"] {
    border-color: #1a1a1a;
    background: #1a1a1a;
}

.checkout-payment-method .payment-method._active .payment-method-title input[type="radio"]::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* Label — big and clear */
.checkout-payment-method .payment-method-title .label {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    cursor: pointer;
    letter-spacing: -0.2px;
}

/* Payment method icon/image */
.checkout-payment-method .payment-method-title img {
    max-height: 30px;
    width: auto;
    flex-shrink: 0;
}

/* Checkmark badge on active */
.checkout-payment-method .payment-method._active .payment-method-title::after {
    content: '\2713';
    position: absolute;
    top: 16px;
    right: 18px;
    width: 24px;
    height: 24px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content area — expanded under active method */
.checkout-payment-method .payment-method-content {
    padding: 22px 22px;
    border-top: 1px solid #e0e8f0;
    background: #f5f8fc;
}

/* Place Order button */
.checkout-payment-method .action.primary.checkout {
    display: block;
    background: #1a1a1a !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 16px 40px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #fff !important;
    width: 100%;
    max-width: 100%;
    cursor: pointer;
    margin-top: 16px;
    text-align: center;
    letter-spacing: 0.3px;
}

.checkout-payment-method .action.primary.checkout:hover {
    background: #333 !important;
}

/* Billing address visibility is now controlled by JS based on payment method + user type.
   See PurplePrince_Budgets/js/checkout/billing-enforcement-mixin */

/* T&C */
.checkout-agreements-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.checkout-agreements-block .checkout-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #444;
}

.checkout-agreements-block input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a1a1a;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Kill T&C hover effects */
.checkout-agreements-block a,
.checkout-agreements-block a:hover,
.checkout-agreements-block a:focus,
.checkout-agreements-block a:active,
.checkout-agreements-block .checkout-agreement label,
.checkout-agreements-block .checkout-agreement label:hover,
.checkout-agreements-block .action-show,
.checkout-agreements-block .action-show:hover,
.checkout-agreements-block .action-show:focus {
    text-decoration: none !important;
    color: inherit !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: default !important;
}

/* ----------------------------------------------------------
   Hide promo / coupon
   ---------------------------------------------------------- */
.checkout-index-index .payment-option._collapsible,
.checkout-index-index .discount-code,
.checkout-index-index #block-discount-heading {
    display: none !important;
}

/* Hide promo code on basket/cart page too */
.checkout-cart-index .block.discount,
.checkout-cart-index #block-discount,
.checkout-cart-index .discount-code {
    display: none !important;
}

/* ----------------------------------------------------------
   Force sidebar visible (undo modal behaviour from theme)
   ---------------------------------------------------------- */
.checkout-index-index .opc-sidebar,
.checkout-index-index .opc-summary-wrapper,
.checkout-index-index #opc-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    z-index: auto !important;
    pointer-events: auto !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Kill modal overlay/wrapper that the theme sidebar creates */
.checkout-index-index .modal-custom-overlay {
    display: none !important;
}

.checkout-index-index .opc-sidebar .modal-inner-wrap,
.checkout-index-index #opc-sidebar.modal-custom {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Hide modal close/header if generated */
.checkout-index-index .opc-sidebar .modal-header,
.checkout-index-index .opc-sidebar .action-close {
    display: none !important;
}

/* ----------------------------------------------------------
   All checkout buttons: force line-height
   ---------------------------------------------------------- */
.checkout-index-index button,
.checkout-index-index .action {
    line-height: 0 !important;
}

/* ----------------------------------------------------------
   Order Summary (sidebar)
   ---------------------------------------------------------- */
.checkout-index-index .opc-block-summary {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    padding: 20px;
}

.checkout-index-index .opc-block-summary > .title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.checkout-index-index .opc-block-summary .items-in-cart {
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.checkout-index-index .opc-block-summary .minicart-items .product-item {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.checkout-index-index .opc-block-summary .minicart-items .product-item:last-child {
    border-bottom: none;
}

.checkout-index-index .opc-block-summary .product-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Force totals table visible */
.checkout-index-index .opc-block-summary .table-totals {
    display: table !important;
    width: 100%;
}

.checkout-index-index .opc-block-summary .table-totals th,
.checkout-index-index .opc-block-summary .table-totals td {
    padding: 5px 0;
    font-size: 13px;
}

.checkout-index-index .opc-block-summary .table-totals .grand.totals th,
.checkout-index-index .opc-block-summary .table-totals .grand.totals td {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    padding-top: 10px;
    border-top: 2px solid #1a1a1a;
}

/* Hide sidebar shipping info edit buttons and the whole block —
   user edits directly on the one-page form */
.checkout-index-index .opc-block-shipping-information {
    display: none !important;
}

/* Hide shipping info edit pencils */
.checkout-index-index .action-edit,
.checkout-index-index .action-edit-address {
    display: none !important;
}

/* Sidebar shipping info (kept for reference, block hidden above) */
.checkout-index-index .opc-sidebar .opc-block-shipping-information {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 14px;
}

.checkout-index-index .ship-to .shipping-information-title,
.checkout-index-index .ship-via .shipping-information-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.checkout-index-index .shipping-information-content {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

/* ----------------------------------------------------------
   Form fields
   ---------------------------------------------------------- */
.checkout-index-index .fieldset .field .control input,
.checkout-index-index .fieldset .field .control select,
.checkout-index-index .fieldset .field .control textarea {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s;
}

.checkout-index-index .fieldset .field .control input:focus,
.checkout-index-index .fieldset .field .control select:focus,
.checkout-index-index .fieldset .field .control textarea:focus {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: none;
}

.checkout-index-index .fieldset .field .label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

/* ----------------------------------------------------------
   Messages
   ---------------------------------------------------------- */
.checkout-index-index .message {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 10px;
}

.checkout-index-index .message.notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #e65100;
}

.checkout-index-index .message.success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.checkout-index-index .message.error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* ----------------------------------------------------------
   Loading
   ---------------------------------------------------------- */
.checkout-index-index .loading-mask {
    background: rgba(255,255,255,.85);
}
