/* ════════════════════════════════════════════════════════════════════
   TodayMembership — Benefit cards (About this membership section).
   SHARED stylesheet: linked by the public listing page AND by the
   admin builder's live-preview iframe (ssi-admin/benefits-preview.php)
   so the preview is pixel-identical to the public rendering.
   ════════════════════════════════════════════════════════════════════ */

/* ── About: benefit cards (parsed from the long description) ── */
.tm-benefit-intro {
    margin-bottom: 16px;
    color: #4a5268;
    font-size: 0.95rem;
    line-height: 1.65;
}
.tm-benefit-intro > :last-child { margin-bottom: 0; }
.tm-benefit-intro .tm-benefit-lead {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fffdf8 0%, #fbf3e3 100%);
    border: 1px solid #ecdcbb;
    border-radius: 10px;
    padding: 9px 14px;
    margin: 0 8px 10px 0;
    font-size: 0.95rem;
    color: #1a2349;
}
.tm-benefit-intro .tm-benefit-lead strong { color: #924f18; font-weight: 700; }
.tm-benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}
.tm-benefit-card {
    background: #fafbfc;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 14px 15px;
    transition: all 0.2s ease;
}
.tm-benefit-card:hover {
    background: #fff;
    border-color: #e3d4b8;
    box-shadow: 0 6px 18px rgba(188, 149, 92, 0.14);
    transform: translateY(-2px);
}
.tm-benefit-card__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.tm-benefit-card__ico {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 10px;
    background: rgba(188, 149, 92, 0.12);
    color: #924f18;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.tm-benefit-card__ico--emoji { font-size: 1.15rem; }
.tm-benefit-card__head h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #1a2349;
    line-height: 1.3;
    letter-spacing: 0;
}
.tm-benefit-card__list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.tm-benefit-card__list li {
    position: relative;
    padding-left: 22px;
    font-size: 0.88rem;
    color: #4a5268;
    line-height: 1.5;
}
.tm-benefit-card__list li::before {
    content: '\f00c'; /* fa-check */
    font-family: 'FontAwesome';
    position: absolute;
    left: 0; top: 1px;
    color: #bc955c;
    font-size: 0.72rem;
}
.tm-benefit-card__list li p { margin: 0; }
.tm-benefit-card__list li strong { color: #1a2349; }

/* Terms & Conditions — collapsible */
.tm-benefit-terms {
    margin-top: 14px;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
}
.tm-benefit-terms__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #fafbfc;
    border: 0;
    padding: 13px 16px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a2349;
    text-align: left;
    transition: background 0.2s ease;
}
.tm-benefit-terms__toggle:hover { background: #f6f1e4; }
.tm-benefit-terms__toggle > span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.tm-benefit-terms__toggle .fa-file-text-o { color: #924f18; }
.tm-benefit-terms__hint {
    font-size: 0.74rem;
    font-weight: 500;
    color: #8a90a3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tm-benefit-terms__toggle .caret { transition: transform 0.25s ease; font-size: 0.7rem; color: #bc955c; }
.tm-benefit-terms__toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.tm-benefit-terms__body {
    padding: 4px 16px 14px;
    border-top: 1px dashed #e8e2d2;
    background: #fffdf8;
}
.tm-benefit-terms__body ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-benefit-terms__body li {
    position: relative;
    padding-left: 20px;
    font-size: 0.86rem;
    color: #5a6172;
    line-height: 1.55;
}
.tm-benefit-terms__body li::before {
    content: '\f105'; /* fa-angle-right */
    font-family: 'FontAwesome';
    position: absolute;
    left: 4px; top: 0;
    color: #bc955c;
    font-weight: 700;
}

/* Structured benefits: coupon-count badge + per-card conditions */
.tm-benefit-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fffdf8 0%, #fbf3e3 100%);
    border: 1px solid #ecdcbb;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #924f18;
    white-space: nowrap;
}
.tm-benefit-card__badge i { color: #bc955c; font-size: 0.72rem; }
.tm-benefit-card__terms {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed #e8e2d2;
}
.tm-benefit-card__terms-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #8a90a3;
    margin-bottom: 6px;
}
.tm-benefit-card__terms-label i { color: #bc955c; }
.tm-benefit-card__terms ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tm-benefit-card__terms li {
    position: relative;
    padding-left: 18px;
    font-size: 0.8rem;
    color: #7c8296;
    line-height: 1.5;
}
.tm-benefit-card__terms li::before {
    content: '\f105'; /* fa-angle-right */
    font-family: 'FontAwesome';
    position: absolute;
    left: 4px; top: 0;
    color: #cbb58a;
    font-weight: 700;
}

/* ── Phone (≤767px) ── */
@media (max-width: 767px) {
    /* Benefit cards: tighter on phone */
    .tm-benefit-card { padding: 12px; }
    .tm-benefit-card__ico { width: 34px; height: 34px; font-size: 0.85rem; }
    .tm-benefit-card__head h3 { font-size: 0.92rem; }
    .tm-benefit-card__badge { font-size: 0.62rem; padding: 3px 8px; }
    .tm-benefit-card__terms li { font-size: 0.76rem; }
    .tm-benefit-terms__toggle { padding: 12px 14px; font-size: 0.88rem; }
    .tm-benefit-terms__hint { display: none; }
    .tm-benefit-terms__toggle::after {
        content: '\f107'; /* fa-angle-down */
        font-family: 'FontAwesome';
        color: #bc955c;
        margin-left: auto;
    }
    .tm-benefit-terms__toggle[aria-expanded="true"]::after { content: '\f106'; }
}

/* ════════════════════════════════════════════════════════════════════
   FAQ-STYLE ACCORDION (structured benefits) — one row per group,
   first open on load, multiple may stay open, animated +/− toggle.
   Item/conditions lists inside reuse .tm-benefit-card__list/__terms.
   ════════════════════════════════════════════════════════════════════ */
.tm-benefit-acc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-benefit-acc__item {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tm-benefit-acc__item.is-open {
    border-color: #e3d4b8;
    box-shadow: 0 6px 18px rgba(188, 149, 92, 0.12);
}
.tm-benefit-acc__head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
button.tm-benefit-acc__head:hover { background: #fdf9f1; }
.tm-benefit-acc__head--static { cursor: default; }
.tm-benefit-acc__title {
    flex: 1;
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #1a2349;
    line-height: 1.35;
}
.tm-benefit-acc__badge { margin-left: 0; flex-shrink: 0; }
.tm-benefit-acc__toggle {
    position: relative;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 50%;
    background: rgba(188, 149, 92, 0.14);
    border: 1px solid #ecdcbb;
    transition: background 0.2s ease, transform 0.25s ease;
}
.tm-benefit-acc__toggle::before,
.tm-benefit-acc__toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: #924f18;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.tm-benefit-acc__toggle::before {  /* horizontal bar */
    width: 12px; height: 2px;
    transform: translate(-50%, -50%);
}
.tm-benefit-acc__toggle::after {   /* vertical bar — collapses when open */
    width: 2px; height: 12px;
    transform: translate(-50%, -50%);
}
.tm-benefit-acc__item.is-open .tm-benefit-acc__toggle {
    background: linear-gradient(135deg, #bc955c, #924f18);
    transform: rotate(180deg);
}
.tm-benefit-acc__item.is-open .tm-benefit-acc__toggle::before { background: #fff; }
.tm-benefit-acc__item.is-open .tm-benefit-acc__toggle::after {
    background: #fff;
    transform: translate(-50%, -50%) scaleY(0);
}
.tm-benefit-acc__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}
.tm-benefit-acc__item.is-open .tm-benefit-acc__body { grid-template-rows: 1fr; }
.tm-benefit-acc__inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 16px;
}
.tm-benefit-acc__item.is-open .tm-benefit-acc__inner {
    padding: 12px 16px 14px;
    border-top: 1px dashed #eee5d2;
}
.tm-benefit-acc__inner > .tm-benefit-card__list { margin-bottom: 0; }
.tm-benefit-acc__inner > .tm-benefit-card__terms:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 767px) {
    .tm-benefit-acc__head { padding: 10px 12px; gap: 9px; flex-wrap: wrap; }
    .tm-benefit-acc__title { font-size: 0.92rem; flex-basis: calc(100% - 90px); }
    .tm-benefit-acc__badge { margin-left: 50px; order: 4; }
    .tm-benefit-acc__toggle { margin-left: auto; }
    .tm-benefit-acc__inner { padding: 0 13px; }
    .tm-benefit-acc__item.is-open .tm-benefit-acc__inner { padding: 10px 13px 12px; }
}

/* ════════════════════════════════════════════════════════════════════
   3D DEPTH + MOTION POLISH (accordion, badges, chips)
   Subtle raised surfaces, staggered entrance, shimmer on coupon
   badges, glow on the open row. Motion respects reduced-motion.
   ════════════════════════════════════════════════════════════════════ */

/* Raised card rows */
.tm-benefit-acc__item {
    background: linear-gradient(180deg, #ffffff 0%, #fbfaf6 100%);
    border: 1px solid #ece7da;
    box-shadow: 0 2px 0 rgba(188, 149, 92, 0.14), 0 3px 10px rgba(16, 24, 39, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.2s ease;
}
.tm-benefit-acc__item:hover {
    transform: translateY(-2px);
    border-color: #e3d4b8;
    box-shadow: 0 4px 0 rgba(188, 149, 92, 0.18), 0 12px 24px rgba(16, 24, 39, 0.10);
}
.tm-benefit-acc__item.is-open {
    border-color: #dcc59a;
    box-shadow: 0 2px 0 rgba(188, 149, 92, 0.22), 0 10px 26px rgba(188, 149, 92, 0.16);
}

/* 3D icon tile */
.tm-benefit-acc__head .tm-benefit-card__ico {
    background: linear-gradient(180deg, #fdf6e8 0%, #f3e6cc 100%);
    border: 1px solid #ecdcbb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 4px rgba(188, 149, 92, 0.18);
}

/* 3D toggle button */
.tm-benefit-acc__toggle {
    background: linear-gradient(180deg, #fdf6e8 0%, #f0e2c6 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 0 rgba(188, 149, 92, 0.35), 0 3px 6px rgba(188, 149, 92, 0.2);
}
button.tm-benefit-acc__head:active .tm-benefit-acc__toggle {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 0 rgba(188, 149, 92, 0.3);
}
.tm-benefit-acc__item.is-open .tm-benefit-acc__toggle {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 0 rgba(122, 63, 18, 0.5), 0 3px 8px rgba(188, 149, 92, 0.4);
}

/* Coupon badge: raised + periodic shimmer sweep */
.tm-benefit-acc__badge {
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 4px rgba(188, 149, 92, 0.2);
}
.tm-benefit-acc__badge::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.85) 50%, transparent 80%);
    transform: skewX(-20deg);
    animation: tmShine 4.2s ease-in-out infinite;
}
@keyframes tmShine {
    0%, 72%  { left: -80%; }
    88%, 100% { left: 130%; }
}

/* Highlight chips: gentle glow breathe */
.tm-benefit-intro .tm-benefit-lead {
    box-shadow: 0 2px 0 rgba(188, 149, 92, 0.15), 0 3px 10px rgba(188, 149, 92, 0.12);
    animation: tmLeadGlow 3.4s ease-in-out infinite;
}
@keyframes tmLeadGlow {
    0%, 100% { box-shadow: 0 2px 0 rgba(188, 149, 92, 0.15), 0 3px 10px rgba(188, 149, 92, 0.10); }
    50%      { box-shadow: 0 2px 0 rgba(188, 149, 92, 0.22), 0 6px 18px rgba(188, 149, 92, 0.28); }
}

/* Staggered entrance (activated by JS adding .acc-animate; rows get .acc-in
   from an IntersectionObserver — without JS everything stays visible) */
.tm-benefit-acc.acc-animate .tm-benefit-acc__item {
    opacity: 0;
    transform: translateY(16px);
}
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in {
    animation: tmAccIn 0.45s ease forwards;
}
@keyframes tmAccIn {
    to { opacity: 1; transform: translateY(0); }
}
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in:nth-child(2) { animation-delay: 0.06s; }
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in:nth-child(3) { animation-delay: 0.12s; }
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in:nth-child(4) { animation-delay: 0.18s; }
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in:nth-child(5) { animation-delay: 0.24s; }
.tm-benefit-acc.acc-animate .tm-benefit-acc__item.acc-in:nth-child(n+6) { animation-delay: 0.3s; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .tm-benefit-acc__item,
    .tm-benefit-acc__item:hover { transform: none; transition: none; }
    .tm-benefit-acc__badge::after,
    .tm-benefit-intro .tm-benefit-lead { animation: none; }
    .tm-benefit-acc.acc-animate .tm-benefit-acc__item { opacity: 1; transform: none; animation: none; }
}
