/**
 * My List — Referral & Earn public styles.
 *
 * Fully responsive: desktop, tablet, and mobile-friendly.
 */

.mlref-wrap {
    --mlref-primary: #1a1a2e;
    --mlref-primary-hover: #16213e;
    --mlref-accent: #16c784;
    --mlref-danger: #d63638;
    --mlref-muted: #6b7280;
    --mlref-border: #e5e7eb;
    --mlref-bg-card: #ffffff;
    --mlref-bg-page: #f5f6fa;
    --mlref-radius: 12px;
    --mlref-shadow: 0 6px 24px rgba(15, 23, 42, .06);

    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 0 40px;
    color: #1f2937;
    box-sizing: border-box;
}
.mlref-wrap *,
.mlref-wrap *::before,
.mlref-wrap *::after { box-sizing: inherit; }

.mlref-header { text-align: center; padding: 8px 12px 24px; }
.mlref-header h2 {
    margin: 0 0 6px; font-size: 26px; font-weight: 700;
    color: var(--mlref-primary);
}
.mlref-header__sub { margin: 0; color: var(--mlref-muted); font-size: 14px; }

.mlref-notice {
    padding: 12px 16px; border-radius: 10px; margin: 10px 0 20px;
    font-size: 14px; border: 1px solid transparent;
}
.mlref-notice--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.mlref-notice--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.mlref-notice--info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.mlref-card {
    background: var(--mlref-bg-card);
    border: 1px solid var(--mlref-border);
    border-radius: var(--mlref-radius);
    box-shadow: var(--mlref-shadow);
    margin: 0 0 22px;
    overflow: hidden;
}
.mlref-card__header { padding: 18px 22px; border-bottom: 1px solid var(--mlref-border); }
.mlref-card__header h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--mlref-primary); }
.mlref-card__body { padding: 22px; }

.mlref-card--link .mlref-card__body { padding: 20px 22px; }

/* Referral income information — scoped to the Referral Earn page only. */
.mlref-info-card__body { padding: 24px; }
.mlref-info-card__heading {
    margin: 0;
    color: var(--mlref-primary);
    font-size: clamp(20px, 2.4vw, 25px);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}
.mlref-info-card__content {
    color: #374151;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.mlref-info-card__content[aria-hidden="true"] { height: 0; overflow: hidden; }
.mlref-info-card__content-inner { padding-top: 22px; }
.mlref-info-card__content-inner > :first-child { margin-top: 0; }
.mlref-info-card__content-inner > :last-child { margin-bottom: 0; }
.mlref-info-card__content h3,
.mlref-info-card__content h4 {
    margin: 20px 0 6px;
    color: var(--mlref-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}
.mlref-info-card__content p,
.mlref-info-card__content ul,
.mlref-info-card__content ol { margin: 0 0 12px; }
.mlref-info-card__content ul,
.mlref-info-card__content ol { padding-left: 22px; }
.mlref-info-card.is-collapsible .mlref-info-card__content {
    overflow: hidden;
    transition: height .35s ease;
}
.mlref-info-card__actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.mlref-info-card__toggle { min-height: 42px; }

.mlref-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.mlref-row--stack { flex-direction: column; }

@media (min-width: 768px) {
    .mlref-row--stack { flex-direction: row; }
    .mlref-field { flex: 1 1 auto; }
    .mlref-field--code { max-width: 320px; }
}

.mlref-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.mlref-label { font-size: 12px; font-weight: 600; color: var(--mlref-muted); text-transform: uppercase; letter-spacing: .04em; }

.mlref-copy { display: flex; gap: 8px; }
.mlref-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--mlref-border);
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color .15s ease, background .15s ease;
    min-width: 0;
    width: 100%;
}
.mlref-input:focus { border-color: var(--mlref-primary); background: #fff; }
.mlref-copy__input { flex: 1 1 auto; }
.mlref-copy__btn   { flex: 0 0 auto; }
.mlref-input--code { font-family: SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; font-weight: 600; text-transform: uppercase; }

.mlref-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; font-size: 14px; font-weight: 600; line-height: 1.2;
    border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    background: var(--mlref-primary); color: #fff;
    transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.mlref-btn:hover  { background: var(--mlref-primary-hover); transform: translateY(-1px); }
.mlref-btn:active { transform: translateY(0); }
.mlref-btn:focus  { outline: 2px solid rgba(26,26,46,.35); outline-offset: 2px; }
.mlref-btn--primary {}
.mlref-btn--outline { background: transparent; color: var(--mlref-primary); border-color: var(--mlref-primary); }
.mlref-btn--outline:hover { background: var(--mlref-primary); color: #fff; }
.mlref-btn--danger { background: var(--mlref-danger); }
.mlref-btn--danger:hover { background: #b02525; }

.mlref-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px; margin: 0 0 22px;
}
.mlref-stat-card {
    background: var(--mlref-bg-card); border: 1px solid var(--mlref-border);
    border-radius: var(--mlref-radius); padding: 18px; text-align: center;
    box-shadow: var(--mlref-shadow);
}
.mlref-stat-card__icon { font-size: 26px; margin-bottom: 8px; }
.mlref-stat-card__label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mlref-muted); }
.mlref-stat-card__value { font-size: 22px; font-weight: 700; color: var(--mlref-primary); margin-top: 6px; }
.mlref-stat-card__value--available { color: var(--mlref-accent); }

