/* Grid container */
.wc-block-components-radio-control:has(.peer-pay-tile) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    border: none;
}

@media (max-width: 640px) {
    .wc-block-components-radio-control:has(.peer-pay-tile) {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Compact mode: single full-width tile instead of 3-up grid. */
.wc-block-components-radio-control:has(.peer-pay-tile--compact) {
    grid-template-columns: repeat(1, 1fr);
}

/* Neutralize WC Blocks outer wrap + per-row dividers when rendering as tiles. */
.wc-block-components-radio-control:has(.peer-pay-tile)::after,
.wc-block-components-radio-control:has(.peer-pay-tile)::before,
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control-accordion-option::after,
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control-accordion-option::before,
.wc-block-components-radio-control__option:has(.peer-pay-tile)::after,
.wc-block-components-radio-control__option:has(.peer-pay-tile)::before {
    content: none !important;
    display: none !important;
    background: transparent !important;
    border: 0 !important;
}

/* The accordion-option wrapper is the direct grid child. Strip its default chrome (especially
   the inset box-shadow that WC Blocks uses to highlight the selected option) so only the inner
   label tile shows. */
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
    display: flex !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* WC Blocks renders buildContent (the description) below the selected tile as accordion content.
   We already show the description inside the tile itself, so hide the duplicate. */
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control-accordion-content {
    display: none !important;
}

/* Tile (unselected): gray border, white fill. !important defeats the equal-specificity
   `.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option { border-width: 0 }` reset. */
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 14px;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: #d4d4d8 !important;
    border-radius: 12px;
    background-color: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option:hover {
    border-color: #a1a1aa !important;
}

/* Selected tile: blue border + light-blue tint. Cover both --checked and -checked variants. */
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option-checked,
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option--checked,
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option:has(input[type="radio"]:checked) {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
}

/* Hide the native radio input — selection is communicated by border color. */
.wc-block-components-radio-control:has(.peer-pay-tile) .wc-block-components-radio-control__option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Tile internals */
.peer-pay-tile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.peer-pay-tile .peer-pay-tile__icon {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    margin-top: 2px;
    border-radius: 0 !important;
    flex-shrink: 0;
    object-fit: contain !important;
    object-position: center !important;
}

.peer-pay-tile__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.peer-pay-tile__title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.25;
    color: #111827;
}

.peer-pay-tile__description {
    font-size: 0.8125rem;
    line-height: 1.3;
    color: #6b7280;
    white-space: normal;
}
