/* parent/rewards.css — shop catalog editor page */

/* .btn-icon sets display:inline-flex, which otherwise wins over [hidden]. */
#shop-page-header .btn-icon[hidden],
#shop-page-header .sub-page-title[hidden] {
    display: none !important;
}

.shop-editor-page.is-viewing .shop-editor-edit-only {
    display: none;
}

.shop-editor-page {
    width: 100%;
    text-align: left;
}

.modal-card--shop-editor {
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

/* ── Shop catalog editor ── */
.shop-editor-page.panel {
    padding: 20px 22px 22px;
}

.shop-editor-intro {
    margin: 0 0 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.shop-editor-intro > summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: var(--fw-label);
    color: var(--primary-text);
    line-height: 1.4;
}

.shop-editor-intro > summary::-webkit-details-marker {
    display: none;
}

.shop-editor-intro > summary::before {
    content: '▸ ';
}

.shop-editor-intro[open] > summary::before {
    content: '▾ ';
}

.shop-editor-intro-body {
    margin-top: 10px;
}

.shop-editor-intro p {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: var(--fw-body);
    line-height: 1.5;
    color: var(--n-600);
}

.shop-editor-intro p:last-child {
    margin-bottom: 0;
}

.shop-editor-group {
    padding: 20px 0 4px;
    border-top: 1px solid var(--border);
}

.shop-editor-group:first-child {
    padding-top: 4px;
    border-top: none;
}

.shop-editor-group-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: var(--fw-title);
    line-height: 1.3;
    color: var(--text-main);
}

.shop-editor-section-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: var(--fw-title);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.shop-editor-pool,
.shop-editor-selected {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-bottom: 16px;
}

.shop-editor-tile,
.shop-editor-pool-item,
.shop-editor-selected-item {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    min-height: 0;
    padding: 8px 10px 8px 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-tile);
}

.shop-editor-tile-media {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.shop-editor-pool-img {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.shop-editor-pool-img--empty {
    background: var(--n-50);
    border-radius: var(--radius-chip);
}

.shop-editor-tile-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shop-editor-pool-label,
.shop-editor-custom-item-name {
    margin: 0;
    font-size: 13px;
    font-weight: var(--fw-label);
    line-height: 1.25;
    color: var(--n-700);
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-editor-circle-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 1;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: white;
    font-size: 15px;
    font-weight: var(--fw-title);
    line-height: 1;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.shop-editor-circle-btn--add {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-light);
}

.shop-editor-circle-btn--remove {
    border-color: #fca5a5;
    color: #b91c1c;
    background: #fef2f2;
}

.shop-editor-pool .shop-editor-selected-empty,
.shop-editor-selected .shop-editor-selected-empty {
    grid-column: 1 / -1;
    padding: 8px 0;
    border: none;
    background: transparent;
}

.shop-editor-selected-wrap {
    margin-bottom: 16px;
}

.shop-editor-selected-wrap .shop-editor-selected {
    margin-bottom: 0;
}

.shop-editor-selected {
    min-height: 72px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-tile);
    background: #f8fafc;
}

.shop-editor-selected-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: var(--fw-body);
    color: #94a3b8;
}

.shop-editor-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0 auto;
    flex-shrink: 0;
}

.shop-editor-price-wrap .shop-editor-num,
.shop-editor-price-wrap .shop-editor-selected-price,
.shop-editor-price-wrap .shop-editor-exchange-coins {
    margin: 0;
}

.shop-editor-price-wrap .currency-icon {
    width: 18px;
    height: 18px;
}

.shop-editor-price-text {
    font-size: 13px;
    font-weight: var(--fw-label);
    font-family: inherit;
    line-height: 1.2;
    color: #0f172a;
    white-space: nowrap;
}

.shop-editor-num,
.shop-editor-selected-price,
.shop-editor-exchange-coins {
    width: 64px;
    max-width: 64px;
    flex-shrink: 0;
    margin: 0 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-chip);
    font-size: 13px;
    font-weight: var(--fw-label);
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    color: #0f172a;
    background: white;
    appearance: textfield;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
}

.shop-editor-num::placeholder,
.shop-editor-selected-price::placeholder,
.shop-editor-exchange-coins::placeholder {
    color: #94a3b8;
}

.shop-editor-num::-webkit-outer-spin-button,
.shop-editor-num::-webkit-inner-spin-button,
.shop-editor-selected-price::-webkit-outer-spin-button,
.shop-editor-selected-price::-webkit-inner-spin-button,
.shop-editor-exchange-coins::-webkit-outer-spin-button,
.shop-editor-exchange-coins::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.shop-editor-selected-price:focus,
.shop-editor-num:focus,
.shop-editor-exchange-coins:focus {
    outline: none;
    border-color: var(--primary);
}

.shop-editor-exchange-hint {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: var(--fw-body);
    color: #64748b;
    line-height: 1.45;
    text-align: left;
}

.shop-editor-exchange-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-editor-exchange-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-tile);
    background: #fff;
}

.shop-editor-exchange-crystals {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: var(--fw-title);
    font-size: 14px;
    color: #0284c7;
    white-space: nowrap;
}

.shop-editor-exchange-crystals .currency-icon {
    width: 18px;
    height: 18px;
}

.shop-editor-exchange-coins {
    width: 72px;
    max-width: 72px;
    margin-left: 0;
}

.shop-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

#shop-editor-flash {
    margin: 16px 0 10px;
}

#shop-editor-flash[hidden] {
    display: none !important;
}

.shop-editor-actions .btn-primary,
.shop-editor-actions .btn-secondary {
    flex: 1;
    width: auto;
    margin-top: 0;
}

.shop-editor-actions .btn-primary {
    margin-bottom: 0;
}

.shop-editor-loading {
    font-size: 14px;
    font-weight: var(--fw-body);
    color: #64748b;
    text-align: center;
    padding: 24px 8px;
}

.modal-card--shop-editor {
    max-width: 480px;
    width: 100%;
    max-height: min(92vh, 720px);
    overflow-y: auto;
}

.shop-editor-custom-add-btn {
    width: auto;
    max-width: 100%;
    margin: 4px 0 12px;
    padding: 8px 14px 8px 10px;
    font-size: 13px;
    color: var(--n-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shop-editor-custom-add-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.shop-editor-custom-add-btn[hidden] {
    display: none;
}

.shop-editor-custom-locked {
    text-align: center;
    padding: 16px 12px;
    margin: 8px 0 4px;
    border-radius: var(--radius-tile);
    background: var(--n-50);
    border: 1px dashed var(--n-300);
}

.shop-editor-custom-lock-text {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: var(--fw-body);
    color: #64748b;
    line-height: 1.45;
}

.shop-editor-custom-upgrade {
    width: auto;
    margin: 0 auto;
    display: inline-flex;
}

.shop-editor-custom-price {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 28px;
}

.shop-editor-custom-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-editor-custom-price-row .form-input {
    flex: 1;
    min-width: 0;
}

.modal-card--shop-custom {
    max-width: 400px;
    width: 100%;
}

.modal-card--shop-custom .form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: var(--fw-body);
    color: #94a3b8;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .shop-editor-pool,
    .shop-editor-selected {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .shop-editor-pool-img,
    .shop-editor-tile-media {
        width: 48px;
        height: 48px;
    }
}

