/**
 * OP Lagos Table Rate Shipping — Frontend Checkout Styles v3.8
 * Full-width vertical cards: icon centred on top, full label below.
 * Author: Observant Parrot
 */

/* ── Hide native WC radio list ───────────────────────────────────────────── */
ul.op-ltrs-hidden-list,
ul.woocommerce-shipping-methods.op-ltrs-hidden-list {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Widget root ─────────────────────────────────────────────────────────── */
#op-ltrs-widget {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 4px 0 12px !important;
    padding: 0 !important;
    font-family: inherit;
    float: none !important;
    clear: both;
}

/* ── Toggle wrap — TWO COLUMNS, each card vertical ───────────────────────── */
.op-ltrs-toggle-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* ── Each card ───────────────────────────────────────────────────────────── */
.op-ltrs-toggle-btn {
    position: relative;          /* for corner indicators */
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 90px;
    padding: 14px 10px 12px;
    box-sizing: border-box;

    font-family: inherit;
    text-align: center;
    background: #f7f7f7;
    color: #555;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
    overflow: visible;
}

.op-ltrs-toggle-btn:not(.active):hover {
    border-color: #96588a;
    color: #6b3a64;
    background: #fdf5fc;
}

.op-ltrs-toggle-btn.active {
    background: #f9f0f8;
    border-color: #96588a;
    color: #4a2347;
    box-shadow: 0 2px 10px rgba(150,88,138,.2);
}

/* ── Radio circle — top-left corner ── */
.op-ltrs-btn-radio {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    transition: border-color .18s;
    box-sizing: border-box;
}

.op-ltrs-btn-radio::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 7px; height: 7px;
    border-radius: 50%;
    background: transparent;
    transition: background .18s;
}

.op-ltrs-toggle-btn.active .op-ltrs-btn-radio       { border-color: #96588a; }
.op-ltrs-toggle-btn.active .op-ltrs-btn-radio::after { background: #96588a; }

/* ── Tick — top-right corner, only visible when active ── */
.op-ltrs-btn-tick {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: transparent;
    transition: background .18s, color .18s;
}

.op-ltrs-toggle-btn.active .op-ltrs-btn-tick {
    background: #96588a;
    color: #fff;
}

/* ── Emoji icon ── */
.op-ltrs-btn-icon {
    display: block;
    font-size: 30px;
    line-height: 1;
    margin-top: 6px;      /* clear the corner radio */
}

/* ── Label — full card width, word-wrap allowed ── */
.op-ltrs-btn-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.3;
    /* No truncation — card is wide enough for the text */
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 100%;
    color: inherit;
}

/* ── Panel wrap ──────────────────────────────────────────────────────────── */
.op-ltrs-panel-wrap {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #96588a;
    border-radius: 10px;
    padding: 12px 12px 10px;
    animation: op-ltrs-slidein .15s ease;
}

@keyframes op-ltrs-slidein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.op-ltrs-select {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 36px 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1d2327;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='8'%3E%3Cpath fill='none' stroke='%2396588a' stroke-width='2' stroke-linecap='round' d='M1 1l5.5 5.5L12 1'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1.5px solid #c8a8c1;
    border-radius: 7px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
}
.op-ltrs-select:hover { border-color: #96588a; }
.op-ltrs-select:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 3px rgba(150,88,138,.14);
}
.op-ltrs-select option[value=""][disabled] { color: #999; font-style: italic; }

/* ── Help text ───────────────────────────────────────────────────────────── */
.op-ltrs-panel-help {
    margin: 6px 0 0;
    font-size: 11px;
    color: #96588a;
    opacity: .8;
    line-height: 1.4;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.op-ltrs-loading { display: none; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: #888; }
.op-ltrs-loading.visible { display: flex; }
.op-ltrs-spinner {
    width: 15px; height: 15px; flex-shrink: 0; border-radius: 50%;
    border: 2px solid #e8dced; border-top-color: #96588a;
    animation: op-ltrs-spin .7s linear infinite;
}
@keyframes op-ltrs-spin { to { transform: rotate(360deg); } }

/* ── Mobile ≤ 480px ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .op-ltrs-toggle-btn { min-height: 82px; padding: 12px 8px 10px; border-radius: 10px; }
    .op-ltrs-btn-icon   { font-size: 26px; }
    .op-ltrs-btn-label  { font-size: 11px; }
    .op-ltrs-select     { font-size: 16px; }   /* prevent iOS zoom */
    .op-ltrs-panel-wrap { border-radius: 8px; padding: 10px; }
}

/* ── Very small phones ≤ 300px — stack cards ─────────────────────────────── */
@media (max-width: 300px) {
    .op-ltrs-toggle-wrap { grid-template-columns: 1fr; }
}
