/* ================================================
   FEATURE STORE — Page & Pixel Designs
   ================================================ */

/* ── Store Layout ──────────────────────────────── */

.feature-store {
    animation: storeIn 0.45s ease-out;
}

@keyframes storeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.store-header {
    margin-bottom: 2rem;
}

.store-header h1 {
    font-size: 2rem;
    color: var(--admin-primary, #2C5282);
    margin: 0 0 0.25rem 0;
}

/* ── Current Package ───────────────────────────── */

.current-package {
    margin-bottom: 2.5rem;
}

.package-summary {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid #E2E8F0;
}

.package-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--admin-primary, #2C5282);
    font-size: 1.05rem;
    font-weight: 700;
}

.package-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.package-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.package-item.base {
    background: rgba(44, 82, 130, 0.05);
    border: 1px solid rgba(44, 82, 130, 0.14);
}

.package-item.purchased {
    background: rgba(72, 187, 120, 0.06);
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.package-name {
    flex: 1;
    font-weight: 600;
    color: #2D3748;
    font-size: 0.92rem;
    min-width: 0;
}

.package-price {
    font-weight: 700;
    color: var(--admin-primary, #2C5282);
    font-size: 0.92rem;
}

.package-status {
    font-size: 0.82rem;
    color: #718096;
    text-align: right;
}

.package-total {
    border-top: 1px solid #E2E8F0;
    padding-top: 0.75rem;
    text-align: right;
    color: #4A5568;
    font-size: 0.95rem;
}

.package-total strong {
    color: var(--admin-primary, #2C5282);
    font-size: 1.05rem;
}

/* ── Available Features ────────────────────────── */

.available-features {
    margin-bottom: 2.5rem;
}

.available-features > h2 {
    font-size: 1.4rem;
    color: var(--admin-primary, #2C5282);
    margin: 0 0 1.25rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ── No Add-Ons Empty State ────────────────────── */

.no-addons-message {
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
    padding: 0.5rem 0;
}

/* ── Feature Card ──────────────────────────────── */

.feature-card {
    background: #fff;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(44, 82, 130, 0.12);
    border-color: #90CDF4;
}

.feature-card.purchased {
    border-color: #68D391;
    background: #F0FFF4;
}

.feature-card.purchased:hover {
    border-color: #48BB78;
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.15);
}

/* ── Purchased Badge ───────────────────────────── */

.purchased-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #48BB78;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
    align-self: flex-start;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.feature-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--admin-primary, #2C5282);
    line-height: 1.35;
    flex: 1;
}

.feature-price {
    background: var(--admin-secondary, #FFAB02);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.feature-card.purchased .feature-price {
    background: #48BB78;
}

.feature-description {
    font-size: 0.9rem;
    color: #4A5568;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* ── Help Tooltip ──────────────────────────────── */

.feature-help {
    display: flex;
    align-items: center;
}

.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #EDF2F7;
    color: #718096;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.help-icon:hover {
    background: var(--admin-primary, #2C5282);
    color: #fff;
}

.help-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    background: #2D3748;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 200;
    pointer-events: none;
    white-space: normal;
    text-align: left;
}

.help-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2D3748;
}

.help-icon:hover .help-tooltip {
    display: block;
}

/* ── Feature Actions ───────────────────────────── */

.feature-actions {
    margin-top: auto;
    padding-top: 0.25rem;
}

.purchase-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--admin-primary, #2C5282);
    color: #fff;
    transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
}

.purchase-btn:hover:not(:disabled) {
    background: #1A365D;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(44, 82, 130, 0.35);
}

.purchase-btn.purchased,
.purchase-btn:disabled {
    background: #C6F6D5;
    color: #276749;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* ── Store Help Section ────────────────────────── */

.store-help {
    margin-bottom: 2rem;
}

/* Override the generic .help-card grid style for this single-card context */
.store-help .help-card {
    background: linear-gradient(135deg, rgba(44, 82, 130, 0.04), rgba(255, 171, 2, 0.04));
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    display: block;
}

.store-help .help-card h3 {
    margin: 0 0 0.75rem 0;
    color: var(--admin-primary, #2C5282);
    font-size: 1.2rem;
}

.store-help .help-card p {
    color: #4A5568;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.help-btn {
    background: var(--admin-secondary, #FFAB02);
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.help-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ── Payment Modal ─────────────────────────────── */

.payment-summary {
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.payment-summary h4 {
    margin: 0 0 0.75rem 0;
    color: var(--admin-primary, #2C5282);
    font-size: 1rem;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #4A5568;
    font-size: 0.92rem;
    border-bottom: 1px solid #E2E8F0;
}

.payment-total {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    font-size: 1rem;
    color: var(--admin-primary, #2C5282);
}

.modal-body > p {
    color: #718096;
    font-size: 0.88rem;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.proceed-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--admin-primary, #2C5282);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.proceed-btn:hover {
    background: #1A365D;
    transform: translateY(-1px);
}

/* Scoped cancel button for payment modal — avoids conflict with domain cancel-btn */
#paymentModal .cancel-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #718096;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-align: center;
}

#paymentModal .cancel-btn:hover {
    border-color: #CBD5E0;
    color: #4A5568;
}

/* Stripe trust signal */
.stripe-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #A0AEC0;
}

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

@media (max-width: 768px) {
    .store-header h1 {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .package-item {
        gap: 0.4rem;
    }

    .feature-card {
        padding: 1.15rem;
    }

}

@media (max-width: 480px) {
    .package-summary {
        padding: 1rem;
    }

    .store-help .help-card {
        padding: 1.25rem;
    }

    .available-features > h2 {
        font-size: 1.2rem;
    }
}
