/* LoyalStar — My Account Dashboard */
.loyalstar { max-width: 800px; }

/* Summary cards */
.loyalstar__summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.loyalstar__balance-card,
.loyalstar__tier-card,
.loyalstar__lifetime-card {
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    text-align: center;
}
.loyalstar__balance-number,
.loyalstar__lifetime-number {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.loyalstar__balance-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}
.loyalstar__balance-value { color: #222; }
.loyalstar__pending {
    font-size: 0.8rem;
    color: #b8860b;
    margin-top: 0.5rem;
}

/* Tier badge */
.loyalstar__tier-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.loyalstar__tier--linen { background: #f5f0e8; color: #8b7355; }
.loyalstar__tier--thread { background: #e8efe8; color: #4a6741; }
.loyalstar__tier--weave { background: #e8ecf0; color: #3a5a7c; }
.loyalstar__tier--atelier { background: #f0e8ef; color: #6b3a6a; }
.loyalstar__tier-multiplier {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Progress bar */
.loyalstar__progress-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
}
.loyalstar__progress-section h3 {
    font-size: 1rem;
    margin: 0 0 1rem;
}
.loyalstar__progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}
.loyalstar__progress-fill {
    height: 100%;
    background: #222;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.loyalstar__progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.35rem;
}
.loyalstar__progress-text {
    font-size: 0.85rem;
    color: #444;
    margin-top: 0.75rem;
}

/* Tabs */
.loyalstar__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 1.5rem;
}
.loyalstar__tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.loyalstar__tab:hover { color: #222; }
.loyalstar__tab.active {
    color: #222;
    border-bottom-color: #222;
    font-weight: 500;
}

/* Panel */
.loyalstar__panel { min-height: 200px; }
.loyalstar__empty {
    text-align: center;
    color: #999;
    padding: 3rem 1rem;
}

/* History table */
.loyalstar__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.loyalstar__table th {
    text-align: left;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.8rem;
    color: #666;
}
.loyalstar__table td {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.loyalstar__col-right { text-align: right; }
.loyalstar__points-pos { color: #2e7d32; font-weight: 500; }
.loyalstar__points-neg { color: #c62828; font-weight: 500; }
.loyalstar__badge-pending {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: #fff3cd;
    color: #856404;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Pagination */
.loyalstar__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}
.loyalstar__pagination button {
    padding: 0.3rem 0.6rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
}
.loyalstar__pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Earn cards */
.loyalstar__earn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.loyalstar__earn-card {
    padding: 1.25rem;
    border: 1px solid #e5e5e5;
    text-align: center;
}
.loyalstar__earn-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.loyalstar__earn-card h4 {
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
}
.loyalstar__earn-card p {
    font-size: 0.85rem;
    margin: 0;
}
.loyalstar__earn-note {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.35rem;
}

/* Birthday form */
.loyalstar__birthday-form {
    padding: 1.25rem;
    border: 1px solid #e5e5e5;
}
.loyalstar__birthday-form h4 {
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}
.loyalstar__birthday-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.loyalstar__birthday-inputs select {
    padding: 0.4rem;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}

/* Tiers grid */
.loyalstar__tiers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.loyalstar__tier-card-full {
    border: 1px solid #e5e5e5;
    overflow: hidden;
}
.loyalstar__tier-current {
    border-color: #222;
    box-shadow: 0 0 0 1px #222;
}
.loyalstar__tier-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}
.loyalstar__tier-you {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 0.15rem;
}
.loyalstar__tier-body {
    padding: 1rem 0.75rem;
    font-size: 0.8rem;
}
.loyalstar__tier-spend {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.loyalstar__tier-mult,
.loyalstar__tier-birthday {
    color: #666;
    margin-bottom: 0.25rem;
}
.loyalstar__tier-perks {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}
.loyalstar__tier-perks li {
    font-size: 0.75rem;
    padding: 0.2rem 0;
    color: #444;
}
.loyalstar__tier-perks li::before {
    content: "\2713 ";
    color: #2e7d32;
}

/* Referral */
.loyalstar__referral-hero {
    text-align: center;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    margin-bottom: 1.5rem;
}
.loyalstar__referral-hero h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}
.loyalstar__referral-hero p {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
}
.loyalstar__referral-link {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.loyalstar__referral-link input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    background: #fafafa;
}
.loyalstar__referral-stats {
    display: flex;
    gap: 2rem;
    text-align: center;
}
.loyalstar__referral-stats > div {
    flex: 1;
    padding: 1rem;
    border: 1px solid #e5e5e5;
}
.loyalstar__referral-stats strong {
    display: block;
    font-size: 1.5rem;
}
.loyalstar__referral-stats span {
    font-size: 0.8rem;
    color: #666;
}

/* Buttons */
.loyalstar__btn {
    padding: 0.5rem 1rem;
    background: #222;
    color: #fff;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}
.loyalstar__btn:hover { background: #444; }
.loyalstar__btn:disabled { opacity: 0.5; cursor: default; }
.loyalstar__btn-link {
    background: none;
    border: none;
    color: #222;
    text-decoration: underline;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Checkout widget */
.loyalstar-checkout-widget { margin-bottom: 1.5rem; }
.loyalstar__checkout-box {
    padding: 1rem 1.25rem;
    border: 1px solid #e5e5e5;
    background: #fafaf8;
}
.loyalstar__checkout-box h4 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}
.loyalstar__checkout-box p {
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
    color: #555;
}
.loyalstar__checkout-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.loyalstar__checkout-input input {
    width: 100px;
    padding: 0.4rem;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}
.loyalstar__checkout-value {
    font-size: 0.85rem;
    color: #2e7d32;
    font-weight: 500;
}
.loyalstar__checkout-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.loyalstar__checkout-applied {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #2e7d32;
}

/* Mobile */
@media (max-width: 640px) {
    .loyalstar__summary { grid-template-columns: 1fr; }
    .loyalstar__earn-grid { grid-template-columns: 1fr; }
    .loyalstar__tiers-grid { grid-template-columns: repeat(2, 1fr); }
    .loyalstar__tabs { overflow-x: auto; }
    .loyalstar__tab { white-space: nowrap; font-size: 0.8rem; padding: 0.6rem 0.75rem; }
    .loyalstar__referral-stats { flex-direction: column; gap: 0.75rem; }
}

/* === Alpine x-cloak (hide until Alpine hydrates) === */
[x-cloak] { display: none !important; }

/* === Earn messages (product + cart pages) === */
.loyalstar-earn-msg {
    font-size: 0.85rem;
    color: #2e7d32;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.loyalstar-earn-msg a { color: #222; text-decoration: underline; }
.loyalstar-earn-msg a:hover { color: #555; }
.loyalstar-earn-msg--cart {
    padding: 0.75rem 1rem;
    background: #f8faf8;
    border: 1px solid #e8f0e8;
    margin-bottom: 1rem;
}

/* === Shortcodes === */
.loyalstar-sc--balance { font-weight: 600; }
.loyalstar-sc--tier {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.loyalstar-sc--guest { color: #666; font-size: 0.85rem; }

/* === Floating launcher widget === */
.loyalstar-launcher {
    position: fixed;
    bottom: 50%;
    right: 0;
    transform: translateY(50%);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.loyalstar-launcher--left { right: auto; left: 0; }

.loyalstar-launcher__btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: background 0.15s, transform 0.15s;
}
.loyalstar-launcher__btn:hover { background: #333; transform: translateX(-2px); }
.loyalstar-launcher__btn.active { background: #444; }
.loyalstar-launcher__btn svg { flex-shrink: 0; display: none; }

.loyalstar-launcher__panel {
    display: none;
    position: absolute;
    bottom: 0;
    right: 100%;
    margin-right: 8px;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    padding: 1.25rem;
    font-size: 0.85rem;
}
.loyalstar-launcher--left .loyalstar-launcher__panel { right: auto; left: 0; }
.loyalstar-launcher__panel--open { display: block; }

.loyalstar-launcher__header {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.loyalstar-launcher__balance { margin-bottom: 0.75rem; color: #222; }
.loyalstar-launcher__balance strong { font-size: 1.3rem; }
.loyalstar-launcher__balance-val { color: #666; font-size: 0.8rem; }

.loyalstar-launcher__tier {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.loyalstar-launcher__tier .loyalstar__tier-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}
.loyalstar-launcher__mult { font-size: 0.8rem; color: #666; }

.loyalstar-launcher__progress { margin-bottom: 0.75rem; }
.loyalstar-launcher__progress small {
    font-size: 0.75rem;
    color: #666;
    display: block;
    margin-top: 0.3rem;
}
.loyalstar-launcher__link {
    display: block;
    text-align: center;
    padding: 0.5rem;
    color: #222;
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}
.loyalstar-launcher__link:hover { color: #555; }
.loyalstar-launcher__desc {
    color: #555;
    margin: 0 0 1rem;
    line-height: 1.4;
}
.loyalstar-launcher__join {
    display: block;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 480px) {
    .loyalstar-launcher { bottom: 16px; right: 16px; }
    .loyalstar-launcher--left { left: 16px; }
    .loyalstar-launcher__panel { width: 260px; }
}
