/* === NetCoord Shop — admin catalog editor styles (index.html dashboard) === */

/* Editor cards use a light background, so force dark text regardless of the
   admin panel's theme (the site is dark-themed and would otherwise inherit
   white text, making labels invisible). */
.shop-catalog-editor { display: flex; flex-direction: column; gap: 14px; color: #1B1B2A; }
.shop-catalog-editor label,
.shop-catalog-editor .shop-admin-variants-head,
.shop-catalog-editor .shop-admin-status { color: #1B1B2A; }
.shop-orders-container { color: #1B1B2A; }

.shop-admin-enabled { font-weight: 600; }

.shop-admin-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

/* Defend against global admin styles that stretch/center form controls. */
.shop-catalog-editor input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: none;
}

.shop-admin-shipping { display: flex; gap: 16px; flex-wrap: wrap; }
.shop-admin-shipping label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.shop-admin-shipping input { width: 120px; }

/* Collapsible catalog tree (sport → product type → product), mirroring the
   storefront's grouping. Everything is collapsed by default. */
#shopProductsList { display: flex; flex-direction: column; gap: 10px; }

.shop-admin-group,
.shop-admin-subgroup {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
}
.shop-admin-group > summary,
.shop-admin-subgroup > summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 700;
    color: #1B1B2A;
    user-select: none;
}
.shop-admin-group > summary { font-size: 15px; }
.shop-admin-group[open] > summary { border-bottom: 1px solid rgba(0, 0, 0, 0.1); }

.shop-admin-subgroup { margin: 10px 12px; background: #fff; }
.shop-admin-subgroup > summary { font-size: 14px; padding: 8px 12px; }

/* Collapsed one-line product row; opens into the full edit card. */
.shop-admin-product-wrap {
    margin: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #fff;
}
.shop-admin-product-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1B1B2A;
    cursor: pointer;
    user-select: none;
}
.shop-admin-product-summary .sps-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shop-admin-product-summary .sps-price { font-weight: 600; white-space: nowrap; }
.shop-admin-product-summary .sps-badge {
    background: rgba(255, 51, 102, 0.12);
    border: 1px solid rgba(255, 51, 102, 0.4);
    color: #c81e4a;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.shop-admin-product-wrap[open] > .shop-admin-product-summary {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.shop-admin-backtotop {
    align-self: flex-start;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    color: #1B1B2A;
    cursor: pointer;
}
.shop-admin-backtotop:hover { border-color: rgba(0, 0, 0, 0.5); }

.shop-admin-product {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.02);
}

/* Inside a collapsible wrap the card doesn't need its own frame. */
.shop-admin-product-wrap .shop-admin-product {
    border: none;
    background: none;
    border-radius: 0 0 10px 10px;
}

.shop-admin-product-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shop-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.shop-admin-product input,
.shop-admin-product select,
.shop-admin-product textarea {
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.shop-admin-variants-head { font-size: 13px; font-weight: 600; margin-top: 4px; }
.shop-admin-hint { font-weight: 400; opacity: 0.6; }

.shop-admin-variants { display: flex; flex-direction: column; gap: 6px; }

.shop-admin-variant {
    display: grid;
    grid-template-columns: auto 1.6fr 0.8fr 1fr auto;
    gap: 6px;
    align-items: center;
}

.sp-remove, .sv-remove {
    background: rgba(255, 51, 102, 0.12);
    border: 1px solid rgba(255, 51, 102, 0.4);
    color: #c81e4a;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
}
.sp-remove:hover, .sv-remove:hover { background: rgba(255, 51, 102, 0.22); }

.sp-add-variant {
    align-self: flex-start;
    background: none;
    border: 1px dashed rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.shop-admin-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.shop-admin-status { font-size: 14px; }
.shop-admin-status.success { color: #1f9d4d; font-weight: 600; }
.shop-admin-status.error { color: #c81e4a; font-weight: 600; }

.shop-orders-container { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

@media (max-width: 600px) {
    .shop-admin-grid { grid-template-columns: 1fr; }
    .shop-admin-variant { grid-template-columns: auto 1fr auto; }
}