.mlref-form { display: block; }
.mlref-form__grid {
    display: grid; grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 720px) {
    .mlref-form__grid { grid-template-columns: 1fr 1fr; }
    .mlref-form__row--full { grid-column: 1 / -1; }
}
.mlref-form__row { display: flex; flex-direction: column; gap: 6px; }
.mlref-form__actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.mlref-form--inline { display: inline-block; margin-left: 8px; }

.mlref-help { margin: 6px 0 0; font-size: 12px; color: var(--mlref-muted); }

.mlref-qr-preview {
    margin-top: 12px; display: inline-block; padding: 6px; background: #fff;
    border: 1px solid var(--mlref-border); border-radius: 10px;
}
.mlref-qr-preview img { display: block; max-width: 180px; height: auto; border-radius: 6px; }

.mlref-textarea { resize: vertical; min-height: 60px; font-family: inherit; }

.mlref-empty {
    margin: 0; padding: 20px; text-align: center; color: var(--mlref-muted);
    background: #f9fafb; border-radius: 10px; border: 1px dashed var(--mlref-border);
}

.mlref-table-wrap { overflow-x: auto; }
.mlref-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.mlref-table th, .mlref-table td {
    padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--mlref-border); vertical-align: middle;
}
.mlref-table th {
    background: #f9fafb; text-transform: uppercase; letter-spacing: .04em;
    font-size: 11px; color: var(--mlref-muted); font-weight: 600;
}
.mlref-table tr:hover td { background: #fafbff; }

.mlref-badge {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; background: #e5e7eb; color: #374151;
}
.mlref-badge--pending    { background: #fef3c7; color: #92400e; }
.mlref-badge--credited   { background: #d1fae5; color: #065f46; }
.mlref-badge--approved   { background: #dbeafe; color: #1e40af; }
.mlref-badge--processing { background: #e0e7ff; color: #3730a3; }
.mlref-badge--paid       { background: #bbf7d0; color: #14532d; }
.mlref-badge--rejected,
.mlref-badge--reversed,
.mlref-badge--refunded,
.mlref-badge--cancelled  { background: #fee2e2; color: #991b1b; }

.mlref-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.mlref-pagination__link {
    display: inline-block; min-width: 34px; padding: 6px 10px; text-align: center;
    border: 1px solid var(--mlref-border); border-radius: 6px;
    text-decoration: none; color: var(--mlref-primary); font-weight: 600;
    background: #fff;
}
.mlref-pagination__link.is-active,
.mlref-pagination__link:hover { background: var(--mlref-primary); color: #fff; border-color: var(--mlref-primary); }

/* Mobile — turn table rows into cards for readability. */
@media (max-width: 720px) {
    .mlref-info-card__body { padding: 20px 16px; }
    .mlref-info-card__content { font-size: 14px; }
    .mlref-info-card__toggle { min-width: 150px; }

    .mlref-table thead { display: none; }
    .mlref-table, .mlref-table tbody, .mlref-table tr, .mlref-table td { display: block; width: 100%; }
    .mlref-table tr {
        border: 1px solid var(--mlref-border); border-radius: 10px;
        padding: 8px 10px; margin-bottom: 10px; background: #fff;
    }
    .mlref-table td {
        border-bottom: 1px dashed var(--mlref-border); padding: 8px 4px;
        display: flex; justify-content: space-between; gap: 10px;
    }
    .mlref-table td:last-child { border-bottom: 0; }
    .mlref-table td::before {
        content: attr(data-label); font-weight: 600; color: var(--mlref-muted);
        font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    }
}

/* Dashboard promo card (My Account → Dashboard) */
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card,
.woocommerce-MyAccount-content > .mlref-dashboard-card,
.mlref-dashboard-card {
    margin: 22px 0 8px !important;
    padding: 22px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--mlref-radius, 12px) !important;
    box-shadow: var(--mlref-shadow, 0 4px 16px rgba(15, 23, 42, .06)) !important;
    position: relative !important;
    overflow: hidden !important;
}
.mlref-dashboard-card::before,
.mlref-dashboard-card::after,
.mlref-dashboard-card__body::before,
.mlref-dashboard-card__body::after {
    display: none !important;
    content: none !important;
    background: none !important;
    background-image: none !important;
}
.mlref-dashboard-card__body {
    position: relative !important;
    z-index: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card .mlref-dashboard-card__title,
.mlref-dashboard-card .mlref-dashboard-card__title {
    color: #000000 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: transparent !important;
    background-image: none !important;
}
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card .mlref-dashboard-card__text,
.mlref-dashboard-card .mlref-dashboard-card__text {
    margin: 0 0 14px !important;
    color: #000000 !important;
    opacity: 1 !important;
    background: transparent !important;
    background-image: none !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card a.mlref-btn,
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card .mlref-btn,
.mlref-dashboard-card a.mlref-btn,
.mlref-dashboard-card .mlref-btn,
.mlref-dashboard-card .mlref-btn:visited {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease !important;
}
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card a.mlref-btn:hover,
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card a.mlref-btn:focus,
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card a.mlref-btn:focus-visible,
.woocommerce-account .woocommerce-MyAccount-content .mlref-dashboard-card a.mlref-btn:active,
.mlref-dashboard-card .mlref-btn:hover,
.mlref-dashboard-card .mlref-btn:focus,
.mlref-dashboard-card .mlref-btn:focus-visible,
.mlref-dashboard-card .mlref-btn:active {
    background: #f3f4f6 !important;
    background-color: #f3f4f6 !important;
    background-image: none !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    outline: none !important;
}
.mlref-dashboard-card:hover,
.mlref-dashboard-card:focus,
.mlref-dashboard-card:active {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
}
@media (max-width: 768px) {
    .mlref-dashboard-card {
        padding: 20px !important;
    }
    .mlref-dashboard-card .mlref-dashboard-card__title {
        font-size: 16px !important;
    }
    .mlref-dashboard-card .mlref-dashboard-card__text {
        font-size: 13.5px !important;
    }
}
@media (max-width: 480px) {
    .mlref-dashboard-card {
        padding: 16px !important;
    }
    .mlref-dashboard-card a.mlref-btn,
    .mlref-dashboard-card .mlref-btn {
        width: 100% !important;
    }
}

.mlref-emoji { font-size: 22px; }
