/**
 * JPF Purchase Flows — Frontend Styles
 * Minimal, theme-agnostic. Inherits your WoodMart theme's font and color variables where possible.
 */

.jpf-purchase-flows {
    margin: 16px 0 20px;
    font-family: inherit;
}

/* ── Tabs ───────────────────────────────────────────────── */

.jpf-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.jpf-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 8px 10px;
    background: #faf5ec;
    border: 1.5px solid #ddd0bb;
    border-bottom: 3px solid #ddd0bb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #7a6a55;
    line-height: 1.3;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    text-align: center;
}

/* Radio dot indicator */
.jpf-tab::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ccc0a8;
    margin-top: 6px;
    background: transparent;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.jpf-tab:hover {
    border-color: #b8651a;
    border-bottom-color: #b8651a;
    color: #b8651a;
    background: #fff8f0;
}

.jpf-tab:hover::after {
    border-color: #b8651a;
}

/* Active / selected state — clearly distinct */
.jpf-tab--active {
    border-color: #b8651a;
    border-bottom: 3px solid #b8651a;
    background: #fff3e8;
    color: #b8651a;
    box-shadow: 0 2px 8px rgba(184,101,26,0.12);
}

.jpf-tab--active::after {
    border-color: #b8651a;
    background: #b8651a;
    box-shadow: inset 0 0 0 2.5px #fff3e8;
}

.jpf-tab-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
}

.jpf-tab-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #b8651a;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Panels ─────────────────────────────────────────────── */

.jpf-panel {
    border: 1.5px solid #ddd0bb;
    border-radius: 4px;
    background: #fffdf9;
    overflow: hidden;
}

.jpf-panel-inner {
    padding: 16px;
}

/* ── One-time Panel ─────────────────────────────────────── */

.jpf-onetime-note {
    font-size: 12px;
    color: #9a8a78;
    margin: 0;
    line-height: 1.5;
}

.jpf-onetime-selected-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0faf0;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}

.jpf-onetime-selected-hint::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* ── Sample Kit Panel ───────────────────────────────────── */

.jpf-sample-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.jpf-price-main {
    font-size: 22px;
    font-weight: 700;
    color: #3b2a1a;
}

.jpf-price-original {
    font-size: 15px;
    color: #999;
    text-decoration: line-through;
}

.jpf-price-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid #c8e6c9;
}

.jpf-sample-tagline {
    font-size: 13px;
    color: #7a6a55;
    font-style: italic;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Checklist (shared) ─────────────────────────────────── */

.jpf-checklist {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.jpf-checklist li {
    position: relative;
    padding-left: 22px;
    font-size: 13px;
    color: #4a3a28;
    margin-bottom: 6px;
    line-height: 1.4;
}

.jpf-checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8651a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Panel notes ────────────────────────────────────────── */

.jpf-panel-note,
.jpf-subscribe-intro,
.jpf-subscribe-meta p {
    font-size: 12px;
    color: #9a8a78;
    margin: 8px 0 0;
    line-height: 1.5;
}

.jpf-subscribe-intro {
    color: #4a3a28;
    font-size: 13px;
    margin-bottom: 12px;
    margin-top: 0;
}

/* ── Subscription Plans ─────────────────────────────────── */

.jpf-plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.jpf-plan {
    position: relative;
    border: 1.5px solid #ddd0bb;
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fff;
}

.jpf-plan:hover {
    border-color: #b8651a;
    background: #fff8f0;
}

.jpf-plan--selected {
    border-color: #b8651a;
    background: #fff3e8;
}

.jpf-plan-badge {
    position: absolute;
    top: -9px;
    left: 12px;
    background: #b8651a;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
}

.jpf-plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.jpf-plan-label {
    font-size: 14px;
    font-weight: 700;
    color: #3b2a1a;
    padding-top: 2px;
}

.jpf-plan-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* Total price row */
.jpf-plan-totals {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.jpf-plan-total-original {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
}

.jpf-plan-price {
    font-size: 17px;
    font-weight: 700;
    color: #3b2a1a;
}

.jpf-plan-saving {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #2e7d32;
}

.jpf-plan-billing {
    font-size: 10px;
    color: #9a8a78;
}

.jpf-plan-perks {
    margin: 8px 0 0;
}

.jpf-plan-perks li {
    font-size: 12px;
    color: #6a5a48;
    margin-bottom: 4px;
}

/* ── Per month label on main price ─────────────────────── */

.jpf-per-month {
    font-size: 14px;
    color: #7a6a55;
    font-weight: 400;
    margin-left: 2px;
}

/* ── My Account — Subscriptions ─────────────────────────── */

.jpf-account-sub {
    border: 1.5px solid #ddd0bb;
    border-radius: 6px;
    background: #fffdf9;
    margin-bottom: 20px;
    overflow: hidden;
}

.jpf-account-sub__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #ede5d8;
    background: #faf5ec;
    flex-wrap: wrap;
}

.jpf-account-sub__title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.jpf-account-sub__product {
    font-size: 15px;
    font-weight: 700;
    color: #3b2a1a;
    text-decoration: none;
}

.jpf-account-sub__product:hover {
    color: #b8651a;
}

.jpf-account-sub__plan {
    font-size: 12px;
    color: #7a6a55;
}

.jpf-account-sub__status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.jpf-account-sub__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0;
    padding: 0;
}

.jpf-account-sub__detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 16px;
    border-right: 1px solid #ede5d8;
}

.jpf-account-sub__detail:last-child {
    border-right: none;
}

.jpf-account-sub__detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a8a78;
    font-weight: 600;
}

.jpf-account-sub__detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #3b2a1a;
}

.jpf-account-sub__detail-value a {
    color: #b8651a;
    text-decoration: none;
}

.jpf-account-sub__detail-value a:hover {
    text-decoration: underline;
}

.jpf-account-sub__actions {
    padding: 12px 16px;
    border-top: 1px solid #ede5d8;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #faf5ec;
}

.jpf-account-sub__paused-note {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 13px;
    color: #7a6a55;
}

.jpf-account-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    line-height: 1.4;
}

.jpf-account-btn--pause {
    background: #fff3e0;
    border-color: #e65100;
    color: #e65100;
}

.jpf-account-btn--pause:hover {
    background: #e65100;
    color: #fff;
}

.jpf-account-btn--cancel {
    background: #ffebee;
    border-color: #c62828;
    color: #c62828;
}

.jpf-account-btn--cancel:hover {
    background: #c62828;
    color: #fff;
}

.jpf-account-btn--resume {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
}

.jpf-account-btn--resume:hover {
    background: #2e7d32;
    color: #fff;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (min-width: 600px) {
    .jpf-plans {
        flex-direction: row;
        align-items: stretch;
    }
    .jpf-plan {
        flex: 1;
    }
}
